@coopcli/specplan 2026.826.2 → 2026.831.1

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.
Files changed (135) hide show
  1. package/dist/cli/index.js +87 -14
  2. package/dist/client/assets/{abnfDiagram-VRR7QNED-DG21UC5n.js → abnfDiagram-VCTEODGH-CfNYg36y.js} +1 -1
  3. package/dist/client/assets/architecture-7GRP2DOG-ClcyuJeM.js +1 -0
  4. package/dist/client/assets/architectureDiagram-5GKGNRK7-EUaFLg_N.js +36 -0
  5. package/dist/client/assets/blockDiagram-I7D4REHJ-D5aVJWK4.js +129 -0
  6. package/dist/client/assets/c4Diagram-7LVT6UL2-BZXD1Ljd.js +38 -0
  7. package/dist/client/assets/channel-BAs8lRyw.js +1 -0
  8. package/dist/client/assets/chunk-2E4U76K2-Cw3KAY14.js +2 -0
  9. package/dist/client/assets/chunk-4HAMMTFA-e90ut0hg.js +62 -0
  10. package/dist/client/assets/{chunk-ICXQ74PX-Cq2aKGhh.js → chunk-75Z2AOVW-BSJ7TCsD.js} +1 -1
  11. package/dist/client/assets/chunk-CLGD4ZFX-C0R2i_19.js +1 -0
  12. package/dist/client/assets/chunk-DU6HZSFF-B9PGrM0S.js +127 -0
  13. package/dist/client/assets/{chunk-32BRIVSS-DnOQr5Hs.js → chunk-F27PBJKO-DDITEZtq.js} +1 -1
  14. package/dist/client/assets/{chunk-KEIR6QF5-BfrZ3jm6.js → chunk-FOHPRMQF-CyTuVbu3.js} +2 -2
  15. package/dist/client/assets/chunk-GMAD6QVW-CYVpwKkW.js +72 -0
  16. package/dist/client/assets/chunk-GVQU2GXP-BJblveWS.js +1 -0
  17. package/dist/client/assets/{chunk-EX3LRPZG-Bi8XxiOh.js → chunk-IMKFNOWR-DAGJCpt6.js} +2 -2
  18. package/dist/client/assets/{chunk-K2UTITRG-BltRQECA.js → chunk-K2UTITRG-H9sh0oLh.js} +3 -3
  19. package/dist/client/assets/chunk-L3NEJ4N5-DxCFFP_W.js +1 -0
  20. package/dist/client/assets/chunk-LNGE3PJU-DNNNwF8Y.js +34 -0
  21. package/dist/client/assets/chunk-OSK3NFVY-BMSa3Vfd.js +10 -0
  22. package/dist/client/assets/chunk-P2QGCYS3-Bu8IRfP3.js +1 -0
  23. package/dist/client/assets/{chunk-VR4S4FIN-BFByvgIN.js → chunk-POPQ4Y6H-D5kqONCm.js} +1 -1
  24. package/dist/client/assets/{chunk-HOUHSVGY-Bl0rPEPe.js → chunk-PWAF6VOD-Dvb7qjWz.js} +1 -1
  25. package/dist/client/assets/chunk-SHT3W25Y-D2BW6_3D.js +168 -0
  26. package/dist/client/assets/{chunk-MOJQB5TN-JtGqXlt7.js → chunk-SVP7TREG-80pA_2GH.js} +1 -1
  27. package/dist/client/assets/{chunk-V7JOEXUC-DY3oUmK_.js → chunk-TICWLB2K-33YpH19H.js} +1 -1
  28. package/dist/client/assets/chunk-TLUHSLCS-DB6mQIZ1.js +2 -0
  29. package/dist/client/assets/chunk-XXDRQBXY-UjAooa0y.js +1 -0
  30. package/dist/client/assets/classDiagram-ZZMXUADV-Dr70HO4g.js +1 -0
  31. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Dr70HO4g.js +1 -0
  32. package/dist/client/assets/{cose-bilkent-JH36ORCC-BZq8oTdP.js → cose-bilkent-JH36ORCC-Cxpw52Vn.js} +1 -1
  33. package/dist/client/assets/cynefin-OW5HDTMX-DGOAC9pl.js +1 -0
  34. package/dist/client/assets/{cynefinDiagram-TSTJHNR4-CSWGdCZG.js → cynefinDiagram-5FMLGOSQ-BBadT3J7.js} +1 -1
  35. package/dist/client/assets/dagre-BJJUWK_n.js +1 -0
  36. package/dist/client/assets/dagre-GXQ25YYZ-uK9Aj9gR.js +4 -0
  37. package/dist/client/assets/{diagram-OA4YK3LP-B57UNui7.js → diagram-S7CK7UJ4-Bx7un_r7.js} +4 -4
  38. package/dist/client/assets/diagram-UQ7AKVKN-D_FPs5n4.js +41 -0
  39. package/dist/client/assets/{diagram-FQU43EPY-lDfjbNDh.js → diagram-VSXAHHWV-DOlaViPU.js} +1 -1
  40. package/dist/client/assets/{diagram-G47NLZAW-Bqb_3tmg.js → diagram-VX7I27RA-W3tftqeG.js} +1 -1
  41. package/dist/client/assets/{diagram-NH7WQ7WH-BArVFXm1.js → diagram-Z3DM3KII-BlTEnFH3.js} +1 -1
  42. package/dist/client/assets/dist-DIRxRVHE.js +29 -0
  43. package/dist/client/assets/{ebnfDiagram-CCIWWBDH-83eSAR_O.js → ebnfDiagram-PWID7BFC-V5TBUB27.js} +1 -1
  44. package/dist/client/assets/erDiagram-RLTQ6QDP-DfsK-we8.js +99 -0
  45. package/dist/client/assets/eventmodeling-NTZA5JFV-Bm8UblGS.js +1 -0
  46. package/dist/client/assets/flowDiagram-HODETNUW-CDbLbKxh.js +1 -0
  47. package/dist/client/assets/{ganttDiagram-NO4QXBWP-Bgga29Au.js → ganttDiagram-EL5Y4UJY--q244SRn.js} +1 -1
  48. package/dist/client/assets/gitGraph-4MIJSDKK-DnrVWqiy.js +1 -0
  49. package/dist/client/assets/{gitGraphDiagram-IHSO6WYX-Br2TGk_K.js → gitGraphDiagram-WWUBYQGX-VNkA4Uf5.js} +1 -1
  50. package/dist/client/assets/image-GAAHSSAO-CD1o-YMR.js +1 -0
  51. package/dist/client/assets/{index-CJ_b6AjB.js → index-B11N7mVL.js} +2 -2
  52. package/dist/client/assets/info-A6RAGUB7-DHahP2t1.js +1 -0
  53. package/dist/client/assets/{infoDiagram-FWYZ7A6U-DHDrXFI4.js → infoDiagram-27XIBGKW-BqdWJsQl.js} +1 -1
  54. package/dist/client/assets/{ishikawaDiagram-FXEZZL3T-O9cNcghb.js → ishikawaDiagram-5VMMS53U-BQDvfXPM.js} +1 -1
  55. package/dist/client/assets/{journeyDiagram-5HDEW3XC-D-xRZp9P.js → journeyDiagram-3NMN7TZE-CUxgRucN.js} +2 -2
  56. package/dist/client/assets/{kanban-definition-HUTT4EX6-BJaeijjD.js → kanban-definition-UXKFOSKX-NRYyPh3u.js} +4 -4
  57. package/dist/client/assets/{line-BNyITG_F.js → line--mn93uFO.js} +1 -1
  58. package/dist/client/assets/{linear-C8fpJQ9Y.js → linear-nn1qWWVx.js} +1 -1
  59. package/dist/client/assets/{mermaid-parser.core-0GwuEqeW.js → mermaid-parser.core-cJplg8ws.js} +3 -3
  60. package/dist/client/assets/{mindmap-definition-LN4V7U3C-C_xpI67d.js → mindmap-definition-YA3MSWOX-5mxipwqK.js} +1 -1
  61. package/dist/client/assets/packet-AYTQ26CC-D_CzDsxi.js +1 -0
  62. package/dist/client/assets/{pegDiagram-2B236MQR-BgEyEYUz.js → pegDiagram-XKGWAZYB-CZgEH2ik.js} +1 -1
  63. package/dist/client/assets/pie-WAS4IAKB-Bbi2nBDh.js +1 -0
  64. package/dist/client/assets/{pieDiagram-ENE6RG2P-_eb7ATmh.js → pieDiagram-E7YTZNPT-BeIds11Q.js} +1 -1
  65. package/dist/client/assets/{prod-Ba4uM3Ch.js → prod-ebIQ9pCZ.js} +5 -5
  66. package/dist/client/assets/{quadrantDiagram-ABIIQ3AL-BfWuKeAQ.js → quadrantDiagram-AXDQQJYC-CU25DqZi.js} +1 -1
  67. package/dist/client/assets/radar-RG4KPBEZ-D9XlnJuS.js +1 -0
  68. package/dist/client/assets/railroad-74A4TZTK-C8zhynVQ.js +1 -0
  69. package/dist/client/assets/railroad-abnf-HS5TGJTU-BTpzeL6Q.js +1 -0
  70. package/dist/client/assets/railroad-ebnf-LZEXJU2U-CDp0cVj8.js +1 -0
  71. package/dist/client/assets/railroad-peg-WCYAUIDC-COHlAN_m.js +1 -0
  72. package/dist/client/assets/{railroadDiagram-RFXS5EU6-Dc-cMKD7.js → railroadDiagram-O6MQD6OU-B3-CeGkJ.js} +1 -1
  73. package/dist/client/assets/{requirementDiagram-TGXJPOKE-DV1943Gb.js → requirementDiagram-BXWQKSXE-BOtLvnrn.js} +2 -2
  74. package/dist/client/assets/{sankeyDiagram-HTMAVEWB-BLoYtcaW.js → sankeyDiagram-P5KCCOFB-d8cZjl2R.js} +1 -1
  75. package/dist/client/assets/{sequenceDiagram-DBY2YBRQ-B6DaItWI.js → sequenceDiagram-WJ2MYXX4-xPYJuZXx.js} +1 -1
  76. package/dist/client/assets/{src-BhL2Ylf6.js → src-vDqOmCca.js} +1 -1
  77. package/dist/client/assets/{stateDiagram-2N3HPSRC-DPj2INXk.js → stateDiagram-D77RDMKH-CoSi3U2M.js} +1 -1
  78. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-rm3bOnma.js +1 -0
  79. package/dist/client/assets/swimlanes-42K2YHIH-Dfmn2Xue.js +1 -0
  80. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DNMa4iz7.js +8 -0
  81. package/dist/client/assets/{timeline-definition-FHXFAJF6-DGOKXG2b.js → timeline-definition-24CTP7MA-5lxZ3j2p.js} +1 -1
  82. package/dist/client/assets/treeView-Q6P3EWNA-WvBrpL2m.js +1 -0
  83. package/dist/client/assets/treemap-WGGIJYW6-BIRckr4X.js +1 -0
  84. package/dist/client/assets/{vennDiagram-L72KCM5P-C5_1kk6U.js → vennDiagram-4TSXK5OY-BNF-a0iW.js} +1 -1
  85. package/dist/client/assets/wardley-WFR3VGLG-BLEFW6m8.js +1 -0
  86. package/dist/client/assets/{wardleyDiagram-EHGQE667-BEkVslCX.js → wardleyDiagram-VM6X3IG4-X0WeO3Ol.js} +1 -1
  87. package/dist/client/assets/{xychartDiagram-FW5EYKEG-CPIaD3HD.js → xychartDiagram-S5SC5T6Z-zv0t5rP8.js} +3 -3
  88. package/dist/client/index.html +1 -1
  89. package/package.json +1 -1
  90. package/dist/client/assets/architecture-TIHT7OUA-DYAR8PGt.js +0 -1
  91. package/dist/client/assets/architectureDiagram-ZJ3FMSHR-C0V7EMlK.js +0 -36
  92. package/dist/client/assets/blockDiagram-677ZJIJ3-Q-VuK37S.js +0 -132
  93. package/dist/client/assets/c4Diagram-LMCZKHZV-Dhz1hxI-.js +0 -10
  94. package/dist/client/assets/channel-SlrdwMao.js +0 -1
  95. package/dist/client/assets/chunk-52WLFC77-BI8xz4Ng.js +0 -10
  96. package/dist/client/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
  97. package/dist/client/assets/chunk-C7G6YPKG-zsqJHbjz.js +0 -1
  98. package/dist/client/assets/chunk-FWX5IMBZ-BFofqCmB.js +0 -2
  99. package/dist/client/assets/chunk-OGEWGWER-CLzHww9d.js +0 -1
  100. package/dist/client/assets/chunk-PUDLZKDR-C2gIwlIm.js +0 -156
  101. package/dist/client/assets/chunk-Q4XR5HBZ-Dju-tUQs.js +0 -70
  102. package/dist/client/assets/chunk-RYQCIY6F-C1vISHVj.js +0 -1
  103. package/dist/client/assets/chunk-VAUOI2AC-BTR1oUbp.js +0 -1
  104. package/dist/client/assets/chunk-WYO6CB5R-2sVpzpwa.js +0 -127
  105. package/dist/client/assets/chunk-XXDRQBXY-CoR8hY2w.js +0 -1
  106. package/dist/client/assets/chunk-ZGVPDNZ5-CPSkfYQU.js +0 -62
  107. package/dist/client/assets/chunk-ZIRB5QZD-C6fEPe3t.js +0 -32
  108. package/dist/client/assets/classDiagram-OUVF2IWQ-C12ZdCSq.js +0 -1
  109. package/dist/client/assets/classDiagram-v2-EOCWNBFH-C12ZdCSq.js +0 -1
  110. package/dist/client/assets/cynefin-VYW2F7L2-Qefl_a7r.js +0 -1
  111. package/dist/client/assets/dagre-CXRCoUWR.js +0 -1
  112. package/dist/client/assets/dagre-VKFMJZFB-8Lzbq-nm.js +0 -4
  113. package/dist/client/assets/diagram-WEI45ONY-BFLTZHeD.js +0 -41
  114. package/dist/client/assets/dist-BXJAQ5z7.js +0 -29
  115. package/dist/client/assets/erDiagram-Q63AITRT-XJGCrYfA.js +0 -85
  116. package/dist/client/assets/eventmodeling-45OFAUF4-CySgleMT.js +0 -1
  117. package/dist/client/assets/flowDiagram-23GEKE2U-CpHOSlUH.js +0 -1
  118. package/dist/client/assets/gitGraph-TEB2WS4Q-wTeiF0vP.js +0 -1
  119. package/dist/client/assets/image-GAAHSSAO-DddoQEI3.js +0 -1
  120. package/dist/client/assets/info-DKCQHKI2-CLYkJTfv.js +0 -1
  121. package/dist/client/assets/map-DsCK-0Cs.js +0 -1
  122. package/dist/client/assets/packet-7NZHBO7P-oaZIsx8j.js +0 -1
  123. package/dist/client/assets/pie-RZYD4A2V-Dc3Fwoex.js +0 -1
  124. package/dist/client/assets/radar-I7S5WNFK-CB0kWg3t.js +0 -1
  125. package/dist/client/assets/railroad-3IZDKUUU-amr7bLB-.js +0 -1
  126. package/dist/client/assets/railroad-abnf-AHOZXSZD-BjM-VtEb.js +0 -1
  127. package/dist/client/assets/railroad-ebnf-EBAXGLYW-CywxI5pS.js +0 -1
  128. package/dist/client/assets/railroad-peg-LSFZ7HO6-C7lj-TYo.js +0 -1
  129. package/dist/client/assets/stateDiagram-v2-6OUMAXLB-_0YmrsU4.js +0 -1
  130. package/dist/client/assets/swimlanes-5IMT3BWC-BeEj60g4.js +0 -2
  131. package/dist/client/assets/swimlanesDiagram-G3AALYLV-B-KepWf4.js +0 -8
  132. package/dist/client/assets/treeView-QDETBFTQ-DTEVOLrT.js +0 -1
  133. package/dist/client/assets/treemap-6X3UGDF4-JYJwO9Vr.js +0 -1
  134. package/dist/client/assets/wardley-OPB4EBWU-B7P-bikf.js +0 -1
  135. /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
@@ -1 +0,0 @@
1
- import{p as e}from"./index-CJ_b6AjB.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-BhL2Ylf6.js";var n=t((t,n)=>{let r;return n===`sandbox`&&(r=e(`#i`+t)),e(n===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${t}"]`)},`getDiagramElement`);export{n as t};
@@ -1,62 +0,0 @@
1
- import{p as e}from"./index-CJ_b6AjB.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as n}from"./src-BhL2Ylf6.js";import{A as r,B as i,M as a,T as o,b as s,g as c,x as l,z as u}from"./chunk-WYO6CB5R-2sVpzpwa.js";import{a as d,r as f,u as p}from"./chunk-ICXQ74PX-Cq2aKGhh.js";import{a as m,i as h,r as g,t as _}from"./chunk-C7G6YPKG-zsqJHbjz.js";import{n as v,t as y}from"./chunk-OGEWGWER-CLzHww9d.js";import{t as b}from"./chunk-HOUHSVGY-Bl0rPEPe.js";import{n as x}from"./chunk-Q4XR5HBZ-Dju-tUQs.js";import{t as S}from"./rough.esm-CSKSodPl.js";var C=t(async(t,n,r)=>{let i,a=n.useHtmlLabels||c(l()?.htmlLabels);i=r||`node default`;let o=t.insert(`g`).attr(`class`,i).attr(`id`,n.domId||n.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,p(n.labelStyle)),f;f=n.label===void 0?``:typeof n.label==`string`?n.label:n.label[0];let m=!!n.icon||!!n.img,h=n.labelType===`markdown`,g=await x(s,u(d(f),l()),{useHtmlLabels:a,width:n.width||l().flowchart?.wrappingWidth,classes:h?`markdown-node-label`:``,style:n.labelStyle,addSvgBackground:m,markdown:h},l()),_=g.getBBox(),v=(n?.padding??0)/2;if(a){let t=g.children[0],n=e(g);await y(t,f),_=t.getBoundingClientRect(),n.attr(`width`,_.width),n.attr(`height`,_.height)}return a?s.attr(`transform`,`translate(`+-_.width/2+`, `+-_.height/2+`)`):s.attr(`transform`,`translate(0, `+-_.height/2+`)`),n.centerLabel&&s.attr(`transform`,`translate(`+-_.width/2+`, `+-_.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:_,halfPadding:v,label:s}},`labelHelper`),w=t(async(t,n,r)=>{let i=r.useHtmlLabels??o(l()),a=t.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await x(a,u(d(n),l()),{useHtmlLabels:i,width:r.width||l()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=s.getBBox(),f=r.padding/2;if(o(l())){let t=s.children[0],n=e(s);c=t.getBoundingClientRect(),n.attr(`width`,c.width),n.attr(`height`,c.height)}return i?a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`):a.attr(`transform`,`translate(0, `+-c.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:t,bbox:c,halfPadding:f,label:a}},`insertLabel`),T=t((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),E=t((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function D(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}t(D,`createPathFromPoints`);function O(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}t(O,`generateFullSineWavePoints`);function k(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(k,`generateCirclePoints`);function A(e){let n=Array.from(e.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=t((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}t(A,`mergePaths`);var j=t((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,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),M=t(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=l(),c=o(s);return await x(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`),N=t((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),P=t(async(t,r)=>{let i=l(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:u}=a,d=u,{labelStyles:f,nodeStyles:p,borderStyles:g,backgroundStyles:_}=h(r),v=t.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look),y=c(i.flowchart.htmlLabels),b=r.direction===`LR`,C=v.insert(`g`).attr(`class`,`cluster-label swimlane-label`),w=await x(C,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),T=w.getBBox();if(y){let t=w.children[0],n=e(w);T=t.getBoundingClientRect(),n.attr(`width`,T.width),n.attr(`height`,T.height)}let E=r.padding??0,D=r.width<=T.width+E?T.width+E:r.width;r.width<=T.width+E?r.diff=(D-r.width)/2-E:r.diff=-E;let O=r.height,k=r.y-O/2,A=r.y+O/2,M=r.x-D/2,N=r.swimlaneContentTop===void 0?k+O/3:r.swimlaneContentTop,P=b?4:0,F=T.height+2*P,I,L;if(b){let e=Math.max(F,T.height+2*P),t=M+e,n=Math.max(0,D-e);if(r.look===`handDrawn`){let i=S.svg(v),a=m(r,{roughness:.7,fill:s,stroke:d,fillWeight:3,seed:o}),c=m(r,{roughness:.7,fill:`none`,stroke:d,seed:o}),l=i.rectangle(M,k,e,O,a);I=v.insert(()=>l,`:first-child`);let u=i.rectangle(t,k,n,O,c);L=v.insert(()=>u,`:first-child`),I.select(`path:nth-child(2)`).attr(`style`,g.join(`;`)),I.select(`path`).attr(`style`,_.join(`;`).replace(`fill`,`stroke`))}else I=v.insert(`rect`,`:first-child`),L=v.insert(`rect`,`:first-child`),I.attr(`class`,`swimlane-title`).attr(`style`,p).attr(`x`,M).attr(`y`,k).attr(`width`,e).attr(`height`,O).attr(`fill`,s).attr(`stroke`,d),L.attr(`class`,`swimlane-body`).attr(`style`,p).attr(`x`,t).attr(`y`,k).attr(`width`,n).attr(`height`,O).attr(`fill`,`none`).attr(`stroke`,d);let i=M+e/2,a=r.y;C.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-T.width/2}, ${-T.height/2})`)}else{let e=Math.max(0,N-k),t=Math.min(F,e),n=k+t,i=Math.max(0,A-n),a=r.x-D/2;if(r.look===`handDrawn`){let e=S.svg(v),c=m(r,{roughness:.7,fill:s,stroke:d,fillWeight:3,seed:o}),l=m(r,{roughness:.7,fill:`none`,stroke:d,seed:o}),u=e.rectangle(a,k,D,t,c);I=v.insert(()=>u,`:first-child`);let f=e.rectangle(a,n,D,i,l);L=v.insert(()=>f,`:first-child`),I.select(`path:nth-child(2)`).attr(`style`,g.join(`;`)),I.select(`path`).attr(`style`,_.join(`;`).replace(`fill`,`stroke`))}else I=v.insert(`rect`,`:first-child`),L=v.insert(`rect`,`:first-child`),I.attr(`class`,`swimlane-title`).attr(`style`,p).attr(`x`,a).attr(`y`,k).attr(`width`,D).attr(`height`,t).attr(`fill`,s).attr(`stroke`,d),L.attr(`class`,`swimlane-body`).attr(`style`,p).attr(`x`,a).attr(`y`,n).attr(`width`,D).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,d);let c=r.x-T.width/2,l=k+(t-T.height)/2;C.attr(`transform`,`translate(${c}, ${l})`)}if(n.trace(`Swimlane data `,r,JSON.stringify(r)),f){let e=C.select(`span`);e&&e.attr(`style`,f)}return r.offsetX=0,r.width=D,r.height=O,r.offsetY=T.height-E/2,r.intersect=function(e){return j(r,e)},{cluster:v,labelBBox:T}},`swimlane`),F=t(async(t,r)=>{n.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:g}=h(r),_=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=o(i),b=_.insert(`g`).attr(`class`,`cluster-label `),C;C=r.labelType===`markdown`?await x(b,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}):await M(b,r.label,r.labelStyle||``,!1,!0);let w=C.getBBox();if(o(i)){let t=C.children[0],n=e(C);w=t.getBoundingClientRect(),n.attr(`width`,w.width),n.attr(`height`,w.height)}let T=r.width<=w.width+r.padding?w.width+r.padding:r.width;r.width<=w.width+r.padding?r.diff=(T-r.width)/2-r.padding:r.diff=-r.padding;let E=r.height,D=r.x-T/2,O=r.y-E/2;n.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),t=m(r,{roughness:.7,fill:c,stroke:u,fillWeight:3,seed:s}),i=e.path(N(D,O,T,E,0),t);k=_.insert(()=>(n.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,g.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=v(i);if(b.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let P=k.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`rect`),I={rect:F,squareRect:F,roundedWithTitle:t(async(t,n)=>{let r=l(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:s,compositeBackground:c,compositeTitleBackground:u,nodeBorder:d}=i,f=t.insert(`g`).attr(`class`,n.cssClasses).attr(`id`,n.domId).attr(`data-id`,n.id).attr(`data-look`,n.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=await M(m,n.label,n.labelStyle,void 0,!0),_=g.getBBox();if(o(r)){let t=g.children[0],n=e(g);_=t.getBoundingClientRect(),n.attr(`width`,_.width),n.attr(`height`,_.height)}let v=0*n.padding,y=v/2,b=(n.width<=_.width+n.padding?_.width+n.padding:n.width)+v;n.width<=_.width+n.padding?n.diff=(b-n.width)/2-n.padding:n.diff=-n.padding;let x=n.height+v,C=n.height+v-_.height-6,w=n.x-b/2,T=n.y-x/2;n.width=b;let E=n.y-n.height/2-y+_.height+2,D;if(n.look===`handDrawn`){let e=n.cssClasses.includes(`statediagram-cluster-alt`),t=S.svg(f),r=n.rx||n.ry?t.path(N(w,T,b,x,10),{roughness:.7,fill:u,fillStyle:`solid`,stroke:d,seed:a}):t.rectangle(w,T,b,x,{seed:a});D=f.insert(()=>r,`:first-child`);let i=t.rectangle(w,E,b,C,{fill:e?s:c,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});D=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else D=p.insert(`rect`,`:first-child`),D.attr(`class`,`outer`).attr(`x`,w).attr(`y`,T).attr(`width`,b).attr(`height`,x).attr(`data-look`,n.look),h.attr(`class`,`inner`).attr(`x`,w).attr(`y`,E).attr(`width`,b).attr(`height`,C);return m.attr(`transform`,`translate(${n.x-_.width/2}, ${T+1-(o(r)?0:3)})`),n.height=D.node().getBBox().height,n.offsetX=0,n.offsetY=_.height-n.padding/2,n.labelBBox=_,n.intersect=function(e){return j(n,e)},{cluster:f,labelBBox:_}},`roundedWithTitle`),noteGroup:t((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return j(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:t((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=l(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,c=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-c/2,f=t.y-u/2;t.width=c;let p;if(t.look===`handDrawn`){let e=S.svg(a).rectangle(d,f,c,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,d).attr(`y`,f).attr(`width`,c).attr(`height`,u).attr(`data-look`,t.look)}return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return j(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:t(async(t,r)=>{n.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:g}=h(r),_=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=o(i),b=_.insert(`g`).attr(`class`,`cluster-label `),C=await x(b,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),w=C.getBBox();if(o(i)){let t=C.children[0],n=e(C);w=t.getBoundingClientRect(),n.attr(`width`,w.width),n.attr(`height`,w.height)}let T=r.width<=w.width+r.padding?w.width+r.padding:r.width;r.width<=w.width+r.padding?r.diff=(T-r.width)/2-r.padding:r.diff=-r.padding;let E=r.height,D=r.x-T/2,O=r.y-E/2;n.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),t=m(r,{roughness:.7,fill:c,stroke:u,fillWeight:4,seed:s}),i=e.path(N(D,O,T,E,r.rx),t);k=_.insert(()=>(n.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,g.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=v(i);if(b.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let M=k.node().getBBox();return r.offsetX=0,r.width=M.width,r.height=M.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`kanbanSection`),swimlane:P},L=new Map,ee=t(async(e,t)=>{let n=await I[t.shape||`rect`](e,t);return L.set(t.id,n),n},`insertCluster`),R=t(()=>{L=new Map},`clear`);function z(e,t){return e.intersect(t)}t(z,`intersectNode`);var te=z;function B(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}t(B,`intersectEllipse`);var V=B;function H(e,t,n){return V(e,t,t,n)}t(H,`intersectCircle`);var U=H;function ne(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&re(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&re(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}t(ne,`intersectLine`);function re(e,t){return e*t>0}t(re,`sameSign`);var ie=ne;function W(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ie(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}t(W,`intersectPolygon`);var G={node:te,circle:U,ellipse:V,polygon:W,rect:j};function K(e,t){let{labelStyles:r}=h(t);t.labelStyle=r;let i=E(t),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,t.domId||t.id),{cssStyles:s}=t,c=S.svg(o),l=m(t,{fill:`black`,stroke:`none`,fillStyle:`solid`});t.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,p(s)),T(t,d),t.intersect=function(e){return n.info(`Circle intersect`,t,1,e),G.circle(t,1,e)},o}t(K,`anchor`);function ae(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}t(ae,`generateArcPoints`);function oe(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}t(oe,`calculateArcSagitta`);async function se(e,n){let{labelStyles:r,nodeStyles:i}=h(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=t(e=>e+s,`calcTotalHeight`),l=t(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await C(e,n,E(n)),f=c(n?.height?n?.height:d.height),[p,g]=l(f),_=oe(f,p,g),v=(n?.width?n?.width:d.width)+o*2+_-_,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...ae(-v/2,-y/2,-v/2,y/2,p,g,!1),{x:v/2,y:y/2},...ae(v/2,y/2,v/2,-y/2,p,g,!0)],w=S.svg(u),O=m(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`);let k=D(x),A=w.path(k,O),j=u.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,i),j.attr(`transform`,`translate(${p/2}, 0)`),T(n,j),n.intersect=function(e){return G.polygon(n,x,e)},u}t(se,`bowTieRect`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}t(q,`insertPolygonShape`);var ce=12;async function le(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+ce),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+ce,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+ce},{x:0+ce,y:f}],g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(p),i=e.path(r,n);g=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),_&&g.attr(`style`,_)}else g=q(s,l,u,p);return r&&g.attr(`style`,r),T(t,g),t.intersect=function(e){return G.polygon(t,p,e)},s}t(le,`card`);function ue(e,t){let{nodeStyles:n}=h(t);t.label=``;let r=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=S.svg(r),c=m(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=D(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return G.polygon(t,o,e)},r}t(ue,`choice`);async function de(e,t,r){let{labelStyles:i,nodeStyles:a}=h(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await C(e,t,E(t)),l=r?.padding??c,u=t.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=S.svg(o),n=m(t,{}),r=e.circle(0,0,u*2,n);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return T(t,d),t.calcIntersect=function(e,t){let n=e.width/2;return G.circle(e,n,t)},t.intersect=function(e){return n.info(`Circle intersect`,t,u,e),G.circle(t,u,e)},o}t(de,`circle`);function fe(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
2
- M ${i.x},${i.y} L ${o.x},${o.y}`}t(fe,`createLine`);function pe(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r,t.label=``;let a=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:s}=t,c=S.svg(a),l=m(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=fe(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),T(t,p),t.intersect=function(e){return n.info(`crossedCircle intersect`,t,{radius:o,point:e}),G.circle(t,o,e)},a}t(pe,`crossedCircle`);function J(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(J,`generateCirclePoints`);async function me(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],g=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],_=S.svg(i),v=m(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=_.path(y,v),x=D(g),w=_.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return G.polygon(t,g,e)},i}t(me,`curlyBraceLeft`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}t(Y,`generateCirclePoints`);async function he(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],g=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],_=S.svg(i),v=m(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=_.path(y,v),x=D(g),w=_.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return G.polygon(t,g,e)},i}t(he,`curlyBraceRight`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(X,`generateCirclePoints`);async function ge(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],g=[...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],_=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],v=S.svg(i),y=m(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=D(p).replace(`Z`,``),x=v.path(b,y),w=D(g).replace(`Z`,``),O=v.path(w,y),k=D(_),A=v.path(k,{...y}),j=i.insert(`g`,`:first-child`);return j.insert(()=>A,`:first-child`).attr(`stroke-opacity`,0),j.insert(()=>x,`:first-child`),j.insert(()=>O,`:first-child`),j.attr(`class`,`text`),f&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,j),t.intersect=function(e){return G.polygon(t,_,e)},i}t(ge,`curlyBraces`);async function _e(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=S.svg(s),g=m(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=l,v=u,y=_-d,b=v/4,x=[{x:y,y:0},{x:b,y:0},{x:0,y:v/2},{x:b,y:v},{x:y,y:v},...k(-y,-v/2,d,50,270,90)],w=D(x),O=p.path(w,g),A=s.insert(()=>O,`:first-child`);return A.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,r),A.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,A),t.intersect=function(e){return G.polygon(t,x,e)},s}t(_e,`curvedTrapezoid`);var ve=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),ye=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),be=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),xe=8,Se=8;async function Ce(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-o,t.width<Se&&(t.width=Se);let n=e/2/(2.5+e/50);t.height=(t.height??0)-a-n*3,t.height<xe&&(t.height=xe)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t.width?t.width:c.width)+o,d=u/2,f=d/(2.5+u/50),g=(t.height?t.height:c.height)+a+f,_,{cssStyles:v}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=ye(0,0,u,g,d,f),r=be(0,f,u,g,d,f),i=m(t,{}),a=e.path(n,i),o=e.path(r,m(t,{fill:`none`}));_=s.insert(()=>o,`:first-child`),_=s.insert(()=>a,`:first-child`),_.attr(`class`,`basic label-container`),v&&_.attr(`style`,v)}else{let e=ve(0,0,u,g,d,f);_=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(v)).attr(`style`,r)}return _.attr(`label-offset-y`,f),_.attr(`transform`,`translate(${-u/2}, ${-(g/2+f)})`),T(t,_),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(e){let n=G.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}t(Ce,`cylinder`);async function we(e,t,n){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await C(e,t,E(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:g}=t,{cssStyles:_}=t;if(n?.rx&&n.ry&&(f=n.rx,g=n.ry),t.look===`handDrawn`){let e=S.svg(a),n=m(t,{}),r=f||g?e.path(N(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(_))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,p(f)).attr(`ry`,p(g)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return T(t,d),t.calcIntersect=function(e,t){return G.rect(e,t)},t.intersect=function(e){return G.rect(t,e)},a}t(we,`drawRect`);async function Te(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await we(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=S.svg(c),n=m(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}t(Te,`datastore`);async function Ee(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:g}=t,_=S.svg(o),v=m(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=_.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),T(t,x),t.intersect=function(e){return G.rect(t,e)},o}t(Ee,`dividedRectangle`);async function De(e,t){let{labelStyles:r,nodeStyles:i}=h(t),a=t.look===`neo`?12:5;t.labelStyle=r;let o=t.padding??0,s=t.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.width?t?.width/2:l.width/2)+(s??0),d=u-a,f,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=m(t,{roughness:.2,strokeWidth:2.5}),r=m(t,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,n),a=e.circle(0,0,d*2,r);f=c.insert(`g`,`:first-child`),f.attr(`class`,p(t.cssClasses)).attr(`style`,p(g)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=c.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return T(t,f),t.intersect=function(e){return n.info(`DoubleCircle intersect`,t,u,e),G.circle(t,u,e)},c}t(De,`doublecircle`);function Oe(e,t,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=h(t);t.label=``,t.labelStyle=i;let o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=S.svg(o),{nodeBorder:l}=r,u=m(t,{fillStyle:`solid`});t.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),T(t,f),t.intersect=function(e){return n.info(`filledCircle intersect`,t,{radius:7,point:e}),G.circle(t,7,e)},o}t(Oe,`filledCircle`);var ke=10,Ae=10;async function je(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let a=t.padding??0,o=t.look===`neo`?a*2:a;(t.width||t.height)&&(t.height=t?.height??0,t.height<ke&&(t.height=ke),t.width=(t?.width??0)-o-o/2,t.width<Ae&&(t.width=Ae));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+(o??0),d=t?.height?t?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:g}=t,_=S.svg(s),v=m(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p),b=_.path(y,v),x=s.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return g&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,g),i&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),t.width=u,t.height=d,T(t,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(t.padding??0)/2+(c.y-(c.top??0))})`),t.intersect=function(e){return n.info(`Triangle intersect`,t,p,e),G.polygon(t,p,e)},s}t(je,`flippedTriangle`);function Me(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=h(t);t.label=``;let o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=S.svg(o),p=m(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let g=f.rectangle(u,d,c,l,p),_=o.insert(()=>g,`:first-child`);s&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,a),T(t,_);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return G.rect(t,e)},o}t(Me,`forkJoin`);async function Ne(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let a=t.look===`neo`?16:t.padding??0,o=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10),t.width=(t?.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:Math.max(15,c.width))+a*2,u=(t?.height?t?.height:Math.max(10,c.height))+o*2,d=u/2,{cssStyles:f}=t,p=S.svg(s),g=m(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...k(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],v=D(_),y=p.path(v,g),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),i&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,i),T(t,b),t.intersect=function(e){return n.info(`Pill intersect`,t,{radius:d,point:e}),G.polygon(t,_,e)},s}t(Ne,`halfRoundedRectangle`);var Pe=t((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=h(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=m(t,{}),r=Pe(0,0,f,u,d),i=e.path(r,n);g=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),_&&g.attr(`style`,_)}else g=q(c,f,u,p);return r&&g.attr(`style`,r),t.width=f,t.height=u,T(t,g),t.intersect=function(e){return G.polygon(t,p,e)},c}t(Fe,`hexagon`);async function Ie(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.label=``,t.labelStyle=r;let{shapeSvg:a}=await C(e,t,E(t)),o=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:c}=t,l=S.svg(a),u=m(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=D(d),p=l.path(f,u),g=a.insert(()=>p,`:first-child`);return g.attr(`class`,`basic label-container outer-path`),c&&t.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,c),i&&t.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,i),g.attr(`transform`,`translate(${-o/2}, ${-s/2})`),T(t,g),t.intersect=function(e){return n.info(`Pill intersect`,t,{points:d}),G.polygon(t,d,e)},a}t(Ie,`hourglass`);async function Le(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(e,t,`icon-shape default`),p=t.pos===`t`,g=c,v=c,{nodeBorder:y}=r,{stylesMap:x}=_(t),w=-v/2,E=-g/2,D=t.label?8:0,O=S.svg(u),k=m(t,{stroke:`none`,fill:`none`});t.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`);let A=O.rectangle(w,E,v,g,k),j=Math.max(v,d.width),M=g+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),P=u.insert(()=>A,`:first-child`),F=u.insert(()=>N);if(t.icon){let e=u.append(`g`);e.html(`<g>${await b(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${x.get(`stroke`)??y};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-M/2:M/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+D/2:-d.height/2-D/2})`),T(t,F),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return G.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+g},{x:r+d.width/2,y:i-a/2+g},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+g},{x:r-v/2,y:i-a/2+g}],G.polygon(t,o,e)},u}t(Le,`icon`);async function Re(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(e,t,`icon-shape default`),p=t.label?8:0,g=t.pos===`t`,{nodeBorder:v,mainBkg:y}=r,{stylesMap:x}=_(t),w=S.svg(u),E=m(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`),E.stroke=x.get(`fill`)??y;let D=u.append(`g`);t.icon&&D.html(`<g>${await b(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let O=D.node().getBBox(),k=O.width,A=O.height,j=O.x,M=O.y,N=Math.max(k,A)*Math.SQRT2+40,P=w.circle(0,0,N,E),F=Math.max(N,d.width),I=N+d.height+p,L=w.rectangle(-F/2,-I/2,F,I,{...E,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>P,`:first-child`),R=u.insert(()=>L);return D.attr(`transform`,`translate(${-k/2-j},${g?d.height/2+p/2-A/2-M:-d.height/2-p/2-A/2-M})`),D.attr(`style`,`color: ${x.get(`stroke`)??v};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${g?-I/2:I/2-d.height})`),ee.attr(`transform`,`translate(0,${g?d.height/2+p/2:-d.height/2-p/2})`),T(t,R),t.intersect=function(e){return n.info(`iconSquare intersect`,t,e),G.rect(t,e)},u}t(Re,`iconCircle`);async function ze(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(e,t,`icon-shape default`),g=t.pos===`t`,v=c+f*2,y=c+f*2,{nodeBorder:x,mainBkg:w}=r,{stylesMap:E}=_(t),D=-y/2,O=-v/2,k=t.label?8:0,A=S.svg(u),j=m(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,y,v,5),j),P=Math.max(y,d.width),F=v+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),L=u.insert(()=>M,`:first-child`).attr(`class`,`icon-shape2`),ee=u.insert(()=>I);if(t.icon){let e=u.append(`g`);e.html(`<g>${await b(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${g?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??x};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${g?-F/2:F/2-d.height})`),L.attr(`transform`,`translate(0,${g?d.height/2+k/2:-d.height/2-k/2})`),T(t,ee),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return G.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=g?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+k},{x:r+y/2,y:i-a/2+d.height+k},{x:r+y/2,y:i+a/2},{x:r-y/2,y:i+a/2},{x:r-y/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-y/2,y:i-a/2},{x:r+y/2,y:i-a/2},{x:r+y/2,y:i-a/2+v},{x:r+d.width/2,y:i-a/2+v},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+v},{x:r-y/2,y:i-a/2+v}],G.polygon(t,o,e)},u}t(ze,`iconRounded`);async function Be(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(e,t,`icon-shape default`),g=t.pos===`t`,v=c+f*2,y=c+f*2,{nodeBorder:x,mainBkg:w}=r,{stylesMap:E}=_(t),D=-y/2,O=-v/2,k=t.label?8:0,A=S.svg(u),j=m(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,y,v,.1),j),P=Math.max(y,d.width),F=v+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),L=u.insert(()=>M,`:first-child`),ee=u.insert(()=>I);if(t.icon){let e=u.append(`g`);e.html(`<g>${await b(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${g?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??x};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${g?-F/2:F/2-d.height})`),L.attr(`transform`,`translate(0,${g?d.height/2+k/2:-d.height/2-k/2})`),T(t,ee),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return G.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=g?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+k},{x:r+y/2,y:i-a/2+d.height+k},{x:r+y/2,y:i+a/2},{x:r-y/2,y:i+a/2},{x:r-y/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-y/2,y:i-a/2},{x:r+y/2,y:i-a/2},{x:r+y/2,y:i-a/2+v},{x:r+d.width/2,y:i-a/2+v},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+v},{x:r-y/2,y:i-a/2+v}],G.polygon(t,o,e)},u}t(Be,`iconSquare`);async function Ve(e,t,{config:{flowchart:r}}){let i=new Image;i.src=t?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));t.imageAspectRatio=a/o;let{labelStyles:s}=h(t);t.labelStyle=s;let c=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let l=Math.max(t.label?c??0:0,t?.assetWidth??a),u=t.constraint===`on`&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,d=t.constraint===`on`?u/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:g}=await C(e,t,`image-shape default`),_=t.pos===`t`,v=-u/2,y=-d/2,b=t.label?8:0,x=S.svg(f),w=m(t,{});t.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let E=x.rectangle(v,y,u,d,w),D=Math.max(u,p.width),O=d+p.height+b,k=x.rectangle(-D/2,-O/2,D,O,{...w,fill:`none`,stroke:`none`}),A=f.insert(()=>E,`:first-child`),j=f.insert(()=>k);if(t.img){let e=f.append(`image`);e.attr(`href`,t.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${_?O/2-d:-O/2})`)}return g.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${_?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),A.attr(`transform`,`translate(0,${_?p.height/2+b/2:-p.height/2-b/2})`),T(t,j),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return G.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=_?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],G.polygon(t,o,e)},f}t(Ve,`imageSquare`);async function He(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(c.width+(o??0)*2,t?.width??0),u=Math.max(c.height+(a??0)*2,t?.height??0),d=[{x:0,y:0},{x:l,y:0},{x:l+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),p&&f.attr(`style`,p)}else f=q(s,l,u,d);return r&&f.attr(`style`,r),t.width=l,t.height=u,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}t(He,`inv_trapezoid`);async function Ue(e,t){let{shapeSvg:n,bbox:r,label:i}=await C(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),T(t,a),t.intersect=function(e){return G.rect(t,e)},n}t(Ue,`labelRect`);async function We(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}t(We,`lean_left`);async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}t(Ge,`lean_right`);function Ke(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.label=``,t.labelStyle=r;let a=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:o}=t,s=Math.max(35,t?.width??0),c=Math.max(35,t?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=S.svg(a),d=m(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=D(l),p=u.path(f,d),g=a.insert(()=>p,`:first-child`);return g.attr(`class`,`outer-path`),o&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,o),i&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,i),g.attr(`transform`,`translate(-${s/2},${-c})`),T(t,g),t.intersect=function(e){return n.info(`lightningBolt intersect`,t,e),G.polygon(t,l,e)},a}t(Ke,`lightningBolt`);var qe=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),Je=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),Ye=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Xe=10,Ze=10;async function Qe(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<Ze&&(t.width=Ze);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<Xe&&(t.height=Xe)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),g=(t?.height?t?.height:c.height)+f+o*2,_=g*.1,v,{cssStyles:y}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=Je(0,0,u,g,d,f,_),r=Ye(0,f,u,g,d,f),i=m(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),v=s.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=qe(0,0,u,g,d,f,_);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(y)).attr(`style`,r)}return v.attr(`label-offset-y`,f),v.attr(`transform`,`translate(${-u/2}, ${-(g/2+f)})`),T(t,v),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=G.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}t(Qe,`linedCylinder`);async function $e(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:g}=t,_=S.svg(s),v=m(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...O(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=_.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),T(t,x),t.intersect=function(e){return G.polygon(t,y,e)},s}t($e,`linedWaveEdgedRect`);async function et(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,g=f-2*s,_=-p/2,v=-g/2,{cssStyles:y}=t,b=S.svg(c),x=m(t,{}),w=[{x:_-s,y:v+s},{x:_-s,y:v+g+s},{x:_+p-s,y:v+g+s},{x:_+p-s,y:v+g},{x:_+p,y:v+g},{x:_+p,y:v+g-s},{x:_+p+s,y:v+g-s},{x:_+p+s,y:v-s},{x:_+s,y:v-s},{x:_+s,y:v},{x:_,y:v},{x:_,y:v+s}],O=[{x:_,y:v+s},{x:_+p-s,y:v+s},{x:_+p-s,y:v+g},{x:_+p,y:v+g},{x:_+p,y:v},{x:_,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let k=D(w),j=b.path(k,x),M=D(O),N=b.path(M,x);t.look!==`handDrawn`&&(j=A(j),N=A(N));let P=c.insert(`g`,`:first-child`);return P.insert(()=>j),P.insert(()=>N),P.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),T(t,P),t.intersect=function(e){return G.polygon(t,w,e)},c}t(et,`multiRect`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,g=f+(u?p/2:-p/2),_=-d/2,v=-g/2,{cssStyles:y}=t,b=O(_-10,v+g+10,_+d-10,v+g+10,p,.8),x=b?.[b.length-1],w=[{x:_-10,y:v+10},{x:_-10,y:v+g+10},...b,{x:_+d-10,y:x.y-10},{x:_+d,y:x.y-10},{x:_+d,y:x.y-20},{x:_+d+10,y:x.y-20},{x:_+d+10,y:v-10},{x:_+10,y:v-10},{x:_+10,y:v},{x:_,y:v},{x:_,y:v+10}],k=[{x:_,y:v+10},{x:_+d-10,y:v+10},{x:_+d-10,y:x.y-10},{x:_+d,y:x.y-10},{x:_+d,y:v},{x:_,y:v}],A=S.svg(i),j=m(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let M=D(w),N=A.path(M,j),P=D(k),F=A.path(P,j),I=i.insert(()=>N,`:first-child`);return I.insert(()=>F),I.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,r),I.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),T(t,I),t.intersect=function(e){return G.polygon(t,w,e)},i}t(tt,`multiWaveEdgedRectangle`);async function nt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await C(e,t,E(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:g}=t,_=S.svg(a),v=m(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=_.rectangle(f,p,u,d,v),b=a.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),g&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,g),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,b),t.intersect=function(e){return G.rect(t,e)},a}t(nt,`note`);var rt=t((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function it(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=S.svg(i),n=m(t,{}),r=rt(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),T(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=G.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}t(it,`question`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width??c.width)+(t.look===`neo`?a*2:a),d=(t?.height??c.height)+(t.look===`neo`?o*2:o),f=-u/2,p=-d/2,g=p/2,_=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:v}=t,y=S.svg(s),b=m(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=D(_),w=y.path(x,b),O=s.insert(()=>w,`:first-child`);return O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-g/2},0)`),l.attr(`transform`,`translate(${-g/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,O),t.intersect=function(e){return G.polygon(t,_,e)},s}t(at,`rect_left_inv_arrow`);async function ot(t,r){let{labelStyles:i,nodeStyles:a}=h(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=t.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),u=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,g=await M(d,p,r.labelStyle,!0,!0),_={width:0,height:0};if(o(l())){let t=g.children[0],n=e(g);_=t.getBoundingClientRect(),n.attr(`width`,_.width),n.attr(`height`,_.height)}n.info(`Text 2`,f);let v=f||[],y=g.getBBox(),b=await M(d,Array.isArray(v)?v.join(`<br/>`):v,r.labelStyle,!0,!0),x=b.children[0],C=e(b);_=x.getBoundingClientRect(),C.attr(`width`,_.width),C.attr(`height`,_.height);let w=(r.padding||0)/2;e(b).attr(`transform`,`translate( `+(_.width>y.width?0:(y.width-_.width)/2)+`, `+(y.height+w+5)+`)`),e(g).attr(`transform`,`translate( `+(_.width<y.width?0:-(y.width-_.width)/2)+`, 0)`),_=d.node().getBBox(),d.attr(`transform`,`translate(`+-_.width/2+`, `+(-_.height/2-w+3)+`)`);let E=_.width+(r.padding||0),D=_.height+(r.padding||0),O=-_.width/2-w,k=-_.height/2-w,A,j;if(r.look===`handDrawn`){let e=S.svg(c),t=m(r,{}),i=e.path(N(O,k,E,D,r.rx||0),t),a=e.line(-_.width/2-w,-_.height/2-w+y.height+w,_.width/2+w,-_.height/2-w+y.height+w,t);j=c.insert(()=>(n.debug(`Rough node insert CXC`,i),a),`:first-child`),A=c.insert(()=>(n.debug(`Rough node insert CXC`,i),i),`:first-child`)}else A=u.insert(`rect`,`:first-child`),j=u.insert(`line`),A.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-_.width/2-w).attr(`y`,-_.height/2-w).attr(`width`,_.width+(r.padding||0)).attr(`height`,_.height+(r.padding||0)),j.attr(`class`,`divider`).attr(`x1`,-_.width/2-w).attr(`x2`,_.width/2+w).attr(`y1`,-_.height/2-w+y.height+w).attr(`y2`,-_.height/2-w+y.height+w);return T(r,A),r.intersect=function(e){return G.rect(r,e)},c}t(ot,`rectWithTitle`);async function st(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return we(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}t(st,`roundedRect`);var Z=8;async function ct(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,f=u,g=Z-l/2,_=-u/2,{cssStyles:v}=t,y=S.svg(o),b=m(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:g,y:_},{x:g+d,y:_},{x:g+d,y:_+f},{x:g-Z,y:_+f},{x:g-Z,y:_},{x:g,y:_},{x:g,y:_+f}],w=y.polygon(x.map(e=>[e.x,e.y]),b),D=o.insert(()=>w,`:first-child`);return D.attr(`class`,`basic label-container outer-path`).attr(`style`,p(v)),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return G.rect(t,e)},o}t(ct,`shadedProcess`);async function lt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,g=-f/2,_=-p/2,{cssStyles:v}=t,y=S.svg(s),b=m(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:g,y:_},{x:g,y:_+p},{x:g+f,y:_+p},{x:g+f,y:_-p/2}],w=D(x),O=y.path(w,b),k=s.insert(()=>O,`:first-child`);return k.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,r),k.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),T(t,k),t.intersect=function(e){return G.polygon(t,x,e)},s}t(lt,`slopedRect`);async function ut(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return we(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}t(ut,`squareRect`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=S.svg(s),g=m(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...k(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...k(u/2-d,0,d,50,270,450)],v=D(_),y=p.path(v,g),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),T(t,b),t.intersect=function(e){return G.polygon(t,_,e)},s}t(dt,`stadium`);async function ft(e,t){return we(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}t(ft,`state`);function pt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=S.svg(u),f=m(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),g=s??c,_=(t.width??0)*5/14,v=d.circle(0,0,_,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;y.attr(`style`,`filter:url(#${n})`)}return T(t,y),t.intersect=function(e){return G.circle(t,(t.width??0)/2,e)},u}t(pt,`stateEnd`);function mt(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=S.svg(a).circle(0,0,t.width,g(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return T(t,o),t.intersect=function(e){return G.circle(t,(t.width??7)/2,e)},a}t(mt,`stateStart`);var ht=8;async function gt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+2*ht+a,u=(t?.height??c.height)+o,d=l-2*ht,f=u,g=-l/2,_=-u/2,v=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=e.rectangle(g,_,d+16,f,n),i=e.line(g+ht,_,g+ht,_+f,n),a=e.line(g+ht+d,_,g+ht+d,_+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,p(c)),T(t,o)}else{let e=q(s,d,f,v);r&&e.attr(`style`,r),T(t,e)}return t.intersect=function(e){return G.polygon(t,v,e)},s}t(gt,`subroutine`);var _t=.2;async function vt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-_t*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height?t?.height:c.height)+o*2,u=_t*l,d=_t*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,g=-f/2,_=-p/2,{cssStyles:v}=t,y=S.svg(s),b=m(t,{}),x=[{x:g-u/2,y:_},{x:g+f+u/2,y:_},{x:g+f+u/2,y:_+p},{x:g-u/2,y:_+p}],w=[{x:g+f-u/2,y:_+p},{x:g+f+u/2,y:_+p},{x:g+f+u/2,y:_+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let O=D(x),k=y.path(O,b),A=D(w),j=y.path(A,{...b,fillStyle:`solid`}),M=s.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),T(t,M),t.intersect=function(e){return G.polygon(t,x,e)},s}t(vt,`taggedRect`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,g=S.svg(i),_=m(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...O(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...O(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],w=D(v),k=g.path(w,_),A=D(x),j=g.path(A,{..._,fillStyle:`solid`}),M=i.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),T(t,M),t.intersect=function(e){return G.polygon(t,v,e)},i}t(yt,`taggedWaveEdgedRectangle`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),T(t,u),t.intersect=function(e){return G.rect(t,e)},i}t(bt,`text`);var xt=t((e,t,n,r,i,a)=>`M${e},${t}
3
- a${i},${a} 0,0,1 0,${-r}
4
- l${n},0
5
- a${i},${a} 0,0,1 0,${r}
6
- M${n},${-r}
7
- a${i},${a} 0,0,0 0,${r}
8
- l${-n},0`,`createCylinderPathD`),St=t((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),Ct=t((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),wt=5,Tt=10;async function Et(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2;if(t.width||t.height){let e=t.height??0;t.height=(t.height??0)-a,t.height<wt&&(t.height=wt);let n=e/2/(2.5+e/50);t.width=(t.width??0)-a-n*3,t.width<Tt&&(t.width=Tt)}let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t.height?t.height:s.height)+a,u=l/2,d=u/(2.5+l/50),f=(t.width?t.width:s.width)+d+a,{cssStyles:g}=t,_;if(t.look===`handDrawn`){let e=S.svg(o),n=St(0,0,f,l,d,u),r=Ct(0,0,f,l,d,u),i=e.path(n,m(t,{})),a=e.path(r,m(t,{fill:`none`}));_=o.insert(()=>a,`:first-child`),_=o.insert(()=>i,`:first-child`),_.attr(`class`,`basic label-container`),g&&_.attr(`style`,g)}else{let e=xt(0,0,f,l,d,u);_=o.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,p(g)).attr(`style`,r),_.attr(`class`,`basic label-container outer-path`),g&&_.selectAll(`path`).attr(`style`,g),r&&_.selectAll(`path`).attr(`style`,r)}return _.attr(`label-offset-x`,d),_.attr(`transform`,`translate(${-f/2}, ${l/2} )`),c.attr(`transform`,`translate(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,_),t.intersect=function(e){let n=G.rect(t,e),r=n.y-(t.y??0);if(u!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-d)){let i=d*d*(1-r*r/(u*u));i!=0&&(i=Math.sqrt(Math.abs(i))),i=d-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},o}t(Et,`tiltedCylinder`);async function Dt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}t(Dt,`trapezoid`);async function Ot(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=S.svg(s),p=m(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let g=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],_=D(g),v=f.path(_,p),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),T(t,y),t.intersect=function(e){return G.polygon(t,g,e)},s}t(Ot,`trapezoidalPentagon`);var kt=10,At=10;async function jt(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let a=t.padding??0,o=t.look===`neo`?a*2:a;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<At&&(t.width=At),t.height=t?.height??0,t.height<kt&&(t.height=kt));let{shapeSvg:s,bbox:u,label:d}=await C(e,t,E(t)),f=c(l().flowchart?.htmlLabels),p=(t?.width?t?.width:u.width)+o,g=t?.height?t?.height:p+u.height,_=g,v=[{x:0,y:0},{x:_,y:0},{x:_/2,y:-g}],{cssStyles:y}=t,b=S.svg(s),x=m(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=D(v),O=b.path(w,x),k=s.insert(()=>O,`:first-child`).attr(`transform`,`translate(${-g/2}, ${g/2})`).attr(`class`,`outer-path`);return y&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,y),i&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,i),t.width=p,t.height=g,T(t,k),d.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))}, ${g/2-(u.height+(t.padding??0)/(f?2:1)-(u.y-(u.top??0)))})`),t.intersect=function(e){return n.info(`Triangle intersect`,t,v,e),G.polygon(t,v,e)},s}t(jt,`triangle`);async function Mt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,g=f+(s?p:-p),{cssStyles:_}=t,v=14-d,y=v>0?v/2:0,b=S.svg(c),x=m(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=[{x:-d/2-y,y:g/2},...O(-d/2-y,g/2,d/2+y,g/2,p,.8),{x:d/2+y,y:-g/2},{x:-d/2-y,y:-g/2}],k=D(w),A=b.path(k,x),j=c.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),T(t,j),t.intersect=function(e){return G.polygon(t,w,e)},c}t(Mt,`waveEdgedRectangle`);async function Nt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,g=S.svg(s),_=m(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:-l/2,y:f/2},...O(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...O(l/2,-f/2,-l/2,-f/2,d,-1)],y=D(v),b=g.path(y,_),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),T(t,x),t.intersect=function(e){return G.polygon(t,v,e)},s}t(Nt,`waveRectangle`);var Q=10;async function Pt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,g=-f/2,{cssStyles:_}=t,v=S.svg(o),y=m(t,{}),b=[{x:p-Q,y:g-Q},{x:p-Q,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Q}],x=`M${p-Q},${g-Q} L${p+d},${g-Q} L${p+d},${g+f} L${p-Q},${g+f} L${p-Q},${g-Q}
9
- M${p-Q},${g} L${p+d},${g}
10
- M${p},${g-Q} L${p},${g+f}`;t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let w=v.path(x,y),D=o.insert(()=>w,`:first-child`);return D.attr(`transform`,`translate(${Q/2}, ${Q/2})`),D.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return G.polygon(t,b,e)},o}t(Pt,`windowPane`);var Ft=new Set([`redux-color`,`redux-dark-color`]),It=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function Lt(t,n){let r=n;r.alias&&(n.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:l,nodeBorder:u,borderColorArray:d}=a;if(n.look===`handDrawn`){let{themeVariables:e}=s(),{background:r}=e;await Lt(t,{...n,id:n.id+`-background`,domId:(n.domId||n.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let p=s();n.useHtmlLabels=p.htmlLabels;let g=p.er?.diagramPadding??10,_=p.er?.entityPadding??6,{cssStyles:v}=n,{labelStyles:y,nodeStyles:b}=h(n);if(r.attributes.length===0&&n.label){let e={rx:0,ry:0,labelPaddingX:g,labelPaddingY:g*1.5,classes:``};f(n.label,p)+e.labelPaddingX*2<p.er.minEntityWidth&&(n.width=p.er.minEntityWidth);let a=await we(t,n,e);if(i!=null&&Ft.has(i)){let e=r.colorIndex??0;a.attr(`data-color-id`,`color-${e%d.length}`)}if(!c(p.htmlLabels)){let e=a.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return a}p.htmlLabels||(g*=1.25,_*=1.25);let x=E(n);x||=`node default`;let C=t.insert(`g`).attr(`class`,x).attr(`id`,n.domId||n.id),w=await Rt(C,n.label??``,p,0,0,[`name`],y);w.height+=_;let D=0,O=[],k=[],A=0,j=0,M=0,N=0,P=!0,F=!0;for(let e of r.attributes){let t=await Rt(C,e.type,p,0,D,[`attribute-type`],y);A=Math.max(A,t.width+g);let n=await Rt(C,e.name,p,0,D,[`attribute-name`],y);j=Math.max(j,n.width+g);let r=await Rt(C,e.keys.join(),p,0,D,[`attribute-keys`],y);M=Math.max(M,r.width+g);let i=await Rt(C,e.comment,p,0,D,[`attribute-comment`],y);N=Math.max(N,i.width+g);let a=Math.max(t.height,n.height,r.height,i.height)+_;k.push({yOffset:D,rowHeight:a}),D+=a}let I=4;M<=g&&(P=!1,M=0,I--),N<=g&&(F=!1,N=0,I--);let L=C.node().getBBox();if(w.width+g*2-(A+j+M+N)>0){let e=w.width+g*2-(A+j+M+N);A+=e/I,j+=e/I,M>0&&(M+=e/I),N>0&&(N+=e/I)}let ee=A+j+M+N,R=S.svg(C),z=m(n,{});n.look!==`handDrawn`&&(z.roughness=0,z.fillStyle=`solid`);let te=0;k.length>0&&(te=k.reduce((e,t)=>e+(t?.rowHeight??0),0));let B=Math.max(L.width+g*2,n?.width||0,ee),V=Math.max((te??0)+w.height,n?.height||0),H=-B/2,U=-V/2;if(C.selectAll(`g:not(:first-child)`).each((t,n,r)=>{let i=e(r[n]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=A:i.attr(`class`).includes(`attribute-keys`)?o+=A+j:i.attr(`class`).includes(`attribute-comment`)&&(o+=A+j+M))}i.attr(`transform`,`translate(${H+g/2+o}, ${s+U+w.height+_/2})`)}),C.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(U+_/2)+`)`),i!=null&&Ft.has(i)){let e=r.colorIndex??0;C.attr(`data-color-id`,`color-${e%d.length}`)}let ne=R.rectangle(H,U,B,V,z),re=C.insert(()=>ne,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));O.push(0);for(let[e,t]of k.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=R.rectangle(H,w.height+U+t?.yOffset,B,t?.rowHeight,{...z,fill:n?o:l,stroke:u});C.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let ie=1e-4,W=zt(H,w.height+U,B+H,w.height+U,ie),K=R.polygon(W.map(e=>[e.x,e.y]),z);if(C.insert(()=>K).attr(`class`,`divider`),W=zt(A+H,w.height+U,A+H,V+U,ie),K=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>K).attr(`class`,`divider`),P){let e=A+j+H;W=zt(e,w.height+U,e,V+U,ie),K=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>K).attr(`class`,`divider`)}if(F){let e=A+j+M+H;W=zt(e,w.height+U,e,V+U,ie),K=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>K).attr(`class`,`divider`)}for(let e of O){let t=w.height+U+e;W=zt(H,t,B+H,t,ie),K=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>K).attr(`class`,`divider`)}if(T(n,re),b&&n.look!==`handDrawn`)if(i!=null&&It.has(i))C.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);C.selectAll(`path`).attr(`style`,e??``),C.selectAll(`.row-rect-even path`).attr(`style`,b)}return n.intersect=function(e){return G.rect(n,e)},C}t(Lt,`erBox`);async function Rt(t,n,r,i=0,o=0,s=[],l=``){let u=t.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,l);n!==a(n)&&(n=a(n),n=n.replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`));let d=u.node().appendChild(await x(u,n,{width:f(n,r)+100,style:l,useHtmlLabels:r.htmlLabels},r));if(n.includes(`&lt;`)||n.includes(`&gt;`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`&lt;`,`<`).replaceAll(`&gt;`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`&lt;`,`<`).replaceAll(`&gt;`,`>`)}let p=d.getBBox();if(c(r.htmlLabels)){let t=d.children[0];t.style.textAlign=`start`;let n=e(d);p=t.getBoundingClientRect(),n.attr(`width`,p.width),n.attr(`height`,p.height)}return p}t(Rt,`addText`);function zt(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}t(zt,`lineToPolygon`);async function Bt(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Vt(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Vt(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Vt(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Vt(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}t(Bt,`textHelper`);async function Vt(n,a,o,l=[]){let u=n.insert(`g`).attr(`class`,`label`).attr(`style`,l.join(`; `)),p=s(),m=`useHtmlLabels`in a?a.useHtmlLabels:c(p.htmlLabels)??!0,h=``;h=`text`in a?a.text:a.label,!m&&h.startsWith(`\\`)&&(h=h.substring(1)),r(h)&&(m=!0);let g=await x(u,i(d(h)),{width:f(h,p)+50,classes:`markdown-node-label`,useHtmlLabels:m},p),_,v=1;if(m){let n=g.children[0],r=e(g);v=n.innerHTML.split(`<br>`).length,n.innerHTML.includes(`</math>`)&&(v+=n.innerHTML.split(`<mrow>`).length-1);let i=n.getElementsByTagName(`img`);if(i){let e=h.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...i].map(n=>new Promise(r=>{function i(){if(n.style.display=`flex`,n.style.flexDirection=`column`,e){let e=p.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,t=parseInt(e,10)*5+`px`;n.style.minWidth=t,n.style.maxWidth=t}else n.style.width=`100%`;r(n)}t(i,`setupImage`),setTimeout(()=>{n.complete&&i()}),n.addEventListener(`error`,i),n.addEventListener(`load`,i)})))}_=n.getBoundingClientRect(),r.attr(`width`,_.width),r.attr(`height`,_.height)}else{l.includes(`font-weight: bolder`)&&e(g).selectAll(`tspan`).attr(`font-weight`,``),v=g.children.length;let t=g.children[0];(g.textContent===``||g.textContent.includes(`&gt`))&&(t.textContent=h[0]+h.substring(1).replaceAll(`&gt;`,`>`).replaceAll(`&lt;`,`<`).trim(),h[1]===` `&&(t.textContent=t.textContent[0]+` `+t.textContent.substring(1))),t.textContent===`undefined`&&(t.textContent=``),_=g.getBBox()}return u.attr(`transform`,`translate(0,`+(-_.height/(2*v)+o)+`)`),_.height}t(Vt,`addText`);async function Ht(t,n){let r=l(),{themeVariables:i}=r,{useGradient:a}=i,o=r.class.padding??12,s=o,u=n.useHtmlLabels??c(r.htmlLabels)??!0,d=n;d.annotations=d.annotations??[],d.members=d.members??[],d.methods=d.methods??[];let{shapeSvg:f,bbox:p}=await Bt(t,n,r,u,s),{labelStyles:g,nodeStyles:_}=h(n);n.labelStyle=g,n.cssStyles=d.styles||``;let v=d.styles?.join(`;`)||_||``;n.cssStyles||=v.replaceAll(`!important`,``).split(`;`);let y=d.members.length===0&&d.methods.length===0&&!r.class?.hideEmptyMembersBox,b=S.svg(f),x=m(n,{});n.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let C=Math.max(n.width??0,p.width),w=Math.max(n.height??0,p.height),E=(n.height??0)>p.height;d.members.length===0&&d.methods.length===0?w+=s:d.members.length>0&&d.methods.length===0&&(w+=s*2);let D=-C/2,O=-w/2,k=y?o*2:d.members.length===0&&d.methods.length===0?-o:0;E&&(k=o*2);let A=b.rectangle(D-o,O-o-(y?o:d.members.length===0&&d.methods.length===0?-o/2:0),C+2*o,w+2*o+k,x),j=f.insert(()=>A,`:first-child`);j.attr(`class`,`basic label-container outer-path`);let M=j.node().getBBox(),N=f.select(`.annotation-group`).node().getBBox().height-(y?o/2:0)||0,P=f.select(`.label-group`).node().getBBox().height-(y?o/2:0)||0,F=f.select(`.members-group`).node().getBBox().height-(y?o/2:0)||0,I=(N+P+O+o-(O-o-(y?o:d.members.length===0&&d.methods.length===0?-o/2:0)))/2;if(f.selectAll(`.text`).each((t,n,i)=>{let a=e(i[n]),c=a.attr(`transform`),l=0;if(c){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);e&&(l=parseFloat(e[2]))}let p=l+O+o-(y?o:d.members.length===0&&d.methods.length===0?-o/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(F,s/2);p=E?Math.max(I,N+P+e+O+s*2+o)+s*2:N+P+e+O+s*4+o}d.members.length===0&&d.methods.length===0&&r.class?.hideEmptyMembersBox&&(p=d.annotations.length>0?l-s:l),u||(p-=4);let m=D;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(m=-a.node()?.getBBox().width/2||0,f.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),a.attr(`transform`,`translate(${m}, ${p})`)}),d.members.length>0||d.methods.length>0||y){let e=N+P+O+o,t=b.line(M.x,e,M.x+M.width,e+.001,x);f.insert(()=>t).attr(`class`,`divider${n.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,v)}if(y||d.members.length>0||d.methods.length>0){let e=N+P+F+O+s*2+o,t=b.line(M.x,E?Math.max(I,e):e,M.x+M.width,(E?Math.max(I,e):e)+.001,x);f.insert(()=>t).attr(`class`,`divider${n.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,v)}if(d.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,v),j.select(`:nth-child(2)`).attr(`style`,v),f.selectAll(`.divider`).select(`path`).attr(`style`,v),n.labelStyle?f.selectAll(`span`).attr(`style`,n.labelStyle):f.selectAll(`span`).attr(`style`,v),!u){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}else if(g){let t=e.exec(g);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}}}return T(n,j),n.intersect=function(e){return G.rect(n,e)},f}t(Ht,`classBox`);async function Ut(t,n){let{labelStyles:r,nodeStyles:i}=h(n);n.labelStyle=r;let a=n,o=n,s=`verifyMethod`in n,c=E(n),{themeVariables:u}=l(),{borderColorArray:d,requirementEdgeLabelBackground:f}=u,p=t.insert(`g`).attr(`class`,c).attr(`id`,n.domId??n.id),g;g=s?await $(p,`&lt;&lt;${a.type}&gt;&gt;`,0,n.labelStyle):await $(p,`&lt;&lt;Element&gt;&gt;`,0,n.labelStyle);let _=g,v=await $(p,a.name,_,n.labelStyle+`; font-weight: bold;`);if(_+=v+20,s){let e=await $(p,`${a.requirementId?`ID: ${a.requirementId}`:``}`,_,n.labelStyle);_+=e;let t=await $(p,`${a.text?`Text: ${a.text}`:``}`,_,n.labelStyle);_+=t;let r=await $(p,`${a.risk?`Risk: ${a.risk}`:``}`,_,n.labelStyle);_+=r,await $(p,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,_,n.labelStyle)}else{let e=await $(p,`${o.type?`Type: ${o.type}`:``}`,_,n.labelStyle);_+=e,await $(p,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,_,n.labelStyle)}let y=(p.node()?.getBBox().width??200)+20,b=(p.node()?.getBBox().height??200)+20,x=-y/2,C=-b/2,w=S.svg(p),D=m(n,{});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=w.rectangle(x,C,y,b,D),k=p.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),d?.length){let e=n.colorIndex??0;p.attr(`data-color-id`,`color-${e%d.length}`)}if(p.selectAll(`.label`).each((t,n,r)=>{let i=e(r[n]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-b/2,l=x+20/2;(n===0||n===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),_>g+v+20){let e=C+g+v+20,t;if(n.look===`neo`){let n=.001,r=[[x,e],[x+y,e],[x+y,e+n],[x,e+n]];t=w.polygon(r,D)}else t=w.line(x,e,x+y,e,D);p.insert(()=>t).attr(`class`,`divider`)}return T(n,k),n.intersect=function(e){return G.rect(n,e)},i&&n.look!==`handDrawn`&&(f||d?.length)&&p.selectAll(`path`).attr(`style`,i),p}t(Ut,`requirementBox`);async function $(t,n,r,a=``){if(n===``)return 0;let o=t.insert(`g`).attr(`class`,`label`).attr(`style`,a),s=l(),c=s.htmlLabels??!0,u=await x(o,i(d(n)),{width:f(n,s)+50,classes:`markdown-node-label`,useHtmlLabels:c,style:a},s),p;if(c){let t=u.children[0],n=e(u);p=t.getBoundingClientRect(),n.attr(`width`,p.width),n.attr(`height`,p.height)}else{let e=u.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);p=u.getBBox(),p.height+=6}return o.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}t($,`addText`);var Wt=t(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function Gt(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,g;d?{label:p,bbox:g}=await w(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:g}=await w(o,`ticket`in t&&t.ticket||``,f);let{label:_,bbox:v}=await w(o,`assigned`in t&&t.assigned||``,f);t.width=a;let y=t?.width||0,b=Math.max(g.height,v.height)/2,x=Math.max(s.height+20,t?.height||0)+b,D=-y/2,O=-x/2;c.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b+s.height/2)+`)`),_.attr(`transform`,`translate(`+(l+y/2-v.width-20)+`, `+(-b+s.height/2)+`)`);let k,{rx:A,ry:j}=t,{cssStyles:M}=t;if(t.look===`handDrawn`){let e=S.svg(o),n=m(t,{}),r=A||j?e.path(N(D,O,y,x,A||0),n):e.rectangle(D,O,y,x,n);k=o.insert(()=>r,`:first-child`),k.attr(`class`,`basic label-container`).attr(`style`,M||null)}else{k=o.insert(`rect`,`:first-child`),k.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,A??5).attr(`ry`,j??5).attr(`x`,D).attr(`y`,O).attr(`width`,y).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=D+2,r=O+Math.floor((A??0)/2),i=O+x-Math.floor((A??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Wt(e))}}return T(t,k),t.height=x,t.intersect=function(e){return G.rect(t,e)},o}t(Gt,`kanbanItem`);async function Kt(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await C(e,t,E(t)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=t,g=o.width+20,_=o.height+20,v=Math.max(l,g),y=Math.max(u,_);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let b,x=`M0 0
11
- a${d},${d} 1 0,0 ${v*.25},${-1*y*.1}
12
- a${d},${d} 1 0,0 ${v*.25},0
13
- a${d},${d} 1 0,0 ${v*.25},0
14
- a${d},${d} 1 0,0 ${v*.25},${y*.1}
15
-
16
- a${d},${d} 1 0,0 ${v*.15},${y*.33}
17
- a${d*.8},${d*.8} 1 0,0 0,${y*.34}
18
- a${d},${d} 1 0,0 ${-1*v*.15},${y*.33}
19
-
20
- a${d},${d} 1 0,0 ${-1*v*.25},${y*.15}
21
- a${d},${d} 1 0,0 ${-1*v*.25},0
22
- a${d},${d} 1 0,0 ${-1*v*.25},0
23
- a${d},${d} 1 0,0 ${-1*v*.25},${-1*y*.15}
24
-
25
- a${d},${d} 1 0,0 ${-1*v*.1},${-1*y*.33}
26
- a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34}
27
- a${d},${d} 1 0,0 ${v*.1},${-1*y*.33}
28
- H0 V0 Z`;if(t.look===`handDrawn`){let e=S.svg(a),n=m(t,{}),r=e.path(x,n);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,p(f))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-v/2}, ${-y/2})`),T(t,b),t.calcIntersect=function(e,t){return G.rect(e,t)},t.intersect=function(e){return n.info(`Bang intersect`,t,e),G.rect(t,e)},a}t(Kt,`bang`);async function qt(e,t){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await C(e,t,E(t)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,g=.35*l,_=.2*l,{cssStyles:v}=t,y,b=`M0 0
29
- a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}
30
- a${g},${g} 1 0,1 ${l*.4},${-1*l*.1}
31
- a${f},${f} 1 0,1 ${l*.35},${l*.2}
32
-
33
- a${d},${d} 1 0,1 ${l*.15},${u*.35}
34
- a${_},${_} 1 0,1 ${-1*l*.15},${u*.65}
35
-
36
- a${f},${d} 1 0,1 ${-1*l*.25},${l*.15}
37
- a${g},${g} 1 0,1 ${-1*l*.5},0
38
- a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15}
39
-
40
- a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}
41
- a${_},${_} 1 0,1 ${l*.1},${-1*u*.65}
42
- H0 V0 Z`;if(t.look===`handDrawn`){let e=S.svg(a),n=m(t,{}),r=e.path(b,n);y=a.insert(()=>r,`:first-child`),y.attr(`class`,`basic label-container`).attr(`style`,p(v))}else y=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),y.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,y),t.calcIntersect=function(e,t){return G.rect(e,t)},t.intersect=function(e){return n.info(`Cloud intersect`,t,e),G.rect(t,e)},a}t(qt,`cloud`);async function Jt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await C(e,t,E(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
43
- M${-c/2} ${l/2-5}
44
- v${-l+10}
45
- q0,-5 5,-5
46
- h${c-10}
47
- q5,0 5,5
48
- v${l-5}
49
- H${-c/2}
50
- Z
51
- `:`
52
- M${-c/2} ${l/2-5}
53
- v${-l+10}
54
- q0,-5 5,-5
55
- h${c-10}
56
- q5,0 5,5
57
- v${l-10}
58
- q0,5 -5,5
59
- h${-(c-10)}
60
- q-5,0 -5,-5
61
- Z
62
- `;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let d=i.append(`path`).attr(`id`,t.domId).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),T(t,d),t.calcIntersect=function(e,t){return G.rect(e,t)},t.intersect=function(e){return G.rect(t,e)},i}t(Jt,`defaultMindmapNode`);async function Yt(e,t){return de(e,t,{padding:t.padding??0})}t(Yt,`mindmapCircle`);var Xt=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:ut},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:st},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:dt},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:gt},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:Ce},{semanticName:`Data Store`,name:`Data Store`,shortName:`datastore`,description:`Data flow diagram data store`,aliases:[`data-store`],handler:Te},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:de},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Kt},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:qt},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:it},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:Fe},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:Ge},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:We},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:Dt},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:He},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:De},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:bt},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:le},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:ct},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:mt},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:pt},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:Me},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:Ie},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:me},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:he},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:ge},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:Ke},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:Mt},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:Ne},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:Et},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:Qe},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:_e},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Ee},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:jt},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:Pt},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:Oe},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:Ot},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:je},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:lt},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:tt},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:et},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:se},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:pe},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:yt},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:vt},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:Nt},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:at},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:$e}],Zt=t(()=>{let e=[...Object.entries({state:ft,choice:ue,note:nt,rectWithTitle:ot,labelRect:Ue,iconSquare:Be,iconCircle:Re,icon:Le,iconRounded:ze,imageSquare:Ve,anchor:K,kanbanItem:Gt,mindmapCircle:Yt,defaultMindmapNode:Jt,classBox:Ht,erBox:Lt,requirementBox:Ut}),...Xt.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)();function Qt(e){return e in Zt}t(Qt,`isValidShape`);var $t=new Map;async function en(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let a=t.shape?Zt[t.shape]:void 0;if(!a)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;n.config.securityLevel===`sandbox`?o=`_top`:t.linkTarget&&(o=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return r.attr(`data-look`,p(t.look)),t.tooltip&&i.attr(`title`,t.tooltip),$t.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}t(en,`insertNode`);var tn=t((e,t)=>{$t.set(t.id,e)},`setNodeElem`),nn=t(()=>{$t.clear()},`clear`),rn=t(e=>{let t=$t.get(e.id);n.trace(`Transforming node`,e.diff,e,`translate(`+(e.x-e.width/2-5)+`, `+e.width/2+`)`);let r=e.diff||0;return e.clusterNode?t.attr(`transform`,`translate(`+(e.x+r-e.width/2)+`, `+(e.y-e.height/2-8)+`)`):t.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`),r},`positionNode`);export{en as a,rn as c,ee as i,tn as l,nn as n,Qt as o,M as r,C as s,R as t,T as u};
@@ -1,32 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";function t(e){return e==null}e(t,`isNothing`);function n(e){return typeof e==`object`&&!!e}e(n,`isObject`);function r(e){return Array.isArray(e)?e:t(e)?[]:[e]}e(r,`toArray`);function i(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}e(i,`extend`);function a(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}e(a,`repeat`);function o(e){return e===0&&1/e==-1/0}e(o,`isNegativeZero`);var s={isNothing:t,isObject:n,toArray:r,repeat:a,isNegativeZero:o,extend:i};function c(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
2
-
3
- `+e.mark.snippet),r+` `+n):r}e(c,`formatError`);function l(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=c(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}e(l,`YAMLException$1`),l.prototype=Object.create(Error.prototype),l.prototype.constructor=l,l.prototype.toString=e(function(e){return this.name+`: `+c(this,e)},`toString`);var u=l;function d(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}e(d,`getLine`);function f(e,t){return s.repeat(` `,t-e.length)+e}e(f,`padStart`);function p(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var c=``,l,u,p=Math.min(e.line+t.linesAfter,i.length).toString().length,m=t.maxLength-(t.indent+p+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)u=d(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),m),c=s.repeat(` `,t.indent)+f((e.line-l+1).toString(),p)+` | `+u.str+`
4
- `+c;for(u=d(e.buffer,r[o],i[o],e.position,m),c+=s.repeat(` `,t.indent)+f((e.line+1).toString(),p)+` | `+u.str+`
5
- `,c+=s.repeat(`-`,t.indent+p+3+u.pos)+`^
6
- `,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)u=d(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),m),c+=s.repeat(` `,t.indent)+f((e.line+l+1).toString(),p)+` | `+u.str+`
7
- `;return c.replace(/\n$/,``)}e(p,`makeSnippet`);var m=p,h=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],g=[`scalar`,`sequence`,`mapping`];function _(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}e(_,`compileStyleAliases`);function v(e,t){if(t||={},Object.keys(t).forEach(function(t){if(h.indexOf(t)===-1)throw new u(`Unknown option "`+t+`" is met in definition of "`+e+`" YAML type.`)}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=_(t.styleAliases||null),g.indexOf(this.kind)===-1)throw new u(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}e(v,`Type$1`);var y=v;function b(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}e(b,`compileList`);function ee(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,r;function i(e){e.multi?(t.multi[e.kind].push(e),t.multi.fallback.push(e)):t[e.kind][e.tag]=t.fallback[e.tag]=e}for(e(i,`collectType`),n=0,r=arguments.length;n<r;n+=1)arguments[n].forEach(i);return t}e(ee,`compileMap`);function x(e){return this.extend(e)}e(x,`Schema$1`),x.prototype.extend=e(function(e){var t=[],n=[];if(e instanceof y)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new u(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof y))throw new u(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new u(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new u(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof y))throw new u(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(x.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=b(r,`implicit`),r.compiledExplicit=b(r,`explicit`),r.compiledTypeMap=ee(r.compiledImplicit,r.compiledExplicit),r},`extend`);var te=new x({explicit:[new y(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:e(function(e){return e===null?``:e},`construct`)}),new y(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:e(function(e){return e===null?[]:e},`construct`)}),new y(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:e(function(e){return e===null?{}:e},`construct`)})]});function ne(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}e(ne,`resolveYamlNull`);function re(){return null}e(re,`constructYamlNull`);function ie(e){return e===null}e(ie,`isNull`);var ae=new y(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:ne,construct:re,predicate:ie,represent:{canonical:e(function(){return`~`},`canonical`),lowercase:e(function(){return`null`},`lowercase`),uppercase:e(function(){return`NULL`},`uppercase`),camelcase:e(function(){return`Null`},`camelcase`),empty:e(function(){return``},`empty`)},defaultStyle:`lowercase`});function oe(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}e(oe,`resolveYamlBoolean`);function se(e){return e===`true`||e===`True`||e===`TRUE`}e(se,`constructYamlBoolean`);function ce(e){return Object.prototype.toString.call(e)===`[object Boolean]`}e(ce,`isBoolean`);var le=new y(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:oe,construct:se,predicate:ce,represent:{lowercase:e(function(e){return e?`true`:`false`},`lowercase`),uppercase:e(function(e){return e?`TRUE`:`FALSE`},`uppercase`),camelcase:e(function(e){return e?`True`:`False`},`camelcase`)},defaultStyle:`lowercase`});function ue(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}e(ue,`isHexCode`);function de(e){return 48<=e&&e<=55}e(de,`isOctCode`);function fe(e){return 48<=e&&e<=57}e(fe,`isDecCode`);function pe(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!ue(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!de(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!fe(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}e(pe,`resolveYamlInteger`);function me(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}e(me,`constructYamlInteger`);function he(e){return Object.prototype.toString.call(e)===`[object Number]`&&e%1==0&&!s.isNegativeZero(e)}e(he,`isInteger`);var ge=new y(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:pe,construct:me,predicate:he,represent:{binary:e(function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},`binary`),octal:e(function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},`octal`),decimal:e(function(e){return e.toString(10)},`decimal`),hexadecimal:e(function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)},`hexadecimal`)},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),_e=RegExp(`^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function ve(e){return!(e===null||!_e.test(e)||e[e.length-1]===`_`)}e(ve,`resolveYamlFloat`);function ye(e){var t=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}e(ye,`constructYamlFloat`);var be=/^[-+]?[0-9]+e/;function xe(e,t){var n;if(isNaN(e))switch(t){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(s.isNegativeZero(e))return`-0.0`;return n=e.toString(10),be.test(n)?n.replace(`e`,`.e`):n}e(xe,`representYamlFloat`);function Se(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||s.isNegativeZero(e))}e(Se,`isFloat`);var Ce=new y(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:ve,construct:ye,predicate:Se,represent:xe,defaultStyle:`lowercase`}),we=te.extend({implicit:[ae,le,ge,Ce]}),Te=we,Ee=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),De=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function Oe(e){return e===null?!1:Ee.exec(e)!==null||De.exec(e)!==null}e(Oe,`resolveYamlTimestamp`);function ke(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=Ee.exec(e),t===null&&(t=De.exec(e)),t===null)throw Error(`Date resolve error`);if(n=+t[1],r=t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}e(ke,`constructYamlTimestamp`);function Ae(e){return e.toISOString()}e(Ae,`representYamlTimestamp`);var je=new y(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:Oe,construct:ke,instanceOf:Date,represent:Ae});function Me(e){return e===`<<`||e===null}e(Me,`resolveYamlMerge`);var Ne=new y(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:Me}),S=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function Pe(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=S;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}e(Pe,`resolveYamlBinary`);function Fe(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=S,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}e(Fe,`constructYamlBinary`);function Ie(e){var t=``,n=0,r,i,a=e.length,o=S;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}e(Ie,`representYamlBinary`);function Le(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}e(Le,`isBinary`);var Re=new y(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:Pe,construct:Fe,predicate:Le,represent:Ie}),ze=Object.prototype.hasOwnProperty,Be=Object.prototype.toString;function Ve(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Be.call(i)!==`[object Object]`)return!1;for(a in i)if(ze.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}e(Ve,`resolveYamlOmap`);function He(e){return e===null?[]:e}e(He,`constructYamlOmap`);var Ue=new y(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:Ve,construct:He}),We=Object.prototype.toString;function Ge(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],We.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}e(Ge,`resolveYamlPairs`);function Ke(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}e(Ke,`constructYamlPairs`);var qe=new y(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:Ge,construct:Ke}),Je=Object.prototype.hasOwnProperty;function Ye(e){if(e===null)return!0;var t,n=e;for(t in n)if(Je.call(n,t)&&n[t]!==null)return!1;return!0}e(Ye,`resolveYamlSet`);function Xe(e){return e===null?{}:e}e(Xe,`constructYamlSet`);var Ze=new y(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:Ye,construct:Xe}),Qe=Te.extend({implicit:[je,Ne],explicit:[Re,Ue,qe,Ze]}),C=Object.prototype.hasOwnProperty,w=1,$e=2,et=3,T=4,E=1,tt=2,nt=3,rt=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,it=/[\x85\u2028\u2029]/,at=/[,\[\]\{\}]/,ot=/^(?:!|!!|![a-z\-]+!)$/i,st=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function D(e){return Object.prototype.toString.call(e)}e(D,`_class`);function O(e){return e===10||e===13}e(O,`is_EOL`);function k(e){return e===9||e===32}e(k,`is_WHITE_SPACE`);function A(e){return e===9||e===32||e===10||e===13}e(A,`is_WS_OR_EOL`);function j(e){return e===44||e===91||e===93||e===123||e===125}e(j,`is_FLOW_INDICATOR`);function ct(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}e(ct,`fromHexCode`);function lt(e){return e===120?2:e===117?4:e===85?8:0}e(lt,`escapedHexLen`);function ut(e){return 48<=e&&e<=57?e-48:-1}e(ut,`fromDecimalCode`);function dt(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
9
- `:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`…`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}e(dt,`simpleEscapeSequence`);function ft(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}e(ft,`charFromCodepoint`);function pt(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}e(pt,`setProperty`);var mt=Array(256),ht=Array(256);for(M=0;M<256;M++)mt[M]=+!!dt(M),ht[M]=dt(M);var M;function gt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Qe,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}e(gt,`State$1`);function _t(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=m(n),new u(t,n)}e(_t,`generateError`);function N(e,t){throw _t(e,t)}e(N,`throwError`);function P(e,t){e.onWarning&&e.onWarning.call(null,_t(e,t))}e(P,`throwWarning`);var vt={YAML:e(function(e,t,n){var r,i,a;e.version!==null&&N(e,`duplication of %YAML directive`),n.length!==1&&N(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&N(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&N(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&P(e,`unsupported YAML version of the document`)},`handleYamlDirective`),TAG:e(function(e,t,n){var r,i;n.length!==2&&N(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],ot.test(r)||N(e,`ill-formed tag handle (first argument) of the TAG directive`),C.call(e.tagMap,r)&&N(e,`there is a previously declared suffix for "`+r+`" tag handle`),st.test(i)||N(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{N(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i},`handleTagDirective`)};function F(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||N(e,`expected valid JSON character`);else rt.test(s)&&N(e,`the stream contains non-printable characters`);e.result+=s}}e(F,`captureSegment`);function yt(e,t,n,r){var i,a,o,c;for(s.isObject(n)||N(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,c=i.length;o<c;o+=1)a=i[o],C.call(t,a)||(pt(t,a,n[a]),r[a]=!0)}e(yt,`mergeMappings`);function I(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&N(e,`nested arrays are not supported inside keys`),typeof i==`object`&&D(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&D(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)yt(e,t,a[l],n);else yt(e,t,a,n);else!e.json&&!C.call(n,i)&&C.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,N(e,`duplicated mapping key`)),pt(t,i,a),delete n[i];return t}e(I,`storeMappingPair`);function L(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):N(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}e(L,`readLineBreak`);function R(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;k(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(O(i))for(L(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&P(e,`deficient indentation`),r}e(R,`skipSeparationSpace`);function z(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||A(n)))}e(z,`testDocumentSeparator`);function B(e,t){t===1?e.result+=` `:t>1&&(e.result+=s.repeat(`
10
- `,t-1))}e(B,`writeFoldedLines`);function bt(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(A(p)||j(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),A(i)||n&&j(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),A(i)||n&&j(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),A(r))break}else if(e.position===e.lineStart&&z(e)||n&&j(p))break;else if(O(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,R(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(F(e,a,o,!1),B(e,e.line-c),a=o=e.position,!1),k(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return F(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}e(bt,`readPlainScalar`);function xt(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(F(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else O(n)?(F(e,r,i,!0),B(e,R(e,!1,t)),r=i=e.position):e.position===e.lineStart&&z(e)?N(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);N(e,`unexpected end of the stream within a single quoted scalar`)}e(xt,`readSingleQuotedScalar`);function St(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return F(e,n,e.position,!0),e.position++,!0;else if(s===92){if(F(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),O(s))R(e,!1,t);else if(s<256&&mt[s])e.result+=ht[s],e.position++;else if((o=lt(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=ct(s))>=0?a=(a<<4)+o:N(e,`expected hexadecimal character`);e.result+=ft(a),e.position++}else N(e,`unknown escape sequence`);n=r=e.position}else O(s)?(F(e,n,r,!0),B(e,R(e,!1,t)),n=r=e.position):e.position===e.lineStart&&z(e)?N(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);N(e,`unexpected end of the stream within a double quoted scalar`)}e(St,`readDoubleQuotedScalar`);function Ct(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(R(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&N(e,`expected the node content, but found ','`):N(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),A(l)&&(d=f=!0,e.position++,R(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,V(e,t,w,!1,!0),g=e.tag,h=e.result,R(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),R(e,!0,t),V(e,t,w,!1,!0),_=e.result),p?I(e,s,m,g,h,_,r,i,a):d?s.push(I(e,null,m,g,h,_,r,i,a)):s.push(h),R(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}N(e,`unexpected end of the stream within a flow collection`)}e(Ct,`readFlowCollection`);function wt(e,t){var n,r,i=E,a=!1,o=!1,c=t,l=0,u=!1,d,f=e.input.charCodeAt(e.position);if(f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)E===i?i=f===43?nt:tt:N(e,`repeat of a chomping mode identifier`);else if((d=ut(f))>=0)d===0?N(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?N(e,`repeat of an indentation width identifier`):(c=t+d-1,o=!0);else break;if(k(f)){do f=e.input.charCodeAt(++e.position);while(k(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!O(f)&&f!==0)}for(;f!==0;){for(L(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!o||e.lineIndent<c)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>c&&(c=e.lineIndent),O(f)){l++;continue}if(e.lineIndent<c){i===nt?e.result+=s.repeat(`
11
- `,a?1+l:l):i===E&&a&&(e.result+=`
12
- `);break}for(r?k(f)?(u=!0,e.result+=s.repeat(`
13
- `,a?1+l:l)):u?(u=!1,e.result+=s.repeat(`
14
- `,l+1)):l===0?a&&(e.result+=` `):e.result+=s.repeat(`
15
- `,l):e.result+=s.repeat(`
16
- `,a?1+l:l),a=!0,o=!0,l=0,n=e.position;!O(f)&&f!==0;)f=e.input.charCodeAt(++e.position);F(e,n,e.position,!1)}return!0}e(wt,`readBlockScalar`);function Tt(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,N(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!A(o))));){if(s=!0,e.position++,R(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,V(e,t,et,!1,!0),a.push(e.result),R(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)N(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}e(Tt,`readBlockSequence`);function Et(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,N(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&A(r))v===63?(g&&(I(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):N(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!V(e,n,$e,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);k(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),A(v)||N(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(I(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)N(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)N(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),V(e,t,T,!0,i)&&(g?m=e.result:h=e.result),g||(I(e,d,f,p,m,h,o,s,c),p=m=h=null),R(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)N(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&I(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}e(Et,`readBlockMapping`);function Dt(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&N(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):N(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!A(o);)o===33&&(r?N(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),ot.test(i)||N(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),at.test(a)&&N(e,`tag suffix cannot contain flow indicator characters`)}a&&!st.test(a)&&N(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{N(e,`tag name is malformed: `+a)}return n?e.tag=a:C.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:N(e,`undeclared tag handle "`+i+`"`),!0}e(Dt,`readTagProperty`);function Ot(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&N(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!A(n)&&!j(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}e(Ot,`readAnchorProperty`);function kt(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!A(r)&&!j(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&N(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),C.call(e.anchorMap,n)||N(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],R(e,!0,-1),!0}e(kt,`readAlias`);function V(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=T===n||et===n,r&&R(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Dt(e)||Ot(e);)R(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||T===n)&&(h=w===n||$e===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(Tt(e,g)||Et(e,g,h))||Ct(e,h)?u=!0:(o&&wt(e,h)||xt(e,h)||St(e,h)?u=!0:kt(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&N(e,`alias node should not have any properties`)):bt(e,h,w===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&Tt(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&N(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(C.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||N(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&N(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):N(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}e(V,`composeNode`);function At(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(R(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!A(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&N(e,`directive name must not be less than one character in length`);o!==0;){for(;k(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!O(o));break}if(O(o))break;for(n=e.position;o!==0&&!A(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&L(e),C.call(vt,r)?vt[r](e,r,i):P(e,`unknown document directive "`+r+`"`)}if(R(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,R(e,!0,-1)):a&&N(e,`directives end mark is expected`),V(e,e.lineIndent-1,T,!1,!0),R(e,!0,-1),e.checkLineBreaks&&it.test(e.input.slice(t,e.position))&&P(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&z(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,R(e,!0,-1));return}if(e.position<e.length-1)N(e,`end of the stream or a document separator is expected`);else return}e(At,`readDocument`);function jt(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new gt(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,N(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)At(n);return n.documents}e(jt,`loadDocuments`);function Mt(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=jt(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}e(Mt,`loadAll$1`);function Nt(e,t){var n=jt(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new u(`expected a single document in the stream, but found more`)}}e(Nt,`load$1`);var Pt={loadAll:Mt,load:Nt},Ft=Object.prototype.toString,It=Object.prototype.hasOwnProperty,Lt=65279,Rt=9,H=10,zt=13,Bt=32,Vt=33,Ht=34,Ut=35,Wt=37,Gt=38,Kt=39,qt=42,Jt=44,Yt=45,U=58,Xt=61,Zt=62,Qt=63,$t=64,en=91,tn=93,nn=96,rn=123,an=124,on=125,W={};W[0]=`\\0`,W[7]=`\\a`,W[8]=`\\b`,W[9]=`\\t`,W[10]=`\\n`,W[11]=`\\v`,W[12]=`\\f`,W[13]=`\\r`,W[27]=`\\e`,W[34]=`\\"`,W[92]=`\\\\`,W[133]=`\\N`,W[160]=`\\_`,W[8232]=`\\L`,W[8233]=`\\P`;var sn=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],cn=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ln(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&It.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}e(ln,`compileStyleMap`);function un(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new u(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+s.repeat(`0`,r-t.length)+t}e(un,`encodeHex`);var dn=1,G=2;function fn(e){this.schema=e.schema||Qe,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=s.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ln(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===`"`?G:dn,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}e(fn,`State`);function pn(e,t){for(var n=s.repeat(` `,t),r=0,i=-1,a=``,o,c=e.length;r<c;)i=e.indexOf(`
18
- `,r),i===-1?(o=e.slice(r),r=c):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
19
- `&&(a+=n),a+=o;return a}e(pn,`indentString`);function K(e,t){return`
20
- `+s.repeat(` `,e.indent*t)}e(K,`generateNextLine`);function mn(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}e(mn,`testImplicitResolving`);function q(e){return e===Bt||e===Rt}e(q,`isWhitespace`);function J(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Lt||65536<=e&&e<=1114111}e(J,`isPrintable`);function hn(e){return J(e)&&e!==Lt&&e!==zt&&e!==H}e(hn,`isNsCharOrWhitespace`);function gn(e,t,n){var r=hn(e),i=r&&!q(e);return(n?r:r&&e!==Jt&&e!==en&&e!==tn&&e!==rn&&e!==on)&&e!==Ut&&!(t===U&&!i)||hn(t)&&!q(t)&&e===Ut||t===U&&i}e(gn,`isPlainSafe`);function _n(e){return J(e)&&e!==Lt&&!q(e)&&e!==Yt&&e!==Qt&&e!==U&&e!==Jt&&e!==en&&e!==tn&&e!==rn&&e!==on&&e!==Ut&&e!==Gt&&e!==qt&&e!==Vt&&e!==an&&e!==Xt&&e!==Zt&&e!==Kt&&e!==Ht&&e!==Wt&&e!==$t&&e!==nn}e(_n,`isPlainSafeFirst`);function vn(e){return!q(e)&&e!==U}e(vn,`isPlainSafeLast`);function Y(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}e(Y,`codePointAt`);function yn(e){return/^\n* /.test(e)}e(yn,`needIndentIndicator`);var bn=1,xn=2,Sn=3,Cn=4,X=5;function wn(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=_n(Y(e,0))&&vn(Y(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=Y(e,c),!J(l))return X;h&&=gn(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=Y(e,c),l===H)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!J(l))return X;h&&=gn(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?bn:a===G?X:xn:n>9&&yn(e)?X:o?a===G?X:xn:f?Cn:Sn}e(wn,`chooseScalarStyle`);function Tn(t,n,r,i,a){t.dump=(function(){if(n.length===0)return t.quotingType===G?`""`:`''`;if(!t.noCompatMode&&(sn.indexOf(n)!==-1||cn.test(n)))return t.quotingType===G?`"`+n+`"`:`'`+n+`'`;var o=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),c=i||t.flowLevel>-1&&r>=t.flowLevel;function l(e){return mn(t,e)}switch(e(l,`testAmbiguity`),wn(n,c,t.indent,s,l,t.quotingType,t.forceQuotes&&!i,a)){case bn:return n;case xn:return`'`+n.replace(/'/g,`''`)+`'`;case Sn:return`|`+En(n,t.indent)+Dn(pn(n,o));case Cn:return`>`+En(n,t.indent)+Dn(pn(On(n,s),o));case X:return`"`+An(n)+`"`;default:throw new u(`impossible error: invalid scalar style`)}})()}e(Tn,`writeScalar`);function En(e,t){var n=yn(e)?String(t):``,r=e[e.length-1]===`
21
- `;return n+(r&&(e[e.length-2]===`
22
- `||e===`
23
- `)?`+`:r?``:`-`)+`
24
- `}e(En,`blockHeader`);function Dn(e){return e[e.length-1]===`
25
- `?e.slice(0,-1):e}e(Dn,`dropEndingNewline`);function On(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var r=e.indexOf(`
26
- `);return r=r===-1?e.length:r,n.lastIndex=r,kn(e.slice(0,r),t)})(),i=e[0]===`
27
- `||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
28
- `:``)+kn(c,t),i=a}return r}e(On,`foldString`);function kn(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
29
- `+e.slice(i,a),i=a+1),o=s;return c+=`
30
- `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
31
- `+e.slice(o+1):c+=e.slice(i),c.slice(1)}e(kn,`foldLine`);function An(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Y(e,i),r=W[n],!r&&J(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||un(n);return t}e(An,`escapeString`);function jn(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(Q(e,t,s,!1,!1)||s===void 0&&Q(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}e(jn,`writeFlowSequence`);function Mn(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(Q(e,t+1,c,!0,!0,!1,!0)||c===void 0&&Q(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=K(e,t)),e.dump&&H===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}e(Mn,`writeBlockSequence`);function Nn(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),Q(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),Q(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}e(Nn,`writeFlowMapping`);function Pn(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,d,f,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new u(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)p=``,(!r||i!==``)&&(p+=K(e,t)),l=o[s],d=n[l],e.replacer&&(d=e.replacer.call(n,l,d)),Q(e,t+1,l,!0,!0,!0)&&(f=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,f&&(e.dump&&H===e.dump.charCodeAt(0)?p+=`?`:p+=`? `),p+=e.dump,f&&(p+=K(e,t)),Q(e,t+1,d,!0,f)&&(e.dump&&H===e.dump.charCodeAt(0)?p+=`:`:p+=`: `,p+=e.dump,i+=p));e.tag=a,e.dump=i||`{}`}e(Pn,`writeBlockMapping`);function Z(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,Ft.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(It.call(s.represent,c))r=s.represent[c](t,c);else throw new u(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}e(Z,`detectType`);function Q(e,t,n,r,i,a,o){e.tag=null,e.dump=n,Z(e,n,!1)||Z(e,n,!0);var s=Ft.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var d=s===`[object Object]`||s===`[object Array]`,f,p;if(d&&(f=e.duplicates.indexOf(n),p=f!==-1),(e.tag!==null&&e.tag!==`?`||p||e.indent!==2&&t>0)&&(i=!1),p&&e.usedDuplicates[f])e.dump=`*ref_`+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(Pn(e,t,e.dump,i),p&&(e.dump=`&ref_`+f+e.dump)):(Nn(e,t,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Mn(e,t-1,e.dump,i):Mn(e,t,e.dump,i),p&&(e.dump=`&ref_`+f+e.dump)):(jn(e,t,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&Tn(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new u(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}e(Q,`writeNode`);function Fn(e,t){var n=[],r=[],i,a;for($(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}e(Fn,`getDuplicateReferences`);function $(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)$(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)$(e[r[i]],t,n)}e($,`inspectNode`);function In(e,t){t||={};var n=new fn(t);n.noRefs||Fn(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),Q(n,0,r,!0,!0)?n.dump+`
32
- `:``}e(In,`dump$1`);var Ln={dump:In};function Rn(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}e(Rn,`renamed`);var zn=we,Bn=Pt.load;Pt.loadAll,Ln.dump;export{Bn as n,zn as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-BhL2Ylf6.js";import"./chunk-WYO6CB5R-2sVpzpwa.js";import"./chunk-ICXQ74PX-Cq2aKGhh.js";import"./chunk-C7G6YPKG-zsqJHbjz.js";import"./chunk-OGEWGWER-CLzHww9d.js";import"./chunk-HOUHSVGY-Bl0rPEPe.js";import"./chunk-Q4XR5HBZ-Dju-tUQs.js";import"./chunk-ZGVPDNZ5-CPSkfYQU.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-52WLFC77-BI8xz4Ng.js";import"./chunk-FWX5IMBZ-BFofqCmB.js";import"./chunk-32BRIVSS-DnOQr5Hs.js";import"./chunk-XXDRQBXY-CoR8hY2w.js";import"./chunk-VR4S4FIN-BFByvgIN.js";import{i as t,n,r,t as i}from"./chunk-V7JOEXUC-DY3oUmK_.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-BhL2Ylf6.js";import"./chunk-WYO6CB5R-2sVpzpwa.js";import"./chunk-ICXQ74PX-Cq2aKGhh.js";import"./chunk-C7G6YPKG-zsqJHbjz.js";import"./chunk-OGEWGWER-CLzHww9d.js";import"./chunk-HOUHSVGY-Bl0rPEPe.js";import"./chunk-Q4XR5HBZ-Dju-tUQs.js";import"./chunk-ZGVPDNZ5-CPSkfYQU.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-52WLFC77-BI8xz4Ng.js";import"./chunk-FWX5IMBZ-BFofqCmB.js";import"./chunk-32BRIVSS-DnOQr5Hs.js";import"./chunk-XXDRQBXY-CoR8hY2w.js";import"./chunk-VR4S4FIN-BFByvgIN.js";import{i as t,n,r,t as i}from"./chunk-V7JOEXUC-DY3oUmK_.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BfrZ3jm6.js";import{A as e}from"./mermaid-parser.core-0GwuEqeW.js";export{e as createCynefinServices};
@@ -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,H as s,I as c,J as l,K as u,L as d,N as f,O as p,Q as m,S as h,T as g,U as _,V as v,W as ee,X as y,Y as te,Z as b,_ as ne,a as x,c as re,d as ie,et as S,f as C,h as ae,i as w,it as oe,k as se,m as ce,n as T,nt as le,o as E,p as ue,r as D,s as de,t as O,tt as fe,u as pe,z as me}from"./graphlib-B8gBHxth.js";import{a as he,c as k,d as ge,f as _e,i as ve,l as ye,n as be,o as xe,r as Se,s as Ce,t as A,u as we}from"./map-DsCK-0Cs.js";var Te=/\s/;function Ee(e){for(var t=e.length;t--&&Te.test(e.charAt(t)););return t}var De=/^\s+/;function Oe(e){return e&&e.slice(0,Ee(e)+1).replace(De,``)}var ke=NaN,Ae=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,Me=/^0o[0-7]+$/i,Ne=parseInt;function Pe(e){if(typeof e==`number`)return e;if(S(e))return ke;if(b(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=b(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Oe(e);var n=je.test(e);return n||Me.test(e)?Ne(e.slice(2),n?2:8):Ae.test(e)?ke:+e}var Fe=1/0,Ie=17976931348623157e292;function j(e){return e?(e=Pe(e),e===Fe||e===-Fe?(e<0?-1:1)*Ie:e===e?e:0):e===0?e:0}function Le(e){var t=j(e),n=t%1;return t===t?n?t-n:t:0}function M(e,t,n){if(!b(n))return!1;var r=typeof t;return(r==`number`?me(n)&&_(t,n.length):r==`string`&&t in n)?s(n[t],e):!1}function Re(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&&M(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 N(e){return e!=null&&e.length?r(e,1):[]}function ze(e){return u(v(e,void 0,N),e+``)}var Be=`[object Object]`,Ve=Function.prototype,He=Object.prototype,Ue=Ve.toString,We=He.hasOwnProperty,Ge=Ue.call(Object);function Ke(e){if(!fe(e)||le(e)!=Be)return!1;var t=Ce(e);if(t===null)return!0;var n=We.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Ue.call(n)==Ge}var qe=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function Je(e){return qe.test(e)}var Ye=1,Xe=4;function Ze(e){return Se(e,Ye|Xe)}var Qe=function(){return oe.Date.now()},$e=Object.prototype,et=$e.hasOwnProperty,tt=n(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&M(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=k(a),c=-1,l=o.length;++c<l;){var u=o[c],d=e[u];(d===void 0||s(d,$e[u])&&!et.call(e,u))&&(e[u]=a[u])}return e});function nt(e,t,n){(n!==void 0&&!s(e[t],n)||n===void 0&&!(t in e))&&ge(e,t,n)}function rt(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function it(e){return ye(e,k(e))}function at(e,t,n,r,i,a,o){var s=rt(e,n),l=rt(t,n),u=o.get(l);if(u){nt(e,n,u);return}var p=a?a(s,l,n+``,e,t,o):void 0,h=p===void 0;if(h){var g=m(l),_=!g&&c(l),v=!g&&!_&&f(l);p=l,g||_||v?m(s)?p=s:re(s)?p=_e(s):_?(h=!1,p=xe(l,!0)):v?(h=!1,p=he(l,!0)):p=[]:Ke(l)||d(l)?(p=s,d(s)?p=it(s):(!b(s)||te(s))&&(p=ve(l))):h=!1}h&&(o.set(l,p),i(p,l,r,a,o),o.delete(l)),nt(e,n,p)}function ot(e,t,n,r,i){e!==t&&ie(t,function(a,o){if(i||=new h,b(a))at(e,t,o,n,ot,r,i);else{var s=r?r(rt(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),nt(e,o,s)}},k)}function P(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function st(e){return function(t,n,r){var i=Object(t);if(!me(t)){var a=C(n,3);t=se(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 ct=Math.max;function lt(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Le(n);return i<0&&(i=ct(r+i,0)),ee(e,C(t,3),i)}var F=st(lt);function ut(e,t){return e==null?e:ie(e,de(t),k)}function dt(e,t){return e&&pe(e,de(t))}function ft(e,t){return e>t}var pt=Object.prototype.hasOwnProperty;function mt(e,t){return e!=null&&pt.call(e,t)}function ht(e,t){return e!=null&&ae(e,t,mt)}var gt=`[object String]`;function _t(e){return typeof e==`string`||!m(e)&&fe(e)&&le(e)==gt}function vt(e,t){return e<t}function I(e,t){var n={};return t=C(t,3),pe(e,function(e,r,i){ge(n,r,t(e,r,i))}),n}function L(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 R(e){return e&&e.length?L(e,y,ft):void 0}var z=Re(function(e,t,n){ot(e,t,n)});function B(e){return e&&e.length?L(e,y,vt):void 0}function V(e,t){return e&&e.length?L(e,C(t,2),vt):void 0}function yt(e,t,n,r){if(!b(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=b(f)?f:_(t[o+1])?[]:{})}we(l,u,d),l=l[u]}return e}function bt(e,t,n){for(var r=-1,a=t.length,o={};++r<a;){var s=t[r],c=g(e,s);n(c,s)&&yt(o,i(s,e),c)}return o}function xt(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function St(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 Ct(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=St(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function wt(t,n,r){n=n.length?e(n,function(e){return m(e)?function(t){return g(t,e.length===1?e[0]:e)}:e}):[y];var i=-1;return n=e(n,o(C)),xt(be(t,function(t,r,a){return{criteria:e(n,function(e){return e(t)}),index:++i,value:t}}),function(e,t){return Ct(e,t,r)})}var Tt=ue(`length`),Et=`\\ud800-\\udfff`,Dt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Ot=`\\ufe0e\\ufe0f`,kt=`[`+Et+`]`,H=`[`+Dt+`]`,U=`\\ud83c[\\udffb-\\udfff]`,At=`(?:`+H+`|`+U+`)`,jt=`[^`+Et+`]`,Mt=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Nt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Pt=`\\u200d`,Ft=At+`?`,It=`[`+Ot+`]?`,Lt=`(?:`+Pt+`(?:`+[jt,Mt,Nt].join(`|`)+`)`+It+Ft+`)*`,Rt=It+Ft+Lt,zt=`(?:`+[jt+H+`?`,H,Mt,Nt,kt].join(`|`)+`)`,Bt=RegExp(U+`(?=`+U+`)|`+zt+Rt,`g`);function Vt(e){for(var t=Bt.lastIndex=0;Bt.test(e);)++t;return t}function Ht(e){return Je(e)?Vt(e):Tt(e)}function Ut(e,t){return bt(e,t,function(t,n){return ce(e,n)})}var W=ze(function(e,t){return e==null?{}:Ut(e,t)}),Wt=Math.ceil,Gt=Math.max;function Kt(e,t,n,r){for(var i=-1,a=Gt(Wt((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function qt(e){return function(t,n,r){return r&&typeof r!=`number`&&M(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),Kt(t,n,r,e)}}var G=qt(),Jt=`[object Map]`,Yt=`[object Set]`;function Xt(e){if(e==null)return 0;if(me(e))return _t(e)?Ht(e):e.length;var n=ne(e);return n==Jt||n==Yt?e.size:t(e).length}var K=n(function(e,t){if(e==null)return[];var n=t.length;return n>1&&M(e,t[0],t[1])?t=[]:n>2&&M(t[0],t[1],t[2])&&(t=[t[0]]),wt(e,r(t,1),[])}),Zt=0;function q(e){var t=++Zt;return p(e)+t}function Qt(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 $t(e,t){return Qt(e||[],t||[],we)}var en=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return tn(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&tn(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,nn)),n=n._prev;return`[`+e.join(`, `)+`]`}};function tn(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function nn(e,t){if(e!==`_next`&&e!==`_prev`)return t}var rn=l(1);function an(e,t){if(e.nodeCount()<=1)return[];var n=sn(e,t||rn);return N(A(on(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function on(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)J(e,t,n,o);for(;o=i.dequeue();)J(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(J(e,t,n,o,!0));break}}}return r}function J(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,cn(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,cn(t,n,o)}),e.removeNode(r.v),a}function sn(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=G(i+r+3).map(function(){return new en}),o=r+1;return E(n.nodes(),function(e){cn(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function cn(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 ln(e){E(e.graph().acyclicer===`greedy`?an(e,t(e)):un(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,q(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function un(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 dn(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 Y(e,t,n,r){var i;do i=q(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function fn(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 pn(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 mn(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 X(e){var t=A(G(vn(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 hn(e){var t=B(A(e.nodes(),function(t){return e.node(t).rank}));E(e.nodes(),function(n){var r=e.node(n);ht(r,`rank`)&&(r.rank-=t)})}function gn(e){var t=B(A(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 _n(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Y(e,`border`,i,t)}function vn(e){return R(A(e.nodes(),function(t){var n=e.node(t).rank;if(!D(n))return n}))}function yn(e,t){var n={lhs:[],rhs:[]};return E(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function bn(e,t){var n=Qe();try{return t()}finally{console.log(e+` time: `+(Qe()-n)+`ms`)}}function xn(e,t){return t()}function Sn(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)Cn(e,`borderLeft`,`_bl`,n,i,a),Cn(e,`borderRight`,`_br`,n,i,a)}}E(e.children(),t)}function Cn(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Y(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function wn(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&En(e)}function Tn(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&On(e),(t===`lr`||t===`rl`)&&(An(e),En(e))}function En(e){E(e.nodes(),function(t){Dn(e.node(t))}),E(e.edges(),function(t){Dn(e.edge(t))})}function Dn(e){var t=e.width;e.width=e.height,e.height=t}function On(e){E(e.nodes(),function(t){kn(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);E(n.points,kn),Object.prototype.hasOwnProperty.call(n,`y`)&&kn(n)})}function kn(e){e.y=-e.y}function An(e){E(e.nodes(),function(t){jn(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);E(n.points,jn),Object.prototype.hasOwnProperty.call(n,`x`)&&jn(n)})}function jn(e){var t=e.x;e.x=e.y,e.y=t}function Mn(e){e.graph().dummyChains=[],E(e.edges(),function(t){Nn(e,t)})}function Nn(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=Y(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 Pn(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 Fn(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=B(A(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 In(e){var t=new O({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ln(t,e)<r;)i=Rn(t,e),a=t.hasNode(i.v)?Z(e,i):-Z(e,i),zn(t,e,a);return t}function Ln(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 Rn(e,t){return V(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Z(t,n)})}function zn(e,t,n){E(e.nodes(),function(e){t.node(e).rank+=n})}l(1),l(1),Bn.CycleException=Q;function Bn(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),Xt(t)!==e.nodeCount())throw new Q;return r}function Q(){}Q.prototype=Error();function Vn(e,t,n){m(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);Hn(e,t,n===`post`,a,r,i)}),i}function Hn(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),E(i(t),function(t){Hn(e,t,n,r,i,a)}),n&&a.push(t))}function Un(e,t){return Vn(e,t,`post`)}function Wn(e,t){return Vn(e,t,`pre`)}$.initLowLimValues=Jn,$.initCutValues=Gn,$.calcCutValue=qn,$.leaveEdge=Xn,$.enterEdge=Zn,$.exchangeEdges=Qn;function $(e){e=fn(e),Fn(e);var t=In(e);Jn(t),Gn(t,e);for(var n,r;n=Xn(t);)r=Zn(t,e,n),Qn(t,e,n,r)}function Gn(e,t){var n=Un(e,e.nodes());n=n.slice(0,n.length-1),E(n,function(n){Kn(e,t,n)})}function Kn(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=qn(e,t,n)}function qn(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,er(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Jn(e,t){arguments.length<2&&(t=e.nodes()[0]),Yn(e,{},1,t)}function Yn(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=Yn(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Xn(e){return F(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Zn(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),V(x(t.edges(),function(t){return c===tr(e,e.node(t.v),s)&&c!==tr(e,e.node(t.w),s)}),function(e){return Z(t,e)})}function Qn(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Jn(e),Gn(e,t),$n(e,t)}function $n(e,t){var n=Wn(e,F(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 er(e,t,n){return e.hasEdge(t,n)}function tr(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function nr(e){switch(e.graph().ranker){case`network-simplex`:ar(e);break;case`tight-tree`:ir(e);break;case`longest-path`:rr(e);break;default:ar(e)}}var rr=Fn;function ir(e){Fn(e),In(e)}function ar(e){$(e)}function or(e){var t=Y(e,`root`,{},`_root`),n=cr(e),r=R(w(n))-1,i=2*r+1;e.graph().nestingRoot=t,E(e.edges(),function(t){e.edge(t).minlen*=i});var a=lr(e)+1;E(e.children(),function(o){sr(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function sr(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=_n(e,`_bt`),l=_n(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,E(s,function(s){sr(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 cr(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 lr(e){return T(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function ur(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 dr(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 fr(e,t,n){var r=pr(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 pr(e){for(var t;e.hasNode(t=q(`_root`)););return t}function mr(e,t){for(var n=0,r=1;r<t.length;++r)n+=hr(e,t[r-1],t[r]);return n}function hr(e,t,n){for(var r=$t(n,A(n,function(e,t){return t})),i=N(A(t,function(t){return K(A(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=A(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 gr(e){var t={},n=x(e.nodes(),function(t){return!e.children(t).length}),r=A(G(R(A(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){ht(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),E(e.successors(n),i))}return E(K(n,function(t){return e.node(t).rank}),i),r}function _r(e,t){return A(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}}else return{v:t}})}function vr(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]))}),yr(x(n,function(e){return!e.indegree}))}function yr(e){var t=[];function n(e){return function(t){t.merged||(D(t.barycenter)||D(e.barycenter)||t.barycenter>=e.barycenter)&&br(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 A(x(t,function(e){return!e.merged}),function(e){return W(e,[`vs`,`i`,`barycenter`,`weight`])})}function br(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 xr(e,t){var n=yn(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=K(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Cr(!!t)),c=Sr(a,i,c),E(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Sr(a,i,c)});var l={vs:N(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function Sr(e,t,n){for(var r;t.length&&(r=P(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Cr(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 wr(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=_r(e,i);E(l,function(t){if(e.children(t.v).length){var i=wr(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Er(t,i)}});var u=vr(l,n);Tr(u,c);var d=xr(u,r);if(o&&(d.vs=N([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 Tr(e,t){E(e,function(e){e.vs=N(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Er(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 Dr(e){var t=vn(e),n=Or(e,G(1,t+1),`inEdges`),r=Or(e,G(t-1,-1,-1),`outEdges`),i=gr(e);Ar(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){kr(s%2?n:r,s%4>=2),i=X(e);var l=mr(e,i);l<a&&(c=0,o=Ze(i),a=l)}Ar(e,o)}function Or(e,t,n){return A(t,function(t){return fr(e,t,n)})}function kr(e,t){var n=new O;E(e,function(e){var r=e.graph().root,i=wr(e,r,n,t);E(i.vs,function(t,n){e.node(t).order=n}),dr(e,n,i.vs)})}function Ar(e,t){E(t,function(t){E(t,function(t,n){e.node(t).order=n})})}function jr(e){var t=Nr(e);E(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=Mr(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 Mr(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 Nr(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 Pr(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=P(r);return E(r,function(t,c){var l=Ir(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)&&Lr(n,r,t)})}),a=c+1,i=u)}),r}return T(t,r),n}function Fr(e,t){var n={};function r(t,r,i,a,o){var s;E(G(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)&&Lr(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 Ir(e,t){if(e.node(t).dummy)return F(e.predecessors(t),function(t){return e.node(t).dummy})}function Lr(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 Rr(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function zr(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=K(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]&&!Rr(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function Br(e,t,n,r,i){var a={},o=Vr(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 Vr(e,t,n,r){var i=new O,a=e.graph(),o=Kr(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 Hr(e,t){return V(w(t),function(t){var n=-1/0,r=1/0;return ut(t,function(t,i){var a=qr(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Ur(e,t){var n=w(t),r=B(n),i=R(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-B(l):i-R(l),c&&(e[o]=I(s,function(e){return e+c}))}})})}function Wr(e,t){return I(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=K(A(e,r));return(i[1]+i[2])/2})}function Gr(e){var t=X(e),n=z(Pr(e,t),Fr(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=A(i,function(e){return w(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=zr(e,i,n,o),c=Br(e,i,s.root,s.align,t===`r`);t===`r`&&(c=I(c,function(e){return-e})),r[a+t]=c})}),Ur(r,Hr(e,r)),Wr(r,e.graph().align)}function Kr(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;break}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;break}return l&&(c+=n?l:-l),l=0,c}}function qr(e,t){return e.node(t).width}function Jr(e){e=pn(e),Yr(e),dt(Gr(e),function(t,n){e.node(n).x=t})}function Yr(e){var t=X(e),n=e.graph().ranksep,r=0;E(t,function(t){var i=R(A(t,function(t){return e.node(t).height}));E(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function Xr(e,t){var n=t&&t.debugTiming?bn:xn;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>si(e));n(` runLayout`,()=>Zr(t,n)),n(` updateInputGraph`,()=>Qr(e,t))})}function Zr(e,t){t(` makeSpaceForEdgeLabels`,()=>ci(e)),t(` removeSelfEdges`,()=>_i(e)),t(` acyclic`,()=>ln(e)),t(` nestingGraph.run`,()=>or(e)),t(` rank`,()=>nr(pn(e))),t(` injectEdgeLabelProxies`,()=>li(e)),t(` removeEmptyRanks`,()=>gn(e)),t(` nestingGraph.cleanup`,()=>ur(e)),t(` normalizeRanks`,()=>hn(e)),t(` assignRankMinMax`,()=>ui(e)),t(` removeEdgeLabelProxies`,()=>di(e)),t(` normalize.run`,()=>Mn(e)),t(` parentDummyChains`,()=>jr(e)),t(` addBorderSegments`,()=>Sn(e)),t(` order`,()=>Dr(e)),t(` insertSelfEdges`,()=>vi(e)),t(` adjustCoordinateSystem`,()=>wn(e)),t(` position`,()=>Jr(e)),t(` positionSelfEdges`,()=>yi(e)),t(` removeBorderNodes`,()=>gi(e)),t(` normalize.undo`,()=>Pn(e)),t(` fixupEdgeLabelCoords`,()=>mi(e)),t(` undoCoordinateSystem`,()=>Tn(e)),t(` translateGraph`,()=>fi(e)),t(` assignNodeIntersects`,()=>pi(e)),t(` reversePoints`,()=>hi(e)),t(` acyclic.undo`,()=>dn(e))}function Qr(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 $r=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],ei={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},ti=[`acyclicer`,`ranker`,`rankdir`,`align`],ni=[`width`,`height`],ri={width:0,height:0},ii=[`minlen`,`weight`,`width`,`height`,`labeloffset`],ai={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},oi=[`labelpos`];function si(e){var t=new O({multigraph:!0,compound:!0}),n=xi(e.graph());return t.setGraph(z({},ei,bi(n,$r),W(n,ti))),E(e.nodes(),function(n){var r=xi(e.node(n));t.setNode(n,tt(bi(r,ni),ri)),t.setParent(n,e.parent(n))}),E(e.edges(),function(n){var r=xi(e.edge(n));t.setEdge(n,z({},ai,bi(r,ii),W(r,oi)))}),t}function ci(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 li(e){E(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Y(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function ui(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=R(t,r.maxRank))}),e.graph().maxRank=t}function di(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 fi(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 pi(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(mn(r,a)),n.points.push(mn(i,o))})}function mi(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;break}})}function hi(e){E(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function gi(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(P(n.borderLeft)),o=e.node(P(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 _i(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 vi(e){E(X(e),function(t){var n=0;E(t,function(t,r){var i=e.node(t);i.order=r+n,E(i.selfEdges,function(t){Y(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 yi(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 bi(e,t){return I(W(e,t),Number)}function xi(e){var t={};return E(e,function(e,n){t[n.toLowerCase()]=e}),t}export{Xr as t};
@@ -1,4 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-BhL2Ylf6.js";import{x as n}from"./chunk-WYO6CB5R-2sVpzpwa.js";import"./chunk-ICXQ74PX-Cq2aKGhh.js";import"./chunk-C7G6YPKG-zsqJHbjz.js";import{n as r}from"./chunk-OGEWGWER-CLzHww9d.js";import"./chunk-HOUHSVGY-Bl0rPEPe.js";import"./chunk-Q4XR5HBZ-Dju-tUQs.js";import{a as i,c as a,i as o,l as s,n as c,t as l,u}from"./chunk-ZGVPDNZ5-CPSkfYQU.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import{a as d,i as f,o as p,r as m,t as h}from"./chunk-52WLFC77-BI8xz4Ng.js";import{t as g}from"./graphlib-B8gBHxth.js";import{t as _}from"./dagre-CXRCoUWR.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./chunk-RYQCIY6F-C1vISHVj.js";var w=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),T=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),E=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`,`shouldMergeSelfLoopSegments`),D=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 T(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`:T(i)},`getSelfLoopSide`),O=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=w(Math.max(r,e.width*.35),36,c),u=w(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`),k=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`),A=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=D(e,l,n,c.start,a),f=O(l,d,t,u.width??0),p=k(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`),j=e(async(n,c,l,d,h,g)=>{t.warn(`Graph in recursive render:XAX`,x(c),h);let b=c.graph().rankdir;t.trace(`Dir in recursive render - dir:`,b);let C=n.insert(`g`).attr(`class`,`root`);c.nodes()?t.info(`Recursive render XXX`,c.nodes()):t.info(`No nodes found for`,c),c.edges().length>0&&t.info(`Recursive edges`,c.edge(c.edges()[0]));let w=C.insert(`g`).attr(`class`,`clusters`),T=C.insert(`g`).attr(`class`,`edgePaths`),D=C.insert(`g`).attr(`class`,`edgeLabels`),O=C.insert(`g`).attr(`class`,`nodes`),k=E(l);await Promise.all(c.nodes().map(async function(e){let n=c.node(e);if(h!==void 0){let n=JSON.parse(JSON.stringify(h.clusterData));t.trace(`Setting data for parent cluster XXX
2
- Node.id = `,e,`
3
- data=`,n.height,`
4
- Parent cluster`,h.height),c.setNode(h.id,n),c.parent(e)||(t.trace(`Setting parent`,e,h.id),c.setParent(e,h.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(c.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,c.node(e));let{ranksep:r,nodesep:i}=c.graph();n.graph.setGraph({...n.graph.graph(),ranksep:r+25,nodesep:i});let a=await j(O,n.graph,l,d,c.node(e),g),o=a.elem;u(n,o),n.diff=a.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),s(o,n)}else c.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,c),t.trace(y(n.id,c)),S.set(n.id,{id:y(n.id,c),node:n})):(t.trace(`Node - the non recursive path XAX`,e,O,c.node(e),b),await i(O,c.node(e),{config:g,dir:b}))})),await e(async()=>{let e=c.edges().map(async function(e){let n=c.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(c.edge(e))),t.info(`Fix`,S,`ids:`,e.v,e.w,`Translating: `,S.get(e.v),S.get(e.w)),k&&n.selfLoop){if(n.selfLoop.order!==1)return;let e=n.id;n.id=n.selfLoop.id,await f(D,n),n.id=e;return}await f(D,n)});await Promise.all(e)},`processEdges`)(),t.info(`Graph before layout:`,JSON.stringify(x(c))),t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),_(c),t.info(`Graph after layout:`,JSON.stringify(x(c)));let M=0,{subGraphTitleTotalMargin:N}=r(g);await Promise.all(v(c).map(async function(e){let n=c.node(e);if(t.info(`Position XBX => `+e+`: (`+n.x,`,`+n.y,`) width: `,n.width,` height: `,n.height),n?.clusterNode)n.y+=N,t.info(`A tainted cluster node XBX1`,e,n.id,n.width,n.height,n.x,n.y,c.parent(e)),S.get(n.id).node=n,a(n);else if(c.children(e).length>0){t.info(`A pure cluster node XBX1`,e,n.id,n.x,n.y,n.width,n.height,c.parent(e)),n.height+=N,c.node(n.parentId);let r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;t.debug(`OffsetY`,a,`labelHeight`,i,`halfPadding`,r),await o(w,n),S.get(n.id).node=n}else{let e=c.node(n.parentId);n.y+=N/2,t.info(`A regular node XBX1 - using the padding`,n.id,`parent`,n.parentId,n.width,n.height,n.x,n.y,`offsetY`,n.offsetY,`parent`,e,e?.offsetY,n),a(n)}}));let P=N/2;return A(c,P,{mergeSelfLoops:k}).forEach(function({edge:e,start:n,end:r}){t.info(`Edge `+n+` -> `+r+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=P);let i=c.node(n),a=c.node(r);p(e,m(T,e,S,l,i,a,d))}),c.nodes().forEach(function(e){let n=c.node(e);t.info(e,n.type,n.diff),n.isGroup&&(M=n.diff)}),t.warn(`Returning from recursive render XAX`,C,M),{elem:C,diff:M}},`recursiveRender`),M=e(async(e,r)=>{let i=new g({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=r.select(`g`);d(a,e.markers,e.type,e.diagramId),c(),h(),l(),b(),e.nodes.forEach(e=>{i.setNode(e.id,{...e}),e.parentId&&i.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,n=t+`---`+t+`---1`,r=t+`---`+t+`---2`,a=i.node(t);i.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),i.setParent(n,a.parentId),i.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),i.setParent(r,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`,i.setEdge(t,n,s,t+`-cyclic-special-0`),i.setEdge(n,r,c,t+`-cyclic-special-1`),i.setEdge(r,t,l,t+`-cyclic-special-2`)}else i.setEdge(e.start,e.end,{...e},e.id)}),t.warn(`Graph at first:`,JSON.stringify(x(i))),C(i),t.warn(`Graph after XAX:`,JSON.stringify(x(i)));let o=n();await j(a,i,e.type,e.diagramId,void 0,o)},`render`);export{A as getEdgesToRender,M as render};