@diffohq/diffo 0.2.0 → 0.3.0
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 +2 -2
- package/dist/cli.mjs +111 -22
- package/dist/client/assets/{abnfDiagram-VCTEODGH-BK74b0Uj.js → abnfDiagram-O67JEVCF-DdDBSVZ4.js} +1 -1
- package/dist/client/assets/{arc-BZJjnFHJ.js → arc-BgNb6rn9.js} +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-CYv-P09J.js +1 -0
- package/dist/client/assets/architectureDiagram-NJMV4G6O-HNLU6Z_V.js +36 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BWSjZ0YR.js → blockDiagram-BEXU5L5S-DO434Dqm.js} +15 -4
- package/dist/client/assets/c4Diagram-YGBWAQC7-CkhXDWcc.js +38 -0
- package/dist/client/assets/channel-eN698CVO.js +1 -0
- package/dist/client/assets/chunk-3FUC2YCW-DTfKImVL.js +2 -0
- package/dist/client/assets/{chunk-GVQU2GXP-3NWb-Kjs.js → chunk-5DYCD2WN-9Pj_Xuzv.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-BRN4CzQ0.js → chunk-742MDFTN-DRQNNbBo.js} +1 -1
- package/dist/client/assets/chunk-7INBJB4K-BqnHF3P0.js +62 -0
- package/dist/client/assets/chunk-7M6MHVWA-NTwtPxj_.js +213 -0
- package/dist/client/assets/chunk-7PRAP22T-reFtaiUY.js +1 -0
- package/dist/client/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/client/assets/{chunk-FOHPRMQF-DHwB1DNv.js → chunk-FOHPRMQF-DzxwRta7.js} +9 -9
- package/dist/client/assets/{chunk-SVP7TREG-CsO-w42m.js → chunk-GTNCS2PH-BbSQqqTd.js} +1 -1
- package/dist/client/assets/{chunk-F27PBJKO-C6X74WsU.js → chunk-GWA4HPMP-B3OAiKhC.js} +1 -1
- package/dist/client/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/dist/client/assets/chunk-MBY4JIJT-CNIWhzdY.js +72 -0
- package/dist/client/assets/chunk-NETBCI7D-Cu2GMg5A.js +1 -0
- package/dist/client/assets/chunk-O7XYJQB3-C616frX3.js +126 -0
- package/dist/client/assets/chunk-UA2S7LBM-_7jUrSu1.js +1 -0
- package/dist/client/assets/{chunk-POPQ4Y6H-DKwUAqbe.js → chunk-WEXAMYUT--WmuTjt8.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-BikhrMBF.js → chunk-XXDRQBXY-CH68Fn6G.js} +1 -1
- package/dist/client/assets/{chunk-OSK3NFVY-BJ8i4cd-.js → chunk-Z7XXMR3K-CMGWkbdd.js} +3 -3
- package/dist/client/assets/{chunk-75Z2AOVW-B_bGdfJP.js → chunk-ZIGJFQKS-Bupo8UEA.js} +2 -2
- package/dist/client/assets/classDiagram-v2-NBCMYWYE-BlYlsN2U.js +217 -0
- package/dist/client/assets/{core-BJUznnCg.js → core-BuHBGQx-.js} +2 -2
- package/dist/client/assets/cose-bilkent-JH36ORCC-BtFdPq63.js +1 -0
- package/dist/client/assets/cynefin-OW5HDTMX-DQ0j2-fq.js +1 -0
- package/dist/client/assets/cynefinDiagram-VND7K2PF-DnctQE5u.js +62 -0
- package/dist/client/assets/cytoscape.esm-Yq6u8L66.js +321 -0
- package/dist/client/assets/dagre-6A5THRUB-u940AeXp.js +4 -0
- package/dist/client/assets/diagram-22UHCM2B-B1jzZKtP.js +200 -0
- package/dist/client/assets/{diagram-VX7I27RA-BmHtC5T2.js → diagram-3UASUU5V-BY_6wxmf.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-BMNFierD.js → diagram-ATOU4E4O-CTsYtnJJ.js} +3 -3
- package/dist/client/assets/{diagram-S7CK7UJ4-C1jP2NX5.js → diagram-CDSNMT55-DuEJO9EQ.js} +3 -3
- package/dist/client/assets/{diagram-Z3DM3KII-CzCV6KsS.js → diagram-MLGK6HIB-CZ10U2Mk.js} +1 -1
- package/dist/client/assets/diagram-MPIPVDR6-CkO6cJlF.js +41 -0
- package/dist/client/assets/dist-DFkgQY1o.js +142 -0
- package/dist/client/assets/{dist-bii_eoxi.js → dist-DkqXbsqN.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-DuVnjPWa.js → ebnfDiagram-ZINNZB2B-BJtnMhOp.js} +1 -1
- package/dist/client/assets/elk-276RUBZZ-CShSerV4.js +27 -0
- package/dist/client/assets/{engine-oniguruma-BlIEwGaN.js → engine-oniguruma-DDtqknzG.js} +1 -1
- package/dist/client/assets/{erDiagram-RLTQ6QDP-CtwYHyZu.js → erDiagram-OPXOYQCR-2VvQxgaY.js} +15 -15
- package/dist/client/assets/eventmodeling-NTZA5JFV-Ur4Uzv5y.js +1 -0
- package/dist/client/assets/flowDiagram-KWPJA3E3-BQS1w4s1.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CR8Sa06t.js → ganttDiagram-FUAMR5RP-hQJ3ga2L.js} +2 -2
- package/dist/client/assets/gitGraph-4MIJSDKK-CVt38-tW.js +1 -0
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-C36JIyKh.js → gitGraphDiagram-X574FWY7-X6_FAtp_.js} +4 -4
- package/dist/client/assets/index-t7j89PJp.js +91 -0
- package/dist/client/assets/info-A6RAGUB7-CsIS2T8y.js +1 -0
- package/dist/client/assets/infoDiagram-VRGFBTTK-CNesth4F.js +2 -0
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CsPYEqSH.js → ishikawaDiagram-OU5B5YK6-C3uowhy1.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-DbHeKN0X.js → journeyDiagram-ZHPQQLJL-Bti7zdNB.js} +3 -3
- package/dist/client/assets/{kanban-definition-UXKFOSKX-CbYeTY2r.js → kanban-definition-PNTS6WVX-Co13mJCW.js} +10 -10
- package/dist/client/assets/{katex-CXMH3UgJ.js → katex-ZlcWpGUi.js} +2 -2
- package/dist/client/assets/{line-BeOqlVB1.js → line-CodMwzVg.js} +1 -1
- package/dist/client/assets/linear-D9CKVpWI.js +1 -0
- package/dist/client/assets/{mermaid-parser.core-BLSiQUXp.js → mermaid-parser.core-OY76TKUN.js} +3 -3
- package/dist/client/assets/mermaid.core-DWE2Tn2R.js +44 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-o49TTsg4.js → mindmap-definition-NLK3R4M7-DJ3MEvZg.js} +25 -25
- package/dist/client/assets/packet-AYTQ26CC-CW1j_hFQ.js +1 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-CZxoewnI.js → pegDiagram-GJSIUBJH-hOvLvBiF.js} +1 -1
- package/dist/client/assets/pie-WAS4IAKB-D1KPtuKA.js +1 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-dAiwtigh.js → pieDiagram-5QR66LMP-CJN1M2lG.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-mefTaSBl.js → quadrantDiagram-O4NWA36T-DOysLQ6R.js} +3 -3
- package/dist/client/assets/radar-RG4KPBEZ-B7XCBnIS.js +1 -0
- package/dist/client/assets/railroad-74A4TZTK-0nmMIDEw.js +1 -0
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DJU_abQP.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-_TwNbNw6.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-CAYsrf-p.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-DdhfhlaU.js → railroadDiagram-XR7U4H2S-BXbeU-WV.js} +1 -1
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-BVrRfVMy.js → requirementDiagram-PLB6GJNP-D3G2HYv-.js} +11 -11
- package/dist/client/assets/sankeyDiagram-IPEJSGJF-CFSa-Gk4.js +40 -0
- package/dist/client/assets/sequenceDiagram-PO4LG4MO-BvmuQTlz.js +169 -0
- package/dist/client/assets/{src-CfhDi0bm.js → src-CplSIRuf.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-GCMORJYK-C_ceCfHy.js +291 -0
- package/dist/client/assets/swimlanes-2SLR337P-D-n44lEC.js +1 -0
- package/dist/client/assets/swimlanesDiagram-TC7HE7FX-DrlgJMk7.js +8 -0
- package/dist/client/assets/timeline-definition-EJHVYXUP-DKYNs1Uj.js +120 -0
- package/dist/client/assets/treeView-Q6P3EWNA-COW2UiIS.js +1 -0
- package/dist/client/assets/treemap-WGGIJYW6-DJOuJZmF.js +1 -0
- package/dist/client/assets/usecaseDiagram-POWQR4AR-BTmpbeJZ.js +328 -0
- package/dist/client/assets/vennDiagram-UO4OBE2U-C37AKEaJ.js +34 -0
- package/dist/client/assets/wardley-WFR3VGLG-CpVTtNOC.js +1 -0
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CFaIuWQk.js → wardleyDiagram-VNRHLVJA-ja-hiiVC.js} +3 -3
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-et5vk4QS.js → xychartDiagram-PMCCYNJV-BsDoacSf.js} +3 -3
- package/dist/client/index.html +1 -1
- package/package.json +4 -4
- package/plugin.json +1 -1
- package/skills/diffo/SKILL.md +17 -8
- package/dist/client/assets/architecture-7GRP2DOG-BMofp_0u.js +0 -1
- package/dist/client/assets/architectureDiagram-5GKGNRK7-BBjd1L77.js +0 -36
- package/dist/client/assets/c4Diagram-7LVT6UL2-z-xUGKCJ.js +0 -38
- package/dist/client/assets/channel-CmX7fcUa.js +0 -1
- package/dist/client/assets/chunk-4HAMMTFA-CAN-T2o-.js +0 -62
- package/dist/client/assets/chunk-DU6HZSFF-wyqPpFTy.js +0 -125
- package/dist/client/assets/chunk-GMAD6QVW-DBossm8a.js +0 -72
- package/dist/client/assets/chunk-IMKFNOWR-BCvjP66C.js +0 -231
- package/dist/client/assets/chunk-L3NEJ4N5-DppEbElX.js +0 -1
- package/dist/client/assets/chunk-P2QGCYS3-fvNVbdI1.js +0 -1
- package/dist/client/assets/chunk-SHT3W25Y-BfzjiqOe.js +0 -168
- package/dist/client/assets/chunk-TICWLB2K-DPzmokY4.js +0 -206
- package/dist/client/assets/classDiagram-ZZMXUADV-BSMgXeCj.js +0 -1
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BSMgXeCj.js +0 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-CBu7-BXr.js +0 -1
- package/dist/client/assets/cynefin-OW5HDTMX-iJEmw--0.js +0 -1
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-B4JnaLZu.js +0 -62
- package/dist/client/assets/cytoscape.esm-CGd-uY3x.js +0 -321
- package/dist/client/assets/dagre-GXQ25YYZ-bmDafESr.js +0 -4
- package/dist/client/assets/dagre-PrKaheQc.js +0 -1
- package/dist/client/assets/diagram-UQ7AKVKN-DssGkq6D.js +0 -41
- package/dist/client/assets/dist-BT7WB1vp.js +0 -142
- package/dist/client/assets/eventmodeling-NTZA5JFV-DBQsn9JF.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-C_zt1wER.js +0 -1
- package/dist/client/assets/gitGraph-4MIJSDKK-DoWc_DJ0.js +0 -1
- package/dist/client/assets/index-BUq9UmeC.js +0 -91
- package/dist/client/assets/info-A6RAGUB7-DULcTga7.js +0 -1
- package/dist/client/assets/infoDiagram-27XIBGKW-eQbUxJ9T.js +0 -2
- package/dist/client/assets/linear-D5d3UlAm.js +0 -1
- package/dist/client/assets/mermaid.core-BoXUi08V.js +0 -44
- package/dist/client/assets/packet-AYTQ26CC-Blxpg-nI.js +0 -1
- package/dist/client/assets/pie-WAS4IAKB-D-fqeiW7.js +0 -1
- package/dist/client/assets/radar-RG4KPBEZ-VaODqy4w.js +0 -1
- package/dist/client/assets/railroad-74A4TZTK-BwoigfOV.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BYYKbIBi.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BFA23uel.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-Cq02Hm_P.js +0 -1
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-BalSSH4U.js +0 -40
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-B2KsE_Z_.js +0 -162
- package/dist/client/assets/stateDiagram-D77RDMKH-CoH6bKG5.js +0 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-rXsredo-.js +0 -1
- package/dist/client/assets/swimlanes-42K2YHIH-3IkzoE1X.js +0 -1
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BeXrrDxh.js +0 -8
- package/dist/client/assets/timeline-definition-24CTP7MA-B2M9pP5h.js +0 -120
- package/dist/client/assets/treeView-Q6P3EWNA-Brp55dHV.js +0 -1
- package/dist/client/assets/treemap-WGGIJYW6-zRe9RDJV.js +0 -1
- package/dist/client/assets/vennDiagram-4TSXK5OY-PNF-rFET.js +0 -34
- package/dist/client/assets/wardley-WFR3VGLG-BSDDZIR6.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-CfhDi0bm.js";import{x as n}from"./chunk-DU6HZSFF-wyqPpFTy.js";import"./chunk-75Z2AOVW-B_bGdfJP.js";import"./chunk-PWAF6VOD-BRN4CzQ0.js";import"./chunk-GMAD6QVW-DBossm8a.js";import"./chunk-P2QGCYS3-fvNVbdI1.js";import{s as r}from"./chunk-4HAMMTFA-CAN-T2o-.js";import{a as i,i as a,n as o}from"./chunk-GVQU2GXP-3NWb-Kjs.js";import{a as s,c,i as l}from"./chunk-OSK3NFVY-BJ8i4cd-.js";import{t as u}from"./graphlib-DS17s2tU.js";import{t as d}from"./dagre-PrKaheQc.js";import{n as f}from"./chunk-L3NEJ4N5-DppEbElX.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./mermaid.core-BoXUi08V.js";var b=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),x=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),S=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),C=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],w=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return x(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:x(i)},`getSelfLoopSide`),T=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=b(Math.max(r,e.width*.35),36,c),u=b(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),E=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),D=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=w(e,l,n,c.start,a),f=T(l,d,t,u.width??0),p=E(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),O=e(async({element:n,graph:a,diagramType:c,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:p,edgePaths:g,edgeLabels:v,nodes:b,rootGroups:x}=_(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let C=S(c);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX
|
|
2
|
-
Node.id = `,e,`
|
|
3
|
-
data=`,n.height,`
|
|
4
|
-
Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:s}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let u=await F({element:b,graph:n.graph,diagramType:c,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(y(n.id,a)),h.set(n.id,{id:y(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,b,a.node(e),f),await m(b,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,h,`ids:`,e.v,e.w,`Translating: `,h.get(e.v),h.get(e.w)),C&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await s(v,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await s(v,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:w}=o(d);return{elem:x,graph:a,groups:{clusters:p,edgePaths:g,edgeLabels:v,nodes:b,rootGroups:x},diagramType:c,id:l,mergeSelfLoops:C,subGraphTitleTotalMargin:w}},`measureDagreGraph`),k=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),d(e)},`runDagreGraphLayout`),A=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),j=e((e,t)=>{C.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),M=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),N=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));g(n).forEach(e=>{let t=A(n,e,i);if(!t)return;j(n.node(e),t);let r=a.get(e);r&&j(r,t)});let o=i/2;return e.edges=D(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>M(e,t,n,o)),e},`applyDagreLayoutResult`),P=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:s,mergeSelfLoops:u,subGraphTitleTotalMargin:d})=>{let p=0;await Promise.all(g(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=d,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),h.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=d,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,s=o-a||0;t.debug(`OffsetY`,s,`labelHeight`,o,`halfPadding`,a),await f(r,i),h.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=d/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let m=d/2;return D(n,m,{mergeSelfLoops:u}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=m);let u=n.node(r),d=n.node(a),f=l(i,e,h,o,u,d,s);c(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(p=r.diff)}),t.warn(`Returning from recursive render XAX`,e,p),{elem:e,diff:p}},`paintDagreLayoutCore`),F=e(async e=>{let t=await O(e);return k(t.graph),await P(t)},`renderDagreSubgraph`),I=e(e=>{let n=new u({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),v(n),{graph:n}},`prepareLayoutForDagre`),L=e(async(e,{element:t,preparedLayout:r})=>{let i=r??I(e),a=n(),o=await O({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),R=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return k(n.graph),N(e,n),n},`runDagreLayoutCore`),z=p({prepareLayout:I,measureLayout:L,runLayoutCore:R,paintOptions:{clusterDb:h,getNodes:e((e,{measure:t})=>g(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{N as applyDagreLayoutResult,D as getEdgesToRender,L as measureDagreLayout,I as prepareLayoutForDagre,z as render,R as runDagreLayoutCore};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as ee,T as te,U as ne,V as re,W as ie,X as ae,Y as oe,Z as y,_ as b,a as x,b as se,c as ce,d as le,et as S,f as C,g as ue,h as de,i as w,it as fe,j as pe,k as me,l as he,m as ge,n as T,nt as _e,o as E,p as ve,q as ye,r as D,rt as be,s as xe,t as O,tt as k,u as Se,v as Ce,w as we,x as Te,y as Ee,z as A}from"./graphlib-DS17s2tU.js";var De=/\s/;function Oe(e){for(var t=e.length;t--&&De.test(e.charAt(t)););return t}var ke=/^\s+/;function Ae(e){return e&&e.slice(0,Oe(e)+1).replace(ke,``)}var je=NaN,Me=/^[-+]0x[0-9a-f]+$/i,Ne=/^0b[01]+$/i,Pe=/^0o[0-7]+$/i,Fe=parseInt;function Ie(e){if(typeof e==`number`)return e;if(S(e))return je;if(y(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=y(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Ae(e);var n=Ne.test(e);return n||Pe.test(e)?Fe(e.slice(2),n?2:8):Me.test(e)?je:+e}var Le=1/0,Re=17976931348623157e292;function j(e){return e?(e=Ie(e),e===Le||e===-Le?(e<0?-1:1)*Re:e===e?e:0):e===0?e:0}function ze(e){var t=j(e),n=t%1;return t===t?n?t-n:t:0}var Be=Object.create,Ve=function(){function e(){}return function(t){if(!y(t))return{};if(Be)return Be(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function He(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function M(e,t,n){t==`__proto__`&&ye?ye(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Ue=Object.prototype.hasOwnProperty;function N(e,t,n){var r=e[t];(!(Ue.call(e,t)&&c(r,n))||n===void 0&&!(t in e))&&M(e,t,n)}function P(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?M(n,s,c):N(n,s,c)}return n}function F(e,t,n){if(!y(n))return!1;var r=typeof t;return(r==`number`?A(n)&&ne(t,n.length):r==`string`&&t in n)?c(n[t],e):!1}function We(e){return n(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&F(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function Ge(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ke=Object.prototype.hasOwnProperty;function qe(e){if(!y(e))return Ge(e);var t=v(e),n=[];for(var r in e)r==`constructor`&&(t||!Ke.call(e,r))||n.push(r);return n}function I(e){return A(e)?p(e,!0):qe(e)}function L(e){return e!=null&&e.length?r(e,1):[]}function Je(e){return d(re(e,void 0,L),e+``)}var Ye=pe(Object.getPrototypeOf,Object),Xe=`[object Object]`,Ze=Function.prototype,Qe=Object.prototype,$e=Ze.toString,et=Qe.hasOwnProperty,tt=$e.call(Object);function nt(e){if(!k(e)||_e(e)!=Xe)return!1;var t=Ye(e);if(t===null)return!0;var n=et.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&$e.call(n)==tt}var rt=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function it(e){return rt.test(e)}function at(e,t){return e&&P(t,me(t),e)}function ot(e,t){return e&&P(t,I(t),e)}var st=typeof exports==`object`&&exports&&!exports.nodeType&&exports,ct=st&&typeof module==`object`&&module&&!module.nodeType&&module,lt=ct&&ct.exports===st?fe.Buffer:void 0,ut=lt?lt.allocUnsafe:void 0;function dt(e,t){if(t)return e.slice();var n=e.length,r=ut?ut(n):new e.constructor(n);return e.copy(r),r}function ft(e,t){return P(e,se(e),t)}var pt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)we(t,se(e)),e=Ye(e);return t}:Te;function mt(e,t){return P(e,pt(e),t)}function ht(e){return Ee(e,I,pt)}var gt=Object.prototype.hasOwnProperty;function _t(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&>.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function vt(e){var t=new e.constructor(e.byteLength);return new ue(t).set(new ue(e)),t}function yt(e,t){var n=t?vt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var bt=/\w*$/;function xt(e){var t=new e.constructor(e.source,bt.exec(e));return t.lastIndex=e.lastIndex,t}var St=be?be.prototype:void 0,Ct=St?St.valueOf:void 0;function wt(e){return Ct?Object(Ct.call(e)):{}}function Tt(e,t){var n=t?vt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Et=`[object Boolean]`,Dt=`[object Date]`,Ot=`[object Map]`,kt=`[object Number]`,At=`[object RegExp]`,jt=`[object Set]`,Mt=`[object String]`,Nt=`[object Symbol]`,Pt=`[object ArrayBuffer]`,Ft=`[object DataView]`,It=`[object Float32Array]`,Lt=`[object Float64Array]`,Rt=`[object Int8Array]`,zt=`[object Int16Array]`,Bt=`[object Int32Array]`,Vt=`[object Uint8Array]`,Ht=`[object Uint8ClampedArray]`,Ut=`[object Uint16Array]`,Wt=`[object Uint32Array]`;function Gt(e,t,n){var r=e.constructor;switch(t){case Pt:return vt(e);case Et:case Dt:return new r(+e);case Ft:return yt(e,n);case It:case Lt:case Rt:case zt:case Bt:case Vt:case Ht:case Ut:case Wt:return Tt(e,n);case Ot:return new r;case kt:case Mt:return new r(e);case At:return xt(e);case jt:return new r;case Nt:return wt(e)}}function Kt(e){return typeof e.constructor==`function`&&!v(e)?Ve(Ye(e)):{}}var qt=`[object Map]`;function Jt(e){return k(e)&&b(e)==qt}var Yt=g&&g.isMap,Xt=Yt?o(Yt):Jt,Zt=`[object Set]`;function Qt(e){return k(e)&&b(e)==Zt}var $t=g&&g.isSet,en=$t?o($t):Qt,tn=1,nn=2,rn=4,an=`[object Arguments]`,on=`[object Array]`,sn=`[object Boolean]`,cn=`[object Date]`,ln=`[object Error]`,un=`[object Function]`,dn=`[object GeneratorFunction]`,fn=`[object Map]`,pn=`[object Number]`,mn=`[object Object]`,hn=`[object RegExp]`,gn=`[object Set]`,_n=`[object String]`,vn=`[object Symbol]`,yn=`[object WeakMap]`,bn=`[object ArrayBuffer]`,xn=`[object DataView]`,Sn=`[object Float32Array]`,Cn=`[object Float64Array]`,wn=`[object Int8Array]`,Tn=`[object Int16Array]`,En=`[object Int32Array]`,Dn=`[object Uint8Array]`,On=`[object Uint8ClampedArray]`,kn=`[object Uint16Array]`,An=`[object Uint32Array]`,R={};R[an]=R[on]=R[bn]=R[xn]=R[sn]=R[cn]=R[Sn]=R[Cn]=R[wn]=R[Tn]=R[En]=R[fn]=R[pn]=R[mn]=R[hn]=R[gn]=R[_n]=R[vn]=R[Dn]=R[On]=R[kn]=R[An]=!0,R[ln]=R[un]=R[yn]=!1;function z(e,t,n,r,i,a){var o,c=t&tn,u=t&nn,d=t&rn;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!y(e))return e;var f=_(e);if(f){if(o=_t(e),!c)return He(e,o)}else{var p=b(e),m=p==un||p==dn;if(l(e))return dt(e,c);if(p==mn||p==an||m&&!i){if(o=u||m?{}:Kt(e),!c)return u?mt(e,ot(o,e)):ft(e,at(o,e))}else{if(!R[p])return i?e:{};o=Gt(e,p,c)}}a||=new ee;var h=a.get(e);if(h)return h;a.set(e,o),en(e)?e.forEach(function(r){o.add(z(r,t,n,r,e,a))}):Xt(e)&&e.forEach(function(r,i){o.set(i,z(r,t,n,i,e,a))});var g=f?void 0:(d?u?ht:Ce:u?I:me)(e);return s(g||e,function(r,i){g&&(i=r,r=e[i]),N(o,i,z(r,t,n,i,e,a))}),o}var jn=1,Mn=4;function Nn(e){return z(e,jn|Mn)}var Pn=function(){return fe.Date.now()},Fn=Object.prototype,In=Fn.hasOwnProperty,Ln=n(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&F(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=I(a),s=-1,l=o.length;++s<l;){var u=o[s],d=e[u];(d===void 0||c(d,Fn[u])&&!In.call(e,u))&&(e[u]=a[u])}return e});function Rn(e,t,n){(n!==void 0&&!c(e[t],n)||n===void 0&&!(t in e))&&M(e,t,n)}function zn(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function Bn(e){return P(e,I(e))}function Vn(e,t,n,r,i,a,o){var s=zn(e,n),c=zn(t,n),u=o.get(c);if(u){Rn(e,n,u);return}var d=a?a(s,c,n+``,e,t,o):void 0,p=d===void 0;if(p){var h=_(c),g=!h&&l(c),v=!h&&!g&&m(c);d=c,h||g||v?_(s)?d=s:ce(s)?d=He(s):g?(p=!1,d=dt(c,!0)):v?(p=!1,d=Tt(c,!0)):d=[]:nt(c)||f(c)?(d=s,f(s)?d=Bn(s):(!y(s)||oe(s))&&(d=Kt(c))):p=!1}p&&(o.set(c,d),i(d,c,r,a,o),o.delete(c)),Rn(e,n,d)}function Hn(e,t,n,r,i){e!==t&&le(t,function(a,o){if(i||=new ee,y(a))Vn(e,t,o,n,Hn,r,i);else{var s=r?r(zn(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Rn(e,o,s)}},I)}function B(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Un(e){return function(t,n,r){var i=Object(t);if(!A(t)){var a=C(n,3);t=me(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Wn=Math.max;function Gn(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:ze(n);return i<0&&(i=Wn(r+i,0)),ie(e,C(t,3),i)}var Kn=Un(Gn);function qn(e,t){var n=-1,r=A(e)?Array(e.length):[];return he(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function V(t,n){return(_(t)?e:qn)(t,C(n,3))}function Jn(e,t){return e==null?e:le(e,xe(t),I)}function Yn(e,t){return e&&Se(e,xe(t))}function Xn(e,t){return e>t}var Zn=Object.prototype.hasOwnProperty;function Qn(e,t){return e!=null&&Zn.call(e,t)}function $n(e,t){return e!=null&&de(e,t,Qn)}var er=`[object String]`;function tr(e){return typeof e==`string`||!_(e)&&k(e)&&_e(e)==er}function nr(e,t){return e<t}function H(e,t){var n={};return t=C(t,3),Se(e,function(e,r,i){M(n,r,t(e,r,i))}),n}function rr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!S(o):n(o,s)))var s=o,c=a}return c}function U(e){return e&&e.length?rr(e,ae,Xn):void 0}var ir=We(function(e,t,n){Hn(e,t,n)});function W(e){return e&&e.length?rr(e,ae,nr):void 0}function ar(e,t){return e&&e.length?rr(e,C(t,2),nr):void 0}function or(e,t,n,r){if(!y(e))return e;t=i(t,e);for(var o=-1,s=t.length,c=s-1,l=e;l!=null&&++o<s;){var u=a(t[o]),d=n;if(u===`__proto__`||u===`constructor`||u===`prototype`)return e;if(o!=c){var f=l[u];d=r?r(f,u,l):void 0,d===void 0&&(d=y(f)?f:ne(t[o+1])?[]:{})}N(l,u,d),l=l[u]}return e}function sr(e,t,n){for(var r=-1,a=t.length,o={};++r<a;){var s=t[r],c=te(e,s);n(c,s)&&or(o,i(s,e),c)}return o}function cr(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function lr(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=S(e),o=t!==void 0,s=t===null,c=t===t,l=S(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function ur(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lr(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function dr(t,n,r){n=n.length?e(n,function(e){return _(e)?function(t){return te(t,e.length===1?e[0]:e)}:e}):[ae];var i=-1;return n=e(n,o(C)),cr(qn(t,function(t,r,a){return{criteria:e(n,function(e){return e(t)}),index:++i,value:t}}),function(e,t){return ur(e,t,r)})}var fr=ve(`length`),pr=`\\ud800-\\udfff`,mr=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,hr=`\\ufe0e\\ufe0f`,gr=`[`+pr+`]`,_r=`[`+mr+`]`,vr=`\\ud83c[\\udffb-\\udfff]`,yr=`(?:`+_r+`|`+vr+`)`,br=`[^`+pr+`]`,xr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Sr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Cr=`\\u200d`,wr=yr+`?`,Tr=`[`+hr+`]?`,Er=`(?:`+Cr+`(?:`+[br,xr,Sr].join(`|`)+`)`+Tr+wr+`)*`,Dr=Tr+wr+Er,Or=`(?:`+[br+_r+`?`,_r,xr,Sr,gr].join(`|`)+`)`,kr=RegExp(vr+`(?=`+vr+`)|`+Or+Dr,`g`);function Ar(e){for(var t=kr.lastIndex=0;kr.test(e);)++t;return t}function jr(e){return it(e)?Ar(e):fr(e)}function Mr(e,t){return sr(e,t,function(t,n){return ge(e,n)})}var G=Je(function(e,t){return e==null?{}:Mr(e,t)}),Nr=Math.ceil,Pr=Math.max;function Fr(e,t,n,r){for(var i=-1,a=Pr(Nr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Ir(e){return function(t,n,r){return r&&typeof r!=`number`&&F(t,n,r)&&(n=r=void 0),t=j(t),n===void 0?(n=t,t=0):n=j(n),r=r===void 0?t<n?1:-1:j(r),Fr(t,n,r,e)}}var K=Ir(),Lr=`[object Map]`,Rr=`[object Set]`;function zr(e){if(e==null)return 0;if(A(e))return tr(e)?jr(e):e.length;var n=b(e);return n==Lr||n==Rr?e.size:t(e).length}var q=n(function(e,t){if(e==null)return[];var n=t.length;return n>1&&F(e,t[0],t[1])?t=[]:n>2&&F(t[0],t[1],t[2])&&(t=[t[0]]),dr(e,r(t,1),[])}),Br=0;function Vr(e){var t=++Br;return h(e)+t}function Hr(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function Ur(e,t){return Hr(e||[],t||[],N)}var Wr=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return Gr(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&Gr(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,Kr)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Gr(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Kr(e,t){if(e!==`_next`&&e!==`_prev`)return t}var qr=u(1);function Jr(e,t){if(e.nodeCount()<=1)return[];var n=Zr(e,t||qr);return L(V(Yr(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function Yr(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)Xr(e,t,n,o);for(;o=i.dequeue();)Xr(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(Xr(e,t,n,o,!0));break}}}return r}function Xr(e,t,n,r,i){var a=i?[]:void 0;return E(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Qr(t,n,s)}),E(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Qr(t,n,o)}),e.removeNode(r.v),a}function Zr(e,t){var n=new O,r=0,i=0;E(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),E(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=K(i+r+3).map(function(){return new Wr}),o=r+1;return E(n.nodes(),function(e){Qr(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Qr(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function $r(e){var t=e.graph().acyclicer===`greedy`?Jr(e,n(e)):ei(e);E(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Vr(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function ei(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,E(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return E(e.nodes(),i),t}function ti(e){E(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function J(e,t,n,r){var i;do i=Vr(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function ni(e){var t=new O().setGraph(e.graph());return E(e.nodes(),function(n){t.setNode(n,e.node(n))}),E(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function ri(e){var t=new O({multigraph:e.isMultigraph()}).setGraph(e.graph());return E(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),E(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function ii(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Y(e){var t=V(K(ci(e)+1),function(){return[]});return E(e.nodes(),function(n){var r=e.node(n),i=r.rank;D(i)||(t[i][r.order]=n)}),t}function ai(e){var t=W(V(e.nodes(),function(t){return e.node(t).rank}));E(e.nodes(),function(n){var r=e.node(n);$n(r,`rank`)&&(r.rank-=t)})}function oi(e){var t=W(V(e.nodes(),function(t){return e.node(t).rank})),n=[];E(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;E(n,function(t,n){D(t)&&n%i!==0?--r:r&&E(t,function(t){e.node(t).rank+=r})})}function si(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),J(e,`border`,i,t)}function ci(e){return U(V(e.nodes(),function(t){var n=e.node(t).rank;if(!D(n))return n}))}function li(e,t){var n={lhs:[],rhs:[]};return E(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function ui(e,t){var n=Pn();try{return t()}finally{console.log(e+` time: `+(Pn()-n)+`ms`)}}function di(e,t){return t()}function fi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&E(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)pi(e,`borderLeft`,`_bl`,n,i,a),pi(e,`borderRight`,`_br`,n,i,a)}}E(e.children(),t)}function pi(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=J(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function mi(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&gi(e)}function hi(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&vi(e),(t===`lr`||t===`rl`)&&(bi(e),gi(e))}function gi(e){E(e.nodes(),function(t){_i(e.node(t))}),E(e.edges(),function(t){_i(e.edge(t))})}function _i(e){var t=e.width;e.width=e.height,e.height=t}function vi(e){E(e.nodes(),function(t){yi(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);E(n.points,yi),Object.prototype.hasOwnProperty.call(n,`y`)&&yi(n)})}function yi(e){e.y=-e.y}function bi(e){E(e.nodes(),function(t){xi(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);E(n.points,xi),Object.prototype.hasOwnProperty.call(n,`x`)&&xi(n)})}function xi(e){var t=e.x;e.x=e.y,e.y=t}function Si(e){e.graph().dummyChains=[],E(e.edges(),function(t){Ci(e,t)})}function Ci(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=J(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function wi(e){E(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function X(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=W(V(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}E(e.sources(),n)}function Z(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Ti(e){var t=new O({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ei(t,e)<r;)i=Di(t,e),a=t.hasNode(i.v)?Z(e,i):-Z(e,i),Oi(t,e,a);return t}function Ei(e,t){function n(r){E(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Z(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return E(e.nodes(),n),e.nodeCount()}function Di(e,t){return ar(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Z(t,n)})}function Oi(e,t,n){E(e.nodes(),function(e){t.node(e).rank+=n})}u(1),u(1),ki.CycleException=Q;function ki(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new Q;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,E(e.predecessors(a),i),delete n[a],r.push(a))}if(E(e.sinks(),i),zr(t)!==e.nodeCount())throw new Q;return r}function Q(){}Q.prototype=Error();function Ai(e,t,n){_(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return E(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);ji(e,t,n===`post`,a,r,i)}),i}function ji(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),E(i(t),function(t){ji(e,t,n,r,i,a)}),n&&a.push(t))}function Mi(e,t){return Ai(e,t,`post`)}function Ni(e,t){return Ai(e,t,`pre`)}$.initLowLimValues=Li,$.initCutValues=Pi,$.calcCutValue=Ii,$.leaveEdge=zi,$.enterEdge=Bi,$.exchangeEdges=Vi;function $(e){e=ni(e),X(e);var t=Ti(e);Li(t),Pi(t,e);for(var n,r;n=zi(t);)r=Bi(t,e,n),Vi(t,e,n,r)}function Pi(e,t){var n=Mi(e,e.nodes());n=n.slice(0,n.length-1),E(n,function(n){Fi(e,t,n)})}function Fi(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Ii(e,t,n)}function Ii(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,E(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Ui(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Li(e,t){arguments.length<2&&(t=e.nodes()[0]),Ri(e,{},1,t)}function Ri(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,E(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=Ri(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function zi(e){return Kn(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Bi(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),ar(x(t.edges(),function(t){return c===Wi(e,e.node(t.v),s)&&c!==Wi(e,e.node(t.w),s)}),function(e){return Z(t,e)})}function Vi(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Li(e),Pi(e,t),Hi(e,t)}function Hi(e,t){var n=Ni(e,Kn(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),E(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Ui(e,t,n){return e.hasEdge(t,n)}function Wi(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Gi(e){switch(e.graph().ranker){case`network-simplex`:Ji(e);break;case`tight-tree`:qi(e);break;case`longest-path`:Ki(e);break;default:Ji(e)}}var Ki=X;function qi(e){X(e),Ti(e)}function Ji(e){$(e)}function Yi(e){var t=J(e,`root`,{},`_root`),n=Zi(e),r=U(w(n))-1,i=2*r+1;e.graph().nestingRoot=t,E(e.edges(),function(t){e.edge(t).minlen*=i});var a=Qi(e)+1;E(e.children(),function(o){Xi(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function Xi(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=si(e,`_bt`),l=si(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,E(s,function(s){Xi(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function Zi(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&E(a,function(e){n(e,i+1)}),t[r]=i}return E(e.children(),function(e){n(e,1)}),t}function Qi(e){return T(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function $i(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,E(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function ea(e,t,n){var r={},i;E(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ta(e,t,n){var r=na(e),i=new O({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return E(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),E(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=D(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function na(e){for(var t;e.hasNode(t=Vr(`_root`)););return t}function ra(e,t){for(var n=0,r=1;r<t.length;++r)n+=ia(e,t[r-1],t[r]);return n}function ia(e,t,n){for(var r=Ur(n,V(n,function(e,t){return t})),i=L(V(t,function(t){return q(V(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=V(Array(o),function(){return 0}),c=0;return E(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function aa(e){var t={},n=x(e.nodes(),function(t){return!e.children(t).length}),r=V(K(U(V(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){$n(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),E(e.successors(n),i))}var a=q(n,function(t){return e.node(t).rank});return E(a,i),r}function oa(e,t){return V(t,function(t){var n=e.inEdges(t);if(n.length){var r=T(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function sa(e,t){var n={};return E(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};D(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),E(t.edges(),function(e){var t=n[e.v],r=n[e.w];!D(t)&&!D(r)&&(r.indegree++,t.out.push(n[e.w]))}),ca(x(n,function(e){return!e.indegree}))}function ca(e){var t=[];function n(e){return function(t){t.merged||(D(t.barycenter)||D(e.barycenter)||t.barycenter>=e.barycenter)&&la(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),E(i.in.reverse(),n(i)),E(i.out,r(i))}return V(x(t,function(e){return!e.merged}),function(e){return G(e,[`vs`,`i`,`barycenter`,`weight`])})}function la(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function ua(e,t){var n=li(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=q(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(fa(!!t)),c=da(a,i,c),E(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=da(a,i,c)});var l={vs:L(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function da(e,t,n){for(var r;t.length&&(r=B(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function fa(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function pa(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=x(i,function(e){return e!==o&&e!==s}));var l=oa(e,i);E(l,function(t){if(e.children(t.v).length){var i=pa(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&ha(t,i)}});var u=sa(l,n);ma(u,c);var d=ua(u,r);if(o&&(d.vs=L([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function ma(e,t){E(e,function(e){e.vs=L(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function ha(e,t){D(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function ga(e){var t=ci(e),n=_a(e,K(1,t+1),`inEdges`),r=_a(e,K(t-1,-1,-1),`outEdges`),i=aa(e);ya(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){va(s%2?n:r,s%4>=2),i=Y(e);var l=ra(e,i);l<a&&(c=0,o=Nn(i),a=l)}ya(e,o)}function _a(e,t,n){return V(t,function(t){return ta(e,t,n)})}function va(e,t){var n=new O;E(e,function(e){var r=e.graph().root,i=pa(e,r,n,t);E(i.vs,function(t,n){e.node(t).order=n}),ea(e,n,i.vs)})}function ya(e,t){E(t,function(t){E(t,function(t,n){e.node(t).order=n})})}function ba(e){var t=Sa(e);E(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=xa(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function xa(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Sa(e){var t={},n=0;function r(i){var a=n;E(e.children(i),r),t[i]={low:a,lim:n++}}return E(e.children(),r),t}function Ca(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=B(r);return E(r,function(t,c){var l=Ta(e,t),u=l?e.node(l).order:o;(l||t===s)&&(E(r.slice(a,c+1),function(t){E(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Ea(n,r,t)})}),a=c+1,i=u)}),r}return T(t,r),n}function wa(e,t){var n={};function r(t,r,i,a,o){var s;E(K(r,i),function(r){s=t[r],e.node(s).dummy&&E(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Ea(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return E(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return T(t,i),n}function Ta(e,t){if(e.node(t).dummy)return Kn(e.predecessors(t),function(t){return e.node(t).dummy})}function Ea(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Da(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Oa(e,t,n,r){var i={},a={},o={};return E(t,function(e){E(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),E(t,function(e){var t=-1;E(e,function(e){var s=r(e);if(s.length){s=q(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Da(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function ka(e,t,n,r,i){var a={},o=Aa(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),E(r,function(e){a[e]=a[n[e]]}),a}function Aa(e,t,n,r){var i=new O,a=e.graph(),o=Fa(a.nodesep,a.edgesep,r);return E(t,function(t){var r;E(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function ja(e,t){return ar(w(t),function(t){var n=-1/0,r=1/0;return Jn(t,function(t,i){var a=Ia(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Ma(e,t){var n=w(t),r=W(n),i=U(n);E([`u`,`d`],function(n){E([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=w(s);c=a===`l`?r-W(l):i-U(l),c&&(e[o]=H(s,function(e){return e+c}))}})})}function Na(e,t){return H(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=q(V(e,r));return(i[1]+i[2])/2})}function Pa(e){var t=Y(e),n=ir(Ca(e,t),wa(e,t)),r={},i;return E([`u`,`d`],function(a){i=a===`u`?t:w(t).reverse(),E([`l`,`r`],function(t){t===`r`&&(i=V(i,function(e){return w(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Oa(e,i,n,o),c=ka(e,i,s.root,s.align,t===`r`);t===`r`&&(c=H(c,function(e){return-e})),r[a+t]=c})}),Ma(r,ja(e,r)),Na(r,e.graph().align)}function Fa(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function Ia(e,t){return e.node(t).width}function La(e){e=ri(e),Ra(e),Yn(Pa(e),function(t,n){e.node(n).x=t})}function Ra(e){var t=Y(e),n=e.graph().ranksep,r=0;E(t,function(t){var i=U(V(t,function(t){return e.node(t).height}));E(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function za(e,t){var n=t&&t.debugTiming?ui:di;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Xa(e));n(` runLayout`,()=>Ba(t,n)),n(` updateInputGraph`,()=>Va(e,t))})}function Ba(e,t){t(` makeSpaceForEdgeLabels`,()=>Za(e)),t(` removeSelfEdges`,()=>oo(e)),t(` acyclic`,()=>$r(e)),t(` nestingGraph.run`,()=>Yi(e)),t(` rank`,()=>Gi(ri(e))),t(` injectEdgeLabelProxies`,()=>Qa(e)),t(` removeEmptyRanks`,()=>oi(e)),t(` nestingGraph.cleanup`,()=>$i(e)),t(` normalizeRanks`,()=>ai(e)),t(` assignRankMinMax`,()=>$a(e)),t(` removeEdgeLabelProxies`,()=>eo(e)),t(` normalize.run`,()=>Si(e)),t(` parentDummyChains`,()=>ba(e)),t(` addBorderSegments`,()=>fi(e)),t(` order`,()=>ga(e)),t(` insertSelfEdges`,()=>so(e)),t(` adjustCoordinateSystem`,()=>mi(e)),t(` position`,()=>La(e)),t(` positionSelfEdges`,()=>co(e)),t(` removeBorderNodes`,()=>ao(e)),t(` normalize.undo`,()=>wi(e)),t(` fixupEdgeLabelCoords`,()=>ro(e)),t(` undoCoordinateSystem`,()=>hi(e)),t(` translateGraph`,()=>to(e)),t(` assignNodeIntersects`,()=>no(e)),t(` reversePoints`,()=>io(e)),t(` acyclic.undo`,()=>ti(e))}function Va(e,t){E(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),E(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Ha=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Ua={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Wa=[`acyclicer`,`ranker`,`rankdir`,`align`],Ga=[`width`,`height`],Ka={width:0,height:0},qa=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Ja={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ya=[`labelpos`];function Xa(e){var t=new O({multigraph:!0,compound:!0}),n=uo(e.graph());return t.setGraph(ir({},Ua,lo(n,Ha),G(n,Wa))),E(e.nodes(),function(n){var r=uo(e.node(n));t.setNode(n,Ln(lo(r,Ga),Ka)),t.setParent(n,e.parent(n))}),E(e.edges(),function(n){var r=uo(e.edge(n));t.setEdge(n,ir({},Ja,lo(r,qa),G(r,Ya)))}),t}function Za(e){var t=e.graph();t.ranksep/=2,E(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Qa(e){E(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);J(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function $a(e){var t=0;E(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=U(t,r.maxRank))}),e.graph().maxRank=t}function eo(e){E(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function to(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}E(e.nodes(),function(t){c(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,E(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),E(e.edges(),function(n){var i=e.edge(n);E(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function no(e){E(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(ii(r,a)),n.points.push(ii(i,o))})}function ro(e){E(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function io(e){E(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function ao(e){E(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(B(n.borderLeft)),o=e.node(B(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),E(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function oo(e){E(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function so(e){var t=Y(e);E(t,function(t){var n=0;E(t,function(t,r){var i=e.node(t);i.order=r+n,E(i.selfEdges,function(t){J(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function co(e){E(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function lo(e,t){return H(G(e,t),Number)}function uo(e){var t={};return E(e,function(e,n){t[n.toLowerCase()]=e}),t}export{za as t};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./mermaid-parser.core-BLSiQUXp.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-CfhDi0bm.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,f as u,v as d,w as f,y as p}from"./chunk-DU6HZSFF-wyqPpFTy.js";import{i as m}from"./chunk-75Z2AOVW-B_bGdfJP.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as g}from"./mermaid.core-BoXUi08V.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v=32,y={axes:[],curves:[],options:_},b=structuredClone(y),x=u.radar,S=t(()=>m({...x,...c().radar}),`getConfig`),C=t(()=>b.axes,`getAxes`),w=t(()=>b.curves,`getCurves`),T=t(()=>b.options,`getOptions`),E=t(e=>{b.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),D=t(e=>{b.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:O(e.entries)}))},`setCurves`),O=t(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=C();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),k={getAxes:C,getCurves:w,getOptions:T,setAxes:E,setCurves:D,setOptions:t(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});b.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule},b.options.ticks>v&&(n.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`),b.options.ticks=v)},`setOptions`),getConfig:S,clear:t(()=>{s(),b=structuredClone(y)},`clear`),setAccTitle:o,getAccTitle:p,setDiagramTitle:a,getDiagramTitle:f,getAccDescription:d,setAccDescription:i},A=t(e=>{h(e,k);let{axes:t,curves:n,options:r}=e;k.setAxes(t),k.setCurves(n),k.setOptions(r)},`populate`),j={parse:t(async t=>{let r=await e(`radar`,t);n.debug(r),A(r)},`parse`)},M=t((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=N(g(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;P(u,a,p,s.ticks,s.graticule),F(u,a,p,c),I(u,a,o,f,d,s.graticule,c),z(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),N=t((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return l(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),P=t((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),F=t((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function I(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=L(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,R(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}t(I,`drawCurves`);function L(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}t(L,`relativeRadius`);function R(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}t(R,`closedRoundCurve`);function z(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}t(z,`drawLegend`);var B={draw:M},V=t((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
|
|
2
|
-
.radarCurve-${r} {
|
|
3
|
-
color: ${i};
|
|
4
|
-
fill: ${i};
|
|
5
|
-
fill-opacity: ${t.curveOpacity};
|
|
6
|
-
stroke: ${i};
|
|
7
|
-
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
-
}
|
|
9
|
-
.radarLegendBox-${r} {
|
|
10
|
-
fill: ${i};
|
|
11
|
-
fill-opacity: ${t.curveOpacity};
|
|
12
|
-
stroke: ${i};
|
|
13
|
-
}
|
|
14
|
-
`}return n},`genIndexStyles`),H=t(e=>{let t=r(),n=c(),i=m(t,n.themeVariables);return{themeVariables:i,radarOptions:m(i.radar,e)}},`buildRadarStyleOptions`),U={parser:j,db:k,renderer:B,styles:t(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=H(e);return`
|
|
15
|
-
.radarTitle {
|
|
16
|
-
font-size: ${t.fontSize};
|
|
17
|
-
color: ${t.titleColor};
|
|
18
|
-
dominant-baseline: hanging;
|
|
19
|
-
text-anchor: middle;
|
|
20
|
-
}
|
|
21
|
-
.radarAxisLine {
|
|
22
|
-
stroke: ${n.axisColor};
|
|
23
|
-
stroke-width: ${n.axisStrokeWidth};
|
|
24
|
-
}
|
|
25
|
-
.radarAxisLabel {
|
|
26
|
-
font-size: ${n.axisLabelFontSize}px;
|
|
27
|
-
color: ${n.axisColor};
|
|
28
|
-
}
|
|
29
|
-
.radarGraticule {
|
|
30
|
-
fill: ${n.graticuleColor};
|
|
31
|
-
fill-opacity: ${n.graticuleOpacity};
|
|
32
|
-
stroke: ${n.graticuleColor};
|
|
33
|
-
stroke-width: ${n.graticuleStrokeWidth};
|
|
34
|
-
}
|
|
35
|
-
.radarLegendText {
|
|
36
|
-
text-anchor: start;
|
|
37
|
-
font-size: ${n.legendFontSize}px;
|
|
38
|
-
dominant-baseline: hanging;
|
|
39
|
-
}
|
|
40
|
-
${V(t,n)}
|
|
41
|
-
`},`styles`)};export{U as diagram};
|