slateboard 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -192
- package/dist/arch-3JZTL2DJ.js +1842 -0
- package/dist/bin.js +93 -17
- package/dist/{chunk-ONZFKR4I.js → chunk-6CR2V7P7.js} +172 -22
- package/dist/chunk-6YTKJKSG.js +129 -0
- package/dist/{chunk-SQHGMBUM.js → chunk-KA7Z72FC.js} +3 -2
- package/dist/{chunk-WXM4BB4D.js → chunk-OJOVDYIZ.js} +1400 -873
- package/dist/{chunk-BWNUX4FT.js → chunk-WREOGLK6.js} +4 -4
- package/dist/{chunk-FMO5B2KJ.js → chunk-ZCFHR5VG.js} +5 -5
- package/dist/{client-JHI2EG6J.js → client-BFKANUSM.js} +4 -4
- package/dist/{commands-ONES545N.js → commands-IB76RJGP.js} +1 -1
- package/dist/{doctor-H5Y5L2JZ.js → doctor-RPN73UNG.js} +3 -3
- package/dist/{hooks-2TI5OLAU.js → hooks-QJ4XG42C.js} +13 -1
- package/dist/{lifecycle-ZB5HEO5P.js → lifecycle-O7LDC735.js} +4 -4
- package/dist/{service-command-26BPMBK3.js → service-command-WG4TAU2T.js} +5 -5
- package/dist/shipped-7D2LNTAK.js +153 -0
- package/dist/{src-QZIVUACM.js → src-2MHSOXLY.js} +12 -2
- package/dist/{src-YVFB3ZLM.js → src-QB7VJHQH.js} +21 -1
- package/dist/ui/assets/abnfDiagram-XWFEHMT6-DAC8TnbO.js +1 -0
- package/dist/ui/assets/architecture-WOLXFQ4H-X8k0-LVf.js +1 -0
- package/dist/ui/assets/architectureDiagram-CSQXQB3N-CVoxvA0s.js +36 -0
- package/dist/ui/assets/blockDiagram-BEDRHYPZ-DGf5VAwB.js +140 -0
- package/dist/ui/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +1 -0
- package/dist/ui/assets/c4Diagram-M2UUVUY5-PB5quCOl.js +38 -0
- package/dist/ui/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dist/ui/assets/chunk-3GCGMST5-RRiusQp9.js +1 -0
- package/dist/ui/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dist/ui/assets/chunk-7U7NFRK5-CSOOpKZT.js +88 -0
- package/dist/ui/assets/chunk-CNRTWJTD-DJuDnaYn.js +1 -0
- package/dist/ui/assets/chunk-D5HYT7QG-imLQxbAy.js +1 -0
- package/dist/ui/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/ui/assets/chunk-DZSZGQHW-BCXsfFfT.js +1 -0
- package/dist/ui/assets/chunk-EBZ3SEQC-CdDips7b.js +2 -0
- package/dist/ui/assets/chunk-F3AE6A5H-DTVcMSk7.js +1 -0
- package/dist/ui/assets/chunk-FGVZ23HU-BEVs0fgA.js +213 -0
- package/dist/ui/assets/chunk-GZTWQ64R-CKGVWw4I.js +62 -0
- package/dist/ui/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/dist/ui/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dist/ui/assets/chunk-KTR4FSNJ-DSr3q0Xy.js +1 -0
- package/dist/ui/assets/chunk-MDAHDJXZ-YMIkXJ0O.js +10 -0
- package/dist/ui/assets/chunk-MPYPSXSE-C-CxVwa7.js +1 -0
- package/dist/ui/assets/chunk-ND7LMLKX-lfusdDHU.js +72 -0
- package/dist/ui/assets/chunk-NGNAAXSQ-DqoPQk1a.js +136 -0
- package/dist/ui/assets/chunk-OWCVCYLK-4-W-ynqW.js +2 -0
- package/dist/ui/assets/chunk-QDWOWVBQ-Du0KmhW4.js +129 -0
- package/dist/ui/assets/chunk-T47YP6PS-CKli33QU.js +1 -0
- package/dist/ui/assets/chunk-XXDRQBXY-DSL17ZTh.js +1 -0
- package/dist/ui/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/ui/assets/classDiagram-v2-KXABOMEV-CYc2BZ2y.js +217 -0
- package/dist/ui/assets/cose-bilkent-JH36ORCC-81nUs0at.js +1 -0
- package/dist/ui/assets/cynefin-EF2NZ3EQ-Clvwy422.js +1 -0
- package/dist/ui/assets/cynefinDiagram-NJNITYFG-CsgTQqAC.js +62 -0
- package/dist/ui/assets/cytoscape.esm-BPveszXl.js +321 -0
- package/dist/ui/assets/d3-scale-lXtN6-Od.js +1 -0
- package/dist/ui/assets/d3-selection-BFzs9NTX.js +1 -0
- package/dist/ui/assets/dagre-KIHZ2IZ3--BpWd3hW.js +4 -0
- package/dist/ui/assets/diagram-7YQZDPLS-Dp_m-C1a.js +41 -0
- package/dist/ui/assets/diagram-QBROCOUO-Bt-Lp7vq.js +200 -0
- package/dist/ui/assets/diagram-RJJCUUZO-DLsG2Tej.js +30 -0
- package/dist/ui/assets/diagram-WERXNKYE-D31SLp70.js +24 -0
- package/dist/ui/assets/diagram-YHHI257C-CVMeUILe.js +3 -0
- package/dist/ui/assets/diagram-YR4HJLHV-Bz9qvIhJ.js +24 -0
- package/dist/ui/assets/dist-YCovsM_S.js +1 -0
- package/dist/ui/assets/ebnfDiagram-N527522P-_FIZSf8P.js +1 -0
- package/dist/ui/assets/elk-O5DQBFGD-BK3qD3UW.js +27 -0
- package/dist/ui/assets/erDiagram-K3K3BIDK-Dmpdi5Ob.js +99 -0
- package/dist/ui/assets/eventmodeling-K75KTNOO-Dt-51L4s.js +1 -0
- package/dist/ui/assets/flowDiagram-Z6JWZHQI-Cn2ZVzvO.js +1 -0
- package/dist/ui/assets/ganttDiagram-3PRQTZWP-BaZof7eT.js +292 -0
- package/dist/ui/assets/gitGraph-VSP46ZUC-ezyaB0jQ.js +1 -0
- package/dist/ui/assets/gitGraphDiagram-VXDFKS5L-DRNdClPw.js +106 -0
- package/dist/ui/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/ui/assets/grid-E2QIVN74--djCUwdI.js +1 -0
- package/dist/ui/assets/index-Bly281F6.css +1 -0
- package/dist/ui/assets/index-CXK8WmR8.js +45 -0
- package/dist/ui/assets/info-OHQRW6UA-DsFXrFWI.js +1 -0
- package/dist/ui/assets/infoDiagram-EZ3ZOAHP-e8qx3eqc.js +2 -0
- package/dist/ui/assets/ishikawaDiagram-S3EKX5GW-CuKExPKN.js +70 -0
- package/dist/ui/assets/journeyDiagram-POQNLL5X-D0GE8iji.js +139 -0
- package/dist/ui/assets/kanban-definition-BH5XI6FM-NL5dOF_0.js +89 -0
- package/dist/ui/assets/katex-BXIx1Jgr.js +257 -0
- package/dist/ui/assets/mermaid-parser.core-0pE4JCc_.js +7 -0
- package/dist/ui/assets/mermaid.core-BVgUieVU.js +44 -0
- package/dist/ui/assets/mindmap-definition-WVAN44T4-BLTtjuVH.js +98 -0
- package/dist/ui/assets/packet-JDAUHWVQ-C-7DeilZ.js +1 -0
- package/dist/ui/assets/pegDiagram-D4NLKWP3-F2SSXiqv.js +1 -0
- package/dist/ui/assets/pie-XZMESJXO-B4BkiWTy.js +1 -0
- package/dist/ui/assets/pieDiagram-36ENHN4W-BB5uEdtB.js +39 -0
- package/dist/ui/assets/quadrantDiagram-ZQUDMS73-B5iPooYO.js +7 -0
- package/dist/ui/assets/radar-ABXABTNO-Dx3jkQdr.js +1 -0
- package/dist/ui/assets/railroad-I3PHUGI6-BSh47OT_.js +1 -0
- package/dist/ui/assets/railroad-abnf-LNEFI6M7-BWFvDxOj.js +1 -0
- package/dist/ui/assets/railroad-ebnf-DWYD2UWJ-GBoLzumA.js +1 -0
- package/dist/ui/assets/railroad-peg-JR7BVNR7-DByw5Orh.js +1 -0
- package/dist/ui/assets/railroadDiagram-JIZHGYPL--ptGd2NR.js +1 -0
- package/dist/ui/assets/render-VIF2ZAQL-CzNp-J42.js +2 -0
- package/dist/ui/assets/requirementDiagram-AXW2TVFA-DBh9Dt63.js +84 -0
- package/dist/ui/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/dist/ui/assets/sankeyDiagram-FBCJTAIF-CjJtGyu8.js +40 -0
- package/dist/ui/assets/sequenceDiagram-3LA2ROMG-BzeMVuzG.js +169 -0
- package/dist/ui/assets/sizeCapture-2Q2CQKSF-DSY_W0YL.js +1 -0
- package/dist/ui/assets/stateDiagram-v2-ATKHQDJO-DYavre2v.js +291 -0
- package/dist/ui/assets/swimlanes-YQL5WMAO-CUTCsfPM.js +1 -0
- package/dist/ui/assets/swimlanesDiagram-UCCPES4V-B7bXxKVr.js +8 -0
- package/dist/ui/assets/timeline-definition-7Z437IG3-HWrtH0QT.js +120 -0
- package/dist/ui/assets/treeView-D4JQ5SDB-B5lbyI_M.js +1 -0
- package/dist/ui/assets/treemap-SAJKECNS-Ckfi-DGc.js +1 -0
- package/dist/ui/assets/usecaseDiagram-RDK6N6HP-BuKN2NAW.js +328 -0
- package/dist/ui/assets/vennDiagram-SHRQU5PJ-s2gljkjP.js +34 -0
- package/dist/ui/assets/wardley-7MLQ67FV-CjAqYBcP.js +1 -0
- package/dist/ui/assets/wardleyDiagram-F3OXNVQS-Ba_SoMTx.js +78 -0
- package/dist/ui/assets/xychartDiagram-GDYJKCDI-FsxUUoqL.js +7 -0
- package/dist/ui/index.html +2 -2
- package/dist/{upgrade-FND3UBJR.js → upgrade-M6TR3IBW.js} +15 -15
- package/migrations/0006_arch_auto.sql +8 -0
- package/package.json +1 -1
- package/dist/chunk-3ZLMW2RI.js +0 -74
- package/dist/ui/assets/index-4WzXlYHs.css +0 -1
- package/dist/ui/assets/index-ZKfByx7Q.js +0 -42
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t}from"./d3-selection-BFzs9NTX.js";import"./chunk-QDWOWVBQ-Du0KmhW4.js";import"./chunk-MDAHDJXZ-YMIkXJ0O.js";import"./chunk-T47YP6PS-CKli33QU.js";import"./chunk-OWCVCYLK-4-W-ynqW.js";import"./chunk-ND7LMLKX-lfusdDHU.js";import"./chunk-DZSZGQHW-BCXsfFfT.js";import"./chunk-GZTWQ64R-CKGVWw4I.js";import"./chunk-MPYPSXSE-C-CxVwa7.js";import"./chunk-F3AE6A5H-DTVcMSk7.js";import{i as n}from"./chunk-EBZ3SEQC-CdDips7b.js";import{n as r,t as i}from"./chunk-3GCGMST5-RRiusQp9.js";function a(e,{measure:t}){let n=r(e.config?.swimlane?.lineHops);if(n===!1)return;let a=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,cornerRadius:e.cornerRadius,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));i(t.groups.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:n})}e(a,`applySwimlaneLineJumps`);function o(e){let t=e?.metadata?.laneRole;return t===`pool`||t===`lane`?t:void 0}e(o,`readLaneRole`);function s(e){let t=e?.metadata?.laneIndex;return typeof t==`number`&&Number.isFinite(t)?t:void 0}e(s,`readLaneIndex`);function c(t){let n=new Map,r=new Map;for(let e of t)n.set(e.id,e),e.isGroup&&e.parentId&&r.set(e.parentId,(r.get(e.parentId)??0)+1);let i=new Set;for(let e of t)e.isGroup&&o(e)===`pool`&&(r.get(e.id)??0)>0&&i.add(e.id);let a=new Set,s=new Map;for(let e of t)if(e.isGroup&&!i.has(e.id)){if(e.parentId&&i.has(e.parentId)){a.add(e.id);let t=s.get(e.parentId)??[];t.push(e.id),s.set(e.parentId,t)}else e.parentId||a.add(e.id)}let c=e((e,t)=>{let r=new Set([e]),i=n.get(e)?.parentId;for(;i&&!r.has(i);){if(t.has(i))return i;r.add(i),i=n.get(i)?.parentId}return null},`walk`),l=new Map;return{isPool:e(e=>i.has(e),`isPool`),isLane:e(e=>a.has(e),`isLane`),laneIdOf:e(e=>{let t=l.get(e);if(t!==void 0)return t;let n=c(e,a);return l.set(e,n),n},`laneIdOf`),poolIdOf:e(e=>i.has(e)?e:c(e,i),`poolIdOf`),lanesByPool:s,hasPools:i.size>0}}e(c,`buildLaneModel`);var l=new Set([`top`,`right`,`bottom`,`left`]),u=8,d=1e4;function f(e){let t=e?.metadata?.anchorTo;if(!t||typeof t!=`object`)return;let{hostId:n,side:r,slot:i,gap:a}=t;if(typeof n==`string`&&n.length!==0&&n!==e?.id)return{hostId:n,...typeof r==`string`&&l.has(r)?{side:r}:{},...typeof i==`number`&&Number.isFinite(i)?{slot:i}:{},...typeof a==`number`&&Number.isFinite(a)&&a>0?{gap:Math.min(a,d)}:{}}}e(f,`readAnchor`);function p(e,t){let n=new Set([e]),r=f(t.get(e))?.hostId;for(;r&&!n.has(r);){let e=t.get(r);if(!e)return;let i=f(e)?.hostId;if(!i)return r;n.add(r),r=i}}e(p,`resolveAnchorHostId`);function m(e){let t=new Map(e.map(e=>[e.id,e])),n=new Set;for(let r of e)f(r)&&p(r.id,t)&&n.add(r.id);return n}e(m,`collectAnchoredIds`);function h(e,t){return e===`canonical`?`right`:t===`LR`||t===`RL`?`bottom`:`right`}e(h,`defaultAnchorSide`);function g(e,t){let n=e.anchor.slot,r=t.anchor.slot;return n!==void 0&&r!==void 0&&n!==r?n-r:n!==void 0&&r===void 0?-1:n===void 0&&r!==void 0?1:e.index-t.index}e(g,`compareBucketEntries`);function _(e){let t=e.reduce((e,t)=>e+t,0)+u*Math.max(0,e.length-1),n=[],r=-t/2;for(let t of e)n.push(r+t/2),r+=t+u;return{offsets:n,total:t}}e(_,`packAlongBorder`);var v=e(e=>[e.width,e.height].every(e=>e===void 0||Number.isFinite(e)),`hasUsableSize`);function y(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Map;e.forEach((e,i)=>{let a=f(e);if(!a||!v(e))return;let o=p(e.id,n);if(!o)return;let s=t(a),c=`${s}:${o}`,l=r.get(c)??[];l.push({node:e,anchor:a,index:i,side:s,hostId:o}),r.set(c,l)});for(let e of r.values())e.sort(g);return r}e(y,`bucketByHostAndSide`);function b(e,t,n,r){return e+(!t&&n>0?-(r+u):0)}e(b,`centreAlongBorder`);function x(t,n){let r=n===`top`||n===`bottom`,i=e(e=>r?e.width??0:e.height??0,`alongBorder`),a=e(e=>r?e.height??0:e.width??0,`reach`),{offsets:o}=_(t.map(e=>i(e.node))),s=0,c=0,l=0;return t.forEach((e,t)=>{let n=e.anchor.gap??0,u=i(e.node)/2,d=b(o[t],r,n,u);s=Math.max(s,u-d),c=Math.max(c,d+u),l=Math.max(l,n>0?n+a(e.node):0)}),{before:s,after:c,beyond:l}}e(x,`footprintOf`);function S(e,t){let n=h(`final`,t??`TB`),r=new Map;for(let t of y(e,e=>e.side??n).values()){if(!t.some(e=>e.anchor.gap))continue;let{hostId:e,side:n}=t[0];r.set(e,{...r.get(e),[n]:x(t,n)})}return r}e(S,`anchorFootprints`);var C=`__swimlane_default__`,w=21,T=20;function E(e){return Math.max(e.padding??T,T)}e(E,`topLaneHorizontalPadding`);function D(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let o=n-i/2,s=Math.min(a,n+i/2),c=o+Math.min(w,Math.max(0,s-o));if(c<=o){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:o,bottom:c}}e(D,`assignTopLaneTitleRect`);function O(e){let t=e.other?.droppedSubGraphMembers;return Array.isArray(t)?t:[]}e(O,`sharedMembers`);var k=e((e,t,n)=>!t.some(e=>e.parentId===n)&&!(e.edges??[]).some(e=>e.start===n||e.end===n),`isEmptyLane`);function ee(e,t){return e.isLane(t)?t:e.laneIdOf(t)??void 0}e(ee,`laneIdOrSelf`);function A(e,t,n){for(let r of n){let n=t.findIndex(e=>e.id===r);n>=0&&k(e,t,r)&&t.splice(n,1)}}e(A,`removeEmptyLanes`);function j(e,n){let r=c(n),i=new Set(n.filter(e=>r.isLane(e.id)).map(e=>e.id)),a=new Set;for(let{node:n,keptBy:o,droppedFrom:s}of O(e)){let e=ee(r,o);e&&e!==s&&i.has(s)&&(t.warn(`Swimlane node "${n}" is listed in lanes "${e}" and "${s}"; it is drawn in "${e}" only.`),a.add(s))}A(e,n,a)}e(j,`dropLanesEmptiedBySharedNodes`);function M(e,n){for(let r of e)r.isGroup&&!n.isLane(r.id)&&!n.isPool(r.id)&&t.warn(`Swimlane subgraph "${r.id}" is nested in "${r.parentId}"; only top-level subgraphs are lanes, so it is drawn as a plain box.`)}e(M,`warnAboutNestedGroups`);function N(e){let t=e.direction,n=e.nodes??=[];j(e,n);let r=c(n);M(n,r);for(let e of n){let n=r.isLane(e.id);(n||r.isPool(e.id))&&(e.shape=n?`swimlane`:`pool`,t&&(e.direction=t))}let i=n.filter(e=>!e.isGroup&&!e.parentId);if(i.length===0)return;let a=n.find(e=>e.id===C);a?a.isGroup&&(a.shape=`swimlane`,t&&(a.direction=t)):(a={id:C,label:``,isGroup:!0,shape:`swimlane`,padding:20,look:e.config?.look,colorIndex:n.reduce((e,t)=>Math.max(e,t.colorIndex??-1),-1)+1,...t?{direction:t}:{}},n.push(a));for(let e of i)e.parentId=C}e(N,`prepareLayoutForSwimlanes`);function P(t){let n=(t.nodes??[]).filter(e=>!e.isEdgeLabel),r=new Map(n.map(e=>[e.id,e])),i=m(n),a=e(e=>i.has(e)?p(e,r)??e:e,`hostOf`),o=new Map;for(let e of n)i.has(e.id)||o.set(e.id,e);let s=[];for(let e of t.edges??[]){let t=typeof e.start==`string`?e.start:void 0,n=typeof e.end==`string`?e.end:void 0;if(!t||!n||e.isLayoutOnly)continue;let r=a(t),i=a(n);r!==i&&s.push({id:e.id,src:r,dst:i,ref:e})}let c=n.filter(e=>e.isGroup&&!i.has(e.id)),l=n.filter(e=>!e.isGroup&&!i.has(e.id));return{nodes:[...[...c].reverse(),...l].map(e=>e.id),edges:s,layout:t,nodeById:o}}e(P,`toGraphView`);function te(t){let n=new Map(t.map(e=>[e.id,e])),r=e(e=>{let t=0,r=e.parentId,i=new Set([e.id]);for(;r!=null&&!i.has(r);)i.add(r),t++,r=n.get(r)?.parentId;return t},`depthOf`);return t.filter(e=>e?.isGroup).map(e=>({node:e,depth:r(e)})).sort((e,t)=>t.depth-e.depth).map(e=>e.node)}e(te,`groupsDeepestFirst`);function ne(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,l=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=l,e.order=t;let i=n.x[r]??t*s,c=n.y[r]??l*o;e.x=i,e.y=c,t++}l++}let u=i.nodes??[],d=m(u);for(let e of u)e.isEdgeLabel&&n.x[e.id]!=null&&n.y[e.id]!=null&&(e.x=n.x[e.id],e.y=n.y[e.id]);let f=new Map,p=c(u),h=[];for(let e of te(u)){p.isLane(e.id)&&h.push(e);let t=u.filter(t=>t.parentId===e.id&&!d.has(t.id)),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(e.isEdgeLabel||(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2)),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*E(e),s=t,c=Math.max(0,i-r)+n,l=Math.max(0,o-a)+s,u=(r+i)/2,d=(a+o)/2;e.x=u,e.y=d,e.width=c,e.height=l,f.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(h.length>0&&f.size>0){let e=1/0,t=-1/0,n=0;for(let r of h){let i=r.padding??20;i>n&&(n=i);let a=f.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of h)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...h].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],c=[];for(let e of a){let t=f.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*E(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),c.push(n)}let l=o.length;if(l>0){let e=new Map;if(l===1)e.set(o[0],c[0]);else{let t=[];for(let e=0;e<l-1;e++)t.push(s[e+1]-s[e]);let n=Array(l);n[0]=0;for(let e=0;e<l-1;e++)n[e+1]=2*t[e]-n[e];let r=0,i=1/0;for(let e=0;e<l;e++){let t=c[e];e%2==0?r=Math.max(r,t-n[e]):i=Math.min(i,n[e]-t)}let a=r;a=r<=i?(r+i)/2:r;for(let t=0;t<l;t++){let r=n[t]+(t%2==0?a:-a),i=Math.max(c[t],r);e.set(o[t],i)}}for(let t of h){let n=e.get(t.id);n!=null&&(t.width=n),D(t)}}}}}e(ne,`writeBackToLayoutData`);var re=`[EdgeLabelNodes]`;function ie(e){let n=[],r=[],i=new Map;for(let t of e.nodes)i.set(t.id,t);for(let a of e.edges){if(!a.label||a.label.length===0||a.isLayoutOnly||a.labelNodeId)continue;let e=a.start?i.get(a.start):void 0,o=a.end?i.get(a.end):void 0;if(!e||!o){t.warn(re,`Edge ${a.id} has missing source or target node`);continue}let s=`edge-label-${a.start}-${a.end}-${a.id}`,c=e.parentId===o.parentId?e.parentId:o.parentId,l={id:s,label:a.label,edgeStart:a.start??``,edgeEnd:a.end??``,shape:`labelRect`,width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:c,isGroup:!1,labelStyle:Array.isArray(a.labelStyle)?a.labelStyle[0]:a.labelStyle??``,...e.dir?{dir:e.dir}:{}};n.push(l),a.labelNodeId=s,a.label=void 0,a.text=void 0;let u={id:`${a.id}-to-label`,start:a.start,end:s,type:`normal`,isLayoutOnly:!0},d={id:`${a.id}-from-label`,start:s,end:a.end,type:`normal`,isLayoutOnly:!0};r.push(u,d)}let a=[...e.nodes,...n],o=[...e.edges,...r];return{...e,nodes:a,edges:o}}e(ie,`createEdgeLabelNodes`);var F=.001;function ae(e){let t=e.x??0,n=e.y??0,r=e.width??0,i=e.height??0;return r>0&&i>0?{cx:t,cy:n,rect:ge(t,n,r,i)}:void 0}e(ae,`measuredNodeRect`);function oe(e){if(e.isGroup)return;let t=ae(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}e(oe,`nodeBoundsInfoFor`);function se(e,t,n=F){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n}e(se,`samePoint`);function I(e,t,n=F){return Math.abs(e.x-t.x)<n}e(I,`sameX`);function L(e,t,n=F){return Math.abs(e.y-t.y)<n}e(L,`sameY`);function R(e,t,n=F){return L(e,t,n)&&Math.abs(e.x-t.x)>n}e(R,`isHorizontalSegment`);function z(e,t,n=F){return I(e,t,n)&&Math.abs(e.y-t.y)>n}e(z,`isVerticalSegment`);function B(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}e(B,`overlapLength`);function V(e,t,n=F){return e.horizontal&&t.horizontal&&L(e.a,t.a,n)?B(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&I(e.a,t.a,n)?B(e.a.y,e.b.y,t.a.y,t.b.y):0}e(V,`sameAxisSegmentOverlapLength`);function H(e,t=F){let n=[];for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=R(i,a,t),s=z(i,a,t);(o||s)&&n.push({index:r,a:i,b:a,horizontal:o,vertical:s})}return n}e(H,`orthogonalSegmentsForPoints`);function U(e,t=F){let n=H(e,t),r=0;for(let e=1;e<n.length;e++)n[e-1].horizontal!==n[e].horizontal&&r++;return r}e(U,`countOrthogonalBends`);function ce(e){let t=H(W(e));return t.slice(1).flatMap((e,n)=>t[n].horizontal===e.horizontal?[]:[e.a])}e(ce,`bendPoints`);function le(e,t){let n=Math.max(Math.min(t.a.x,t.b.x)-e.x,0,e.x-Math.max(t.a.x,t.b.x)),r=Math.max(Math.min(t.a.y,t.b.y)-e.y,0,e.y-Math.max(t.a.y,t.b.y));return Math.hypot(n,r)}e(le,`distanceToSegment`);function ue(t,n,r){let i=e((e,t)=>{let n=H(W(t));return ce(e).some(e=>n.some(t=>le(e,t)<r))},`touches`);return i(t,n)||i(n,t)}e(ue,`routesTouchAtBend`);function W(e,t=F){let n=[];for(let r of e){let e=n.length>0?n[n.length-1]:void 0;(!e||!se(e,r,t))&&n.push({x:r.x,y:r.y})}return n}e(W,`dedupeConsecutivePoints`);function de(e,t=F){if(!e||e.length!==4)return;let[n,r,i,a]=e;return R(n,r,t)&&z(r,i,t)&&R(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:z(n,r,t)&&R(r,i,t)&&z(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}e(de,`classifyThreeSegmentRoute`);function fe(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&i<n.right+r&&s>n.top-r&&o<n.bottom+r}e(fe,`segmentBoundsOverlapRect`);function pe(e,t,n=0){return e.x>t.left+n&&e.x<t.right-n&&e.y>t.top+n&&e.y<t.bottom-n}e(pe,`pointInsideRect`);function G(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}e(G,`rectContainsRect`);function me(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}e(me,`rectsOverlap`);function he(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}e(he,`inflateRect`);function ge(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}e(ge,`rectFromCenterSize`);function K(e){return ae(e)?.rect}e(K,`rectOfNodeBounds`);function _e(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}e(_e,`portForRectSide`);function ve(e,t,n,r,i,a=F){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.x<n.x||t===`left`&&r===`right`&&e.x>n.x){if(L(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(L(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(I(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.y<n.y||t===`top`&&r===`bottom`&&e.y>n.y))return;if(I(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.x<e.x,a=r===`top`&&e.y<n.y||r===`bottom`&&e.y>n.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.y<e.y,l=r===`left`&&e.x<n.x||r===`right`&&e.x>n.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}e(ve,`buildOrthogonalPortPath`);function ye(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}e(ye,`buildSameSideTrackPath`);function be(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=oe(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}e(be,`collectRealNodeBounds`);function xe(e){let t=[],n=[];for(let r of e){let e=oe(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}e(xe,`collectNodeRectEntries`);function Se(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...ge(e,i,a,o)})}return n}e(Se,`collectLayoutNodeRects`);function Ce(e,t,n=F){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(a&&o)return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)<n,collinearY:Math.abs(a.cy-o.cy)<n}}e(Ce,`getNodePairGeometry`);function q(e,t,n,r=[],i=0){for(let a of n)if(!r.includes(a.id)&&fe(e,t,a.rect,-i))return!0;return!1}e(q,`segmentHitsAnyRect`);function we(e,t,n,r,i=F,a=1e-6){let o=L(e,t,i),s=I(e,t,i),c=L(n,r,i),l=I(n,r,i);if(o&&c||s&&l||!(o||s)||!(c||l))return!1;let u=o?{a:e,b:t}:{a:n,b:r},d=s?{a:e,b:t}:{a:n,b:r},f=u.a.y,p=Math.min(u.a.x,u.b.x),m=Math.max(u.a.x,u.b.x),h=d.a.x,g=Math.min(d.a.y,d.b.y),_=Math.max(d.a.y,d.b.y);if(h<p||h>m||f<g||f>_)return!1;let v=Math.abs(h-u.a.x)<a&&Math.abs(f-u.a.y)<a||Math.abs(h-u.b.x)<a&&Math.abs(f-u.b.y)<a,y=Math.abs(h-d.a.x)<a&&Math.abs(f-d.a.y)<a||Math.abs(h-d.b.x)<a&&Math.abs(f-d.b.y)<a;return!(v&&y)}e(we,`orthogonalSegmentsCross`);function Te(e,t,n,r,i=F){let a=L(e,t,i),o=I(e,t,i),s=L(n,r,i),c=I(n,r,i);return o&&c&&I(e,n,i)?B(e.y,t.y,n.y,r.y)>i:a&&s&&L(e,n,i)?B(e.x,t.x,n.x,r.x)>i:!1}e(Te,`sameAxisSegmentsOverlap`);function Ee(e,t,n,r,{epsilon:i=F,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;r<n.length-1;r++){let o=n[r],s=n[r+1];if(!(a&&se(o,s,i))&&(we(e,t,o,s,i)||Te(e,t,o,s,i)))return!0}}return!1}e(Ee,`segmentConflictsWithAnyEdge`);function De(e,t,n,r,i=F){let a=L(e,t,i),o=I(e,t,i),s=L(n,r,i),c=I(n,r,i);if(!(a&&c||o&&s))return!1;let l=a?{a:e,b:t}:{a:n,b:r},u=a?{a:n,b:r}:{a:e,b:t},d=l.a.y,f=Math.min(l.a.x,l.b.x),p=Math.max(l.a.x,l.b.x),m=u.a.x,h=Math.min(u.a.y,u.b.y),g=Math.max(u.a.y,u.b.y);return m>f+i&&m<p-i&&d>h+i&&d<g-i}e(De,`orthogonalSegmentsStrictlyCross`);function Oe(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+F&&e<i-F}e(Oe,`strictlyBetween`);function ke(e,t,n){return I(e,t)&&I(t,n)?Oe(t.y,e.y,n.y):L(e,t)&&L(t,n)?Oe(t.x,e.x,n.x):!1}e(ke,`isCollinearIntermediate`);function Ae(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=n[n.length-1],a=e[r],o=r+1<e.length?e[r+1]:void 0;if(i&&o){if(se(i,o)){r++,t=!0;continue}if(ke(i,a,o)){t=!0;continue}}n.push(a)}return{points:n,changed:t}}e(Ae,`simplifyPolylineOnce`);function je(e){let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];if(!I(r,i)&&!L(r,i)){let e=t.length>=2?t[t.length-2]:void 0,n=e&&I(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!se(t,e))&&n.push(e)}return n}e(je,`orthogonalizePolyline`);function Me(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=Ae(t);if(t=e.points,!e.changed)break}return t}e(Me,`simplifyPolyline`);var J=.001,Ne=.5,Pe=4;function Fe(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length<n)return;let i=r.start?t.get(r.start):void 0,a=r.end?t.get(r.end):void 0;return{edge:r,points:r.points,srcRect:i?K(i):void 0,dstRect:a?K(a):void 0}}e(Fe,`endpointContextFor`);function Ie(e,t,n){if(L(e,t,J))return{x:e.x<n.left?n.left:n.right,y:e.y};if(I(e,t,J)){let t=e.y<n.top?n.top:n.bottom;return{x:e.x,y:t}}return{x:Math.min(n.right,Math.max(n.left,e.x)),y:Math.min(n.bottom,Math.max(n.top,e.y))}}e(Ie,`segmentEnterPoint`);function Le(e,t,n){let r=n?1:-1,i=n?0:e.length-1;for(;i>=0&&i<e.length&&pe(e[i],t,Ne);)i+=r;if(i<0||i>=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=Ie(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}e(Le,`clipEndpoint`);function Re(e,t){for(let n of e){let e=Fe(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=Le(r,e.srcRect,!0)),e.dstRect&&(r=Le(r,e.dstRect,!1)),r=Me(je(r)),r=Ye(r,e.srcRect,e.dstRect),e.edge.points=Me(je(r))}}e(Re,`clipEdgeEndpointsToNodeBoundaries`);function ze(e,t,n,r=!1){if(L(e,t,J)){if(t.y<n.top-J||t.y>n.bottom+J)return t;if(r){if(e.x<n.left-J)return{x:n.left,y:e.y};if(e.x>n.right+J)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(I(e,t,J)){if(t.x<n.left-J||t.x>n.right+J)return t;if(r){if(e.y<n.top-J)return{x:e.x,y:n.top};if(e.y>n.bottom+J)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}e(ze,`snapEndpointToBoundary`);function Be(e,t,n){let r=e[t];for(let i=t+n;i>=0&&i<e.length;i+=n){let t=e[i];if(!se(t,r,J))return t}return e[t+n]}e(Be,`firstDistinctAdjacent`);function Ve(e,t){let n=e+Pe,r=t-Pe;return n<=r?{lo:n,hi:r}:{lo:(e+t)/2,hi:(e+t)/2}}e(Ve,`cornerClearanceRange`);function He(e,t,n){let{lo:r,hi:i}=Ve(t,n);return Math.min(i,Math.max(r,e))}e(He,`clampToCornerClearance`);function Ue(e){let t=Math.max(...e.map(e=>e.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}e(Ue,`intersectRanges`);function We(e,t){return t===`left`||t===`right`?Ve(e.top,e.bottom):Ve(e.left,e.right)}e(We,`clearanceRangeForSide`);function Ge(e,t,n){let r=e.y>=n.top-J&&e.y<=n.bottom+J,i=e.x>=n.left-J&&e.x<=n.right+J;if(L(e,t,J)&&r){if(Math.abs(e.x-n.left)<J)return`left`;if(Math.abs(e.x-n.right)<J)return`right`}if(I(e,t,J)&&i){if(Math.abs(e.y-n.top)<J)return`top`;if(Math.abs(e.y-n.bottom)<J)return`bottom`}}e(Ge,`terminalSideForSegment`);function Ke(e){return e===`left`||e===`right`}e(Ke,`isHorizontalSide`);function qe(e,t,n,r,i){let a=[],o=n?Ge(e,t,n):void 0,s=r?Ge(t,e,r):void 0;return n&&o&&Ke(o)===i&&a.push(We(n,o)),r&&s&&Ke(s)===i&&a.push(We(r,s)),a.length>0?Ue(a):void 0}e(qe,`straightClearanceRange`);function Je(e,t,n,r,i){let a=qe(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)<J))return i?[{x:e.x,y:s},{x:t.x,y:s}]:[{x:s,y:e.y},{x:s,y:t.y}]}e(Je,`clearStraightEndpointCornerAxis`);function Ye(e,t,n){if(e.length!==2)return e;let[r,i]=e;return L(r,i,J)?Je(r,i,t,n,!0)??e:I(r,i,J)?Je(r,i,t,n,!1)??e:e}e(Ye,`clearStraightEndpointCornerConnections`);function Xe(e,t,n){return Ke(n)?{x:e.x,y:He(e.y,t.top,t.bottom)}:{x:He(e.x,t.left,t.right),y:e.y}}e(Xe,`cornerClearedEndpoint`);function Ze(e,t,n,r,i,a){let o=e.map(e=>({...e}));for(let s=t;s>=0&&s<e.length;s+=n){let t=e[s];if(a&&!L(t,r,J)||!a&&!I(t,r,J))break;a?o[s].y=i.y:o[s].x=i.x}return o}e(Ze,`moveCollinearEndpointRun`);function Qe(e,t,n){if(e.length<2)return e;let r=n?0:e.length-1,i=n?1:-1,a=e[r],o=Be(e,r,i);if(!o)return e;let s=Ge(a,o,t);if(!s)return e;let c=Ke(s),l=Xe(a,t,s);return se(a,l,J)?e:Ze(e,r,i,a,l,c)}e(Qe,`clearEndpointCornerConnection`);function $e(e,t,n){let r=Math.min(e.x,t.x)>=n.left-J&&Math.max(e.x,t.x)<=n.right+J,i=Math.min(e.y,t.y)>=n.top-J&&Math.max(e.y,t.y)<=n.bottom+J;if(Math.abs(e.y-n.top)<J&&Math.abs(t.y-n.top)<J&&r)return`top`;if(Math.abs(e.y-n.bottom)<J&&Math.abs(t.y-n.bottom)<J&&r)return`bottom`;if(Math.abs(e.x-n.left)<J&&Math.abs(t.x-n.left)<J&&i)return`left`;if(Math.abs(e.x-n.right)<J&&Math.abs(t.x-n.right)<J&&i)return`right`}e($e,`borderSideForSegment`);function et(e,t,n,r){switch(e){case`top`:return I(t,n,J)&&n.y<r.top-J;case`bottom`:return I(t,n,J)&&n.y>r.bottom+J;case`left`:return L(t,n,J)&&n.x<r.left-J;case`right`:return L(t,n,J)&&n.x>r.right+J}}e(et,`leavesOutward`);function tt(e,t,n){if(e.length<3)return e;if(n){let n=$e(e[0],e[1],t);return n&&et(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=$e(e[r-1],e[r],t);return i&&et(i,e[r-1],e[r-2],t)?e.slice(0,r):e}e(tt,`collapseOwnBorderStub`);function nt(e,t,n){let r=e;if(t){let e=Be(r,0,1);if(e){let n=ze(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=tt(r,t,!0)}if(n){let e=r.length-1,t=Be(r,e,-1);if(t){let i=ze(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=tt(r,n,!1)}let i=Ye(r,t,n);return i!==r||r.length===2?i:(t&&(r=Qe(r,t,!0)),n&&(r=Qe(r,n,!1)),r)}e(nt,`snapAndCollapseEndpoints`);function rt(e,t){for(let n of e){let e=Fe(n,t,2);if(!e)continue;let r=nt(W(e.points,J),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}e(rt,`prepareEdgeEndpointsForRenderer`);function it(e){return new Map(e.map(e=>[e.id,e]))}e(it,`buildNodeMap`);function at(e,t){let n=new Set([e.id]),r=0,i=e.parentId;for(;i&&!n.has(i);){let e=t.get(i);if(!e?.isGroup)break;n.add(i),r++,i=e.parentId}return r}e(at,`groupDepth`);function ot(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}e(ot,`boundsForChildren`);function st(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}e(st,`applyGroupBounds`);function ct(e){let t=it(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>at(n,t)-at(e,t));for(let t of n){let n=ot(e.filter(e=>e.parentId===t.id));n&&st(t,n)}}e(ct,`recomputeNestedGroupBounds`);function lt(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=e(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}e(lt,`mirrorAxis`);function ut(e){return!(e.nodes??[]).some(e=>!e.isGroup)||lt(e,`y`)}e(ut,`applyBtDirectionTransform`);function dt(e){let t=m(e),n=e.filter(e=>!e.isGroup&&!e.isEdgeLabel&&!t.has(e.id));if(n.length===0)return 1;let r=0,i=0;for(let e of n)r+=e.width??0,i+=e.height??0;let a=r/n.length,o=i/n.length;return o>0?Math.max(1,a/o):1}e(dt,`flowAxisStretch`);var ft=36,pt=[`top`,`right`,`bottom`,`left`];function mt(e){return e===`left`?`right`:e===`right`?`left`:e}e(mt,`mirroredSide`);function ht(e,t,n,r,i){if(n===`top`||n===`bottom`){let n=(t.left+t.right)/2,[a,o]=i?[r.after,r.before]:[r.before,r.after];e.left=Math.min(e.left,n-a),e.right=Math.max(e.right,n+o);return}let a=(t.top+t.bottom)/2;e.top=Math.min(e.top,a-r.before),e.bottom=Math.max(e.bottom,a+r.after)}e(ht,`growAlongBorder`);var gt={top:e((e,t,n)=>{e.top=Math.min(e.top,t.top-n)},`top`),bottom:e((e,t,n)=>{e.bottom=Math.max(e.bottom,t.bottom+n)},`bottom`),left:e((e,t,n)=>{e.left=Math.min(e.left,t.left-n)},`left`),right:e((e,t,n)=>{e.right=Math.max(e.right,t.right+n)},`right`)};function _t(e,t,n,r,i){ht(e,t,n,r,i),gt[n](e,t,r.beyond)}e(_t,`reserveOnSide`);function vt(e,t,n){let r=e.x??0,i=e.y??0,a=(e.width??0)/2,o=(e.height??0)/2,s={left:r-a,right:r+a,top:i-o,bottom:i+o},c={...s},l=n===`RL`;for(let e of pt){let n=t[e];n&&_t(c,s,l?mt(e):e,n,l)}return{...e,x:(c.left+c.right)/2,y:(c.top+c.bottom)/2,width:c.right-c.left,height:c.bottom-c.top}}e(vt,`withAnchorFootprints`);function yt(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=m(n),a=n.filter(e=>!e.isGroup&&!i.has(e.id)),o=1/0,s=1/0;for(let e of a){let t=e.x??0,n=e.y??0;t<o&&(o=t),n<s&&(s=n)}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let l=ft,u=dt(n);for(let e of a){let t=e.x??0,n=((e.y??0)-s)*u+l,r=t-o;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-s)*u+l,r=e-o;t.x=n,t.y=r}ct(n);let d=c(n),f=n.filter(e=>d.isLane(e.id));if(f.length===0)return t===`RL`&<(e,`x`),!0;let p=new Map,h=S(n,t);for(let e of n){if(d.isLane(e.id)||d.isPool(e.id)||i.has(e.id))continue;let n=d.laneIdOf(e.id);if(!n)continue;let r=p.get(n)??[],a=h.get(e.id);r.push(a?vt(e,a,t):e),p.set(n,r)}let g=0;for(let e of f){let t=e.padding??0;t>g&&(g=t)}let _=[],v=1/0,y=-1/0;for(let e of f){let t=ot(p.get(e.id)??[]);t&&(v=Math.min(v,t.minX),y=Math.max(y,t.maxX),_.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(v===1/0||y===-1/0)return!0;let b=Math.max(0,y-v)+2*Math.max(g,10),x=l+b,C=(v+y)/2-b/2-l,w=C+x/2,T=Math.max(g,l);_.sort((e,t)=>e.centerY-t.centerY);for(let e=0;e<_.length;e++){let t=_[e],n,r;if(n=e===0?t.contentTop-T:(_[e-1].contentBottom+t.contentTop)/2,e===_.length-1)r=t.contentBottom+T;else{let n=_[e+1];r=(t.contentBottom+n.contentTop)/2}let i=Math.max(0,r-n),a=(n+r)/2;t.lane.x=w,t.lane.y=a,t.lane.width=x,t.lane.height=i,t.lane.swimlaneContentTop=t.contentTop,t.lane.groupTitleRect={left:C,right:C+l,top:n,bottom:r}}return t===`RL`&<(e,`x`),!0}e(yt,`applyLrDirectionTransform`);var bt=1e-6,xt=8,St=[0,xt,-xt,2*xt,-2*xt];function Ct(e,t){let{nodeInfoById:n,realNodeRects:r}=be(t);for(let t of e){if(t.isLayoutOnly)continue;let i=t.points;if(!i||i.length<4)continue;let a=de(W(i,bt),bt);if(!a)continue;let{p3:o}=a,s=a.kind===`HVH`,c=Ce(t,n,bt);if(!c)continue;let{srcId:l,dstId:u,srcInfo:d,dstInfo:f,collinearX:p,collinearY:m}=c;if(p||m)continue;let h,g=d.rect;for(let n of St){let i,a,c;if(s){let e=f.cy>d.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+bt||t>=g.right-bt)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+bt||t>=g.bottom-bt)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=se(i,a,bt),m=se(a,c,bt);if(p&&m||!p&&q(i,a,r,[l],1)||!m&&q(a,c,r,[u],1))continue;let _=!p&&Ee(i,a,e,t,{epsilon:bt,skipDegenerateOther:!0}),v=!m&&Ee(a,c,e,t,{epsilon:bt,skipDegenerateOther:!0});if(!(_||v)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}e(Ct,`portSwapToLShape`);function wt(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=xe(n.values());for(let o of t){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=W(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h<r)continue;let g=d.x-f.x,_=d.y-f.y;if(Math.hypot(g,_)<r)continue;let v=R(d,u,r),y=z(d,u,r),b=R(f,d,r),x=z(f,d,r);if(!(v&&x||y&&b))continue;let S=o.end,C=o.start,w=S?n.get(S):void 0;if(!w)continue;let T=w.x??0,E=w.y??0,D=K(w);if(!D)continue;let O,k;if(x){let e=_<0;O={x:T,y:f.y},k={x:T,y:e?D.bottom:D.top}}else{let e=g>0;O={x:f.x,y:E},k={x:e?D.right:D.left,y:E}}if(q(O,k,i,S?[S]:[],-2)||q(O,k,a,[],-2))continue;if(C){let e=n.get(C),t=e?K(e):void 0;if(t&&pe(O,t,2))continue}let ee=e((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),A=new Set;for(let e=0;e<c.length-1;e++)A.add(ee(c[e],c[e+1]));let j=e((e,n)=>{for(let i of t){if(i===o||i.isLayoutOnly)continue;let t=i.points;if(!(!t||t.length<2))for(let i=0;i<t.length-1;i++){let a=t[i],o=t[i+1];if(!A.has(ee(a,o))&&De(e,n,a,o,r))return!0}}return!1},`segmentCrossesOtherEdge`);if(j(O,k))continue;if(l-3>=0){let e=c[l-3],t=[C,S].filter(e=>!!e);if(q(e,O,i,t,-2)||j(e,O))continue}let M=[...c.slice(0,l-2),O,k];o.points=M;let N=o.labelNodeId;if(N){let e=n.get(N);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e<M.length-1;e++){let s=M[e],c=M[e+1],l=Math.hypot(c.x-s.x,c.y-s.y),u=L(s,c,r),d=I(s,c,r);(u&&l>=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}e(wt,`collapseShortTerminalStub`);var Tt=4,Et=2,Dt={EDGE_GAP:12,LANE_MARGIN:20,ARROWHEAD_SIZE:8,ARROWHEAD_GAP:Tt,MIN_ARROWHEAD_SPACING:12,EDGE_STROKE_WIDTH:Et,ROUTE_TOUCH_TOLERANCE:Tt+Et},Ot={EPSILON:1e-6},kt={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},At={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40,EDGE_LABEL_CLEARANCE:16},Y=.001,X=8,jt=e(e=>typeof e==`string`?e.toUpperCase():``,`upperCaseDirection`),Z=H,Mt=e((e,t)=>I(e,t,Y)||L(e,t,Y),`orthogonallyAligned`);function Nt(t,n){let r=e((e,t)=>{let n=Math.min(8,(t-e)/4);return{low:e+n,high:t-n}},`usableFace`),i=e((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),a=e((e,t)=>{let r=W(e.points??[]);if(r.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?K(o):void 0;if(!o||!a||!s)return;let c=t?r[0]:r[r.length-1],l=t?r[1]:r[r.length-2],u=i(o,c),d=c;if(Mt(l,u)&&(d=l),I(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(L(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),o=e((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),s=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&I(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&L(e.boundary,t.boundary,1),`sameTerminalFace`),c=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:o(e,t)>=X&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),l=e((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=o(e,t);if(n<X)return!1;let r=e.rect.bottom-e.rect.top;return n<r||n>2*r?!1:s(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),u=e((t,n)=>{let i=W(t.edge.points??[]);if(i.length<2)return;let a=t.orientation===`V`?{x:t.boundary.x+n,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+n},o=t.orientation===`V`?{x:t.railEnd.x+n,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+n};if(!e(()=>{if(Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1){let e=r(t.rect.left,t.rect.right);return L(a,t.boundary,Y)&&a.x>=e.low&&a.x<=e.high}if(Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1){let e=r(t.rect.top,t.rect.bottom);return I(a,t.boundary,Y)&&a.y>=e.low&&a.y<=e.high}return!1},`boundaryStaysOnSameFace`)())return;if(t.atStart){let e=i.length>1&&se(i[1],t.railEnd,Y),n=i.slice(e?2:1),r=n[0];return r&&!Mt(r,o)?void 0:[a,o,...n]}let s=i.length>1&&se(i[i.length-2],t.railEnd,Y),c=i.slice(0,s?-2:-1),l=c[c.length-1];if(!l||Mt(l,o))return[...c,o,a]},`shiftedCandidate`),d=e(e=>{let t=e.edge,r=W(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return L(f,p,Y)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||I(f,p,Y)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),f=e(e=>e.orientation===`H`?r(e.rect.top,e.rect.bottom):r(e.rect.left,e.rect.right),`usableSpanOf`),p=e((e,t)=>{let n=f(e),r=e.coord<t.coord?n.low-e.coord:n.high-e.coord;return Math.sign(r)===Math.sign(e.coord-t.coord)?r:0},`shiftToFaceLimit`),m=e(e=>{let t=f(e);return[t.low-e.coord,t.high-e.coord]},`shiftsToFaceEnds`),h=[-7,7,-14,14,-21,21];for(let n=0;n<8;n++){let n=t.filter(e=>!e.isLayoutOnly).flatMap(e=>[a(e,!0),a(e,!1)]).filter(e=>!!e),r=!1;for(let t=0;t<n.length&&!r;t++)for(let i=t+1;i<n.length&&!r;i++){let s=n[t],f=n[i];if(s.edge===f.edge||!(c(s,f)||l(s,f)))continue;let g=!c(s,f),_=[s,f].sort((e,t)=>{let n=d(e),r=d(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)}),v=e((e,t,r)=>n.some(n=>n.edge!==e.edge&&(c(t,n)||r&&l(t,n))),`conflictsWith`),y=e((e,t)=>Math.min(...n.filter(n=>n.edge!==e.edge&&n.nodeId===t.nodeId&&n.orientation===t.orientation&&o(t,n)>=X).map(e=>Math.abs(t.coord-e.coord))),`closestTrackGap`),b=e((e,t,n,r=!1)=>{let i=t?a({...e.edge,points:t},e.atStart):void 0;return!t||!i||v(e,i,n)||r&&y(e,i)<y(e,e)?!1:(e.edge.points=t,!0)},`accept`),x=g?_.filter(e=>!d(e)):_;for(let e of x)if(r=h.some(t=>b(e,u(e,t),g)),r)break;if(!r){for(let e of x)if(r=(g?[p(e,e===s?f:s)]:m(e)).some(t=>Math.abs(t)>Y&&b(e,u(e,t),!1,!0)),r)break}}if(!r)return}}e(Nt,`separateSharedRenderedTerminalLanes`);function Pt(t,n){let{realNodeRects:r,labelNodeRects:i}=xe(n.values()),a=e((e,n)=>{let a=e.start,o=e.end,s=Z(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(q(e.a,e.b,r,c,-2)||q(e.a,e.b,i,[],-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of s)for(let n of Z(W(t)))if(V(e,n,.5)>=X||De(e.a,e.b,n.a,n.b,Y))return!1}}return!0},`candidateIsSafe`),o=e((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=R(n,r)&&z(r,i)&&R(i,a)&&z(a,o)&&I(n,a,Y)&&I(n,o,Y)&&I(r,i,Y)&&(r.x-n.x)*(a.x-i.x)<0,c=z(n,r)&&R(r,i)&&z(i,a)&&R(a,o)&&L(n,a,Y)&&L(n,o,Y)&&L(r,i,Y)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return W([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=z(n,r)&&R(r,i)&&z(i,a)&&R(a,o)&&z(o,l)&&I(n,o,Y)&&I(n,l,Y)&&I(i,a,Y)&&(i.x-r.x)*(o.x-a.x)<0,d=R(n,r)&&z(r,i)&&R(i,a)&&z(a,o)&&R(o,l)&&L(n,o,Y)&&L(n,l,Y)&&L(i,a,Y)&&(i.y-r.y)*(o.y-a.y)<0;if(u||d)return W([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let e=0;e<8;e++){let e=!1;for(let n of t){if(n.isLayoutOnly)continue;let t=W(n.points??[]);for(let r=0;r<=t.length-5;r++){let i=o(t,r);if(i&&a(n,i)){n.points=i,e=!0;break}}if(e)break}if(!e)return}}e(Pt,`collapseRedundantRectangularDoglegs`);function Ft(t,n){let{realNodeRects:r,labelNodeRects:i}=xe(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>W(e===t?n??[]:e.points??[]),`pointsFor`),s=e((e,t)=>{let n=0;for(let r=0;r<a.length;r++){let i=Z(o(a[r],e,t));for(let s=r+1;s<a.length;s++){let r=Z(o(a[s],e,t));for(let e of i)for(let t of r)De(e.a,e.b,t.a,t.b,Y)&&n++}}return n},`strictCrossingCount`),c=e(e=>{let t=Z(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?B(t.a.x,t.b.x,r.left,r.right)>=X&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:B(t.a.y,t.b.y,r.top,r.bottom)>=X&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=e((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=Me(W(r));return Z(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=e((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Z(t);if(l.length!==t.length-1)return!1;for(let e of l)if(q(e.a,e.b,r,c,-2)||q(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Z(o(t)))if(V(e,n,.5)>=X)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(o&&d(n,o,e)){n.points=o,t=!0;break}}if(t)break}if(!t)return}}e(Ft,`liftObstacleHuggingSameSideRails`);function It(t,n,r){let i=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),a=c([...n.values()]),o=e(e=>{if(!a.isLane(e.id))return;let t=jt(e.direction??r);if(t===`LR`||t===`RL`||t===`BT`)return;let n=i(e),o=e.y,s=e.height;if(!n||typeof o!=`number`||typeof s!=`number`||!Number.isFinite(o)||!Number.isFinite(s)||s<=0)return;let c=n.right-n.left,l=n.bottom-n.top;if(!(l<=0||c<l))return{node:e,rect:n}},`topLaneTitleFor`),s=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<t.top-Y||n>t.bottom+Y?!1:B(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),l=[...n.values()].map(o).filter(e=>!!e);if(l.length===0)return;let u=0;for(let e of t){if(e.isLayoutOnly)continue;let t=W(e.points??[]);for(let e of Z(t))for(let t of l)s(e,t.rect)&&(u=Math.max(u,t.rect.bottom-e.a.y+4))}if(!(u<=Y))for(let e of l){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-u/2,e.node.height=n+u,e.node.groupTitleRect={...e.rect,top:e.rect.top-u,bottom:e.rect.bottom-u})}}e(It,`liftTopLaneTitleBandsAboveRails`);function Lt(t,n,r){let i=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),a=c([...n.values()]),o=e(e=>{if(!a.isLane(e.id)||jt(e.direction??r)!==`LR`)return;let t=i(e),n=e.x,o=e.width;if(!t||typeof n!=`number`||typeof o!=`number`||!Number.isFinite(n)||!Number.isFinite(o)||o<=0)return;let s=t.right-t.left,c=t.bottom-t.top;if(!(s<=0||c<s))return{node:e,rect:t}},`leftLaneTitleFor`),s=e((e,t)=>{if(!e.vertical)return!1;let n=e.a.x;return n<t.left-Y||n>t.right+Y?!1:B(e.a.y,e.b.y,t.top,t.bottom)>=X},`verticalSegmentIntersectsTitle`),l=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<t.top-Y||n>t.bottom+Y?!1:B(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),u=[...n.values()].map(o).filter(e=>!!e);if(u.length===0)return;let d=0;for(let e of t){if(e.isLayoutOnly)continue;let t=W(e.points??[]);for(let e of Z(t))for(let t of u)if(s(e,t.rect))d=Math.max(d,t.rect.right-e.a.x+4);else if(l(e,t.rect)){let n=Math.min(e.a.x,e.b.x);d=Math.max(d,t.rect.right-n+4)}}if(!(d<=Y))for(let e of u){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-d/2,e.node.width=n+d,e.node.groupTitleRect={...e.rect,left:e.rect.left-d,right:e.rect.right-d})}}e(Lt,`shiftLeftLaneTitleBandsLeftOfRails`);function Rt(t,n){let{realNodeRects:r}=xe(n.values()),i=t.filter(e=>!e.isLayoutOnly),a=e((e,t=new Map)=>W(t.get(e)??e.points??[]),`replacementPointsFor`),o=e((e=new Map)=>{let t=0;for(let n=0;n<i.length;n++){let r=Z(a(i[n],e));for(let o=n+1;o<i.length;o++){let n=Z(a(i[o],e));for(let e of r)for(let r of n)De(e.a,e.b,r.a,r.b,Y)&&t++}}return t},`crossingCount`),s=e((e=new Map)=>i.reduce((t,n)=>t+U(a(n,e)),0),`totalBends`),c=e(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(R(n,r,Y)||z(n,r,Y))return{tailStart:n,terminal:r}},`terminalTailFor`),l=e((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(R(r,i,Y))o={x:i.x,y:t.tailStart.y};else if(z(r,i,Y))o={x:t.tailStart.x,y:i.y};else return;let s=Me(W([r,i,o,t.tailStart,t.terminal]));return Z(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(q(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=e((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Z(t))for(let t of Z(a(r,n)))if(V(e,t,.5)>=X)return!0}return!1},`pathHasSharedTrack`),f=e((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=e(()=>{let e=new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a<t.length;a++)for(let u=a+1;u<t.length;u++){let d=t[a],p=t[u],m=c(d),h=c(p);if(!m||!h)continue;let g=l(d,h),_=l(p,m);if(!g||!_)continue;let v=new Map([[d,g],[p,_]]);if(!f(d,g,v)||!f(p,_,v))continue;let y=o(v),b=s(v);y>=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}e(Rt,`swapDestinationTerminalTailsToReduceCrossings`);function zt(t,n){let{realNodeRects:r,labelNodeRects:i}=xe(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t=new Map)=>W(t.get(e)??e.points??[]),`replacementPointsFor`),s=e((e=new Map)=>{let t=0;for(let n=0;n<a.length;n++){let r=Z(o(a[n],e));for(let i=n+1;i<a.length;i++){let n=Z(o(a[i],e));for(let e of r)for(let r of n)De(e.a,e.b,r.a,r.b,Y)&&t++}}return t},`strictCrossingCount`),c=e((e=new Map)=>a.reduce((t,n)=>t+U(o(n,e)),0),`totalBends`),l=e(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?K(i):void 0,s=a?K(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=e((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=i<a-Y?`left`:i>o+Y?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=i<a-Y?`top`:i>o+Y?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=e(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Z(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=e((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&B(e.min,e.max,t.min,t.max)>=X,`railsInteract`),p=e(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=e(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord)<Y)||t.push(n.coord);for(;t.length<e.length;){let n=Math.min(...t),r=Math.max(...t),i=e[0].side;t.push(i===`left`||i===`top`?n-12*(e.length-t.length):r+12*(e.length-t.length))}return t},`uniqueCoordsFor`),h=e(t=>{let n=t.map(e=>e.coord),r=m(t),i=[];if(t.length<=6){let a=Array(r.length).fill(!1),o=[],s=e(()=>{if(o.length===t.length){o.some((e,t)=>Math.abs(e-n[t])>=Y)&&i.push([...o]);return}for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let r=[...n];[r[e],r[t]]=[r[t],r[e]],i.push(r)}return i},`coordinateAssignmentsFor`),g=e((e,t)=>{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=Me(W(t));if(Z(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=e(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Z(n))if(q(t.a,t.b,r,e,-2)||q(t.a,t.b,i,[],-2))return!1}for(let t=0;t<a.length;t++){let n=a[t],r=e.has(n),i=Z(o(n,e));for(let n=t+1;n<a.length;n++){let t=a[n];if(!r&&!e.has(t))continue;let s=Z(o(t,e));for(let e of i)for(let t of s)if(V(e,t,.5)>=X)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}e(zt,`reassignCrossingExternalRailChannels`);function Bt(t,n){let{realNodeRects:r,labelNodeRects:i}=xe(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>W(e===t?n??[]:e.points??[]),`pointsFor`),s=e(e=>Z(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=e((e,t)=>{let n=0;for(let r=0;r<a.length;r++){let i=Z(o(a[r],e,t));for(let s=r+1;s<a.length;s++){let r=Z(o(a[s],e,t));for(let e of i)for(let t of r)De(e.a,e.b,t.a,t.b,Y)&&n++}}return n},`strictCrossingCount`),l=e((e,t)=>{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&B(e.a.x,e.b.x,t.left,t.right)>=X}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&B(e.a.y,e.b.y,t.top,t.bottom)>=X}return!1},`segmentRunsAlongRectBorder`),u=e(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?K(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=e((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=R(n,r,Y)&&z(r,i,Y)&&R(i,a,Y),s=z(n,r,Y)&&R(r,i,Y)&&z(i,a,Y);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=I(n,a,Y)||L(n,a,Y)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=new Set;return l.map(e=>Me(W(e))).filter(e=>{if(Z(e).length!==e.length-1||!e.some(e=>se(e,a,Y)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!u.has(t)&&(u.add(t),!0)})},`shortcutCandidatesAt`),f=e((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Z(t))if(q(e.a,e.b,r,s,-2)||q(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Z(t))for(let t of Z(o(n)))if(V(e,t,.5)>=X)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=U(a,Y),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=U(h,Y),o=s(h);if(!(a<p||a===p&&o<m-Y)||!f(u,h,e))continue;let d=c(u,h);d>r||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}e(Bt,`shortcutRedundantOrthogonalJogs`);function Vt(t,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=K(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=t.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=e(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=e((e,t=new Map)=>W(t.get(e)??e.points??[]),`replacementPointsFor`),f=e((e,t)=>{let n=0;for(let r of e)for(let e of t)De(r.a,r.b,e.a,e.b,Y)&&n++;return n},`crossingCountBetweenSegments`),p=e((e,t)=>f(Z(e),Z(t)),`crossingCountBetweenPaths`),m=e((t=new Map)=>{let n=0,r=[],i=new Set,a=[],o=e(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let e=0;e<c.length;e++){let i=c[e],a=d(i,t);for(let s=e+1;s<c.length;s++){let e=c[s],l=p(a,d(e,t));l>0&&(n+=l,r.push({first:i,second:e,count:l}),o(i),o(e))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=e((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e<c.length;e++){let r=c[e],a=n.has(r),o=d(r,t);for(let r=e+1;r<c.length;r++){let e=c[r];(a||n.has(e))&&(i+=p(o,d(e,t)))}}return e.count-r+i},`crossingCountWithReplacements`),g=e(e=>{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=e(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=e(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=e((e,t,n)=>h(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=e(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),x=e(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),S=e((e=new Map)=>c.reduce((t,n)=>t+U(d(n,e)),0),`totalBends`),C=e((e=new Map)=>c.reduce((t,n)=>t+x(d(n,e)),0),`totalLength`),w=e((e,t)=>ue(e,t,Dt.ROUTE_TOUCH_TOLERANCE),`touchesAtBend`),T=e((e,t,n=new Map)=>{let r=Z(t);for(let i of c)if(i!==e){for(let e of r)for(let t of Z(d(i,n)))if(V(e,t,.5)>=X)return!0;if(w(t,d(i,n)))return!0}return!1},`pathHasSegmentConflict`),E=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(q(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),D=e((e,t)=>{let n=Me(W(t));Z(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),O=e(e=>e===`left`||e===`right`,`sideIsHorizontal`),k=e((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),ee=e((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[k(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)D(e,ye(t,n,r,o+i*20*a))},`addSameSideCandidates`),A=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))D(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),j=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))D(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),M=e((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)D(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),N=e((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)D(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),P=e(e=>{let t=new Set;return e.map(e=>W(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),te=e((e,t,n,r)=>{let i=[],a=ve(e,t,n,r,20,Y);a&&D(i,a),t===r&&ee(i,e,t,n);let o=O(t),s=O(r);return o&&!s?A(i,e,t,n,r):!o&&s?j(i,e,t,n,r):o?M(i,e,t,n,r):N(i,e,t,n,r),P(i)},`buildCandidatesForSides`),ne=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=_e(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){O(s)&&D(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)D(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),re=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=_e(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){O(s)||D(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)D(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),ie=e(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=W(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return z(o,s,Y)?ne(c,o,s,r):R(o,s,Y)&&re(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),F=e(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=_e(r,e);for(let n of o)s.push(...te(t,e,_e(a,n),n))}return s.push(...ie(e)),s},`candidatePathsFor`),ae=e(()=>new Map(c.map(e=>[e,Z(d(e))])),`currentSegmentsByEdge`),oe=e((e,t,n,r)=>{let i=new Set;for(let a of c){if(a===e)continue;let o=r.get(a)??Z(d(a));(n.some(e=>o.some(t=>V(e,t,.5)>=X))||w(t,d(a)))&&i.add(a)}return i},`sharedTrackConflictsFor`),se=e((e,t,n,r)=>{let i=new Set;return F(e).map(e=>Me(W(e))).filter(t=>{if(E(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Z(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Z(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:U(i,Y),totalBends:U(i),length:x(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:oe(e,t.candidate,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),I=e((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Z(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),L=e((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),B=e((e,t)=>e.segments.some(e=>t.segments.some(t=>V(e,t,.5)>=X))||w(e.path,t.path),`candidatesShareTrack`),H=e((e,t,n,r)=>L(t,n.edge)&&L(r,e.edge)&&!B(t,r),`pairCandidatesAreCompatible`),ce=e((e,t,n,r,i)=>{let a=I(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),le=e((e,t)=>e.crossings<t.crossings||e.crossings===t.crossings&&(e.bends<t.bends||e.bends===t.bends&&e.length<t.length),`pairScoreIsBetter`),de=e((e,t,n,r)=>{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!H(t,r,n,a))continue;let o=ce(e,t,r,n,a);o&&le(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),fe=e(e=>{let t=S(),n=C(),r=ae(),i=b(e),a=new Map(c.map(e=>[e,U(d(e))])),o=new Map(c.map(e=>[e,x(d(e))])),s=new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=se(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e<r.length;e++){let t=r[e];for(let i=e+1;i<r.length;i++){let e=r[i];(n.has(t.edge)||n.has(e.edge))&&(u=de(f,t,e,u))}}}return u.replacements.size>0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=U(d(o),Y);for(let c of F(o)){let l=E(o,c),u=!l&&T(o,c),d=y(e,o,c),f=U(c,Y);l||u||(d<t||d===t&&f<s)&&(d>i||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=fe(e);if(!o)return;for(let[e,t]of o)e.points=t}}e(Vt,`resolveRenderedOrthogonalCrossings`);var Ht=.001,Ut=8;function Wt(t,n){let{nodeInfoById:r,realNodeRects:i}=be(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=e((e,t,n,r)=>{let i=[],a=ve(e,t,n,r,20,Ht);return a&&i.push(a),t===r&&i.push(ye(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=e((e,t)=>{for(let n=0;n<e.length-1;n++){let r=e[n],a=e[n+1];if(q(r,a,i,t,1))return!0}return!1},`pathHitsNode`),l=e((e,n,r=!1)=>{let i=0,a=H(e,Ht),o=n.start,s=n.end;for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,c=e.end;if(!r&&o&&s&&(t===o||t===s||c===o||c===s))continue;let l=e.points;if(!(!l||l.length<2))for(let e of a)for(let t of H(l,Ht)){if(we(e.a,e.b,t.a,t.b,Ht,Ht)){i++;continue}V(e,t,Ht)>=Ut&&i++}}return i},`pathConflictCount`),u=e((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r<s&&(o=`bottom`,s=r),i<s&&(o=`left`,s=i),a<s&&(o=`right`,s=a),o},`nearestSideOfRect`),d=new Map,f=e((e,t,n)=>{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points??[];if(t.length<1)continue;let n=e.id??``,i=e.start,a=e.end;if(i){let e=r.get(i);e&&f(i,u(t[0],e),n)}if(a){let e=r.get(a);e&&f(a,u(t[t.length-1],e),n)}}let p=e((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=U(t,Ht);if(n<4)continue;let i=e.start,o=e.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=e.id??``,_=l(t,e,!0),v=l(t,e),y,b=_,x=n;for(let t of a){if(p(i,t,g))continue;let n=_e(m,t);for(let r of a){if(p(o,r,g))continue;let a=_e(h,r);for(let u of s(n,t,a,r)){if(c(u,[i,o]))continue;let t=U(u,Ht);if(_>0){let n=l(u,e,!0);if(n>b||n===b&&t>=x)continue;b=n,x=t,y=u;continue}l(u,e)>v||t<x&&(x=t,y=u)}}}if(y){e.points=y;let t=d.get(i);t&&d.set(i,t.filter(e=>e.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}e(Wt,`simplifyDetouredEdges`);var Gt=.001,Kt=10,qt=7;function Jt(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)<Gt)){if(Math.abs(s)<=Gt){let e=i.x+Math.sign(o)*Kt;return{left:Math.min(i.x,e),right:Math.max(i.x,e),top:i.y-qt,bottom:i.y+qt}}if(Math.abs(o)<=Gt){let e=i.y+Math.sign(s)*Kt;return{left:i.x-qt,right:i.x+qt,top:Math.min(i.y,e),bottom:Math.max(i.y,e)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}e(Jt,`markerClearanceRectFor`);function Yt(e){return{left:Math.min(e.left,e.right),right:Math.max(e.left,e.right),top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom)}}e(Yt,`normalizeRect`);function Xt(e,t){let n=W(t);return[Jt(n,!0),Jt(n,!1)].some(t=>t&&me(e,Yt(t)))}e(Xt,`labelOverlapsOwnMarker`);function Zt(t,n){let r=[];for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!(!t||t.length<2))for(let n=0;n<t.length-1;n++)r.push({edgeId:e.id,p1:t[n],p2:t[n+1]})}let i=[],a=[],o=c([...n.values()]);for(let e of n.values()){let t=e.isGroup;if(o.isLane(e.id)){let t=K(e);t&&a.push({id:e.id,rect:t});continue}if(t||e.isEdgeLabel)continue;let n=K(e);n&&i.push({nodeId:e.id,rect:n})}let s=e((e,t)=>{let n=he(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&me(n,r))return!0;return!1},`labelOverlapsForeignNode`),l=e((e,t)=>{let n=he(t,3);for(let t of r)if(t.edgeId!==e&&fe(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),u=e((e,t,n)=>s(e,n)||l(t,n),`labelOverlapsAnything`),d=[],f=e(e=>{for(let{id:t,rect:n}of a)if(G(n,e))return t},`findContainingLane`),p=e((e,t)=>d.some(n=>n.labelId!==e&&me(t,n.rect)),`overlapsPlacedLabel`);for(let r of t){if(r.isLayoutOnly)continue;let t=r.labelNodeId;if(!t)continue;let i=n.get(t);if(!i)continue;let o=r.points;if(!o||o.length<2)continue;let c=i.width??0,m=i.height??0;if(c<=0||m<=0)continue;let h=[];for(let e=0;e<o.length-1;e++){let t=o[e],n=o[e+1],r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);r<Gt&&i<Gt||r>=Gt&&i>=Gt||h.push({idx:e,length:r+i,orientation:r>=Gt?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx<h.length-1):h,_=g.length>0?g:h,v=c>=m?`horizontal`:`vertical`,y=e(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?c:m)+2;return r===t.length>=(t.orientation===`horizontal`?c:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=e((e,t)=>{let n=o[e.idx],r=o[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=e((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=e((e,t)=>e.midX>=t.left-Gt&&e.midX<=t.right+Gt&&e.midY>=t.top-Gt&&e.midY<=t.bottom+Gt,`pointInsideRectInclusive`),E=e(e=>{let t=ge(e.midX,e.midY,c,m),n=f(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+c/2+1,o=r.rect.right-c/2-1,s=r.rect.top+m/2+1,l=r.rect.bottom-m/2-1;if(i>o||s>l)return;let u={midX:w(e.midX,i,o),midY:w(e.midY,s,l)},d=ge(u.midX,u.midY,c,m);return T(e,d)?{laneId:r.id,anchor:u,rect:d}:void 0},`placementForAnchor`),D=e((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=e((e,t)=>{let n=(e.orientation===`horizontal`?c/2:m/2)+12;if(e===b){let r=o[e.idx];if(D(e,t,r)+Gt<n)return!1}if(e===x){let r=o[e.idx+1];if(D(e,t,r)+Gt<n)return!1}return!0},`labelClearsTerminalEndpoints`),k=e(e=>{let n=y(e);for(let e of n)for(let n of S){let i=C(e,n);if(!O(e,i))continue;let a=E(i);if(a&&!Xt(a.rect,o)&&!p(t,a.rect)&&!u(t,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),ee=e((e,n,i=!1)=>{let a=y(e);for(let e of a){let a={midX:e.midX,midY:e.midY};if(n&&!O(e,a))continue;let c=E(a);if(c&&!Xt(c.rect,o)&&!p(t,c.rect)&&!s(t,c.rect)&&(i||!l(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),A=k(_)??(_.length<h.length?k(h):void 0)??ee(h,!0)??ee(h,!1)??ee(h,!1,!0);if(A){i.x=A.anchor.midX,i.y=A.anchor.midY,i.parentId=A.laneId;let e=ge(A.anchor.midX,A.anchor.midY,c,m),n=d.findIndex(e=>e.labelId===t);n>=0?d[n]={labelId:t,rect:e}:d.push({labelId:t,rect:e})}}}e(Zt,`anchorLabelsToPolyline`);var Qt=1e-6,$t=4,en=3;function tn(e,t,n,{cx:r,cy:i},a,o){let s={x:r,y:i},c=o===`x`?`y`:`x`,l=Math.sign(a[c]-s[c]);for(let r of e)if(r!==t&&!r.isLayoutOnly&&r.points?.length&&[...r.end===n?[r.points.at(-1)]:[],...r.start===n?[r.points[0]]:[]].some(e=>Math.sign(e[c]-s[c])===l&&Math.abs(e[o]-a[o])<Dt.MIN_ARROWHEAD_SPACING))return!0;return!1}e(tn,`crowdsFaceNeighbour`);function nn(e,t){return e<t?`${e}::${t}`:`${t}::${e}`}e(nn,`pairKey`);function rn(t,n){let{nodeInfoById:r,realNodeRects:i}=be(n),a=new Map;for(let e of n){let t=e.id;if(!e.isGroup&&e.isEdgeLabel){a.set(t,{w:e.width??0,h:e.height??0});continue}}let o=e((n,r,i,o)=>{let s=nn(r,i),c=0,l=e(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,r=e.end;t&&r&&nn(t,r)===s&&l(e.labelNodeId)}return c>0?c+en:0},`labelClearanceFor`);for(let e of t){if(e.isLayoutOnly)continue;let n=e.points;if(!de(n,Qt))continue;let a=Ce(e,r,Qt);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(q(p,m,i,[s,c],1))continue;let h=d?`x`:`y`,g=o(e,s,c,h),_=g>$t?g:$t,v=[0,_,-_],y;for(let n of v){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(q(r,a,i,[s,c],1)||Ee(r,a,t,e,{epsilon:Qt}))continue;let o=[r,a];if(tn(t,e,s,l,r,h)||tn(t,e,c,u,a,h)){y??=o;continue}e.points=o,y=void 0;break}y&&(e.points=y)}}e(rn,`straightenCollinearSiblingDetours`);function an(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=xe(n.values()),o=e((e,t)=>H(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=e(()=>{let e=[];for(let n of t){if(n.isLayoutOnly)continue;let t=n.points;!t||t.length<2||e.push(...o(n,W(t)))}return e},`allSegments`),c=e((e,t)=>e.horizontal&&t.horizontal?B(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?B(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=e((e,n)=>{let s=e.start,l=e.end,u=o(e,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=e.labelNodeId?[e.labelNodeId]:[];for(let e of u)if(q(e.a,e.b,i,d,-2)||q(e.a,e.b,a,f,-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of u)for(let i of o(n,W(t)))if(c(e,i)||De(e.a,e.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=e((e,t)=>{let n=W(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=e((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=e(e=>{let t=e.edge,r=W(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?K(i):void 0,s=a?K(a):void 0,c=r.slice(e.index+2);if(i&&a&&o&&s&&c.length!==0)return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=e((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return W([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=e((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return W([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=e((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;n<e.length&&!t;n++)for(let r=n+1;r<e.length&&!t;r++){let i=e[n],a=e[r];if(i.edge===a.edge||!c(i,a))continue;let o=[i,a].filter(e=>e.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}e(an,`nudgeSharedInteriorSubpaths`);var Q=.001,on=2,sn=e(e=>e===`top`||e===`bottom`?`x`:`y`,`runsAlongFace`);function cn(e,t,n){let r=sn(n),[i,a]=r===`x`?[t.left,t.right]:[t.top,t.bottom];return{top:t.top-e.y,bottom:e.y-t.bottom,left:t.left-e.x,right:e.x-t.right}[n]>-Q&&e[r]>=i-Q&&e[r]<=a+Q}e(cn,`endpointThroughFace`);function ln(e,t,n){let r=e.node.id;return n.every(n=>{if(n===t||n.isLayoutOnly)return!0;let i=n.points??[];return[[n.start,i.at(0)],[n.end,i.at(-1)]].every(([t,n])=>t!==r||!n||!cn(n,e.rect,e.side))})}e(ln,`faceIsOwn`);function un(e,t){let n=H(t,Q);return H(e,Q).reduce((e,t)=>e+n.filter(e=>De(t.a,t.b,e.a,e.b,Q)).length,0)}e(un,`strictCrossings`);function dn(e,t){let n=H(t,Q);return H(e,Q).some(e=>n.some(t=>Te(e.a,e.b,t.a,t.b,Q)))}e(dn,`overlapsAny`);function fn(e,t,n,r){let i=Dt.ROUTE_TOUCH_TOLERANCE;return r.every(r=>{let a=W(r.points??[],Q);return r===e||r.isLayoutOnly||a.length<2?!0:!dn(n,a)&&un(n,a)<=un(t,a)&&(!ue(n,a,i)||ue(t,a,i))})}e(fn,`clearOfOtherEdges`);function pn(e,t,n){let r=e.labelNodeId,i=[e.start,e.end].filter(e=>!!e),a=H(t,Q);return a.every(e=>{let t=e.index===0||e.index===a.length-1?i:[];return!q(e.a,e.b,n.realNodeRects,t,on)&&!q(e.a,e.b,n.labelNodeRects,r?[r]:[],on)})}e(pn,`clearOfNodes`);var mn=1;function hn(e){let t=e&&!e.isGroup?K(e):void 0;return e&&t?{node:e,rect:t,cx:e.x??0,cy:e.y??0}:void 0}e(hn,`placed`);function gn(e,t){let n=t.rect.top>e.rect.bottom;if(!n&&t.rect.bottom>=e.rect.top)return;let[r,i]=n?[`bottom`,`top`]:[`top`,`bottom`];return{from:{node:e.node,rect:e.rect,side:r},to:{node:t.node,rect:t.rect,side:i},points:[{x:e.cx,y:n?e.rect.bottom:e.rect.top},{x:e.cx,y:n?t.rect.top:t.rect.bottom}]}}e(gn,`verticalLine`);function _n(e,t){let n=t.rect.left>e.rect.right;if(!n&&t.rect.right>=e.rect.left)return;let[r,i]=n?[`right`,`left`]:[`left`,`right`];return{from:{node:e.node,rect:e.rect,side:r},to:{node:t.node,rect:t.rect,side:i},points:[{x:n?e.rect.right:e.rect.left,y:e.cy},{x:n?t.rect.left:t.rect.right,y:e.cy}]}}e(_n,`horizontalLine`);function vn(e,t){let n=hn(t.get(e.start??``)),r=hn(t.get(e.end??``));if(n&&r&&n.node!==r.node)return n.node.parentId===r.node.parentId?void 0:[n,r]}e(vn,`crossGroupPair`);function yn(e,t){let n=vn(e,t);if(!n)return;let[r,i]=n;return Math.abs(r.cx-i.cx)<=mn?gn(r,i):Math.abs(r.cy-i.cy)<=mn?_n(r,i):void 0}e(yn,`straightLineFor`);var bn=e((e,t)=>e.length===t.length&&e.every((e,n)=>Math.abs(e.x-t[n].x)<Q&&Math.abs(e.y-t[n].y)<Q),`isAlready`);function xn(e,t,n,r,i){return ln(t.from,e,r)&&ln(t.to,e,r)&&pn(e,t.points,i)&&fn(e,n,t.points,r)}e(xn,`lineIsClear`);function Sn(e,t,n,r){let i=yn(e,n),a=W(e.points??[],Q);return!i||a.length<2||bn(a,i.points)||!xn(e,i,a,t,r)?!1:(e.points=i.points,!0)}e(Sn,`straighten`);function Cn(e,t){let n=xe(t.values()),r=!1;for(let i of e)!i.isLayoutOnly&&Sn(i,e,t,n)&&(r=!0);return r}e(Cn,`straightenAlignedCrossLaneEdges`);var wn=new Set([`question`,`diamond`,`diam`,`decision`]),Tn=e(e=>wn.has(e.shape??``),`isDiamond`),En=e((e,t)=>Math.abs(e-t)<Q,`near`),Dn=e((e,t,n)=>e>=t-Q&&e<=n+Q,`within`);function On(e,t,n){if(I(e,t,Q)&&Dn(e.x,n.left,n.right))return En(e.y,n.bottom)&&t.y>e.y?`bottom`:En(e.y,n.top)&&t.y<e.y?`top`:void 0}e(On,`verticalLegFace`);function kn(e,t,n){if(L(e,t,Q)&&Dn(e.y,n.top,n.bottom))return En(e.x,n.right)&&t.x>e.x?`right`:En(e.x,n.left)&&t.x<e.x?`left`:void 0}e(kn,`horizontalLegFace`);var An=e((e,t,n)=>On(e,t,n)??kn(e,t,n),`faceOfLeg`);function jn(e,t,n,r){let i=An(r[0],r[1],n);if(!i)return;let a=sn(i);return En(r[1][a],r[2][a])?void 0:{edge:e,node:t,rect:n,side:i,route:r}}e(jn,`terminalFrom`);var Mn=e((e,t)=>(t?e.start:e.end)??``,`endpointId`);function Nn(e,t,n){let r=W(e.points??[],Q),i=n.get(Mn(e,t)),a=i?K(i):void 0;if(!(!i||!a||r.length<3))return jn(e,i,a,t?r:r.reverse())}e(Nn,`terminalAt`);function Pn({node:e,rect:t,side:n,route:r}){let i=sn(n),a=(i===`x`?e.x:e.y)??0,o=r[0][i];if(Math.abs(o-a)<Q)return;if(Tn(e))return a;let[s,c]=i===`x`?[t.left,t.right]:[t.top,t.bottom];return Math.min(o-s,c-o)<=Pe+Q?a:void 0}e(Pn,`alignedCoord`);function Fn(e,t,n,r){let i=Pn(e);if(i===void 0||!ln(e,e.edge,t))return!1;let a=sn(e.side),[o,s,...c]=e.route,l=Me(W([{...o,[a]:i},{...s,[a]:i},...c],Q)),u=r?e.route:[...e.route].reverse(),d=r?l:[...l].reverse();return!pn(e.edge,d,n)||!fn(e.edge,u,d,t)?!1:(e.edge.points=d,!0)}e(Fn,`alignTerminal`);function In(e,t){let n=xe(t.values()),r=!1;for(let i of e)if(!i.isLayoutOnly)for(let a of[!0,!1]){let o=Nn(i,a,t);o&&Fn(o,e,n,a)&&(r=!0)}return r}e(In,`alignTerminalLegsToPorts`);function Ln(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<.99&&f>p&&f<.99}e(Ln,`segmentsIntersect`);function Rn(e){let n=e.nodes??[],r=e.edges??[],i=[];if(!r.length||!n.length)return i;let a=Se(n),o=[];for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,s=e.labelNodeId,c=e.id??`${n}->${r}`;for(let e of a)if(e.nodeId!==n&&e.nodeId!==r&&!(s&&e.nodeId===s)){for(let n=0;n<t.length-1;n++)if(fe(t[n],t[n+1],e,-1)){i.push({type:`edge-node-overlap`,edgeId:c,targetId:e.nodeId,detail:`segment ${n} passes through node "${e.nodeId}"`});break}}for(let e=0;e<t.length-1;e++)o.push({edgeId:c,start:n,end:r,p1:t[e],p2:t[e+1]})}let s=new Set;for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++){let n=o[e],r=o[t];if(n.edgeId!==r.edgeId&&n.start!==r.start&&n.start!==r.end&&n.end!==r.start&&n.end!==r.end&&Ln(n.p1,n.p2,r.p1,r.p2)){let e=n.edgeId<r.edgeId?`${n.edgeId}|${r.edgeId}`:`${r.edgeId}|${n.edgeId}`;s.has(e)||(s.add(e),i.push({type:`edge-edge-crossing`,edgeId:n.edgeId,targetId:r.edgeId,detail:`edges "${n.edgeId}" and "${r.edgeId}" cross`}))}}if(i.length>0){let e=i.filter(e=>e.type===`edge-node-overlap`).length,n=i.filter(e=>e.type===`edge-edge-crossing`).length;t.warn(`[SWIMLANE_VALIDATE] ${i.length} issue(s) detected: ${e} edge-node overlap(s), ${n} edge crossing(s)`);for(let e of i)t.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return i}e(Rn,`validateSwimlanesLayout`);function zn(e,t){let n=Cn(e,t);(In(e,t)||n)&&(Zt(e,t),rt(e,t))}e(zn,`alignTerminalLegsAndRefresh`);function Bn(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!yt(t,n)||n===`BT`&&a.length>0&&!ut(t))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=Me(je(t)))}Wt(i,r),rn(i,r),Ct(i,r);let o=new Map;for(let e of r)o.set(String(e.id),e);Zt(i,o),Re(i,o),wt(i,o),an(i,o),Nt(i,o),Pt(i,o),Ft(i,o),Rt(i,o);let s=e(()=>{Vt(i,o),Nt(i,o),zt(i,o),Bt(i,o),Zt(i,o),rt(i,o),Ft(i,o),Zt(i,o),rt(i,o)},`finalizeRenderedEdges`);s(),an(i,o),s(),zn(i,o),It(i,o,n),Lt(i,o,n),It(i,o,n),Lt(i,o,n)}e(Bn,`postProcessSwimlaneLayout`);function Vn(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}e(Vn,`normalizeGraph`);function Hn(e,t){return e.edges.filter(e=>e.dst===t)}e(Hn,`incoming`);function Un(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}e(Un,`buildSuccessorMap`);function Wn(e){let t=Un(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}e(Wn,`buildSortedSuccessorMap`);function Gn(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}e(Gn,`buildInDegreeMap`);function Kn(t,n){let r=[...n.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t)),i=new Set(t.edges.flatMap(e=>[e.src,e.dst])),a=e(e=>!i.has(e)&&!t.nodeById.get(e)?.isGroup,`isUnconnected`),o=[...n.keys()].filter(e=>n.get(e)===0&&a(e)),s=0;return r.map(e=>a(e)?o[s++]:e)}e(Kn,`sortedZeroInDegreeNodes`);function qn(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}e(qn,`buildPredecessorSuccessorMaps`);function Jn(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}e(Jn,`buildLayersFromRanks`);function Yn(e){let t=Gn(e),n=Kn(e,t),r=[],i=Wn(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e<n.length&&n[e]<r;)e++;n.splice(e,0,r)}}return r.length===e.nodes.length?r:null}e(Yn,`topoSortIfAcyclic`);function Xn(e){let t=new Map,n=0;for(let r of e)t.set(r,n),n++;return t}e(Xn,`buildLayerIndex`);function Zn(t){let n=Array(t.length),r=e((e,i)=>{if(i-e<=1)return 0;let a=e+i>>1,o=r(e,a)+r(a,i),s=e,c=a,l=e;for(;s<a||c<i;)c>=i||s<a&&t[s]<=t[c]?n[l++]=t[s++]:(n[l++]=t[c++],o+=a-s);for(let r=e;r<i;r++)t[r]=n[r];return o},`count`);return r(0,t.length)}e(Zn,`countInversions`);function Qn(t){let n=Vn(t),r=new Map;for(let e of n.nodes)r.set(e,[]);for(let e of n.edges)r.get(e.src).push(e);for(let e of r.values())e.sort((e,t)=>e.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=e(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=Gn(n),c=[...n.nodes.filter(e=>(s.get(e)??0)===0),...n.nodes.filter(e=>(s.get(e)??0)!==0)];for(let e of c)i[e]===0&&o(e);let l=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),u=n.edges.map(e=>l.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:u,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}e(Qn,`removeCycles_DFS`);function $n(e){let t=c(e.layout.nodes??[]),n=new Map;for(let r of e.nodes)n.set(r,t.laneIdOf(r));return n}e($n,`buildTopLaneMap`);function er(e){let t=$n(e);return e=>t.get(e)??null}e(er,`createTopLaneResolver`);function tr(e){let t=e.layout.nodes??[],n=c(t),r=t.filter(e=>n.isLane(e.id)),i=r.filter(e=>s(e)!==void 0);if(i.length>0&&i.length===r.length)return[...i].sort((e,t)=>(s(e)??0)-(s(t)??0)).map(e=>e.id);if(!n.hasPools)return[...new Set(r.map(e=>e.id))].reverse();let a=[];for(let e of t)e.parentId||(n.isPool(e.id)?a.push(...n.lanesByPool.get(e.id)??[]):n.isLane(e.id)&&a.push(e.id));return[...new Set(a)].reverse()}e(tr,`buildTopLaneOrder`);function nr(e,t){let n=tr(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)r.has(e)&&!i.has(e)&&(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}e(nr,`resolveTopLaneOrder`);function rr(t,n){let r=Vn(t),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=qn(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Yn(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=new Map;for(let[e,t]of s.entries())c.set(t,e);let l=new Map,u=new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=ir(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=ar(r),m=new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=or(m),g=sr(m),_=new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=new Set,x=e(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}e(rr,`buildDrivingTree`);function ir(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}e(ir,`chooseParent`);function ar(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}e(ar,`buildAdjacency`);function or(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}e(or,`assignComponents`);function sr(t){let n=new Map,r=new Map,i=[],a=[],o=0,s=e((e,c)=>{n.set(e,++o),r.set(e,o);for(let l of t.get(e)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(e)??0)&&(i.push([e,l]),r.set(e,Math.min(r.get(e)??o,n.get(l)??o))):(i.push([e,l]),s(l,e),r.set(e,Math.min(r.get(e)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(e)??0)&&a.push(cr(e,l,i,a.length))))},`visit`);for(let e of t.keys())n.has(e)||s(e,null);return a}e(sr,`computeBlocks`);function cr(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}e(cr,`popBlock`);function lr(t,n,r){let i=[...t.nodes],a=new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e<o;e++)f[0][e]=s[e];for(let e=1;e<d;e++)for(let t=0;t<o;t++){let n=f[e-1][t];f[e][t]=n===-1?-1:f[e-1][n]}let p=e((e,t)=>{if(e===-1||t===-1)return-1;c[e]<c[t]&&([e,t]=[t,e]);let n=c[e]-c[t];for(let t=0;t<d;t++)if(n>>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>new Map);for(let e of t.edges){let t=e.src,r=e.dst,i=n[t],o=n[r];if(i==null||o==null||(i>o&&([t,r]=[r,t],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(t),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e<o;e++)u.set(e,(u.get(e)??0)+1)}let h=new Map,g=e((e,t)=>{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=new Set,v=e(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}e(lr,`computeSubtreeCrossCounts`);function ur(t,n,r){let i=new Map,a=e(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort(dr(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let e of t)a(e);return i}e(ur,`annotateMinimumLayers`);function dr(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}e(dr,`compareByRankThenId`);function fr(t,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=new Set,c=e(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let e of t)c(e);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}e(fr,`emitNodesInTreeOrder`);function pr(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}e(pr,`deduplicateLayers`);function mr(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}e(mr,`createChildOrderer`);function hr(e,t,n){let r=rr(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=lr(e,t,r),s=[...a].sort(dr(t)),c=mr(i,t,o,ur(s,i,t)),l=fr(s,e.nodes,t,c);return l=pr(l),l}e(hr,`buildMultitreeLayerOrder`);function gr(e,t,n){let r=new Set(e),i=new Set(t),a=Xn(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return Zn(o)}e(gr,`countCrossingsBetweenAdjacent`);function _r(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t<c;t++)r.push({id:`${e.id}@${t}`,src:a,dst:o,ref:e.ref})}let i=0;for(let t=0;t+1<e.length;t++)i+=gr(e[t],e[t+1],r);return i}e(_r,`totalCrossings`);function vr(e,t){let n={...t},{preds:r}=qn(e),i=er(e),a=_r(hr(e,n,i),e.edges,n),o=kt.MAX_CROSSING_OPTIMIZATION_PASSES;for(let t=0;t<o;t++){let t=!1,o=[...e.nodes].sort((e,t)=>(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=_r(hr(e,n,i),e.edges,n);u<a?(a=u,t=!0):n[s]=l}if(!t)break}return n}e(vr,`optimizeRanksByCrossings`);function yr(e,t){let n=er(e),r=[...e.nodes].sort((e,n)=>(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}e(yr,`adjustCrossLaneSources`);function br(e,t){let n=Vn(e),r=Yn(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=er(n),o=Object.create(null);for(let e of r){let r=Hn(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=vr(n,o)),t?.ignoreCrossLaneEdges&&yr(n,o),{layers:hr(n,o,a),rankOf:o,dummy:new Set}}e(br,`assignLayers_LongestPath`);function xr(t,n){let r=Vn(t),i={...br(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=er(r),{preds:o,succs:s}=qn(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Yn(r)??[...r.nodes],l=[...c].reverse(),u=e((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=kt.GRAVITY_ITERATIONS,f=e(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=Math.round((a+c)/2),d=u(n,l);d!==i[n]&&(i[n]=d,t=!0)}return t},`relaxOrder`);for(let e=0;e<d;e++){let e=f(c),t=f(l);if(!e&&!t)break}for(let e of c){let t=0;for(let n of o.get(e)??[])t=Math.max(t,(i[n]??0)+1);(i[e]??0)<t&&(i[e]=t)}for(let e of l){let t=s.get(e)??[];if(t.length>0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:Jn(r,c,i),rankOf:i,dummy:new Set}}e(xr,`assignLayers_Gravity`);function Sr(e){let t=Gn(e),n=Wn(e),r=Kn(e,t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}e(Sr,`topoSortByGenerationIfAcyclic`);function Cr(t,n){let r=Vn(t),i=n?.direction===`LR`?Sr(r)??[...r.nodes].sort():Yn(r)??[...r.nodes].sort(),a=er(r),o=e(e=>a(e)??e,`laneOf`),s=Object.create(null),c=new Map,l=e((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=Hn(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:Jn(r,i,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}e(Cr,`assignLayers_LaneAwareCompact`);function wr(t,n){let r=Vn(n),{rankOf:i}=t,a=t.layers.map(e=>[...e]),o=new Set(t.dummy?[...t.dummy]:[]),s=0,c=new Map(r.nodeById),l=e(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i<n;i++,a++){let t=l(i);d.push({id:`${e.id}#${a}`,src:r,dst:t,weight:e.weight,ref:e.ref}),r=t}let a=n-t-2;d.push({id:`${e.id}#${Math.max(a+1,0)}`,src:r,dst:e.dst,weight:e.weight,ref:e.ref})}let f={nodes:[...r.nodes,...[...o].filter(e=>!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}e(wr,`makeProperLayering`);function Tr(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}e(Tr,`median`);function Er(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}e(Er,`barycenter`);function Dr(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}e(Dr,`neighborPositionsFor`);function Or(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}e(Or,`currentOrderTieBreak`);function kr(e,t,n){let r=new Set(e),i=new Set(t),a=Xn(e),o=Xn(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),Zn(s.map(e=>e.v))}e(kr,`countCrossingsBetweenAdjacent`);function Ar(e,t,n){return[...e].sort((e,r)=>{let i=Tr(t.get(e)??[]),a=Tr(t.get(r)??[]);return i===a?Or(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}e(Ar,`sortByHeuristic`);function jr(e,t,n,r,i,a){let o=Xn(e),s=Xn(t),c=Dr(t,o,n,r);if(!i||!a||a.length===0)return Ar(t,c,s);let l=new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=Ar(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=Ar(d,c,s);for(let t of e){let e=Er(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(e<Er(c.get(r)??[])){n=t;break}}u.splice(n,0,t)}}return u}e(jr,`reorderLayer`);function Mr(t,n,r,i,a){let o=[...n],s=new Set(t),c=new Set(n),l=i?new Set(i):null,u=r.filter(e=>s.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=e(e=>{let n=kr(t,e,u);return d&&i&&(n+=kr(e,i,d)),n},`crossingScore`),p=a?new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1<o.length;e++){if(p&&p.get(o[e])!==p.get(o[e+1]))continue;let t=h;[o[e],o[e+1]]=[o[e+1],o[e]];let n=f(o);n<t?(h=n,m=!0):[o[e],o[e+1]]=[o[e+1],o[e]]}}return o}e(Mr,`transposeImprove`);function Nr(e,t,n){let r=e.layers.map(e=>[...e]),i=t.edges,a=er(t),o=nr(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e<r.length;e++)r[e]=jr(r[e-1],r[e],i,`down`,a,o),r[e]=Mr(r[e-1],r[e],i,r[e+1],a);for(let e=r.length-2;e>=0;e--)r[e]=jr(r[e+1],r[e],i,`up`,a,o),r[e]=Mr(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}e(Nr,`orderLayers`);function Pr(t,n,r){let i=r?.layerGap??At.DEFAULT_LAYER_GAP,a=r?.nodeGap??At.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=Object.create(null),u=Object.create(null),d=new Map((n.layout?.nodes??[]).filter(e=>e.isEdgeLabel).map(e=>[e.id,e])),f=e(e=>d.get(e)??n.nodeById.get(e),`getNode`),p=e(e=>f(e)?.width??0,`getWidth`),m=e(e=>f(e)?.height??0,`getHeight`),h=er(n),g=new Map,_=e(e=>g.has(e)?g.get(e)??null:h(e),`topLaneOf`),v=nr(n,r?.laneOrder),y=new Set;for(let e of t.layers)for(let t of e)y.add(h(t));let b=y.has(null),x=v.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=t.layers,w=new Map;for(let[e,t]of C.entries())for(let n of t)w.set(n,e);let T=[],E=[],D=[];for(let t of n.layout?.edges??[]){let n=t.labelNodeId,r=t.start,i=t.end;if(!n||!d.has(n)||r==null||i==null)continue;let a=w.get(r),o=w.get(i);if(a==null||o==null){D.push({labelId:n,near:a==null?i:r});continue}if(g.set(n,h(i)),a===o){let t=e(e=>S.indexOf(h(e)),`column`);T.push({labelId:n,rank:o,lane:h(i),side:r!==i&&t(r)<t(i)?`before`:`after`});continue}let s=Math.min(a,o),c=Math.max(a,o);E.push({labelId:n,start:r,end:i,gap:s+Math.floor((c-s-1)/2),crossesLanes:h(r)!==h(i)})}let O=C.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0));for(let{labelId:e,rank:t}of T)O[t]=Math.max(O[t],m(e));let k=C.map(()=>0);if(c)for(let e=0;e+1<C.length;e++){let t=C[e].reduce((e,t)=>Math.max(e,p(t)),0),n=C[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=O[e],a=O[e+1],o=r/2+a/2,s=(t+n)/2;k[e]=Math.max(0,s-o-i)}let ee=c?dt(n.layout?.nodes??[]):1,A=C.map(()=>0);for(let{labelId:e,gap:t}of E){let n=((c?p(e):m(e))+2*At.EDGE_LABEL_CLEARANCE)/ee;A[t]=Math.max(A[t],n)}for(let[e,t]of A.entries())k[e]+=t;let j=Object.create(null);for(let e of x)j[e]=0;b&&(j.null=0);for(let e of C){let t=Object.create(null),n=[];for(let r of e){let e=_(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);j[e]=Math.max(j[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);j.null=Math.max(j.null??0,e)}}let M=new Map;for(let e of E){let t=`${e.gap}:${_(e.labelId)}`,n=M.get(t);n?n.push(e):M.set(t,[e])}for(let e of M.values()){let t=_(e[0].labelId);if(t!==null){let n=e.reduce((e,t,n)=>e+p(t.labelId)+(n>0?a:0),0);j[t]=Math.max(j[t]??0,n)}}let N=new Map;for(let{labelId:e,rank:t,lane:n,side:r}of T){let i=`${t}:${n}:${r}`;N.set(i,(N.get(i)??0)+a+p(e))}let P=e((e,t,n)=>N.get(`${e}:${t}:${n}`)??0,`rowLabelSpan`);for(let{rank:e,lane:t}of T){let n=C[e].filter(e=>_(e)===t).reduce((e,t,n)=>e+p(t)+(n>0?a:0),0),r=Math.max(P(e,t,`before`),P(e,t,`after`)),i=t??`null`;j[i]=Math.max(j[i]??0,n+2*r)}let te=new Map;{let e=S.map(e=>(e===null?j.null:j[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;n<S.length;n++){let r=S[n],i=e[n]??0,a=t+i/2;te.set(r,a),t+=i,n<S.length-1&&(t+=o)}}let ne=[],re=0;for(let[e,t]of C.entries()){let n=O[e]??0,r=new Map;for(let e of t){let t=_(e),n=r.get(t)??[];n.push(e),r.set(t,n)}for(let e of S){let t=r.get(e)??[];if(t.length===0)continue;let i=te.get(e);if(t.length===1){let e=t[0];l[e]=i,u[e]=re+n/2}else{let e=t.map(e=>p(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];l[o]=r+t/2,u[o]=re+n/2,r+=t+a}}}let o=i+(k[e]??0);ne[e]=re+n+o/2,re+=n+o}let ie=new Map;for(let{labelId:e,rank:t,lane:n,side:r}of T){let i=`${t}:${n}:${r}`;if(!ie.has(i)){let e=C[t].filter(e=>_(e)===n).map(e=>r===`before`?l[e]-p(e)/2:l[e]+p(e)/2);ie.set(i,r===`before`?Math.min(...e):Math.max(...e))}let o=p(e),s=ie.get(i)+(r===`before`?-1:1)*(a+o/2);l[e]=s,u[e]=u[C[t].find(e=>_(e)===n)],ie.set(i,s+o/2*(r===`before`?-1:1))}for(let t of M.values()){let n=t.map(({start:e,end:t,crossesLanes:n})=>n?l[t]:((l[e]??0)+(l[t]??0))/2),r=t.map((e,t)=>t).sort((e,t)=>n[e]-n[t]||e-t),i=[],o=-1/0;for(let e of r){let r=p(t[e].labelId);i[e]=Math.max(n[e],o+a+r/2),o=i[e]+r/2}let s=e(e=>e.reduce((e,t)=>e+t,0)/e.length,`mean`),c=s(n)-s(i);for(let[e,{labelId:n,gap:r}]of t.entries())l[n]=i[e]+c,u[n]=ne[r]}for(let{labelId:e,near:t}of D)l[e]=l[t]??0,u[e]=u[t]??0;let F=new Map;for(let e of n.edges){let t=e.ref.id;F.has(t)||F.set(t,[]),F.get(t).push(e)}for(let[,e]of F){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((l[r]??0)+(l[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&n.nodeById.get(e)?.isDummy&&(l[e]=a)}return{x:l,y:u}}e(Pr,`assignCoordinates`);var Fr=8;function Ir(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}e(Ir,`hashString`);function Lr(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}e(Lr,`mulberry32`);function Rr(e,t){let n=[...e],r=Lr(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}e(Rr,`deterministicShuffle`);function zr(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}e(zr,`sourceDistance`);function Br(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}e(Br,`laneArrangementCost`);function Vr(e){let t=tr(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=er(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}e(Vr,`buildWeightedLaneEdges`);function Hr(e,t,n){let r=[...e],i=Br(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&o<s;){a=!1,o++;for(let e=0;e+1<r.length;e++){[r[e],r[e+1]]=[r[e+1],r[e]];let n=Br(r,t);n<i?(i=n,a=!0):[r[e],r[e+1]]=[r[e+1],r[e]]}}return{order:r,cost:i,sourceDistance:zr(r,n)}}e(Hr,`greedySwitch`);function Ur(e,t){return e.cost===t.cost?e.sourceDistance<t.sourceDistance:e.cost<t.cost}e(Ur,`isBetterCandidate`);function Wr(e,t,n){let r=[...t].sort((e,t)=>e.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return Ir(`${e.join(`|`)}#${r}#${n}`)}e(Wr,`seedForRestart`);function Gr(e,t={}){let n=tr(e);if(n.length<2)return n;let r=Vr(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=Hr(n,r,i),o=Math.max(0,t.restarts??Fr);for(let e=0;e<o;e++){let t=Hr(Rr(n,Wr(n,r,e)),r,i);Ur(t,a)&&(a=t)}return a.order}e(Gr,`optimizeTopLaneOrder`);function Kr(e,t){let n=t?.ignoreCrossLaneEdges??!0,r=t?.optimizeRanksByCrossings??!0,i=Vn(e),a=t?.automaticLaneOrdering?Gr(i,{restarts:Fr}):void 0,o=Qn(i),s=o.acyclic,{layering:c,graphWithDummies:l}=wr(n?Cr(s,{compactSingleInput:t?.compactSingleInput??kt.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:t?.direction}):xr(s,{compactSingleInput:t?.compactSingleInput??kt.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:r}),s),u=Nr(c,l,{laneOrder:a}),d=Pr(u,l,{layerGap:t?.layerGap,nodeGap:t?.nodeGap,direction:t?.direction,laneOrder:a});return{acyclic:s,reversed:o.reversed,layering:c,ordered:u,coordinates:d}}e(Kr,`sugiyamaLayout`);var $=Ot.EPSILON,qr=8,Jr=15,Yr=15,Xr=25,Zr=20,Qr=10;function $r(e,t,n){let r=e.x??0,i=e.y??0,a=t.x-r,o=t.y-i,s=Math.abs(a),c=Math.abs(o);return s<$&&c<$?n:c>$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}e($r,`chooseOrthogonalSide`);var ei=e(e=>typeof e==`number`&&Number.isFinite(e)&&e>0,`isDrawableSize`);function ti(e,t){let n=e.metadata?.drawnExtent;return{w:ei(n?.width)?n.width:e.width??t,h:ei(n?.height)?n.height:e.height??t}}e(ti,`drawnSize`);function ni(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}e(ni,`sharedLineEndpointCoord`);function ri(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}e(ri,`pointOnLine`);function ii(t,n){let r=t.nodes??[],i=t.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=new Map,s=new Map,l=[],u=n===`LR`;for(let e of r)o.set(e.id,e);let d=c(r),f=r.filter(e=>d.isLane(e.id));for(let t of f){let n={id:t.id},i=e(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(t)}let p=m(r),h=r.filter(e=>!e.isGroup&&!e.isEdgeLabel&&!p.has(e.id)).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=qr;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:u?n/2+a:t/2+a}}),g=e((e,t,n,r)=>{let i=l.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},l.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),_=e((e,t)=>{let{w:n,h:r}=ti(e,10),i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),v=e((e,t,n)=>_(e,$r(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),y=[],b=[],x=new Set,S=1e3,C=e((e,t,n)=>{if(y.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of y)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coord<i||t.pipe.coord>o||t.from-$<=r&&t.to+$>=r&&(a+=S))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of y)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coord<i||t.pipe.coord>o||t.from-$<=r&&t.to+$>=r&&(a+=S))}return a},`crossingPenalty`),w=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),T=e((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!h.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minY<e.y&&c.maxY>e.y&&c.maxX>i&&c.minX<a:c.minX<e.x&&c.maxX>e.x&&c.maxY>o&&c.minY<s)},`isSegmentBlocked`),E=new Map,D=new Map;for(let e of a)e.start&&e.end&&e.start!==e.end&&(D.set(e.start,(D.get(e.start)??0)+1),D.set(e.end,(D.get(e.end)??0)+1));let O=e((e,t)=>$r(e,t,`bottom`),`determineSide`),k=new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);k.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:O(n,{x:r.x??0,y:r.y??0}),dstSide:O(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let ee=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),A=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign===0?[`right`,`left`]:[e.dxSign>0?`right`:`left`]:e.dySign===0?[`bottom`,`top`]:[e.dySign>0?`bottom`:`top`],`secondarySides`),j=e(e=>A(e)[0],`secondarySide`),M=new Map;for(let e of k.values()){let t=`${e.srcId}:${e.srcSide}`;M.has(t)||M.set(t,[]),M.get(t).push(e)}let N=new Map,P=e((e,t)=>`${e}:${t}`,`loadKey`);for(let e of k.values())N.set(P(e.srcId,e.srcSide),(N.get(P(e.srcId,e.srcSide))??0)+1),N.set(P(e.dstId,e.dstSide),(N.get(P(e.dstId,e.dstSide))??0)+1);for(let e of M.values())if(!(e.length<2)){e.sort((e,t)=>{let n=ee(e),r=ee(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t<e.length;t++){let n=e[t],r=N.get(P(n.srcId,n.srcSide))??0,i=A(n).reduce((e,t)=>(N.get(P(n.srcId,t))??0)<(N.get(P(n.srcId,e))??0)?t:e),a=N.get(P(n.srcId,i))??0;a>=r||(N.set(P(n.srcId,n.srcSide),r-1),N.set(P(n.srcId,i),a+1),n.srcSide=i)}}let te=e(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),ne=new Map;for(let e of k.values())ne.has(e.dstId)||ne.set(e.dstId,new Set),ne.get(e.dstId).add(e.dstSide);for(let e of k.values()){if(!te(o.get(e.srcId)))continue;let t=ne.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=j(e);if(t.has(n)||(N.get(P(e.srcId,n))??0)>0)continue;let r=N.get(P(e.srcId,e.srcSide))??0;N.set(P(e.srcId,e.srcSide),Math.max(0,r-1)),N.set(P(e.srcId,n),1),e.srcSide=n}let re=e(e=>{let t=e?.shape;return t===`hexagon`||t===`notch-pent`},`hasVertexFaces`),ie=new Map;for(let e of k.values())ie.has(e.srcId)||ie.set(e.srcId,new Set),ie.get(e.srcId).add(e.srcSide);let F=e(e=>e.dstSide===`top`||e.dstSide===`bottom`?e.dxSign>=0?`left`:`right`:e.dySign>=0?`top`:`bottom`,`secondaryDstSide`);for(let e of k.values()){if(!re(o.get(e.dstId)))continue;let t=ie.get(e.dstId);if(!t?.has(e.dstSide))continue;let n=F(e);if(t.has(n)||(N.get(P(e.dstId,n))??0)>0)continue;let r=N.get(P(e.dstId,e.dstSide))??0;N.set(P(e.dstId,e.dstSide),Math.max(0,r-1)),N.set(P(e.dstId,n),1),e.dstSide=n;let i=e.dySign>=0?`bottom`:`top`;if((n===`top`||n===`bottom`)&&ne.get(e.srcId)?.has(e.srcSide)&&!ne.get(e.srcId)?.has(i)&&(N.get(P(e.srcId,i))??0)===0){let t=N.get(P(e.srcId,e.srcSide))??0;N.set(P(e.srcId,e.srcSide),Math.max(0,t-1)),N.set(P(e.srcId,i),1),e.srcSide=i}}for(let e of k.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;E.has(l)||E.set(l,[]),E.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;E.has(d)||E.set(d,[]),E.get(d).push({edgeIdx:t,oppositeCoord:f})}let ae=new Map;for(let[e,t]of E){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`,l=ti(s,10),u=c?l.h:l.w,d=s.shape,f=d===`question`||d===`diamond`?u*.3:u,p=Math.min(20,f/(t.length-1),Math.max(8,f/(t.length+1))),m=-(p*(t.length-1))/2;for(let[e,n]of t.entries()){let t=m+e*p,r=`${n.edgeIdx}:${a}`;ae.set(r,t)}}let oe=e(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),se=e((e,t)=>e?(E.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>oe(e))||(E.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>oe(e)):!1,`faceHasLabelNode`),I=e((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),L=e((e,t,n)=>{let r=k.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??O(t,i),s=r?.dstSide??O(n,a),c=r?_(t,r.srcSide):v(t,i,!0),l=r?_(n,r.dstSide):v(n,a,!1),u=ae.get(`${e}:src`),d=ae.get(`${e}:dst`);return u!==void 0&&(c=I(c,o,u)),d!==void 0&&(l=I(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let t of w){let n=a[t];if(b[t]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:c,srcSide:d,dstSide:f}=L(t,r,i),p={...s},m={...c},_=d===`top`||d===`bottom`,v=f===`top`||f===`bottom`;_?p.y=s.y>(r.y??0)?s.y+Zr:s.y-Zr:p.x=s.x>(r.x??0)?s.x+Zr:s.x-Zr,v?m.y=c.y>(i.y??0)?c.y+Zr:c.y-Zr:m.x=c.x>(i.x??0)?c.x+Zr:c.x-Zr;let S=e((e,t)=>{for(let n of h)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.x<n.maxX&&e.y>n.minY&&e.y<n.maxY)return{inside:!0,obstacle:n};return{inside:!1}},`isPointInObstacle`),w=e((e,t,n,r,i)=>{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+Jr:r.minX-Jr,y:i?r.maxY+Yr:r.minY-Yr,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+Jr:r.minX-Jr,y:o?r.maxY+Yr:r.minY-Yr,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],ee=S(p,k);if(ee.inside&&ee.obstacle){let e=ee.obstacle;if(_){let t=w(s,r,i,e,!0);p.x=t.x,p.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+Zr):Math.max(e.maxY+2,s.y-Zr);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=w(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+Zr):Math.max(e.maxX+2,s.x-Zr);p.x=t.x,p.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let A=[],j=S(m,k);if(j.inside&&j.obstacle){let e=j.obstacle;if(v){let t=w(c,i,r,e,!0);m.x=t.x,m.y=t.y,A=[{x:t.x,y:t.y},{x:c.x,y:t.y}]}else{let t=w(c,i,r,e,!1);m.x=t.x,m.y=t.y,A=[{x:t.x,y:t.y},{x:t.x,y:c.y}]}}if(O.length===0&&A.length===0){let e=Jr,r=Math.abs(p.x-m.x)<e,i=Math.abs(p.y-m.y)<e,a=ae.get(`${t}:src`)!==void 0||ae.get(`${t}:dst`)!==void 0,o=(E.get(`${n.start??``}:${d}:src`)?.length??0)+(E.get(`${n.start??``}:${d}:dst`)?.length??0),l=(E.get(`${n.end??``}:${f}:src`)?.length??0)+(E.get(`${n.end??``}:${f}:dst`)?.length??0),u=o>1||l>1,h=D.get(n.start??``)??0,g=D.get(n.end??``)??0,_=o>1&&se(n.start,d)||l>1&&se(n.end,f);if((r||i)&&!a&&(!u||u&&!_&&(o<=1||h<=2)&&(l<=1||g<=2))&&!T(s,c,n.start,n.end)){n.points=[{...s},{...p},{...m},{...c}],x.add(t);let e=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,c.x):Math.min(s.y,c.y),o=i?Math.max(s.x,c.x):Math.max(s.y,c.y),l={id:`fast-path-${e}-${r.toFixed(0)}-${t}`,orientation:e,coord:r,spanMin:a,spanMax:o,tracks:[]};y.push({edgeIndex:t,segmentIndex:0,orientation:e,pipe:l,trackIndex:0,from:a,to:o});continue}}p.x=g(`vertical`,p.x,p.y,p.y).coord,m.x=g(`vertical`,m.x,m.y,m.y).coord;let M=Math.min(p.x,m.x)-50,N=Math.max(p.x,m.x)+50,P=Math.min(p.y,m.y)-50,te=Math.max(p.y,m.y)+50;for(let e of h){let t=Math.min(p.x,m.x),n=Math.max(p.x,m.x),r=Math.min(p.y,m.y),i=Math.max(p.y,m.y);e.minX<n&&e.maxX>t&&e.minY<i&&e.maxY>r&&(M=Math.min(M,e.minX-Xr),N=Math.max(N,e.maxX+Xr),P=Math.min(P,e.minY-Xr),te=Math.max(te,e.maxY+Xr))}for(let e of h){if(e.maxX<M||e.minX>N||e.maxY<P||e.minY>te)continue;let t=Jr;g(`horizontal`,e.minY-t,M,N),g(`horizontal`,e.maxY+t,M,N);let n=Yr;g(`vertical`,e.minX-n,P,te),g(`vertical`,e.maxX+n,P,te)}g(`horizontal`,p.y,M,N),g(`horizontal`,m.y,M,N);let ne=l.filter(e=>e.orientation===`horizontal`&&e.coord>=P&&e.coord<=te),re=l.filter(e=>e.orientation===`vertical`&&e.coord>=M&&e.coord<=N),ie=e((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),F=ie(p.x,p.y),oe=ie(m.x,m.y),I=new Map,R=new Map,z=new Map,B=new Set,V=[];I.set(F,0),z.set(F,`n`),V.push({key:F,f:Math.hypot(m.x-p.x,m.y-p.y),pt:p}),B.add(F);let H=[],U=e((e,t)=>T(e,t,n.start,n.end),`checkSegmentBlocked`),ce={x:m.x,y:p.y},le=U(p,ce),ue=U(ce,m),W=le||ue,de={x:p.x,y:m.y},fe=U(p,de),pe=U(de,m);if(W?fe||pe||(H=Math.abs(p.x-m.x)<$?[p,m]:[p,de,m]):H=Math.abs(p.y-m.y)<$||Math.abs(p.x-m.x)<$?[p,m]:[p,ce,m],H.length===0)for(;V.length>0;){V.sort((e,t)=>e.f-t.f);let e=V.shift();if(B.delete(e.key),e.key===oe){let e=oe,t=m;for(H=[t];R.has(e);){let n=R.get(e);H.unshift(n),t=n,e=ie(n.x,n.y)}break}let r=e.pt.x,i=e.pt.y,a=re.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=ne.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o<a.length-1&&l.push({x:a[o+1].coord,y:i}),c>0&&l.push({x:r,y:s[c-1].coord}),c>=0&&c<s.length-1&&l.push({x:r,y:s[c+1].coord});for(let a of l){let o=Math.min(r,a.x),s=Math.max(r,a.x),c=Math.min(i,a.y),l=Math.max(i,a.y);if(h.some(e=>e.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minX<r&&e.maxX>r&&e.maxY>c&&e.minY<l:e.minY<i&&e.maxY>i&&e.maxX>o&&e.minX<s))continue;let u=ie(a.x,a.y),d=Math.abs(a.x-r)+Math.abs(a.y-i),f=C(t,e.pt,a),g=0,_=m.x-p.x,v=m.y-p.y,y=a.x-r,b=a.y-i;(v>10&&b<-5||v<-10&&b>5)&&(g=Math.abs(b)*100),(_>10&&y<-5||_<-10&&y>5)&&(g+=Math.abs(y)*50);let x=0,S=z.get(e.key)??`n`,w=Math.abs(y)>$?`h`:`v`;S!==`n`&&S!==w&&(x=50);let T=d+f+g+x,E=(I.get(e.key)??1/0)+T,D=Math.abs(m.x-a.x)+Math.abs(m.y-a.y);if(E<(I.get(u)??1/0)){if(R.set(u,e.pt),I.set(u,E),z.set(u,w),!B.has(u))V.push({key:u,f:E+D,pt:a}),B.add(u);else{let e=V.findIndex(e=>e.key===u);e!==-1&&(V[e].f=E+D)}}}}if(H.length===0&&(H=[p,{x:p.x,y:m.y},m]),H.length>4){let t=H[0],n=H[H.length-1],r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);for(let e of H)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(t.x,n.x),c=r<Math.min(t.x,n.x);if(u){let e=Yr;if(s){let r=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y),s=h.filter(e=>e.minX<r&&e.maxX>r&&e.minY<o&&e.maxY>a);if(s.length>0){let r=Math.max(t.x,n.x);for(let t of s){let n=(t.minX+t.maxX)/2;if(t.visualXHalfExtent===void 0||isNaN(t.visualXHalfExtent))continue;let i=n+t.visualXHalfExtent+e;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=h.filter(r=>r.minX<Math.min(t.x,n.x)+e&&r.minY<Math.max(t.y,n.y)&&r.maxY>Math.min(t.y,n.y));if(i.length>0){let a=Math.min(t.x,n.x);for(let t of i){let n=(t.minX+t.maxX)/2-t.visualXHalfExtent-e;a=Math.min(a,n)}r=a}}}let l=e(e=>{let r=n.y>t.y,i=h.filter(e=>{let r=Math.min(t.x,n.x)<e.maxX&&Math.max(t.x,n.x)>e.minX,i=Math.min(t.y,n.y)<e.maxY&&Math.max(t.y,n.y)>e.minY;return r&&i}),a=i;if(u&&i.length>0){let t=i.filter(t=>t.minX<e&&t.maxX>e);t.length>0&&(a=t)}if(a.length===0)return n.y;let o=Jr;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(e<n.y-$)return e}else{let e=Math.min(...a.map(e=>e.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),d=e(e=>{let r=l(e),i={x:e,y:t.y},a={x:e,y:r},o={x:n.x,y:r},s=U(t,i),c=U(i,a),u=U(a,o),d=r!==n.y&&U(o,n);return!s&&!c&&!u&&!d?Math.abs(r-n.y)<$?[t,i,a,n]:[t,i,a,o,n]:null},`trySimplifyWithDetourX`),f=s&&!c?d(i):c&&!s?d(r):null;f&&(H=f)}let G=[s,...O,...H,...A.reverse(),c];if(G.length>=3){let e=G[G.length-1],t=G[G.length-2],n=G[G.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&G.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&G.splice(-2,1)}}let me=[G[0]];for(let e=1;e<G.length-1;e++){if(e===1){me.push(G[e]);continue}let t=me[me.length-1],n=G[e],r=G[e+1];if(Math.abs(t.y-n.y)<$&&Math.abs(n.y-r.y)<$){if(n.x>t.x!=r.x>n.x){me.push(n);continue}continue}if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){me.push(n);continue}continue}me.push(n)}me.push(G[G.length-1]);for(let e=0;e<me.length-1;e++){let n=me[e],r=me[e+1],i=Math.abs(n.x-r.x)<$?`vertical`:`horizontal`,a=i===`vertical`?n.x:n.y,o=i===`vertical`?Math.min(n.y,r.y):Math.min(n.x,r.x),s=i===`vertical`?Math.max(n.y,r.y):Math.max(n.x,r.x),c=g(i,a,o,s),l={edgeIndex:t,segmentIndex:e,orientation:i,pipe:c,trackIndex:0,from:o,to:s};y.push(l),b[t].push(y.length-1),c.tracks[0]||(c.tracks[0]={index:0,coord:c.coord,segments:[]}),c.tracks[0].segments.push({edgeIndex:t,segmentIndex:e,from:o,to:s})}}let R=e((e,t)=>e.from<t.to&&t.from<e.to,`segmentsOverlap`),z=e((e,t,n,r)=>{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&R(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&R(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),B=e(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),V=e((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),H=e((e,t)=>{let n=b[e.edgeIndex];for(let r of n){let n=y[r];n.pipe===e.pipe&&V(n,t)}},`moveSegmentChainToTrack`),U=e(e=>{let t=b[e.edgeIndex],n=t.indexOf(y.indexOf(e)),r=[];return n>0&&r.push(y[t[n-1]]),n<t.length-1&&r.push(y[t[n+1]]),r},`getAdjacentSegmentsAlongEdge`),ce=e((e,t)=>{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coord<n.to&&n.pipe.coord>r.from&&n.pipe.coord<r.to},`haveAnyCrossing`),le=e((e,t)=>{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&R(e,t)))return n.index;return-1},`findAvailableTrack`),ue=e((e,t)=>{if(e.trackIndex===t.trackIndex)return R(e,t);let n=U(e),r=U(t);return n.some(e=>r.some(t=>ce(e,t)))},`segmentsConflict`),W=e((e,t,n)=>{if(z(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=le(e.pipe,t);n(t,r===-1?B(e.pipe):r)},`resolveTrackConflict`),de=e(e=>{let t=0;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){let i=e[n],a=e[r];i.pipe===a.pipe&&ue(i,a)&&(t++,W(i,a,H))}return t},`resolveHandleConflicts`),fe=new Map,pe=e(e=>{if(fe.has(e))return fe.get(e);let t=b[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return fe.set(e,t),t}let n=y[t[0]].pipe.coord,r=n;for(let e=1;e<t.length;e++){let i=y[t[e]];if(i.orientation===`horizontal`){let e=i.from,t=i.to;r=Math.abs(e-n)>Math.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return fe.set(e,a),a},`getDestInfo`),G=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())b[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=e(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let e of n.values()){e.sort((e,t)=>{let n=pe(e),i=pe(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=b[e].length,c=b[t].length;if(s!==c)return s-c;if(s===1){let n=b[e][0],r=b[t][0];if(y[n]&&y[r]){let e=y[n],t=y[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=e.map(e=>y[b[e][0]]);t+=de(n)}return t},`fixSourceHandleCrossings`),me=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())b[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((t,n)=>{let r=e(e=>{let t=b[e];if(t.length<2)return 0;let n=y[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(t),a=r(n);return Math.abs(i-a)>.1?i-a:t-n});let n=r.map(e=>y[b[e][b[e].length-1]]);t+=de(n)}return t},`fixTargetHandleCrossings`),he=e(()=>{let e=0;for(let t of l){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=b[t.edgeIndex].find(e=>y[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(y[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let i=n[t],a=n[r];ue(i,a)&&(e++,W(i,a,V))}}return e},`fixPipeCrossings`),ge=0;for(;ge<10;){let e=0;if(e+=G(),e+=me(),e+=he(),e===0)break;ge++}let K=new Map;for(let t of l){let n=[];t.tracks.forEach(e=>{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;i<n.length;i++){let a=n[i];a.from<t?(e.push(a),t=Math.max(t,a.to)):(r.push(e),e=[a],t=a.to)}r.push(e)}for(let n of r){let r=new Set;n.forEach(e=>r.add(e.trackIndex));let i=new Map;n.forEach(e=>{let t=pe(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=e((e,r)=>{n.filter(t=>t.trackIndex===e).forEach(e=>{let n=x.has(e.edgeIndex)?t.coord:r;K.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},`assignCoord`),l=0;for(let e of a)l++,c(e,t.coord-l*Qr);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let e of s){if(u===0)c(e,t.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(e,t.coord+n*r*Qr*.5)}u++}let d=0;for(let e of o)d++,c(e,t.coord+d*Qr)}}for(let[e,t]of a.entries()){let n=b[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=L(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=y[e],n=K.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e<s.length;e++){let t=s[e],n=r[r.length-1],i=t.orient===`vertical`?n.y:n.x,a=t.orient===`vertical`?n.x:n.y,o=s[e+1],c=e<s.length-1;if(Math.abs(a-t.coord)>$&&r.push(ri(t,i)),c&&o.orient===t.orient){if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:ni(t,o);r.push(ri(t,e),ri(o,e))}else(e===0||e===s.length-2)&&r.push(ri(t,ni(t,o)))}else if(c)r.push(ri(t,o.coord));else{let e=Math.abs(t.from-i)<Math.abs(t.to-i)?t.to:t.from;r.push(ri(t,e))}}let c=r[r.length-1];(Math.abs(c.x-a.x)>$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=r[0];l&&(Math.abs(l.x-i.x)>$||Math.abs(l.y-i.y)>$)&&r.unshift(i);let u=[];r.length>0&&u.push(r[0]);for(let e=1;e<r.length;e++){let t=r[e],n=u[u.length-1];(Math.abs(t.x-n.x)>$||Math.abs(t.y-n.y)>$)&&u.push(t)}t.points=u}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}t.edges=(t.edges??[]).filter(e=>!e.isLayoutOnly);let _e=e((e,t)=>{let n=t.x??0,r=t.y??0,{w:i,h:a}=ti(t,0);if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.x<o||e.x>s||e.y<c||e.y>l)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let e of t.edges){let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(t[0]=_e(t[0],i)),a&&(t[t.length-1]=_e(t[t.length-1],a))}return t}e(ii,`routeEdgesOrthogonal`);function ai(e){return e.direction??`TB`}e(ai,`getSwimlaneDirection`);function oi(e){let t=P(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=ai(e),{ordered:c,coordinates:l}=Kr(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});ne(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;ii(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return Bn(e,s),Rn(e),s}e(oi,`runSwimlaneLayoutCore`);function si(e){N(e);let t=ie(e);e.nodes=t.nodes,e.edges=t.edges}e(si,`prepareSwimlaneLayout`);var ci=n({prepareLayout:si,runLayoutCore:oi,afterPaint:a});export{ci as render};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./d3-selection-BFzs9NTX.js";import"./chunk-QDWOWVBQ-Du0KmhW4.js";import"./chunk-MDAHDJXZ-YMIkXJ0O.js";import"./chunk-T47YP6PS-CKli33QU.js";import"./chunk-OWCVCYLK-4-W-ynqW.js";import"./chunk-ND7LMLKX-lfusdDHU.js";import"./chunk-DZSZGQHW-BCXsfFfT.js";import"./chunk-GZTWQ64R-CKGVWw4I.js";import"./chunk-MPYPSXSE-C-CxVwa7.js";import"./chunk-D5HYT7QG-imLQxbAy.js";import"./chunk-CNRTWJTD-DJuDnaYn.js";import"./chunk-F3AE6A5H-DTVcMSk7.js";import"./chunk-KTR4FSNJ-DSr3q0Xy.js";import{r as t,t as n}from"./chunk-FGVZ23HU-BEVs0fgA.js";import"./mermaid.core-BVgUieVU.js";var r=n({styles:e(e=>`${t(e)}
|
|
2
|
+
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
|
+
stroke: ${e.clusterBorder} !important;
|
|
4
|
+
}
|
|
5
|
+
[data-look="neo"].cluster rect {
|
|
6
|
+
filter: none;
|
|
7
|
+
}
|
|
8
|
+
`,`getStyles`)});export{r as diagram};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{n as e,t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n,t as r}from"./d3-selection-BFzs9NTX.js";import{Z as i,a,at as o,b as s,ct as c,o as l,ot as u,y as d}from"./chunk-QDWOWVBQ-Du0KmhW4.js";import{n as f}from"./dist-YCovsM_S.js";import{m as p}from"./chunk-OWCVCYLK-4-W-ynqW.js";import{i as m,n as h}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{a as g}from"./mermaid.core-BVgUieVU.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s]}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(n,[2,5],{5:6}),t(n,[2,2]),t(n,[2,3]),t(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,10],{1:[2,1]}),t(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,8]),t(n,[2,9]),t(n,[2,11]),{16:[1,22]},{18:[1,23]},t(n,[2,14]),t(n,[2,15]),t(n,[2,16]),t(n,[2,17]),t(n,[2,18]),t(n,[2,19]),t(n,[2,7]),t(n,[2,12]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};u.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin(`acc_title`),15;case 10:return this.popState(),`acc_title_value`;case 11:return this.begin(`acc_descr`),17;case 12:return this.popState(),`acc_descr_value`;case 13:this.begin(`acc_descr_multiline`);break;case 14:this.popState();break;case 15:return`acc_descr_multiline_value`;case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}})();function d(){this.yy={}}return e(d,`Parser`),d.prototype=u,u.Parser=d,new d})();_.parser=_;var v=_,y={};t(y,{addEvent:()=>P,addSection:()=>A,addTask:()=>N,addTaskOrg:()=>F,clear:()=>D,default:()=>ee,getCommonDb:()=>E,getDirection:()=>k,getSections:()=>j,getTasks:()=>M,setDirection:()=>O});var b=``,x=0,S=`LR`,C=[],w=[],T=[],E=e(()=>l,`getCommonDb`),D=e(function(){C.length=0,w.length=0,b=``,T.length=0,S=`LR`,a()},`clear`),O=e(function(e){S=e},`setDirection`),k=e(function(){return S},`getDirection`),A=e(function(e){b=e,C.push(e)},`addSection`),j=e(function(){return C},`getSections`),M=e(function(){let e=I(),t=0;for(;!e&&t<100;)e=I(),t++;return w.push(...T),w},`getTasks`),N=e(function(e,t,n){let r={id:x++,section:b,type:b,task:e,score:t||0,events:n?[n]:[]};T.push(r)},`addTask`),P=e(function(e){T.find(e=>e.id===x-1).events.push(e)},`addEvent`),F=e(function(e){let t={section:b,type:b,description:e,task:e,classes:[]};w.push(t)},`addTaskOrg`),I=e(function(){let t=e(function(e){return T[e].processed},`compileTask`),n=!0;for(let[e,r]of T.entries())t(e),n&&=r.processed;return n},`compileTasks`),ee={clear:D,getCommonDb:E,getDirection:k,setDirection:O,addSection:A,getSections:j,getTasks:M,addTask:N,addTaskOrg:F,addEvent:P},L=0,R=e(function(e,t){let n=e.append(`rect`);return n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),n.attr(`rx`,t.rx),n.attr(`ry`,t.ry),t.class!==void 0&&n.attr(`class`,t.class),n},`drawRect`),te=e(function(t,n){let r=t.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=t.append(`g`);i.append(`circle`).attr(`cx`,n.cx-5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}e(a,`smile`);function o(e){let t=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}e(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),ne=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),z=e(function(e,t){let n=t.text.replace(/<br\s*\/?>/gi,` `),r=e.append(`text`);r.attr(`x`,t.x),r.attr(`y`,t.y),r.attr(`class`,`legend`),r.style(`text-anchor`,t.anchor),t.class!==void 0&&r.attr(`class`,t.class);let i=r.append(`tspan`);return i.attr(`x`,t.x+t.textMargin*2),i.text(n),r},`drawText`),re=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,z(t,n)},`drawLabel`),ie=e(function(e,t,n){let r=e.append(`g`),i=V();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,R(r,i),H(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),B=-1,ae=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);B++,a.append(`line`).attr(`id`,r+`-task`+B).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),te(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=V();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,R(a,o),H(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),oe=e(function(e,t){R(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:`rect`}).lower()},`drawBackgroundRect`),se=e(function(){return{x:0,y:0,fill:void 0,"text-anchor":`start`,width:100,height:100,textMargin:0,rx:0,ry:0}},`getTextObj`),V=e(function(){return{x:0,y:0,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),H=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),ce=e(function(e,t){L=0,B=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`);function U(e,t){e.each(function(){var e=r(this),n=e.text().split(/(\s+|<br>)/).reverse(),i,a=[],o=1.1,s=e.attr(`y`),c=parseFloat(e.attr(`dy`)),l=e.text(null).append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,c+`em`);for(let r=0;r<n.length;r++)i=n[n.length-1-r],a.push(i),l.text(a.join(` `).trim()),(l.node().getComputedTextLength()>t||i===`<br>`)&&(a.pop(),l.text(a.join(` `).trim()),a=i===`<br>`?[``]:[i],l=e.append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,o+`em`).text(i))})}e(U,`wrap`);var le=e(function(e,t,n,i,a,o=!1){let{theme:s,look:c}=i,l=s?.includes(`redux`),u=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=e.append(`g`);t.section=u,d.attr(`class`,(t.class?t.class+` `:``)+`timeline-node `+(`section-`+u));let f=d.append(`g`),p=d.append(`g`),m=p.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(U,t.width).node().getBBox(),h=i.fontSize?.replace?i.fontSize.replace(`px`,``):i.fontSize;if(t.height=m.height+h*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width+=2*t.padding,p.attr(`transform`,`translate(`+t.width/2+`, `+t.padding/2+`)`),l&&p.attr(`transform`,`translate(${t.width/2}, ${o?t.padding/2+3:t.padding})`),de(f,t,u,a,i),c===`neo`&&(d.attr(`data-look`,`neo`),l)){let t=s.includes(`dark`),n=e.node()?.ownerSVGElement??e.node(),i=r(n),a=i.attr(`id`)??``,o=a?`${a}-drop-shadow`:`drop-shadow`;if(i.select(`#${o}`).empty()){let e=i.select(`defs`);(e.empty()?i.append(`defs`):e).append(`filter`).attr(`id`,o).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,t?`0.2`:`0.06`).attr(`flood-color`,t?`#FFFFFF`:`#000000`)}}return t},`drawNode`),ue=e(function(e,t,n){let r=e.append(`g`),i=r.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(U,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace(`px`,``):n.fontSize;return r.remove(),i.height+a*1.1*.5+t.padding},`getVirtualNodeHeight`),de=e(function(e,t,n,r,i){let{theme:a}=i,o=a?.includes(`redux`)?0:5,s=o>0?`M0 ${t.height-5} v${-t.height+10} q0,-${o},${o},-${o} h${t.width-10} q${o},0,${o},${o} v${t.height-5} H0 Z`:`M0 ${t.height-5} v${-(t.height-5)} h${t.width} v${t.height} H0 Z`;e.append(`path`).attr(`id`,r+`-node-`+L++).attr(`class`,`node-bkg node-`+t.type).attr(`d`,s),a?.includes(`redux`)||e.append(`line`).attr(`class`,`node-line-`+n).attr(`x1`,0).attr(`y1`,t.height).attr(`x2`,t.width).attr(`y2`,t.height)},`defaultBkg`),W={drawRect:R,drawCircle:ne,drawSection:ie,drawText:z,drawLabel:re,drawTask:ae,drawBackgroundRect:oe,getTextObj:se,getNoteRect:V,initGraphics:ce,drawNode:le,getVirtualNodeHeight:ue},fe=e(function(e,t,a,o){let c=s(),{look:l,theme:u,themeVariables:d}=c,{useGradient:f,gradientStart:p,gradientStop:m}=d,h=c.timeline?.leftMargin??50;n.debug(`timeline`,o.db);let g=c.securityLevel,_;g===`sandbox`&&(_=r(`#i`+t));let v=r(g===`sandbox`?_.nodes()[0].contentDocument.body:`body`).select(`#`+t);v.append(`g`);let y=o.db.getTasks(),b=o.db.getCommonDb().getDiagramTitle();n.debug(`task`,y),W.initGraphics(v,t);let x=o.db.getSections();n.debug(`sections`,x);let S=0,C=0,w=0,T=0,E=50+h,D=50;T=50;let O=0,k=!0;x.forEach(function(e){let t={number:O,descr:e,section:O,width:150,padding:20,maxHeight:S},r=W.getVirtualNodeHeight(v,t,c);n.debug(`sectionHeight before draw`,r),S=Math.max(S,r+20)});let A=0,j=0;n.debug(`tasks.length`,y.length);for(let[e,t]of y.entries()){let r={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:C},i=W.getVirtualNodeHeight(v,r,c);n.debug(`taskHeight before draw`,i),C=Math.max(C,i+20),A=Math.max(A,t.events.length);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=W.getVirtualNodeHeight(v,n,c)}t.events.length>0&&(a+=(t.events.length-1)*10),j=Math.max(j,a)}n.debug(`maxSectionHeight before draw`,S),n.debug(`maxTaskHeight before draw`,C),x&&x.length>0?x.forEach(e=>{let r=y.filter(t=>t.section===e),i={number:O,descr:e,section:O,width:200*Math.max(r.length,1)-50,padding:20,maxHeight:S};n.debug(`sectionNode`,i);let a=v.append(`g`),o=W.drawNode(a,i,O,c,t);n.debug(`sectionNode output`,o),a.attr(`transform`,`translate(${E}, ${T})`),D+=S+50,r.length>0&&G(v,r,O,E,D,C,c,A,j,S,!1,t),E+=200*Math.max(r.length,1),D=T,O++}):(k=!1,G(v,y,O,E,D,C,c,A,j,S,!0,t));let M=v.node().getBBox();if(n.debug(`bounds`,M),b&&v.append(`text`).text(b).attr(`x`,l===`neo`?M.x*2+h:M.width/2-h).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),w=k?S+C+150:C+100,v.append(`g`).attr(`class`,`lineWrapper`).append(`line`).attr(`x1`,h).attr(`y1`,w).attr(`x2`,M.width+3*h).attr(`y2`,w).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#${t}-arrowhead)`),l===`neo`&&f&&u!==`neutral`){let e=v.select(`defs`),t=(e.empty()?v.append(`defs`):e).append(`linearGradient`).attr(`id`,v.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,p).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,m).attr(`stop-opacity`,1)}i(void 0,v,c.timeline?.padding??50,c.timeline?.useMaxWidth??!1)},`draw`),G=e(function(e,t,r,i,a,o,s,c,l,u,d,f){for(let c of t){let t={descr:c.task,section:r,number:r,width:150,padding:20,maxHeight:o};n.debug(`taskNode`,t);let u=e.append(`g`).attr(`class`,`taskWrapper`),p=W.drawNode(u,t,r,s,f).height;if(n.debug(`taskHeight after draw`,p),u.attr(`transform`,`translate(${i}, ${a})`),o=Math.max(o,p),c.events){let t=e.append(`g`).attr(`class`,`lineWrapper`),n=o;a+=100,n+=pe(e,c.events,r,i,a,s,f),a-=100,t.append(`line`).attr(`x1`,i+95).attr(`y1`,a+o).attr(`x2`,i+95).attr(`y2`,a+o+100+l+100).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#${f}-arrowhead)`).attr(`stroke-dasharray`,`5,5`)}i+=200,d&&!s.timeline?.disableMulticolor&&r++}a-=10},`drawTasks`),pe=e(function(e,t,r,i,a,o,s){let c=0,l=a;a+=100;for(let l of t){let t={descr:l,section:r,number:r,width:150,padding:20,maxHeight:50};n.debug(`eventNode`,t);let u=e.append(`g`).attr(`class`,`eventWrapper`),d=W.drawNode(u,t,r,o,s,!0).height;c+=d,u.attr(`transform`,`translate(${i}, ${a})`),a=a+10+d}return a=l,c},`drawEvents`),me={setConf:e(()=>{},`setConf`),draw:fe},K=200,q=5,he=K+q*2,J=K+100,ge=J+q*2,Y=10,_e=0,X=20,Z=20,Q=30,$=50,ve=e(function(e,t,r,a){let o=s(),c=o.timeline?.leftMargin??50;n.debug(`timeline`,a.db);let l=g(t);l.append(`g`);let u=a.db.getTasks(),d=a.db.getCommonDb().getDiagramTitle();n.debug(`task`,u),W.initGraphics(l);let f=a.db.getSections();n.debug(`sections`,f);let m=0,h=0,_=50+c,v=50,y=v,b=_,x=he+Z,S=ge+$,C=b+x,w=0,T=f&&f.length>0,E=T?C:_+x,D=Math.max(50,x+S-q*2);f.forEach(function(e){let t={number:w,descr:e,section:w,width:D,padding:q,maxHeight:m},r=W.getVirtualNodeHeight(l,t,o);n.debug(`sectionHeight before draw`,r),m=Math.max(m,r)});let O=0;n.debug(`tasks.length`,u.length);for(let[e,t]of u.entries()){let r={number:e,descr:t,section:t.section,width:K,padding:q,maxHeight:h},i=W.getVirtualNodeHeight(l,r,o);n.debug(`taskHeight before draw`,i),h=Math.max(h,i);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:J,padding:q,maxHeight:50};a+=W.getVirtualNodeHeight(l,n,o)}t.events.length>0&&(a+=(t.events.length-1)*Y),O=Math.max(O,a)+_e}n.debug(`maxSectionHeight before draw`,m),n.debug(`maxTaskHeight before draw`,h);let k=Math.max(h,O)+Q;T?f.forEach(e=>{let t=u.filter(t=>t.section===e),r={number:w,descr:e,section:w,width:D,padding:q,maxHeight:m};n.debug(`sectionNode`,r);let i=l.append(`g`),a=W.drawNode(i,r,w,o);n.debug(`sectionNode output`,a);let s=E-x;i.attr(`transform`,`translate(${s}, ${v})`);let c=v+a.height+X;t.length>0&&ye(l,t,w,E,c,h,o,k,!1);let d=t.length,f=a.height+X+k*Math.max(d,1)-(d>0?Q*2:0);v+=f,w++}):ye(l,u,w,E,v,h,o,k,!0);let A=l.node()?.getBBox();if(!A)throw Error(`bbox not found`);if(n.debug(`bounds`,A),d){if(l.append(`text`).text(d).attr(`x`,A.width/2-c).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),A=l.node()?.getBBox(),!A)throw Error(`bbox not found`);n.debug(`bounds after title`,A)}let[j]=p(o.fontSize),M=(j??16)*2,N=(j??16)*.5+20,P=l.append(`g`).attr(`class`,`lineWrapper`);P.append(`line`).attr(`x1`,E).attr(`y1`,y-M).attr(`x2`,E).attr(`y2`,A.y+A.height+N).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`),P.lower(),i(void 0,l,o.timeline?.padding??50,o.timeline?.useMaxWidth??!1)},`draw`),ye=e(function(e,t,r,i,a,o,s,c,l){for(let u of t){let t={descr:u.task,section:r,number:r,width:K,padding:q,maxHeight:o};n.debug(`taskNode`,t);let d=e.append(`g`).attr(`class`,`taskWrapper`),f=W.drawNode(d,t,r,s),p=f.height;n.debug(`taskHeight after draw`,p);let m=i-Z-f.width;if(d.attr(`transform`,`translate(${m}, ${a})`),o=Math.max(o,p),u.events&&u.events.length>0){let t=a,n=i+$;be(e,u.events,r,i,n,t,s)}a+=c,l&&!s.timeline?.disableMulticolor&&r++}},`drawTasks`),be=e(function(e,t,r,i,a,o,s){let c=o;for(let o of t){let t={descr:o,section:r,number:r,width:J,padding:q,maxHeight:0};n.debug(`eventNode`,t);let l=e.append(`g`).attr(`class`,`eventWrapper`),u=W.drawNode(l,t,r,s).height;l.attr(`transform`,`translate(${a}, ${c})`);let d=e.append(`g`).attr(`class`,`lineWrapper`),f=c+u/2;d.append(`line`).attr(`x1`,i).attr(`y1`,f).attr(`x2`,a).attr(`y2`,f).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`).attr(`stroke-dasharray`,`5,5`),c=c+u+Y}return c-o},`drawEvents`),xe={setConf:e(()=>{},`setConf`),draw:ve},Se=e(e=>{let{theme:t}=d(),n=t?.includes(`dark`),r=m(t,e.borderColorArray),i=e.svgId?.replace(/^#/,``)??``,a=i?`url(#${i}-drop-shadow)`:e.dropShadow??`none`,o=``;for(let t=0;t<h(e.THEME_COLOR_LIMIT);t++){let i=`${17-3*t}`,s=r?e.borderColorArray[t%e.borderColorArray.length]:void 0,c=s??e.mainBkg,l=s??e.nodeBorder;o+=`
|
|
7
|
+
.section-${t-1} rect,
|
|
8
|
+
.section-${t-1} path,
|
|
9
|
+
.section-${t-1} circle {
|
|
10
|
+
fill: ${n&&r?e.mainBkg:c};
|
|
11
|
+
stroke: ${l};
|
|
12
|
+
stroke-width: ${e.strokeWidth};
|
|
13
|
+
filter: ${a};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.section-${t-1} text {
|
|
17
|
+
fill: ${e.nodeBorder};
|
|
18
|
+
font-weight: ${e.fontWeight}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.node-icon-${t-1} {
|
|
22
|
+
font-size: 40px;
|
|
23
|
+
color: ${e[`cScaleLabel`+t]};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.section-edge-${t-1} {
|
|
27
|
+
stroke: ${e[`cScale`+t]};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.edge-depth-${t-1} {
|
|
31
|
+
stroke-width: ${i};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.section-${t-1} line {
|
|
35
|
+
stroke: ${e[`cScaleInv`+t]};
|
|
36
|
+
stroke-width: 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.lineWrapper line {
|
|
40
|
+
stroke: ${e.nodeBorder};
|
|
41
|
+
stroke-width:${e.strokeWidth}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.disabled,
|
|
45
|
+
.disabled circle,
|
|
46
|
+
.disabled text {
|
|
47
|
+
fill: ${e.tertiaryColor??`lightgray`};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.disabled text {
|
|
51
|
+
fill: ${e.clusterBorder??`#efefef`};
|
|
52
|
+
}
|
|
53
|
+
`}return o},`genReduxSections`),Ce=e(e=>{let t=``,n=h(e.THEME_COLOR_LIMIT);for(let t=0;t<n;t++)e[`lineColor`+t]=e[`lineColor`+t]??e[`cScaleInv`+t],c(e[`lineColor`+t])?e[`lineColor`+t]=u(e[`lineColor`+t],20):e[`lineColor`+t]=o(e[`lineColor`+t],20);for(let r=0;r<n;r++){let n=``+(17-3*r);t+=`
|
|
54
|
+
.section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} path {
|
|
55
|
+
fill: ${e[`cScale`+r]};
|
|
56
|
+
}
|
|
57
|
+
.section-${r-1} text {
|
|
58
|
+
fill: ${e[`cScaleLabel`+r]};
|
|
59
|
+
}
|
|
60
|
+
.node-icon-${r-1} {
|
|
61
|
+
font-size: 40px;
|
|
62
|
+
color: ${e[`cScaleLabel`+r]};
|
|
63
|
+
}
|
|
64
|
+
.section-edge-${r-1}{
|
|
65
|
+
stroke: ${e[`cScale`+r]};
|
|
66
|
+
}
|
|
67
|
+
.edge-depth-${r-1}{
|
|
68
|
+
stroke-width: ${n};
|
|
69
|
+
}
|
|
70
|
+
.section-${r-1} line {
|
|
71
|
+
stroke: ${e[`cScaleInv`+r]} ;
|
|
72
|
+
stroke-width: 3;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.lineWrapper line{
|
|
76
|
+
stroke: ${e[`cScaleLabel`+r]} ;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.disabled, .disabled circle, .disabled text {
|
|
80
|
+
fill: ${e.tertiaryColor??`lightgray`};
|
|
81
|
+
}
|
|
82
|
+
.disabled text {
|
|
83
|
+
fill: ${e.clusterBorder??`#efefef`};
|
|
84
|
+
}
|
|
85
|
+
`}return t},`genSections`),we={db:y,renderer:{setConf:e(()=>{},`setConf`),draw:e((e,t,n,r)=>(r?.db?.getDirection?.()??`LR`)===`TD`?xe.draw(e,t,n,r):me.draw(e,t,n,r),`draw`)},parser:v,styles:e(e=>{let{theme:t}=d(),n=t?.includes(`redux`),r=t===`neutral`,i=e.svgId?.replace(/^#/,``)??``,a=``;if(e.useGradient&&i&&e.THEME_COLOR_LIMIT&&!r){let t=h(e.THEME_COLOR_LIMIT);for(let n=0;n<t;n++)a+=`
|
|
86
|
+
.section-${n-1}[data-look="neo"] rect,
|
|
87
|
+
.section-${n-1}[data-look="neo"] path,
|
|
88
|
+
.section-${n-1}[data-look="neo"] circle {
|
|
89
|
+
fill: ${e.mainBkg};
|
|
90
|
+
stroke: url(#${i}-gradient);
|
|
91
|
+
stroke-width: 2;
|
|
92
|
+
}
|
|
93
|
+
.section-${n-1}[data-look="neo"] line {
|
|
94
|
+
stroke: url(#${i}-gradient);
|
|
95
|
+
stroke-width: 2;
|
|
96
|
+
}`}return`
|
|
97
|
+
.edge {
|
|
98
|
+
stroke-width: 3;
|
|
99
|
+
}
|
|
100
|
+
${n?Se(e):Ce(e)}
|
|
101
|
+
${a}
|
|
102
|
+
.section-root rect, .section-root path, .section-root circle {
|
|
103
|
+
fill: ${e.git0};
|
|
104
|
+
}
|
|
105
|
+
.section-root text {
|
|
106
|
+
fill: ${e.gitBranchLabel0};
|
|
107
|
+
}
|
|
108
|
+
.icon-container {
|
|
109
|
+
height:100%;
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
}
|
|
114
|
+
.edge {
|
|
115
|
+
fill: none;
|
|
116
|
+
}
|
|
117
|
+
.eventWrapper {
|
|
118
|
+
filter: brightness(120%);
|
|
119
|
+
}
|
|
120
|
+
`},`getStyles`)};export{we as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-NGNAAXSQ-DqoPQk1a.js";import{c as e}from"./mermaid-parser.core-0pE4JCc_.js";export{e as createTreeViewServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-NGNAAXSQ-DqoPQk1a.js";import{o as e}from"./mermaid-parser.core-0pE4JCc_.js";export{e as createTreemapServices};
|