-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1263.e25c0800.chunk.js
More file actions
1 lines (1 loc) · 11.6 KB
/
1263.e25c0800.chunk.js
File metadata and controls
1 lines (1 loc) · 11.6 KB
1
"use strict";(self.webpackChunkfezcodex=self.webpackChunkfezcodex||[]).push([[1263],{4725(e,n,t){t.d(n,{A:()=>i});var r=t(65676);const i=function(e){return(0,r.A)(e,4)}},11263(e,n,t){t.r(n),t.d(n,{render:()=>K});var r=t(89379),i=t(70012),o=(t(99850),t(13782)),a=t(72285),d=(t(68755),t(34683),t(11130),t(68591)),s=t(19789),c=t(8573),l=t(12904),g=t(4725),f=t(32498);t(23488);function u(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:h(e),edges:p(e)};return l.A(e.graph())||(n.value=g.A(e.graph())),n}function h(e){return f.A(e.nodes(),function(n){var t=e.node(n),r=e.parent(n),i={v:n};return l.A(t)||(i.value=t),l.A(r)||(i.parent=r),i})}function p(e){return f.A(e.edges(),function(n){var t=e.edge(n),r={v:n.v,w:n.w};return l.A(n.name)||(r.name=n.name),l.A(t)||(r.value=t),r})}var m=t(34921),w=new Map,v=new Map,R=new Map,y=(0,s.K2)(()=>{v.clear(),R.clear(),w.clear()},"clear"),X=(0,s.K2)((e,n)=>{const t=v.get(n)||[];return s.Rm.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),b=(0,s.K2)((e,n)=>{const t=v.get(n)||[];return s.Rm.info("Descendants of ",n," is ",t),s.Rm.info("Edge is ",e),e.v!==n&&e.w!==n&&(t?t.includes(e.v)||X(e.v,n)||X(e.w,n)||t.includes(e.w):(s.Rm.debug("Tilt, ",n,",not in descendants"),!1))},"edgeInCluster"),E=(0,s.K2)((e,n,t,r)=>{s.Rm.warn("Copying children of ",e,"root",r,"data",n.node(e),r);const i=n.children(e)||[];e!==r&&i.push(e),s.Rm.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(i=>{if(n.children(i).length>0)E(i,n,t,r);else{const o=n.node(i);s.Rm.info("cp ",i," to ",r," with parent ",e),t.setNode(i,o),r!==n.parent(i)&&(s.Rm.warn("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(s.Rm.debug("Setting parent",i,e),t.setParent(i,e)):(s.Rm.info("In copy ",e,"root",r,"data",n.node(e),r),s.Rm.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const a=n.edges(i);s.Rm.debug("Copying Edges",a),a.forEach(i=>{s.Rm.info("Edge",i);const o=n.edge(i.v,i.w,i.name);s.Rm.info("Edge data",o,r);try{b(i,r)?(s.Rm.info("Copying as ",i.v,i.w,o,i.name),t.setEdge(i.v,i.w,o,i.name),s.Rm.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):s.Rm.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}catch(a){s.Rm.error(a)}})}s.Rm.debug("Removing node",i),n.removeNode(i)})},"copy"),N=(0,s.K2)((e,n)=>{const t=n.children(e);let r=[...t];for(const i of t)R.set(i,e),r=[...r,...N(i,n)];return r},"extractDescendants"),C=(0,s.K2)((e,n,t)=>{const r=e.edges().filter(e=>e.v===n||e.w===n),i=e.edges().filter(e=>e.v===t||e.w===t),o=r.map(e=>({v:e.v===n?t:e.v,w:e.w===n?n:e.w})),a=i.map(e=>({v:e.v,w:e.w}));return o.filter(e=>a.some(n=>e.v===n.v&&e.w===n.w))},"findCommonEdges"),x=(0,s.K2)((e,n,t)=>{const r=n.children(e);if(s.Rm.trace("Searching children of id ",e,r),r.length<1)return e;let i;for(const o of r){const e=x(o,n,t),r=C(n,t,e);if(e){if(!(r.length>0))return e;i=e}}return i},"findNonClusterChild"),S=(0,s.K2)(e=>w.has(e)&&w.get(e).externalConnections&&w.has(e)?w.get(e).id:e,"getAnchorId"),I=(0,s.K2)((e,n)=>{if(!e||n>10)s.Rm.debug("Opting out, no graph ");else{s.Rm.debug("Opting in, graph "),e.nodes().forEach(function(n){e.children(n).length>0&&(s.Rm.warn("Cluster identified",n," Replacement id in edges: ",x(n,e,n)),v.set(n,N(n,e)),w.set(n,{id:x(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const t=e.children(n),r=e.edges();t.length>0?(s.Rm.debug("Cluster identified",n,v),r.forEach(e=>{X(e.v,n)^X(e.w,n)&&(s.Rm.warn("Edge: ",e," leaves cluster ",n),s.Rm.warn("Descendants of XXX ",n,": ",v.get(n)),w.get(n).externalConnections=!0)})):s.Rm.debug("Not a cluster ",n,v)});for(let n of w.keys()){const t=w.get(n).id,r=e.parent(t);r!==n&&w.has(r)&&!w.get(r).externalConnections&&(w.get(n).id=r)}e.edges().forEach(function(n){const t=e.edge(n);s.Rm.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.Rm.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,i=n.w;if(s.Rm.warn("Fix XXX",w,"ids:",n.v,n.w,"Translating: ",w.get(n.v)," --- ",w.get(n.w)),w.get(n.v)||w.get(n.w)){if(s.Rm.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=S(n.v),i=S(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const i=e.parent(r);w.get(i).externalConnections=!0,t.fromCluster=n.v}if(i!==n.w){const r=e.parent(i);w.get(r).externalConnections=!0,t.toCluster=n.w}s.Rm.warn("Fix Replacing with XXX",r,i,n.name),e.setEdge(r,i,t,n.name)}}),s.Rm.warn("Adjusted Graph",u(e)),A(e,0),s.Rm.trace(w)}},"adjustClustersAndEdges"),A=(0,s.K2)((e,n)=>{if(s.Rm.warn("extractor - ",n,u(e),e.children("D")),n>10)return void s.Rm.error("Bailing out");let t=e.nodes(),r=!1;for(const o of t){const n=e.children(o);r=r||n.length>0}if(r){s.Rm.debug("Nodes = ",t,n);for(const r of t)if(s.Rm.debug("Extracting node",r,w,w.has(r)&&!w.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",n),w.has(r))if(!w.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){var i;s.Rm.warn("Cluster without external connections, without a parent and with children",r,n);let t="TB"===e.graph().rankdir?"LR":"TB";null!==(i=w.get(r))&&void 0!==i&&null!==(i=i.clusterData)&&void 0!==i&&i.dir&&(t=w.get(r).clusterData.dir,s.Rm.warn("Fixing dir",w.get(r).clusterData.dir,t));const o=new m.T({multigraph:!0,compound:!0}).setGraph({rankdir:t,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.Rm.warn("Old graph before copy",u(e)),E(r,e,o,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:w.get(r).clusterData,label:w.get(r).label,graph:o}),s.Rm.warn("New graph after copy node: (",r,")",u(o)),s.Rm.debug("Old graph after copy",u(e))}else s.Rm.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!w.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),n),s.Rm.debug(w);else s.Rm.debug("Not a cluster",r,n);t=e.nodes(),s.Rm.warn("New list of nodes",t);for(const r of t){const t=e.node(r);s.Rm.warn(" Now next level",r,t),null!==t&&void 0!==t&&t.clusterNode&&A(t.graph,n+1)}}else s.Rm.debug("Done, no node has children",e.nodes())},"extractor"),D=(0,s.K2)((e,n)=>{if(0===n.length)return[];let t=Object.assign([],n);return n.forEach(n=>{const r=e.children(n),i=D(e,r);t=[...t,...i]}),t},"sorter"),O=(0,s.K2)(e=>D(e,e.children()),"sortNodesByHierarchy"),k=(0,s.K2)(async(e,n,t,d,l,g)=>{s.Rm.warn("Graph in recursive render:XAX",u(n),l);const f=n.graph().rankdir;s.Rm.trace("Dir in recursive render - dir:",f);const h=e.insert("g").attr("class","root");n.nodes()?s.Rm.info("Recursive render XXX",n.nodes()):s.Rm.info("No nodes found for",n),n.edges().length>0&&s.Rm.info("Recursive edges",n.edge(n.edges()[0]));const p=h.insert("g").attr("class","clusters"),m=h.insert("g").attr("class","edgePaths"),v=h.insert("g").attr("class","edgeLabels"),R=h.insert("g").attr("class","nodes");await Promise.all(n.nodes().map(async function(e){const i=n.node(e);if(void 0!==l){const t=JSON.parse(JSON.stringify(l.clusterData));s.Rm.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",t.height,"\nParent cluster",l.height),n.setNode(l.id,t),n.parent(e)||(s.Rm.trace("Setting parent",e,l.id),n.setParent(e,l.id,t))}if(s.Rm.info("(Insert) Node XXX"+e+": "+JSON.stringify(n.node(e))),null!==i&&void 0!==i&&i.clusterNode){s.Rm.info("Cluster identified XBX",e,i.width,n.node(e));const{ranksep:a,nodesep:c}=n.graph();i.graph.setGraph((0,r.A)((0,r.A)({},i.graph.graph()),{},{ranksep:a+25,nodesep:c}));const l=await k(R,i.graph,t,d,n.node(e),g),f=l.elem;(0,o.lC)(i,f),i.diff=l.diff||0,s.Rm.info("New compound node after recursive render XAX",e,"width",i.width,"height",i.height),(0,o.U7)(f,i)}else n.children(e).length>0?(s.Rm.trace("Cluster - the non recursive path XBX",e,i.id,i,i.width,"Graph:",n),s.Rm.trace(x(i.id,n)),w.set(i.id,{id:x(i.id,n),node:i})):(s.Rm.trace("Node - the non recursive path XAX",e,R,n.node(e),f),await(0,o.on)(R,n.node(e),{config:g,dir:f}))}));const y=(0,s.K2)(async()=>{const e=n.edges().map(async function(e){const t=n.edge(e.v,e.w,e.name);s.Rm.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),s.Rm.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(n.edge(e))),s.Rm.info("Fix",w,"ids:",e.v,e.w,"Translating: ",w.get(e.v),w.get(e.w)),await(0,i.jP)(v,t)});await Promise.all(e)},"processEdges");await y(),s.Rm.info("Graph before layout:",JSON.stringify(u(n))),s.Rm.info("############################################# XXX"),s.Rm.info("### Layout ### XXX"),s.Rm.info("############################################# XXX"),(0,c.Zp)(n),s.Rm.info("Graph after layout:",JSON.stringify(u(n)));let X=0,{subGraphTitleTotalMargin:b}=(0,a.O)(g);return await Promise.all(O(n).map(async function(e){const t=n.node(e);if(s.Rm.info("Position XBX => "+e+": ("+t.x,","+t.y,") width: ",t.width," height: ",t.height),null!==t&&void 0!==t&&t.clusterNode)t.y+=b,s.Rm.info("A tainted cluster node XBX1",e,t.id,t.width,t.height,t.x,t.y,n.parent(e)),w.get(t.id).node=t,(0,o.U_)(t);else if(n.children(e).length>0){var r;s.Rm.info("A pure cluster node XBX1",e,t.id,t.x,t.y,t.width,t.height,n.parent(e)),t.height+=b,n.node(t.parentId);const i=(null===t||void 0===t?void 0:t.padding)/2||0,a=(null===t||void 0===t||null===(r=t.labelBBox)||void 0===r?void 0:r.height)||0,d=a-i||0;s.Rm.debug("OffsetY",d,"labelHeight",a,"halfPadding",i),await(0,o.U)(p,t),w.get(t.id).node=t}else{const e=n.node(t.parentId);t.y+=b/2,s.Rm.info("A regular node XBX1 - using the padding",t.id,"parent",t.parentId,t.width,t.height,t.x,t.y,"offsetY",t.offsetY,"parent",e,null===e||void 0===e?void 0:e.offsetY,t),(0,o.U_)(t)}})),n.edges().forEach(function(e){const r=n.edge(e);s.Rm.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(r),r),r.points.forEach(e=>e.y+=b/2);const o=n.node(e.v);var a=n.node(e.w);const c=(0,i.Jo)(m,r,w,t,o,a,d);(0,i.T_)(r,c)}),n.nodes().forEach(function(e){const t=n.node(e);s.Rm.info(e,t.type,t.diff),t.isGroup&&(X=t.diff)}),s.Rm.warn("Returning from recursive render XAX",h,X),{elem:h,diff:X}},"recursiveRender"),K=(0,s.K2)(async(e,n)=>{var t,a,c,l;const g=new m.T({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:(null===(t=e.config)||void 0===t?void 0:t.nodeSpacing)||(null===(a=e.config)||void 0===a||null===(a=a.flowchart)||void 0===a?void 0:a.nodeSpacing)||e.nodeSpacing,ranksep:(null===(c=e.config)||void 0===c?void 0:c.rankSpacing)||(null===(l=e.config)||void 0===l||null===(l=l.flowchart)||void 0===l?void 0:l.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),f=n.select("g");(0,i.g0)(f,e.markers,e.type,e.diagramId),(0,o.gh)(),(0,i.IU)(),(0,o.IU)(),y(),e.nodes.forEach(e=>{g.setNode(e.id,(0,r.A)({},e)),e.parentId&&g.setParent(e.id,e.parentId)}),s.Rm.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){const n=e.start,t=n+"---"+n+"---1",r=n+"---"+n+"---2",i=g.node(n);g.setNode(t,{domId:t,id:t,parentId:i.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(t,i.parentId),g.setNode(r,{domId:r,id:r,parentId:i.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(r,i.parentId);const o=structuredClone(e),a=structuredClone(e),d=structuredClone(e);o.label="",o.arrowTypeEnd="none",o.id=n+"-cyclic-special-1",a.arrowTypeStart="none",a.arrowTypeEnd="none",a.id=n+"-cyclic-special-mid",d.label="",i.isGroup&&(o.fromCluster=n,d.toCluster=n),d.id=n+"-cyclic-special-2",d.arrowTypeStart="none",g.setEdge(n,t,o,n+"-cyclic-special-0"),g.setEdge(t,r,a,n+"-cyclic-special-1"),g.setEdge(r,n,d,n+"-cyc<lic-special-2")}else g.setEdge(e.start,e.end,(0,r.A)({},e),e.id)}),s.Rm.warn("Graph at first:",JSON.stringify(u(g))),I(g),s.Rm.warn("Graph after XAX:",JSON.stringify(u(g)));const h=(0,d.D7)();await k(f,g,e.type,e.diagramId,void 0,h)},"render")}}]);