@eeshaai/code 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/LICENSE.md +3 -3
  2. package/README.md +337 -322
  3. package/dist/cli.js +4 -4
  4. package/dist/resources/styles/custom/instructions/design.md +283 -283
  5. package/dist/resources/styles/custom/instructions/requirements.md +161 -161
  6. package/dist/resources/styles/custom/instructions/tasks-implement.md +90 -90
  7. package/dist/resources/styles/custom/instructions/tasks.md +159 -159
  8. package/dist/resources/styles/custom/process.md +49 -49
  9. package/dist/resources/styles/custom/prompts/first.md +29 -29
  10. package/dist/resources/styles/custom/prompts/implement.md +27 -27
  11. package/dist/resources/styles/custom/prompts/rewrite-note.md +40 -40
  12. package/dist/resources/styles/custom/prompts/rewrite.md +32 -32
  13. package/dist/resources/styles/custom/style.yml +46 -46
  14. package/dist/resources/styles/grammar.md +727 -731
  15. package/dist/resources/styles/kiro/style.yml +63 -0
  16. package/dist/resources/styles/speckit/style.yml +59 -0
  17. package/dist/server.js +465 -486
  18. package/dist/web/chunks/{abnfDiagram-VCTEODGH-6KC3BO47.js → abnfDiagram-VCTEODGH-P6AZFXJU.js} +2 -2
  19. package/dist/web/chunks/architecture-7GRP2DOG-K6PMPK7N.js +2 -0
  20. package/dist/web/chunks/{architectureDiagram-5GKGNRK7-QKPCVOD2.js → architectureDiagram-5GKGNRK7-JB5DD7KL.js} +2 -2
  21. package/dist/web/chunks/{blockDiagram-I7D4REHJ-4XZWNXLB.js → blockDiagram-I7D4REHJ-ARCDWS5D.js} +2 -2
  22. package/dist/web/chunks/{c4Diagram-7LVT6UL2-4HJHKNE3.js → c4Diagram-7LVT6UL2-57CIXPJZ.js} +2 -2
  23. package/dist/web/chunks/{chunk-GQPX4EIC.js → chunk-3EZ2OKHV.js} +2 -2
  24. package/dist/web/chunks/{chunk-37NHO5VO.js → chunk-4KJ2U3VQ.js} +2 -2
  25. package/dist/web/chunks/{chunk-OXLTOJNY.js → chunk-4ZUFUR3U.js} +2 -2
  26. package/dist/web/chunks/{chunk-46RPN6IE.js → chunk-63W35XXT.js} +2 -2
  27. package/dist/web/chunks/{chunk-LSVIQRSY.js → chunk-6YVFH4BZ.js} +2 -2
  28. package/dist/web/chunks/{chunk-6VRLULJH.js → chunk-7PUK2GON.js} +2 -2
  29. package/dist/web/chunks/{chunk-TPXX77KB.js → chunk-7Q4TXKAS.js} +2 -2
  30. package/dist/web/chunks/{chunk-4S2DRQJ6.js → chunk-7QRY2XB7.js} +2 -2
  31. package/dist/web/chunks/{chunk-2DLEMZHM.js → chunk-CA2KMNVI.js} +2 -2
  32. package/dist/web/chunks/{chunk-LHNPPNB7.js → chunk-CFMSYLIK.js} +2 -2
  33. package/dist/web/chunks/{chunk-4TORDSRR.js → chunk-CKJRXIX7.js} +2 -2
  34. package/dist/web/chunks/{chunk-L34PKG4P.js → chunk-CXXG5KL5.js} +2 -2
  35. package/dist/web/chunks/chunk-EFBAEJZJ.js +2 -0
  36. package/dist/web/chunks/{chunk-LQ6CTWX6.js → chunk-FKTXB6RJ.js} +2 -2
  37. package/dist/web/chunks/{chunk-TXNHMPKM.js → chunk-FU7R4QOG.js} +2 -2
  38. package/dist/web/chunks/{chunk-DIRT34TZ.js → chunk-GEV6X2TZ.js} +2 -2
  39. package/dist/web/chunks/{chunk-II6WN3ZG.js → chunk-GPW7TXQS.js} +2 -2
  40. package/dist/web/chunks/{chunk-5KNOHX5X.js → chunk-I6RMTJPN.js} +2 -2
  41. package/dist/web/chunks/{chunk-6TGTE6CF.js → chunk-IKC3ZQV7.js} +2 -2
  42. package/dist/web/chunks/{chunk-LDXBIOBF.js → chunk-ITN3D7RJ.js} +2 -2
  43. package/dist/web/chunks/{chunk-OODDZ447.js → chunk-J6N7AUC2.js} +2 -2
  44. package/dist/web/chunks/{chunk-FGASMJTA.js → chunk-J7VDGOTK.js} +2 -2
  45. package/dist/web/chunks/chunk-KVRWT2YT.js +2 -0
  46. package/dist/web/chunks/{chunk-6URXM4C4.js → chunk-NBC6B3KN.js} +2 -2
  47. package/dist/web/chunks/{chunk-HBEUVMXY.js → chunk-NLHJT4GD.js} +2 -2
  48. package/dist/web/chunks/{chunk-HNYXDXPN.js → chunk-NOVL2262.js} +2 -2
  49. package/dist/web/chunks/{chunk-FPLIRG3U.js → chunk-NQ2XP5EN.js} +2 -2
  50. package/dist/web/chunks/chunk-P44J6WNO.js +2 -0
  51. package/dist/web/chunks/{chunk-6KSWTVXD.js → chunk-QBOSTM7Q.js} +2 -2
  52. package/dist/web/chunks/{chunk-HAKJ3AUV.js → chunk-QKU4ZFG5.js} +2 -2
  53. package/dist/web/chunks/{chunk-T4HEWXAQ.js → chunk-RINQGKTH.js} +2 -2
  54. package/dist/web/chunks/{chunk-TPYBIPJG.js → chunk-RK4EOCHJ.js} +2 -2
  55. package/dist/web/chunks/{chunk-YM7LHP34.js → chunk-S4X6ERXI.js} +2 -2
  56. package/dist/web/chunks/{chunk-VY4GEFSG.js → chunk-SE57RN36.js} +2 -2
  57. package/dist/web/chunks/{chunk-6FQEBIA3.js → chunk-SGL7WI35.js} +3 -3
  58. package/dist/web/chunks/chunk-SOAWGUAD.js +2 -0
  59. package/dist/web/chunks/{chunk-7XAOOQR4.js → chunk-U6ILIHMR.js} +2 -2
  60. package/dist/web/chunks/{chunk-M3SWKTLZ.js → chunk-USZ3ZJYA.js} +2 -2
  61. package/dist/web/chunks/{chunk-MBZYSJFT.js → chunk-UU7BHEBD.js} +2 -2
  62. package/dist/web/chunks/{chunk-QNEZP2TE.js → chunk-WL4ZMLPV.js} +2 -2
  63. package/dist/web/chunks/{chunk-MZEMPN3C.js → chunk-XE4RLI22.js} +2 -2
  64. package/dist/web/chunks/{chunk-VAKN3BTM.js → chunk-XJ6FSQEO.js} +2 -2
  65. package/dist/web/chunks/{chunk-XBYCKXUJ.js → chunk-XM7VXEGI.js} +2 -2
  66. package/dist/web/chunks/{chunk-2RFQIKC6.js → chunk-XO4SHRSO.js} +2 -2
  67. package/dist/web/chunks/{chunk-BUZPUGIT.js → chunk-XOZZFIHV.js} +2 -2
  68. package/dist/web/chunks/{chunk-FNIFXWXL.js → chunk-YYJ5VFH5.js} +2 -2
  69. package/dist/web/chunks/{chunk-JOSXY3EP.js → chunk-ZX45GMMJ.js} +2 -2
  70. package/dist/web/chunks/{chunk-4IPDIKAU.js → chunk-ZXMMITLE.js} +2 -2
  71. package/dist/web/chunks/classDiagram-ZZMXUADV-ALD5ECFE.js +2 -0
  72. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-IMIEVQNX.js +2 -0
  73. package/dist/web/chunks/{cose-bilkent-JH36ORCC-ZPRW5JRW.js → cose-bilkent-JH36ORCC-YVEPG7XZ.js} +2 -2
  74. package/dist/web/chunks/cynefin-OW5HDTMX-5G3MG4ZJ.js +2 -0
  75. package/dist/web/chunks/{cynefinDiagram-5FMLGOSQ-O7GURHJG.js → cynefinDiagram-5FMLGOSQ-A3E3NM6X.js} +2 -2
  76. package/dist/web/chunks/{dagre-GXQ25YYZ-WK67O4N6.js → dagre-GXQ25YYZ-WKL3XLC6.js} +2 -2
  77. package/dist/web/chunks/{diagram-S7CK7UJ4-2CEO2EN2.js → diagram-S7CK7UJ4-AENTNBTM.js} +2 -2
  78. package/dist/web/chunks/{diagram-UQ7AKVKN-2Z4VHGF3.js → diagram-UQ7AKVKN-BN6IVDBP.js} +2 -2
  79. package/dist/web/chunks/{diagram-VSXAHHWV-AN4BOWYB.js → diagram-VSXAHHWV-X7IW7FU6.js} +2 -2
  80. package/dist/web/chunks/{diagram-VX7I27RA-VEZ2GXCM.js → diagram-VX7I27RA-4V6RQ6IS.js} +2 -2
  81. package/dist/web/chunks/{diagram-Z3DM3KII-TGGNDSLW.js → diagram-Z3DM3KII-ODYVRYAT.js} +2 -2
  82. package/dist/web/chunks/{ebnfDiagram-PWID7BFC-7RM57IJV.js → ebnfDiagram-PWID7BFC-2KD46JNN.js} +2 -2
  83. package/dist/web/chunks/{erDiagram-RLTQ6QDP-LCATC3YT.js → erDiagram-RLTQ6QDP-6MYZ2NRT.js} +2 -2
  84. package/dist/web/chunks/eventmodeling-NTZA5JFV-QZXC5VKS.js +2 -0
  85. package/dist/web/chunks/flowDiagram-HODETNUW-BILJ37ZX.js +2 -0
  86. package/dist/web/chunks/{ganttDiagram-EL5Y4UJY-5VPBBF2V.js → ganttDiagram-EL5Y4UJY-LVA23DND.js} +2 -2
  87. package/dist/web/chunks/gitGraph-4MIJSDKK-H43S2MKN.js +2 -0
  88. package/dist/web/chunks/{gitGraphDiagram-WWUBYQGX-HZMAGPIJ.js → gitGraphDiagram-WWUBYQGX-JRB4SUZI.js} +2 -2
  89. package/dist/web/chunks/info-A6RAGUB7-DKS7Q63Q.js +2 -0
  90. package/dist/web/chunks/infoDiagram-27XIBGKW-JLOVILVF.js +3 -0
  91. package/dist/web/chunks/{ishikawaDiagram-5VMMS53U-A54WWBPX.js → ishikawaDiagram-5VMMS53U-SUA2YN5D.js} +2 -2
  92. package/dist/web/chunks/{journeyDiagram-3NMN7TZE-XRCTMTR7.js → journeyDiagram-3NMN7TZE-ORMC2WB2.js} +2 -2
  93. package/dist/web/chunks/{kanban-definition-UXKFOSKX-UW2PQXZF.js → kanban-definition-UXKFOSKX-TPRG3VMF.js} +2 -2
  94. package/dist/web/chunks/{katex-B7HWCVTN.js → katex-DLHJF5VS.js} +2 -2
  95. package/dist/web/chunks/{mermaid.core-VL5SQK5M.js → mermaid.core-ZM3JSPVU.js} +3 -3
  96. package/dist/web/chunks/{mindmap-definition-YA3MSWOX-2H2Z6CVN.js → mindmap-definition-YA3MSWOX-BLW6WWFS.js} +2 -2
  97. package/dist/web/chunks/packet-AYTQ26CC-FIXQVEDM.js +2 -0
  98. package/dist/web/chunks/{pegDiagram-XKGWAZYB-KC4BYUN7.js → pegDiagram-XKGWAZYB-BYMP3YHY.js} +2 -2
  99. package/dist/web/chunks/pie-WAS4IAKB-R4EUNVPB.js +2 -0
  100. package/dist/web/chunks/{pieDiagram-E7YTZNPT-54T6XSU5.js → pieDiagram-E7YTZNPT-XOJE3H3L.js} +2 -2
  101. package/dist/web/chunks/{quadrantDiagram-AXDQQJYC-3G3RXSTE.js → quadrantDiagram-AXDQQJYC-23VSADTC.js} +2 -2
  102. package/dist/web/chunks/radar-RG4KPBEZ-O6Y2TENX.js +2 -0
  103. package/dist/web/chunks/railroad-74A4TZTK-PHWZ7KVH.js +2 -0
  104. package/dist/web/chunks/railroad-abnf-HS5TGJTU-DZ4OSJAN.js +2 -0
  105. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-GYBLRQUL.js +2 -0
  106. package/dist/web/chunks/railroad-peg-WCYAUIDC-ZK4ZOBSX.js +2 -0
  107. package/dist/web/chunks/{railroadDiagram-O6MQD6OU-3LHKFF5N.js → railroadDiagram-O6MQD6OU-Z5IEAZJK.js} +2 -2
  108. package/dist/web/chunks/{requirementDiagram-BXWQKSXE-M4LF54YT.js → requirementDiagram-BXWQKSXE-MNP4O73E.js} +2 -2
  109. package/dist/web/chunks/{sankeyDiagram-P5KCCOFB-USCKKKNT.js → sankeyDiagram-P5KCCOFB-PADI35QR.js} +2 -2
  110. package/dist/web/chunks/{sequenceDiagram-WJ2MYXX4-QZ2O4KWV.js → sequenceDiagram-WJ2MYXX4-FGWOVXU4.js} +2 -2
  111. package/dist/web/chunks/{sizeCapture-INFHLROL-DZI5JWEV.js → sizeCapture-INFHLROL-Y6H3VQLE.js} +2 -2
  112. package/dist/web/chunks/{stateDiagram-D77RDMKH-EQJNTBF3.js → stateDiagram-D77RDMKH-7PRO4WYR.js} +2 -2
  113. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-2Y6SWEJW.js +2 -0
  114. package/dist/web/chunks/{swimlanes-42K2YHIH-H7SZ2HG6.js → swimlanes-42K2YHIH-DXVTFB6Q.js} +2 -2
  115. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-U2LP4OEE.js +9 -0
  116. package/dist/web/chunks/{timeline-definition-24CTP7MA-4Q2ARIQ6.js → timeline-definition-24CTP7MA-7ZIALE6C.js} +2 -2
  117. package/dist/web/chunks/treeView-Q6P3EWNA-VSJ7TJ36.js +2 -0
  118. package/dist/web/chunks/treemap-WGGIJYW6-JZWFGRKS.js +2 -0
  119. package/dist/web/chunks/{vennDiagram-4TSXK5OY-WMJVK74C.js → vennDiagram-4TSXK5OY-IPXNDYWM.js} +2 -2
  120. package/dist/web/chunks/wardley-WFR3VGLG-PAUUFL5N.js +2 -0
  121. package/dist/web/chunks/{wardleyDiagram-VM6X3IG4-CLB324RQ.js → wardleyDiagram-VM6X3IG4-4Z2U2NNR.js} +2 -2
  122. package/dist/web/chunks/{xychartDiagram-S5SC5T6Z-G5C2R7C2.js → xychartDiagram-S5SC5T6Z-NAEIWN4K.js} +2 -2
  123. package/dist/web/page.css +1 -1
  124. package/dist/web/page.js +156 -125
  125. package/package.json +64 -62
  126. package/dist/web/chunks/architecture-7GRP2DOG-JLXNDD4H.js +0 -2
  127. package/dist/web/chunks/chunk-4KP3BIPB.js +0 -2
  128. package/dist/web/chunks/chunk-HX7W7GSO.js +0 -2
  129. package/dist/web/chunks/chunk-PR453BYT.js +0 -2
  130. package/dist/web/chunks/chunk-R7TFKRNM.js +0 -2
  131. package/dist/web/chunks/classDiagram-ZZMXUADV-4J5HHZD6.js +0 -2
  132. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-X6WY2DAS.js +0 -2
  133. package/dist/web/chunks/cynefin-OW5HDTMX-SVVTQRRB.js +0 -2
  134. package/dist/web/chunks/eventmodeling-NTZA5JFV-2SR57JAH.js +0 -2
  135. package/dist/web/chunks/flowDiagram-HODETNUW-HU6Y2EYQ.js +0 -2
  136. package/dist/web/chunks/gitGraph-4MIJSDKK-25JPIQP7.js +0 -2
  137. package/dist/web/chunks/info-A6RAGUB7-72MROTVX.js +0 -2
  138. package/dist/web/chunks/infoDiagram-27XIBGKW-BQYTPGNG.js +0 -3
  139. package/dist/web/chunks/packet-AYTQ26CC-NEGDW4B6.js +0 -2
  140. package/dist/web/chunks/pie-WAS4IAKB-OT3EMGHT.js +0 -2
  141. package/dist/web/chunks/radar-RG4KPBEZ-DCHU5FOQ.js +0 -2
  142. package/dist/web/chunks/railroad-74A4TZTK-RZX6D7H6.js +0 -2
  143. package/dist/web/chunks/railroad-abnf-HS5TGJTU-STTFN7R4.js +0 -2
  144. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-RBXU3IBK.js +0 -2
  145. package/dist/web/chunks/railroad-peg-WCYAUIDC-OD5BXOH6.js +0 -2
  146. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-WSCDKLG6.js +0 -2
  147. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-DFYTBPVS.js +0 -9
  148. package/dist/web/chunks/treeView-Q6P3EWNA-ADCP6RPT.js +0 -2
  149. package/dist/web/chunks/treemap-WGGIJYW6-NEV7DUDY.js +0 -2
  150. package/dist/web/chunks/wardley-WFR3VGLG-4QZOFDI5.js +0 -2
@@ -1,4 +1,4 @@
1
- import{a as i}from"./chunk-LDXBIOBF.js";import{d as _n}from"./chunk-R7TFKRNM.js";_n();function Zn(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}i(Zn,"getDefaultExportFromCjs");var D={},Ye={},oe={},In;function ge(){if(In)return oe;In=1;function w(d){return typeof d>"u"||d===null}i(w,"isNothing");function E(d){return typeof d=="object"&&d!==null}i(E,"isObject");function _(d){return Array.isArray(d)?d:w(d)?[]:[d]}i(_,"toArray");function O(d,p){if(p){let C=Object.keys(p);for(let o=0,u=C.length;o<u;o+=1){let T=C[o];d[T]=p[T]}}return d}i(O,"extend");function h(d,p){let C="";for(let o=0;o<p;o+=1)C+=d;return C}i(h,"repeat");function y(d){return d===0&&Number.NEGATIVE_INFINITY===1/d}return i(y,"isNegativeZero"),oe.isNothing=w,oe.isObject=E,oe.toArray=_,oe.repeat=h,oe.isNegativeZero=y,oe.extend=O,oe}i(ge,"requireCommon");var De,kn;function Ae(){if(kn)return De;kn=1;function w(_,O){let h="",y=_.reason||"(unknown reason)";return _.mark?(_.mark.name&&(h+='in "'+_.mark.name+'" '),h+="("+(_.mark.line+1)+":"+(_.mark.column+1)+")",!O&&_.mark.snippet&&(h+=`
1
+ import{a as i}from"./chunk-ITN3D7RJ.js";import{d as _n}from"./chunk-SOAWGUAD.js";_n();function Zn(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}i(Zn,"getDefaultExportFromCjs");var D={},Ye={},oe={},In;function ge(){if(In)return oe;In=1;function w(d){return typeof d>"u"||d===null}i(w,"isNothing");function E(d){return typeof d=="object"&&d!==null}i(E,"isObject");function _(d){return Array.isArray(d)?d:w(d)?[]:[d]}i(_,"toArray");function O(d,p){if(p){let C=Object.keys(p);for(let o=0,u=C.length;o<u;o+=1){let T=C[o];d[T]=p[T]}}return d}i(O,"extend");function h(d,p){let C="";for(let o=0;o<p;o+=1)C+=d;return C}i(h,"repeat");function y(d){return d===0&&Number.NEGATIVE_INFINITY===1/d}return i(y,"isNegativeZero"),oe.isNothing=w,oe.isObject=E,oe.toArray=_,oe.repeat=h,oe.isNegativeZero=y,oe.extend=O,oe}i(ge,"requireCommon");var De,kn;function Ae(){if(kn)return De;kn=1;function w(_,O){let h="",y=_.reason||"(unknown reason)";return _.mark?(_.mark.name&&(h+='in "'+_.mark.name+'" '),h+="("+(_.mark.line+1)+":"+(_.mark.column+1)+")",!O&&_.mark.snippet&&(h+=`
2
2
 
3
3
  `+_.mark.snippet),y+" "+h):y}i(w,"formatError");function E(_,O){Error.call(this),this.name="YAMLException",this.reason=_,this.mark=O,this.message=w(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i(E,"YAMLException2"),E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E.prototype.toString=i(function(O){return this.name+": "+w(this,O)},"toString"),De=E,De}i(Ae,"requireException");var Be,Ln;function zn(){if(Ln)return Be;Ln=1;let w=ge();function E(h,y,d,p,C){let o="",u="",T=Math.floor(C/2)-1;return p-y>T&&(o=" ... ",y=p-T+o.length),d-p>T&&(u=" ...",d=p+T-u.length),{str:o+h.slice(y,d).replace(/\t/g,"\u2192")+u,pos:p-y+o.length}}i(E,"getLine");function _(h,y){return w.repeat(" ",y-h.length)+h}i(_,"padStart");function O(h,y){if(y=Object.create(y||null),!h.buffer)return null;y.maxLength||(y.maxLength=79),typeof y.indent!="number"&&(y.indent=1),typeof y.linesBefore!="number"&&(y.linesBefore=3),typeof y.linesAfter!="number"&&(y.linesAfter=2);let d=/\r?\n|\r|\0/g,p=[0],C=[],o,u=-1;for(;o=d.exec(h.buffer);)C.push(o.index),p.push(o.index+o[0].length),h.position<=o.index&&u<0&&(u=p.length-2);u<0&&(u=p.length-1);let T="",v=Math.min(h.line+y.linesAfter,C.length).toString().length,M=y.maxLength-(y.indent+v+3);for(let F=1;F<=y.linesBefore&&!(u-F<0);F++){let K=E(h.buffer,p[u-F],C[u-F],h.position-(p[u]-p[u-F]),M);T=w.repeat(" ",y.indent)+_((h.line-F+1).toString(),v)+" | "+K.str+`
4
4
  `+T}let Z=E(h.buffer,p[u],C[u],h.position,M);T+=w.repeat(" ",y.indent)+_((h.line+1).toString(),v)+" | "+Z.str+`
@@ -30,4 +30,4 @@ import{a as i}from"./chunk-LDXBIOBF.js";import{d as _n}from"./chunk-R7TFKRNM.js"
30
30
  `,n.length-a>l&&m>a?x+=n.slice(a,m)+`
31
31
  `+n.slice(m+1):x+=n.slice(a),x.slice(1)}i(V,"foldLine");function ke(n){let l="",g=0;for(let f=0;f<n.length;g>=65536?f+=2:f++){g=Q(n,f);let a=Y[g];!a&&J(g)?(l+=n[f],g>=65536&&(l+=n[f+1])):l+=a||G(g)}return l}i(ke,"escapeString");function de(n,l,g){let f="",a=n.tag;for(let A=0,m=g.length;A<m;A+=1){let b=g[A];n.replacer&&(b=n.replacer.call(g,String(A),b)),(c(n,l,b,!1,!1)||typeof b>"u"&&c(n,l,null,!1,!1))&&(f!==""&&(f+=","+(n.condenseFlow?"":" ")),f+=n.dump)}n.tag=a,n.dump="["+f+"]"}i(de,"writeFlowSequence");function me(n,l,g,f){let a="",A=n.tag;for(let m=0,b=g.length;m<b;m+=1){let x=g[m];n.replacer&&(x=n.replacer.call(g,String(m),x)),(c(n,l+1,x,!0,!0,!1,!0)||typeof x>"u"&&c(n,l+1,null,!0,!0,!1,!0))&&((!f||a!=="")&&(a+=ie(n,l)),n.dump&&p===n.dump.charCodeAt(0)?a+="-":a+="- ",a+=n.dump)}n.tag=A,n.dump=a||"[]"}i(me,"writeBlockSequence");function Le(n,l,g){let f="",a=n.tag,A=Object.keys(g);for(let m=0,b=A.length;m<b;m+=1){let x="";f!==""&&(x+=", "),n.condenseFlow&&(x+='"');let k=A[m],L=g[k];n.replacer&&(L=n.replacer.call(g,k,L)),c(n,l,k,!1,!1)&&(n.dump.length>1024&&(x+="? "),x+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),c(n,l,L,!1,!1)&&(x+=n.dump,f+=x))}n.tag=a,n.dump="{"+f+"}"}i(Le,"writeFlowMapping");function e(n,l,g,f){let a="",A=n.tag,m=Object.keys(g);if(n.sortKeys===!0)m.sort();else if(typeof n.sortKeys=="function")m.sort(n.sortKeys);else if(n.sortKeys)throw new E("sortKeys must be a boolean or a function");for(let b=0,x=m.length;b<x;b+=1){let k="";(!f||a!=="")&&(k+=ie(n,l));let L=m[b],N=g[L];if(n.replacer&&(N=n.replacer.call(g,L,N)),!c(n,l+1,L,!0,!0,!0))continue;let R=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024;R&&(n.dump&&p===n.dump.charCodeAt(0)?k+="?":k+="? "),k+=n.dump,R&&(k+=ie(n,l)),c(n,l+1,N,!0,R)&&(n.dump&&p===n.dump.charCodeAt(0)?k+=":":k+=": ",k+=n.dump,a+=k)}n.tag=A,n.dump=a||"{}"}i(e,"writeBlockMapping");function r(n,l,g){let f=g?n.explicitTypes:n.implicitTypes;for(let a=0,A=f.length;a<A;a+=1){let m=f[a];if((m.instanceOf||m.predicate)&&(!m.instanceOf||typeof l=="object"&&l instanceof m.instanceOf)&&(!m.predicate||m.predicate(l))){if(g?m.multi&&m.representName?n.tag=m.representName(l):n.tag=m.tag:n.tag="?",m.represent){let b=n.styleMap[m.tag]||m.defaultStyle,x;if(O.call(m.represent)==="[object Function]")x=m.represent(l,b);else if(h.call(m.represent,b))x=m.represent[b](l,b);else throw new E("!<"+m.tag+'> tag resolver accepts not "'+b+'" style');n.dump=x}return!0}}return!1}i(r,"detectType");function c(n,l,g,f,a,A,m){n.tag=null,n.dump=g,r(n,g,!1)||r(n,g,!0);let b=O.call(n.dump),x=f;f&&(f=n.flowLevel<0||n.flowLevel>l);let k=b==="[object Object]"||b==="[object Array]",L,N;if(k&&(L=n.duplicates.indexOf(g),N=L!==-1),(n.tag!==null&&n.tag!=="?"||N||n.indent!==2&&l>0)&&(a=!1),N&&n.usedDuplicates[L])n.dump="*ref_"+L;else{if(k&&N&&!n.usedDuplicates[L]&&(n.usedDuplicates[L]=!0),b==="[object Object]")f&&Object.keys(n.dump).length!==0?(e(n,l,n.dump,a),N&&(n.dump="&ref_"+L+n.dump)):(Le(n,l,n.dump),N&&(n.dump="&ref_"+L+" "+n.dump));else if(b==="[object Array]")f&&n.dump.length!==0?(n.noArrayIndent&&!m&&l>0?me(n,l-1,n.dump,a):me(n,l,n.dump,a),N&&(n.dump="&ref_"+L+n.dump)):(de(n,l,n.dump),N&&(n.dump="&ref_"+L+" "+n.dump));else if(b==="[object String]")n.tag!=="?"&&_e(n,n.dump,l,A,x);else{if(b==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new E("unacceptable kind of an object to dump "+b)}if(n.tag!==null&&n.tag!=="?"){let R=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21");n.tag[0]==="!"?R="!"+R:R.slice(0,18)==="tag:yaml.org,2002:"?R="!!"+R.slice(18):R="!<"+R+">",n.dump=R+" "+n.dump}}return!0}i(c,"writeNode");function s(n,l){let g=[],f=[];t(n,g,f);let a=f.length;for(let A=0;A<a;A+=1)l.duplicates.push(g[f[A]]);l.usedDuplicates=new Array(a)}i(s,"getDuplicateReferences");function t(n,l,g){if(n!==null&&typeof n=="object"){let f=l.indexOf(n);if(f!==-1)g.indexOf(f)===-1&&g.push(f);else if(l.push(n),Array.isArray(n))for(let a=0,A=n.length;a<A;a+=1)t(n[a],l,g);else{let a=Object.keys(n);for(let A=0,m=a.length;A<m;A+=1)t(n[a[A]],l,g)}}}i(t,"inspectNode");function S(n,l){l=l||{};let g=new Te(l);g.noRefs||s(n,g);let f=n;return g.replacer&&(f=g.replacer.call({"":f},"",f)),c(g,0,f,!0,!0)?g.dump+`
32
32
  `:""}return i(S,"dump2"),cn.dump=S,cn}i(ni,"requireDumper");var $n;function ii(){if($n)return D;$n=1;let w=ei(),E=ni();function _(O,h){return function(){throw new Error("Function yaml."+O+" is removed in js-yaml 4. Use yaml."+h+" instead, which is now safe by default.")}}return i(_,"renamed"),D.Type=B(),D.Schema=un(),D.FAILSAFE_SCHEMA=sn(),D.JSON_SCHEMA=An(),D.CORE_SCHEMA=yn(),D.DEFAULT_SCHEMA=Pe(),D.load=w.load,D.loadAll=w.loadAll,D.dump=E.dump,D.YAMLException=Ae(),D.types={binary:Tn(),float:gn(),map:pn(),null:hn(),pairs:xn(),set:bn(),timestamp:Sn(),bool:dn(),int:mn(),merge:Cn(),omap:wn(),seq:an(),str:fn()},D.safeLoad=_("safeLoad","load"),D.safeLoadAll=_("safeLoadAll","loadAll"),D.safeDump=_("safeDump","dump"),D}i(ii,"requireJsYaml");var ri=ii(),li=Zn(ri),{Type:ci,Schema:ui,FAILSAFE_SCHEMA:fi,JSON_SCHEMA:ai,CORE_SCHEMA:pi,DEFAULT_SCHEMA:si,load:hi,loadAll:di,dump:mi,YAMLException:gi,types:Ai,safeLoad:yi,safeLoadAll:Si,safeDump:Ci}=li;export{ai as a,hi as b};
33
- //# sourceMappingURL=chunk-2DLEMZHM.js.map
33
+ //# sourceMappingURL=chunk-CA2KMNVI.js.map
@@ -1,3 +1,3 @@
1
- import{a as ut}from"./chunk-MBZYSJFT.js";import{A as D,D as xr,N as j,h as mr,l as hr}from"./chunk-6FQEBIA3.js";import{$ as _r,G as Ar,J as wr,K as Or,L as Br,M as Sr,N as Ir,O as Pr,P as Mr,Q as Wr,R as Er,S as Lr,T as Dr,U as $r,V as Rr,W as Nr,X as Fr,Y as jr,Z as Tr,_ as zr,b as B,h as br}from"./chunk-L34PKG4P.js";import{a as p}from"./chunk-LDXBIOBF.js";import{c as ct,d as s}from"./chunk-R7TFKRNM.js";s();s();function b(r){return r==null||typeof r!="object"&&typeof r!="function"}s();function x(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}s();var T="[object RegExp]",S="[object String]",I="[object Number]",P="[object Boolean]",M="[object Arguments]",z="[object Symbol]",_="[object Date]",v="[object Map]",U="[object Set]",k="[object Array]";var H="[object ArrayBuffer]",q="[object Object]";var K="[object DataView]",V="[object Uint8Array]",X="[object Uint8ClampedArray]",Y="[object Uint16Array]",G="[object Uint32Array]";var J="[object Int8Array]",Z="[object Int16Array]",Q="[object Int32Array]";var C="[object Float32Array]",rr="[object Float64Array]";s();function vr(r){return Array.isArray(r)}s();s();function W(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function A(r){return W(r)}function yt(r){if(b(r))return r;let t=x(r);if(!lt(r))return{};if(vr(r)){let e=Array.from(r);return r.length>0&&typeof r[0]=="string"&&Object.hasOwn(r,"index")&&(e.index=r.index,e.input=r.input),e}if(A(r)){let e=r,n=e.constructor;return new n(e.buffer,e.byteOffset,e.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(r.byteLength);if(t==="[object DataView]"){let e=r,n=e.buffer,m=e.byteOffset,o=e.byteLength,f=new ArrayBuffer(o),a=new Uint8Array(n,m,o);return new Uint8Array(f).set(a),new DataView(f)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){let e=r.constructor,n=new e(r.valueOf());return t==="[object String]"?dt(n,r):fr(n,r),n}if(t==="[object Date]")return new Date(Number(r));if(t==="[object RegExp]"){let e=r,n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(r));if(t==="[object Map]"){let e=r,n=new Map;return e.forEach((m,o)=>{n.set(o,m)}),n}if(t==="[object Set]"){let e=r,n=new Set;return e.forEach(m=>{n.add(m)}),n}if(t==="[object Arguments]"){let e=r,n={};return fr(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}let i={};return ht(i,r),fr(i,r),gt(i,r),i}function lt(r){switch(x(r)){case M:case k:case H:case K:case P:case _:case C:case rr:case J:case Z:case Q:case v:case I:case q:case T:case U:case S:case z:case V:case X:case Y:case G:return!0;default:return!1}}function fr(r,t){for(let i in t)Object.hasOwn(t,i)&&(r[i]=t[i])}function gt(r,t){let i=Object.getOwnPropertySymbols(t);for(let e=0;e<i.length;e++){let n=i[e];Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}}function dt(r,t){let i=t.valueOf().length;for(let e in t)Object.hasOwn(t,e)&&(Number.isNaN(Number(e))||Number(e)>=i)&&(r[e]=t[e])}function ht(r,t){let i=Object.getPrototypeOf(t);i!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(r,i)}s();s();s();var sr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function E(r){return typeof sr.Buffer<"u"&&sr.Buffer.isBuffer(r)}s();s();function Ur(r){return Number.isSafeInteger(r)&&r>=0}function tr(r){return r!=null&&typeof r!="function"&&Ur(r.length)}s();function $(r){return r!==null&&typeof r=="object"&&x(r)==="[object Arguments]"}s();function kr(r){let t=r?.constructor;return r===(typeof t=="function"?t.prototype:Object.prototype)}function xt(r){if(r==null)return!0;if(tr(r))return typeof r.splice!="function"&&typeof r!="string"&&!E(r)&&!A(r)&&!$(r)?!1:r.length===0;if(typeof r=="object"||typeof r=="function"){if(r instanceof Map||r instanceof Set)return r.size===0;let t=Object.keys(r);return kr(r)?t.filter(i=>i!=="constructor").length===0:t.length===0}return!0}s();s();function er(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){let i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let t=r;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}s();function Hr(){}s();function ir(r){return Object.getOwnPropertySymbols(r).filter(t=>Object.prototype.propertyIsEnumerable.call(r,t))}s();function qr(r){return r==="__proto__"}s();function Kr(r,t){return L(r,void 0,r,new Map,t)}function L(r,t,i,e=new Map,n=void 0){let m=n?.(r,t,i,e);if(m!==void 0)return m;if(b(r))return r;if(e.has(r))return e.get(r);if(Array.isArray(r)){let o=new Array(r.length);e.set(r,o);for(let f=0;f<r.length;f++)o[f]=L(r[f],f,i,e,n);return Object.hasOwn(r,"index")&&(o.index=r.index),Object.hasOwn(r,"input")&&(o.input=r.input),o}if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp){let o=new RegExp(r.source,r.flags);return o.lastIndex=r.lastIndex,o}if(r instanceof Map){let o=new Map;e.set(r,o);for(let[f,a]of r)o.set(f,L(a,f,i,e,n));return o}if(r instanceof Set){let o=new Set;e.set(r,o);for(let f of r)o.add(L(f,void 0,i,e,n));return o}if(E(r))return r.subarray();if(W(r)){let o=new(Object.getPrototypeOf(r)).constructor(r.length);e.set(r,o);for(let f=0;f<r.length;f++)o[f]=L(r[f],f,i,e,n);return o}if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer)return r.slice(0);if(r instanceof DataView){let o=new DataView(r.buffer.slice(0),r.byteOffset,r.byteLength);return e.set(r,o),l(o,r,i,e,n),o}if(typeof File<"u"&&r instanceof File){let o=new File([r],r.name,{type:r.type});return e.set(r,o),l(o,r,i,e,n),o}if(typeof Blob<"u"&&r instanceof Blob){let o=new Blob([r],{type:r.type});return e.set(r,o),l(o,r,i,e,n),o}if(r instanceof Error){let o=structuredClone(r);return e.set(r,o),o.message=r.message,o.name=r.name,o.stack=r.stack,o.cause=r.cause,o.constructor=r.constructor,l(o,r,i,e,n),o}if(r instanceof Boolean){let o=new Boolean(r.valueOf());return e.set(r,o),l(o,r,i,e,n),o}if(r instanceof Number){let o=new Number(r.valueOf());return e.set(r,o),l(o,r,i,e,n),o}if(r instanceof String){let o=new String(r.valueOf());return e.set(r,o),l(o,r,i,e,n),o}if(typeof r=="object"&&bt(r)){let o=Object.create(Object.getPrototypeOf(r));return e.set(r,o),l(o,r,i,e,n),o}return r}function l(r,t,i=r,e,n){let m=[...Object.keys(t),...ir(t)];for(let o=0;o<m.length;o++){let f=m[o],a=Object.getOwnPropertyDescriptor(r,f);(a==null||a.writable)&&(r[f]=L(t[f],f,i,e,n))}}function bt(r){switch(x(r)){case M:case k:case H:case K:case P:case _:case C:case rr:case J:case Z:case Q:case v:case I:case q:case T:case U:case S:case z:case V:case X:case Y:case G:return!0;default:return!1}}s();function Vr(r,t){return Kr(r,(i,e,n,m)=>{let o=t?.(i,e,n,m);if(o!==void 0)return o;if(typeof r=="object"){if(x(r)==="[object Object]"&&typeof r.constructor!="function"){let f={};return m.set(r,f),l(f,r,n,m),f}switch(Object.prototype.toString.call(r)){case I:case S:case P:{let f=new r.constructor(r?.valueOf());return l(f,r),f}case M:{let f={};return l(f,r),f.length=r.length,f[Symbol.iterator]=r[Symbol.iterator],f}default:return}}})}s();function ar(r){return Vr(r)}s();function R(r){return typeof r=="object"&&r!==null}s();function Xr(r){return R(r)&&tr(r)}s();function w(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");let i=function(...e){let n=t?t.apply(this,e):e[0],m=i.cache;if(m.has(n))return m.get(n);let o=r.apply(this,e);return i.cache=m.set(n,o)||m,o};return i.cache=new(w.Cache||Map),i}w.Cache=Map;s();s();function Yr(r){if(b(r))return r;if(Array.isArray(r)||W(r)||r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer)return r.slice(0);let t=Object.getPrototypeOf(r);if(t==null)return Object.assign(Object.create(t),r);let i=t.constructor;if(r instanceof Date||r instanceof Map||r instanceof Set)return new i(r);if(r instanceof RegExp){let e=new i(r);return e.lastIndex=r.lastIndex,e}if(r instanceof DataView)return new i(r.buffer.slice(0));if(r instanceof Error){let e;return r instanceof AggregateError?e=new i(r.errors,r.message,{cause:r.cause}):e=new i(r.message,{cause:r.cause}),e.stack=r.stack,Object.assign(e,r),e}return typeof File<"u"&&r instanceof File?new i([r],r.name,{type:r.type,lastModified:r.lastModified}):typeof r=="object"?Object.assign(Object.create(t),r):r}function Gr(r,...t){let i=t.slice(0,-1),e=t[t.length-1],n=r;for(let m=0;m<i.length;m++){let o=i[m];n=or(n,o,e,new Map)}return n}function or(r,t,i,e){if(b(r)&&(r=Object(r)),t==null||typeof t!="object")return r;if(e.has(t))return Yr(e.get(t));if(e.set(t,r),Array.isArray(t)){t=t.slice();for(let m=0;m<t.length;m++)t[m]=t[m]??void 0}let n=[...Object.keys(t),...ir(t)];for(let m=0;m<n.length;m++){let o=n[m];if(qr(o))continue;let f=t[o],a=r[o];if($(f)&&(f={...f}),$(a)&&(a={...a}),E(f)&&(f=ar(f)),Array.isArray(f))if(Array.isArray(a)){let g=[],y=Reflect.ownKeys(a);for(let h=0;h<y.length;h++){let d=y[h];g[d]=a[d]}a=g}else if(Xr(a)){let g=[];for(let y=0;y<a.length;y++)g[y]=a[y];a=g}else a=[];let u=i(a,f,o,r,t,e);u!==void 0?r[o]=u:Array.isArray(f)||R(a)&&R(f)&&(er(a)||er(f)||A(a)||A(f))?r[o]=or(a,f,i,e):a==null&&er(f)?r[o]=or({},f,i,e):a==null&&A(f)?r[o]=ar(f):(a===void 0||f!==void 0)&&(r[o]=f)}return r}s();function pr(r,...t){return Gr(r,...t,Hr)}s();var Qr=ct(ut(),1);var At="\u200B",wt={curveBasis:Br,curveBasisClosed:Sr,curveBasisOpen:Ir,curveBumpX:wr,curveBumpY:Or,curveBundle:Pr,curveCardinalClosed:Wr,curveCardinalOpen:Er,curveCardinal:Mr,curveCatmullRomClosed:Dr,curveCatmullRomOpen:$r,curveCatmullRom:Lr,curveLinear:Ar,curveLinearClosed:Rr,curveMonotoneX:Nr,curveMonotoneY:Fr,curveNatural:jr,curveStep:Tr,curveStepAfter:_r,curveStepBefore:zr},Ot=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Bt=p(function(r,t){let i=Cr(r,/(?:init\b)|(?:initialize\b)/),e={};if(Array.isArray(i)){let o=i.map(f=>f.args);hr(o),e=mr(e,[...o])}else e=i.args;if(!e)return;let n=xr(r,t),m="config";return e[m]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),e[n]=e[m],delete e[m]),e},"detectInit"),Cr=p(function(r,t=null){try{let i=new RegExp(`[%]{2}(?![{]${Ot.source})(?=[}][%]{2}).*
1
+ import{a as ut}from"./chunk-UU7BHEBD.js";import{A as D,D as xr,N as j,h as mr,l as hr}from"./chunk-SGL7WI35.js";import{$ as _r,G as Ar,J as wr,K as Or,L as Br,M as Sr,N as Ir,O as Pr,P as Mr,Q as Wr,R as Er,S as Lr,T as Dr,U as $r,V as Rr,W as Nr,X as Fr,Y as jr,Z as Tr,_ as zr,b as B,h as br}from"./chunk-CXXG5KL5.js";import{a as p}from"./chunk-ITN3D7RJ.js";import{c as ct,d as s}from"./chunk-SOAWGUAD.js";s();s();function b(r){return r==null||typeof r!="object"&&typeof r!="function"}s();function x(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}s();var T="[object RegExp]",S="[object String]",I="[object Number]",P="[object Boolean]",M="[object Arguments]",z="[object Symbol]",_="[object Date]",v="[object Map]",U="[object Set]",k="[object Array]";var H="[object ArrayBuffer]",q="[object Object]";var K="[object DataView]",V="[object Uint8Array]",X="[object Uint8ClampedArray]",Y="[object Uint16Array]",G="[object Uint32Array]";var J="[object Int8Array]",Z="[object Int16Array]",Q="[object Int32Array]";var C="[object Float32Array]",rr="[object Float64Array]";s();function vr(r){return Array.isArray(r)}s();s();function W(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function A(r){return W(r)}function yt(r){if(b(r))return r;let t=x(r);if(!lt(r))return{};if(vr(r)){let e=Array.from(r);return r.length>0&&typeof r[0]=="string"&&Object.hasOwn(r,"index")&&(e.index=r.index,e.input=r.input),e}if(A(r)){let e=r,n=e.constructor;return new n(e.buffer,e.byteOffset,e.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(r.byteLength);if(t==="[object DataView]"){let e=r,n=e.buffer,m=e.byteOffset,o=e.byteLength,f=new ArrayBuffer(o),a=new Uint8Array(n,m,o);return new Uint8Array(f).set(a),new DataView(f)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){let e=r.constructor,n=new e(r.valueOf());return t==="[object String]"?dt(n,r):fr(n,r),n}if(t==="[object Date]")return new Date(Number(r));if(t==="[object RegExp]"){let e=r,n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(r));if(t==="[object Map]"){let e=r,n=new Map;return e.forEach((m,o)=>{n.set(o,m)}),n}if(t==="[object Set]"){let e=r,n=new Set;return e.forEach(m=>{n.add(m)}),n}if(t==="[object Arguments]"){let e=r,n={};return fr(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}let i={};return ht(i,r),fr(i,r),gt(i,r),i}function lt(r){switch(x(r)){case M:case k:case H:case K:case P:case _:case C:case rr:case J:case Z:case Q:case v:case I:case q:case T:case U:case S:case z:case V:case X:case Y:case G:return!0;default:return!1}}function fr(r,t){for(let i in t)Object.hasOwn(t,i)&&(r[i]=t[i])}function gt(r,t){let i=Object.getOwnPropertySymbols(t);for(let e=0;e<i.length;e++){let n=i[e];Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}}function dt(r,t){let i=t.valueOf().length;for(let e in t)Object.hasOwn(t,e)&&(Number.isNaN(Number(e))||Number(e)>=i)&&(r[e]=t[e])}function ht(r,t){let i=Object.getPrototypeOf(t);i!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(r,i)}s();s();s();var sr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function E(r){return typeof sr.Buffer<"u"&&sr.Buffer.isBuffer(r)}s();s();function Ur(r){return Number.isSafeInteger(r)&&r>=0}function tr(r){return r!=null&&typeof r!="function"&&Ur(r.length)}s();function $(r){return r!==null&&typeof r=="object"&&x(r)==="[object Arguments]"}s();function kr(r){let t=r?.constructor;return r===(typeof t=="function"?t.prototype:Object.prototype)}function xt(r){if(r==null)return!0;if(tr(r))return typeof r.splice!="function"&&typeof r!="string"&&!E(r)&&!A(r)&&!$(r)?!1:r.length===0;if(typeof r=="object"||typeof r=="function"){if(r instanceof Map||r instanceof Set)return r.size===0;let t=Object.keys(r);return kr(r)?t.filter(i=>i!=="constructor").length===0:t.length===0}return!0}s();s();function er(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){let i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let t=r;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}s();function Hr(){}s();function ir(r){return Object.getOwnPropertySymbols(r).filter(t=>Object.prototype.propertyIsEnumerable.call(r,t))}s();function qr(r){return r==="__proto__"}s();function Kr(r,t){return L(r,void 0,r,new Map,t)}function L(r,t,i,e=new Map,n=void 0){let m=n?.(r,t,i,e);if(m!==void 0)return m;if(b(r))return r;if(e.has(r))return e.get(r);if(Array.isArray(r)){let o=new Array(r.length);e.set(r,o);for(let f=0;f<r.length;f++)o[f]=L(r[f],f,i,e,n);return Object.hasOwn(r,"index")&&(o.index=r.index),Object.hasOwn(r,"input")&&(o.input=r.input),o}if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp){let o=new RegExp(r.source,r.flags);return o.lastIndex=r.lastIndex,o}if(r instanceof Map){let o=new Map;e.set(r,o);for(let[f,a]of r)o.set(f,L(a,f,i,e,n));return o}if(r instanceof Set){let o=new Set;e.set(r,o);for(let f of r)o.add(L(f,void 0,i,e,n));return o}if(E(r))return r.subarray();if(W(r)){let o=new(Object.getPrototypeOf(r)).constructor(r.length);e.set(r,o);for(let f=0;f<r.length;f++)o[f]=L(r[f],f,i,e,n);return o}if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer)return r.slice(0);if(r instanceof DataView){let o=new DataView(r.buffer.slice(0),r.byteOffset,r.byteLength);return e.set(r,o),l(o,r,i,e,n),o}if(typeof File<"u"&&r instanceof File){let o=new File([r],r.name,{type:r.type});return e.set(r,o),l(o,r,i,e,n),o}if(typeof Blob<"u"&&r instanceof Blob){let o=new Blob([r],{type:r.type});return e.set(r,o),l(o,r,i,e,n),o}if(r instanceof Error){let o=structuredClone(r);return e.set(r,o),o.message=r.message,o.name=r.name,o.stack=r.stack,o.cause=r.cause,o.constructor=r.constructor,l(o,r,i,e,n),o}if(r instanceof Boolean){let o=new Boolean(r.valueOf());return e.set(r,o),l(o,r,i,e,n),o}if(r instanceof Number){let o=new Number(r.valueOf());return e.set(r,o),l(o,r,i,e,n),o}if(r instanceof String){let o=new String(r.valueOf());return e.set(r,o),l(o,r,i,e,n),o}if(typeof r=="object"&&bt(r)){let o=Object.create(Object.getPrototypeOf(r));return e.set(r,o),l(o,r,i,e,n),o}return r}function l(r,t,i=r,e,n){let m=[...Object.keys(t),...ir(t)];for(let o=0;o<m.length;o++){let f=m[o],a=Object.getOwnPropertyDescriptor(r,f);(a==null||a.writable)&&(r[f]=L(t[f],f,i,e,n))}}function bt(r){switch(x(r)){case M:case k:case H:case K:case P:case _:case C:case rr:case J:case Z:case Q:case v:case I:case q:case T:case U:case S:case z:case V:case X:case Y:case G:return!0;default:return!1}}s();function Vr(r,t){return Kr(r,(i,e,n,m)=>{let o=t?.(i,e,n,m);if(o!==void 0)return o;if(typeof r=="object"){if(x(r)==="[object Object]"&&typeof r.constructor!="function"){let f={};return m.set(r,f),l(f,r,n,m),f}switch(Object.prototype.toString.call(r)){case I:case S:case P:{let f=new r.constructor(r?.valueOf());return l(f,r),f}case M:{let f={};return l(f,r),f.length=r.length,f[Symbol.iterator]=r[Symbol.iterator],f}default:return}}})}s();function ar(r){return Vr(r)}s();function R(r){return typeof r=="object"&&r!==null}s();function Xr(r){return R(r)&&tr(r)}s();function w(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");let i=function(...e){let n=t?t.apply(this,e):e[0],m=i.cache;if(m.has(n))return m.get(n);let o=r.apply(this,e);return i.cache=m.set(n,o)||m,o};return i.cache=new(w.Cache||Map),i}w.Cache=Map;s();s();function Yr(r){if(b(r))return r;if(Array.isArray(r)||W(r)||r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer)return r.slice(0);let t=Object.getPrototypeOf(r);if(t==null)return Object.assign(Object.create(t),r);let i=t.constructor;if(r instanceof Date||r instanceof Map||r instanceof Set)return new i(r);if(r instanceof RegExp){let e=new i(r);return e.lastIndex=r.lastIndex,e}if(r instanceof DataView)return new i(r.buffer.slice(0));if(r instanceof Error){let e;return r instanceof AggregateError?e=new i(r.errors,r.message,{cause:r.cause}):e=new i(r.message,{cause:r.cause}),e.stack=r.stack,Object.assign(e,r),e}return typeof File<"u"&&r instanceof File?new i([r],r.name,{type:r.type,lastModified:r.lastModified}):typeof r=="object"?Object.assign(Object.create(t),r):r}function Gr(r,...t){let i=t.slice(0,-1),e=t[t.length-1],n=r;for(let m=0;m<i.length;m++){let o=i[m];n=or(n,o,e,new Map)}return n}function or(r,t,i,e){if(b(r)&&(r=Object(r)),t==null||typeof t!="object")return r;if(e.has(t))return Yr(e.get(t));if(e.set(t,r),Array.isArray(t)){t=t.slice();for(let m=0;m<t.length;m++)t[m]=t[m]??void 0}let n=[...Object.keys(t),...ir(t)];for(let m=0;m<n.length;m++){let o=n[m];if(qr(o))continue;let f=t[o],a=r[o];if($(f)&&(f={...f}),$(a)&&(a={...a}),E(f)&&(f=ar(f)),Array.isArray(f))if(Array.isArray(a)){let g=[],y=Reflect.ownKeys(a);for(let h=0;h<y.length;h++){let d=y[h];g[d]=a[d]}a=g}else if(Xr(a)){let g=[];for(let y=0;y<a.length;y++)g[y]=a[y];a=g}else a=[];let u=i(a,f,o,r,t,e);u!==void 0?r[o]=u:Array.isArray(f)||R(a)&&R(f)&&(er(a)||er(f)||A(a)||A(f))?r[o]=or(a,f,i,e):a==null&&er(f)?r[o]=or({},f,i,e):a==null&&A(f)?r[o]=ar(f):(a===void 0||f!==void 0)&&(r[o]=f)}return r}s();function pr(r,...t){return Gr(r,...t,Hr)}s();var Qr=ct(ut(),1);var At="\u200B",wt={curveBasis:Br,curveBasisClosed:Sr,curveBasisOpen:Ir,curveBumpX:wr,curveBumpY:Or,curveBundle:Pr,curveCardinalClosed:Wr,curveCardinalOpen:Er,curveCardinal:Mr,curveCatmullRomClosed:Dr,curveCatmullRomOpen:$r,curveCatmullRom:Lr,curveLinear:Ar,curveLinearClosed:Rr,curveMonotoneX:Nr,curveMonotoneY:Fr,curveNatural:jr,curveStep:Tr,curveStepAfter:_r,curveStepBefore:zr},Ot=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Bt=p(function(r,t){let i=Cr(r,/(?:init\b)|(?:initialize\b)/),e={};if(Array.isArray(i)){let o=i.map(f=>f.args);hr(o),e=mr(e,[...o])}else e=i.args;if(!e)return;let n=xr(r,t),m="config";return e[m]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),e[n]=e[m],delete e[m]),e},"detectInit"),Cr=p(function(r,t=null){try{let i=new RegExp(`[%]{2}(?![{]${Ot.source})(?=[}][%]{2}).*
2
2
  `,"ig");r=r.trim().replace(i,"").replace(/'/gm,'"'),B.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${r}`);let e,n=[];for(;(e=D.exec(r))!==null;)if(e.index===D.lastIndex&&D.lastIndex++,e&&!t||t&&e[1]?.match(t)||t&&e[2]?.match(t)){let m=e[1]?e[1]:e[2],o=e[3]?e[3].trim():e[4]?JSON.parse(e[4].trim()):null;n.push({type:m,args:o})}return n.length===0?{type:r,args:null}:n.length===1?n[0]:n}catch(i){return B.error(`ERROR: ${i.message} - Unable to parse directive type: '${t}' based on the text: '${r}'`),{type:void 0,args:null}}},"detectDirective"),ji=p(function(r){return r.replace(D,"")},"removeDirectives"),St=p(function(r,t){for(let[i,e]of t.entries())if(e.match(r))return i;return-1},"isSubstringInArray");function rt(r,t){if(!r)return t;let i=`curve${r.charAt(0).toUpperCase()+r.slice(1)}`;return wt[i]??t}p(rt,"interpolateToCurve");function tt(r,t){let i=r.trim();if(i)return t.securityLevel!=="loose"?(0,Qr.sanitizeUrl)(i):i}p(tt,"formatUrl");var It=p((r,...t)=>{let i=r.split("."),e=i.length-1,n=i[e],m=window;for(let o=0;o<e;o++)if(m=m[i[o]],!m){B.error(`Function name: ${r} not found in window`);return}m[n](...t)},"runFunc");function cr(r,t){return!r||!t?0:Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}p(cr,"distance");function et(r){let t,i=0;r.forEach(n=>{i+=cr(n,t),t=n});let e=i/2;return ur(r,e)}p(et,"traverseEdge");function it(r){return r.length===1?r[0]:et(r)}p(it,"calcLabelPosition");var Jr=p((r,t=2)=>{let i=Math.pow(10,t);return Math.round(r*i)/i},"roundNumber"),ur=p((r,t)=>{let i,e=t;for(let n of r){if(i){let m=cr(n,i);if(m===0)return i;if(m<e)e-=m;else{let o=e/m;if(o<=0)return i;if(o>=1)return{x:n.x,y:n.y};if(o>0&&o<1)return{x:Jr((1-o)*i.x+o*n.x,5),y:Jr((1-o)*i.y+o*n.y,5)}}}i=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Pt=p((r,t,i)=>{B.info(`our points ${JSON.stringify(t)}`),t[0]!==i&&(t=t.reverse());let n=ur(t,25),m=r?10:5,o=Math.atan2(t[0].y-n.y,t[0].x-n.x),f={x:0,y:0};return f.x=Math.sin(o)*m+(t[0].x+n.x)/2,f.y=-Math.cos(o)*m+(t[0].y+n.y)/2,f},"calcCardinalityPosition");function ot(r,t,i){let e=structuredClone(i);B.info("our points",e),t!=="start_left"&&t!=="start_right"&&e.reverse();let n=25+r,m=ur(e,n),o=10+r*.5,f=Math.atan2(e[0].y-m.y,e[0].x-m.x),a={x:0,y:0};return t==="start_left"?(a.x=Math.sin(f+Math.PI)*o+(e[0].x+m.x)/2,a.y=-Math.cos(f+Math.PI)*o+(e[0].y+m.y)/2):t==="end_right"?(a.x=Math.sin(f-Math.PI)*o+(e[0].x+m.x)/2-5,a.y=-Math.cos(f-Math.PI)*o+(e[0].y+m.y)/2-5):t==="end_left"?(a.x=Math.sin(f)*o+(e[0].x+m.x)/2-5,a.y=-Math.cos(f)*o+(e[0].y+m.y)/2-5):(a.x=Math.sin(f)*o+(e[0].x+m.x)/2,a.y=-Math.cos(f)*o+(e[0].y+m.y)/2),a}p(ot,"calcTerminalLabelPosition");function nt(r){let t="",i="";for(let e of r)e!==void 0&&(e.startsWith("color:")||e.startsWith("text-align:")?i=i+e+";":t=t+e+";");return{style:t,labelStyle:i}}p(nt,"getStylesFromArray");var Zr=0,Mt=p(()=>(Zr++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Zr),"generateId");function mt(r){let t="",i="0123456789abcdef",e=i.length;for(let n=0;n<r;n++)t+=i.charAt(Math.floor(Math.random()*e));return t}p(mt,"makeRandomHex");var Wt=p(r=>mt(r.length),"random"),Et=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Lt=p(function(r,t){let i=t.text.replace(j.lineBreakRegex," "),[,e]=lr(t.fontSize),n=r.append("text");n.attr("x",t.x),n.attr("y",t.y),n.style("text-anchor",t.anchor),n.style("font-family",t.fontFamily),n.style("font-size",e),n.style("font-weight",t.fontWeight),n.attr("fill",t.fill),t.class!==void 0&&n.attr("class",t.class);let m=n.append("tspan");return m.attr("x",t.x+t.textMargin*2),m.attr("fill",t.fill),m.text(i),n},"drawSimpleText"),Dt=w((r,t,i)=>{if(!r||(i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},i),j.lineBreakRegex.test(r)))return r;let e=r.split(" ").filter(Boolean),n=[],m="";return e.forEach((o,f)=>{let a=N(`${o} `,i),u=N(m,i);if(a>t){let{hyphenatedStrings:h,remainingWord:d}=$t(o,t,"-",i);n.push(m,...h),m=d}else u+a>=t?(n.push(m),m=o):m=[m,o].filter(Boolean).join(" ");f+1===e.length&&n.push(m)}),n.filter(o=>o!=="").join(i.joinWith)},(r,t,i)=>`${r}${t}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`),$t=w((r,t,i="-",e)=>{e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},e);let n=[...r],m=[],o="";return n.forEach((f,a)=>{let u=`${o}${f}`;if(N(u,e)>=t){let y=a+1,h=n.length===y,d=`${u}${i}`;m.push(h?u:d),o=""}else o=u}),{hyphenatedStrings:m,remainingWord:o}},(r,t,i="-",e)=>`${r}${t}${i}${e.fontSize}${e.fontWeight}${e.fontFamily}`);function ft(r,t){return yr(r,t).height}p(ft,"calculateTextHeight");function N(r,t){return yr(r,t).width}p(N,"calculateTextWidth");var yr=w((r,t)=>{let{fontSize:i=12,fontFamily:e="Arial",fontWeight:n=400}=t;if(!r)return{width:0,height:0};let[,m]=lr(i),o=["sans-serif",e],f=r.split(j.lineBreakRegex),a=[],u=br("body");if(!u.remove)return{width:0,height:0,lineHeight:0};let g=u.append("svg");for(let h of o){let d=0,O={width:0,height:0,lineHeight:0};for(let pt of f){let gr=Et();gr.text=pt||At;let dr=Lt(g,gr).style("font-size",m).style("font-weight",n).style("font-family",h),F=(dr._groups||dr)[0][0].getBBox();if(F.width===0&&F.height===0)throw new Error("svg element not in render tree");O.width=Math.round(Math.max(O.width,F.width)),d=Math.round(F.height),O.height+=d,O.lineHeight=Math.round(Math.max(O.lineHeight,d))}a.push(O)}g.remove();let y=isNaN(a[1].height)||isNaN(a[1].width)||isNaN(a[1].lineHeight)||a[0].height>a[1].height&&a[0].width>a[1].width&&a[0].lineHeight>a[1].lineHeight?0:1;return a[y]},(r,t)=>`${r}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Rt=class{constructor(r=!1,t){this.count=0,this.count=t?t.length:0,this.next=r?()=>this.count++:()=>Date.now()}static{p(this,"InitIDGenerator")}},nr,Nt=p(function(r){return nr=nr||document.createElement("div"),r=escape(r).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),nr.innerHTML=r,unescape(nr.textContent)},"entityDecode");function Ft(r){return"str"in r}p(Ft,"isDetailedError");var jt=p((r,t,i,e)=>{if(!e)return;let n=r.node()?.getBBox();n&&r.append("text").text(e).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-i).attr("class",t)},"insertTitle"),lr=p(r=>{if(typeof r=="number")return[r,r+"px"];let t=parseInt(r??"",10);return Number.isNaN(t)?[void 0,void 0]:r===String(t)?[t,r+"px"]:[t,r]},"parseFontSize");function st(r,t){return pr({},r,t)}p(st,"cleanAndMerge");var Ti={assignWithDepth:mr,wrapLabel:Dt,calculateTextHeight:ft,calculateTextWidth:N,calculateTextDimensions:yr,cleanAndMerge:st,detectInit:Bt,detectDirective:Cr,isSubstringInArray:St,interpolateToCurve:rt,calcLabelPosition:it,calcCardinalityPosition:Pt,calcTerminalLabelPosition:ot,formatUrl:tt,getStylesFromArray:nt,generateId:Mt,random:Wt,runFunc:It,entityDecode:Nt,insertTitle:jt,isLabelCoordinateInPath:at,parseFontSize:lr,InitIDGenerator:Rt},zi=p(function(r){let t=r;return t=t.replace(/style.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/#\w+;/g,function(i){let e=i.substring(1,i.length-1);return/^\+?\d+$/.test(e)?"\uFB02\xB0\xB0"+e+"\xB6\xDF":"\uFB02\xB0"+e+"\xB6\xDF"}),t},"encodeEntities"),_i=p(function(r){return r.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),vi=p((r,t,{counter:i=0,prefix:e,suffix:n},m)=>m||`${e?`${e}_`:""}${r}_${t}_${i}${n?`_${n}`:""}`,"getEdgeId");function Tt(r){return r??null}p(Tt,"handleUndefinedAttr");function at(r,t){let i=Math.round(r.x),e=Math.round(r.y),n=t.replace(/(\d+\.\d+)/g,m=>Math.round(parseFloat(m)).toString());return n.includes(i.toString())||n.includes(e.toString())}p(at,"isLabelCoordinateInPath");export{yt as a,xt as b,At as c,ji as d,rt as e,nt as f,Mt as g,Wt as h,Dt as i,ft as j,N as k,yr as l,Ft as m,lr as n,st as o,Ti as p,zi as q,_i as r,vi as s,Tt as t};
3
- //# sourceMappingURL=chunk-LHNPPNB7.js.map
3
+ //# sourceMappingURL=chunk-CFMSYLIK.js.map
@@ -1,2 +1,2 @@
1
- import{A as D,B as $,C as y,a as _r,b as G,c as O,d as wr,e as Z,f as br,g as S,h as f,i as I,j as z,k as w,l as Er,m as yr,n as X,o as L,p as x,q as V,r as k,s as U,t as C,u as B,v as A,w as g,x as M,y as xr,z as P}from"./chunk-5KNOHX5X.js";import{d as h}from"./chunk-R7TFKRNM.js";h();h();h();function N(r,e,n,t){var o;do o=D(t);while(r.hasNode(o));return n.dummy=e,r.setNode(o,n),o}function kr(r){var e=new y().setGraph(r.graph());return f(r.nodes(),function(n){e.setNode(n,r.node(n))}),f(r.edges(),function(n){var t=e.edge(n.v,n.w)||{weight:0,minlen:1},o=r.edge(n);e.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),e}function H(r){var e=new y({multigraph:r.isMultigraph()}).setGraph(r.graph());return f(r.nodes(),function(n){r.children(n).length||e.setNode(n,r.node(n))}),f(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function rr(r,e){var n=r.x,t=r.y,o=e.x-n,a=e.y-t,i=r.width/2,s=r.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,d;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),u=s*o/a,d=s):(o<0&&(i=-i),u=i,d=i*a/o),{x:n+u,y:t+d}}function j(r){var e=w(g(nr(r)+1),function(){return[]});return f(r.nodes(),function(n){var t=r.node(n),o=t.rank;x(o)||(e[o][t.order]=n)}),e}function gr(r){var e=C(w(r.nodes(),function(n){return r.node(n).rank}));f(r.nodes(),function(n){var t=r.node(n);X(t,"rank")&&(t.rank-=e)})}function Nr(r){var e=C(w(r.nodes(),function(a){return r.node(a).rank})),n=[];f(r.nodes(),function(a){var i=r.node(a).rank-e;n[i]||(n[i]=[]),n[i].push(a)});var t=0,o=r.graph().nodeRankFactor;f(n,function(a,i){x(a)&&i%o!==0?--t:t&&f(a,function(s){r.node(s).rank+=t})})}function er(r,e,n,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=t),N(r,"border",o,e)}function nr(r){return k(w(r.nodes(),function(e){var n=r.node(e).rank;if(!x(n))return n}))}function Or(r,e){var n={lhs:[],rhs:[]};return f(r,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function Ir(r,e){var n=Z();try{return e()}finally{console.log(r+" time: "+(Z()-n)+"ms")}}function Pr(r,e){return e()}function Cr(r){function e(n){var t=r.children(n),o=r.node(n);if(t.length&&f(t,e),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)Lr(r,"borderLeft","_bl",n,o,a),Lr(r,"borderRight","_br",n,o,a)}}f(r.children(),e)}function Lr(r,e,n,t,o,a){var i={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],u=N(r,"border",i,n);o[e][a]=u,r.setParent(u,t),s&&r.setEdge(s,u,{weight:1})}h();function Tr(r){var e=r.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Sr(r)}function Rr(r){var e=r.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&me(r),(e==="lr"||e==="rl")&&(ve(r),Sr(r))}function Sr(r){f(r.nodes(),function(e){jr(r.node(e))}),f(r.edges(),function(e){jr(r.edge(e))})}function jr(r){var e=r.width;r.width=r.height,r.height=e}function me(r){f(r.nodes(),function(e){tr(r.node(e))}),f(r.edges(),function(e){var n=r.edge(e);f(n.points,tr),Object.prototype.hasOwnProperty.call(n,"y")&&tr(n)})}function tr(r){r.y=-r.y}function ve(r){f(r.nodes(),function(e){or(r.node(e))}),f(r.edges(),function(e){var n=r.edge(e);f(n.points,or),Object.prototype.hasOwnProperty.call(n,"x")&&or(n)})}function or(r){var e=r.x;r.x=r.y,r.y=e}h();h();h();var J=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return Mr(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&Mr(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,t=n._prev;t!==n;)e.push(JSON.stringify(t,we)),t=t._prev;return"["+e.join(", ")+"]"}};function Mr(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function we(r,e){if(r!=="_next"&&r!=="_prev")return e}var be=G(1);function Fr(r,e){if(r.nodeCount()<=1)return[];var n=ye(r,e||be),t=Ee(n.graph,n.buckets,n.zeroIdx);return O(w(t,function(o){return r.outEdges(o.v,o.w)}))}function Ee(r,e,n){for(var t=[],o=e[e.length-1],a=e[0],i;r.nodeCount();){for(;i=a.dequeue();)ar(r,e,n,i);for(;i=o.dequeue();)ar(r,e,n,i);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(i=e[s].dequeue(),i){t=t.concat(ar(r,e,n,i,!0));break}}}return t}function ar(r,e,n,t,o){var a=o?[]:void 0;return f(r.inEdges(t.v),function(i){var s=r.edge(i),u=r.node(i.v);o&&a.push({v:i.v,w:i.w}),u.out-=s,ir(e,n,u)}),f(r.outEdges(t.v),function(i){var s=r.edge(i),u=i.w,d=r.node(u);d.in-=s,ir(e,n,d)}),r.removeNode(t.v),a}function ye(r,e){var n=new y,t=0,o=0;f(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),f(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),o=Math.max(o,n.node(s.v).out+=d),t=Math.max(t,n.node(s.w).in+=d)});var a=g(o+t+3).map(function(){return new J}),i=t+1;return f(n.nodes(),function(s){ir(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function ir(r,e,n){n.out?n.in?r[n.out-n.in+e].enqueue(n):r[r.length-1].enqueue(n):r[0].enqueue(n)}function Gr(r){var e=r.graph().acyclicer==="greedy"?Fr(r,n(r)):xe(r);f(e,function(t){var o=r.edge(t);r.removeEdge(t),o.forwardName=t.name,o.reversed=!0,r.setEdge(t.w,t.v,o,D("rev"))});function n(t){return function(o){return t.edge(o).weight}}}function xe(r){var e=[],n={},t={};function o(a){Object.prototype.hasOwnProperty.call(t,a)||(t[a]=!0,n[a]=!0,f(r.outEdges(a),function(i){Object.prototype.hasOwnProperty.call(n,i.w)?e.push(i):o(i.w)}),delete n[a])}return f(r.nodes(),o),e}function Vr(r){f(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var t=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,t)}})}h();function Ar(r){r.graph().dummyChains=[],f(r.edges(),function(e){ke(r,e)})}function ke(r,e){var n=e.v,t=r.node(n).rank,o=e.w,a=r.node(o).rank,i=e.name,s=r.edge(e),u=s.labelRank;if(a!==t+1){r.removeEdge(e);var d=void 0,c,l;for(l=0,++t;t<a;++l,++t)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:t},c=N(r,"edge",d,"_d"),t===u&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),r.setEdge(n,c,{weight:s.weight},i),l===0&&r.graph().dummyChains.push(c),n=c;r.setEdge(n,o,{weight:s.weight},i)}}function Dr(r){f(r.graph().dummyChains,function(e){var n=r.node(e),t=n.edgeLabel,o;for(r.setEdge(n.edgeObj,t);n.dummy;)o=r.successors(e)[0],r.removeNode(e),t.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height),e=o,n=r.node(e)})}h();h();h();function W(r){var e={};function n(t){var o=r.node(t);if(Object.prototype.hasOwnProperty.call(e,t))return o.rank;e[t]=!0;var a=C(w(r.outEdges(t),function(i){return n(i.w)-r.edge(i).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),o.rank=a}f(r.sources(),n)}function F(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function K(r){var e=new y({directed:!1}),n=r.nodes()[0],t=r.nodeCount();e.setNode(n,{});for(var o,a;ge(e,r)<t;)o=Ne(e,r),a=e.hasNode(o.v)?F(r,o):-F(r,o),Oe(e,r,a);return e}function ge(r,e){function n(t){f(e.nodeEdges(t),function(o){var a=o.v,i=t===a?o.w:a;!r.hasNode(i)&&!F(e,o)&&(r.setNode(i,{}),r.setEdge(t,i,{}),n(i))})}return f(r.nodes(),n),r.nodeCount()}function Ne(r,e){return B(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return F(e,n)})}function Oe(r,e,n){f(r.nodes(),function(t){e.node(t).rank+=n})}h();h();h();h();h();var ot=G(1);h();h();h();h();var mt=G(1);h();h();sr.CycleException=q;function sr(r){var e={},n={},t=[];function o(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new q;Object.prototype.hasOwnProperty.call(e,a)||(n[a]=!0,e[a]=!0,f(r.predecessors(a),o),delete n[a],t.push(a))}if(f(r.sinks(),o),xr(e)!==r.nodeCount())throw new q;return t}function q(){}q.prototype=new Error;h();h();function Q(r,e,n){_r(e)||(e=[e]);var t=(r.isDirected()?r.successors:r.neighbors).bind(r),o=[],a={};return f(e,function(i){if(!r.hasNode(i))throw new Error("Graph does not have node: "+i);zr(r,i,n==="post",a,t,o)}),o}function zr(r,e,n,t,o,a){Object.prototype.hasOwnProperty.call(t,e)||(t[e]=!0,n||a.push(e),f(o(e),function(i){zr(r,i,n,t,o,a)}),n&&a.push(e))}function fr(r,e){return Q(r,e,"post")}h();function ur(r,e){return Q(r,e,"pre")}h();R.initLowLimValues=cr;R.initCutValues=dr;R.calcCutValue=Wr;R.leaveEdge=Xr;R.enterEdge=Hr;R.exchangeEdges=Jr;function R(r){r=kr(r),W(r);var e=K(r);cr(e),dr(e,r);for(var n,t;n=Xr(e);)t=Hr(e,r,n),Jr(e,r,n,t)}function dr(r,e){var n=fr(r,r.nodes());n=n.slice(0,n.length-1),f(n,function(t){je(r,e,t)})}function je(r,e,n){var t=r.node(n),o=t.parent;r.edge(n,o).cutvalue=Wr(r,e,n)}function Wr(r,e,n){var t=r.node(n),o=t.parent,a=!0,i=e.edge(n,o),s=0;return i||(a=!1,i=e.edge(o,n)),s=i.weight,f(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==o){var l=d===a,m=e.edge(u).weight;if(s+=l?m:-m,Re(r,n,c)){var v=r.edge(n,c).cutvalue;s+=l?-v:v}}}),s}function cr(r,e){arguments.length<2&&(e=r.nodes()[0]),qr(r,{},1,e)}function qr(r,e,n,t,o){var a=n,i=r.node(t);return e[t]=!0,f(r.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(e,s)||(n=qr(r,e,n,s,t))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function Xr(r){return z(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Hr(r,e,n){var t=n.v,o=n.w;e.hasEdge(t,o)||(t=n.w,o=n.v);var a=r.node(t),i=r.node(o),s=a,u=!1;a.lim>i.lim&&(s=i,u=!0);var d=I(e.edges(),function(c){return u===Ur(r,r.node(c.v),s)&&u!==Ur(r,r.node(c.w),s)});return B(d,function(c){return F(e,c)})}function Jr(r,e,n,t){var o=n.v,a=n.w;r.removeEdge(o,a),r.setEdge(t.v,t.w,{}),cr(r),dr(r,e),Te(r,e)}function Te(r,e){var n=z(r.nodes(),function(o){return!e.node(o).parent}),t=ur(r,n);t=t.slice(1),f(t,function(o){var a=r.node(o).parent,i=e.edge(o,a),s=!1;i||(i=e.edge(a,o),s=!0),e.node(o).rank=e.node(a).rank+(s?i.minlen:-i.minlen)})}function Re(r,e,n){return r.hasEdge(e,n)}function Ur(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function hr(r){switch(r.graph().ranker){case"network-simplex":Kr(r);break;case"tight-tree":Me(r);break;case"longest-path":Se(r);break;default:Kr(r)}}var Se=W;function Me(r){W(r),K(r)}function Kr(r){R(r)}h();function Qr(r){var e=N(r,"root",{},"_root"),n=Fe(r),t=k(L(n))-1,o=2*t+1;r.graph().nestingRoot=e,f(r.edges(),function(i){r.edge(i).minlen*=o});var a=Ge(r)+1;f(r.children(),function(i){Zr(r,e,o,a,t,n,i)}),r.graph().nodeRankFactor=o}function Zr(r,e,n,t,o,a,i){var s=r.children(i);if(!s.length){i!==e&&r.setEdge(e,i,{weight:0,minlen:n});return}var u=er(r,"_bt"),d=er(r,"_bb"),c=r.node(i);r.setParent(u,i),c.borderTop=u,r.setParent(d,i),c.borderBottom=d,f(s,function(l){Zr(r,e,n,t,o,a,l);var m=r.node(l),v=m.borderTop?m.borderTop:l,_=m.borderBottom?m.borderBottom:l,E=m.borderTop?t:2*t,Y=v!==_?1:o-a[i]+1;r.setEdge(u,v,{weight:E,minlen:Y,nestingEdge:!0}),r.setEdge(_,d,{weight:E,minlen:Y,nestingEdge:!0})}),r.parent(i)||r.setEdge(e,u,{weight:0,minlen:o+a[i]})}function Fe(r){var e={};function n(t,o){var a=r.children(t);a&&a.length&&f(a,function(i){n(i,o+1)}),e[t]=o}return f(r.children(),function(t){n(t,1)}),e}function Ge(r){return M(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function $r(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,f(r.edges(),function(n){var t=r.edge(n);t.nestingEdge&&r.removeEdge(n)})}h();h();function re(r,e,n){var t={},o;f(n,function(a){for(var i=r.parent(a),s,u;i;){if(s=r.parent(i),s?(u=t[s],t[s]=i):(u=o,o=i),u&&u!==i){e.setEdge(u,i);return}i=s}})}h();function ee(r,e,n){var t=Be(r),o=new y({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(a){return r.node(a)});return f(r.nodes(),function(a){var i=r.node(a),s=r.parent(a);(i.rank===e||i.minRank<=e&&e<=i.maxRank)&&(o.setNode(a),o.setParent(a,s||t),f(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=o.edge(d,a),l=x(c)?0:c.weight;o.setEdge(d,a,{weight:r.edge(u).weight+l})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[e],borderRight:i.borderRight[e]}))}),o}function Be(r){for(var e;r.hasNode(e=D("_root")););return e}h();function ne(r,e){for(var n=0,t=1;t<e.length;++t)n+=Ae(r,e[t-1],e[t]);return n}function Ae(r,e,n){for(var t=$(n,w(n,function(d,c){return c})),o=O(w(e,function(d){return P(w(r.outEdges(d),function(c){return{pos:t[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;a<n.length;)a<<=1;var i=2*a-1;a-=1;var s=w(new Array(i),function(){return 0}),u=0;return f(o.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;for(var l=0;c>0;)c%2&&(l+=s[c+1]),c=c-1>>1,s[c]+=d.weight;u+=d.weight*l})),u}h();function te(r){var e={},n=I(r.nodes(),function(s){return!r.children(s).length}),t=k(w(n,function(s){return r.node(s).rank})),o=w(g(t+1),function(){return[]});function a(s){if(!X(e,s)){e[s]=!0;var u=r.node(s);o[u.rank].push(s),f(r.successors(s),a)}}var i=P(n,function(s){return r.node(s).rank});return f(i,a),o}h();h();function oe(r,e){return w(e,function(n){var t=r.inEdges(n);if(t.length){var o=M(t,function(a,i){var s=r.edge(i),u=r.node(i.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:n}})}h();function ae(r,e){var n={};f(r,function(o,a){var i=n[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:a};x(o.barycenter)||(i.barycenter=o.barycenter,i.weight=o.weight)}),f(e.edges(),function(o){var a=n[o.v],i=n[o.w];!x(a)&&!x(i)&&(i.indegree++,a.out.push(n[o.w]))});var t=I(n,function(o){return!o.indegree});return De(t)}function De(r){var e=[];function n(a){return function(i){i.merged||(x(i.barycenter)||x(a.barycenter)||i.barycenter>=a.barycenter)&&Ye(a,i)}}function t(a){return function(i){i.in.push(a),--i.indegree===0&&r.push(i)}}for(;r.length;){var o=r.pop();e.push(o),f(o.in.reverse(),n(o)),f(o.out,t(o))}return w(I(e,function(a){return!a.merged}),function(a){return A(a,["vs","i","barycenter","weight"])})}function Ye(r,e){var n=0,t=0;r.weight&&(n+=r.barycenter*r.weight,t+=r.weight),e.weight&&(n+=e.barycenter*e.weight,t+=e.weight),r.vs=e.vs.concat(r.vs),r.barycenter=n/t,r.weight=t,r.i=Math.min(e.i,r.i),e.merged=!0}h();function se(r,e){var n=Or(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=n.lhs,o=P(n.rhs,function(c){return-c.i}),a=[],i=0,s=0,u=0;t.sort(ze(!!e)),u=ie(a,o,u),f(t,function(c){u+=c.vs.length,a.push(c.vs),i+=c.barycenter*c.weight,s+=c.weight,u=ie(a,o,u)});var d={vs:O(a)};return s&&(d.barycenter=i/s,d.weight=s),d}function ie(r,e,n){for(var t;e.length&&(t=S(e)).i<=n;)e.pop(),r.push(t.vs),n++;return n}function ze(r){return function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:r?n.i-e.i:e.i-n.i}}function lr(r,e,n,t){var o=r.children(e),a=r.node(e),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};i&&(o=I(o,function(_){return _!==i&&_!==s}));var d=oe(r,o);f(d,function(_){if(r.children(_.v).length){var E=lr(r,_.v,n,t);u[_.v]=E,Object.prototype.hasOwnProperty.call(E,"barycenter")&&We(_,E)}});var c=ae(d,n);Ue(c,u);var l=se(c,t);if(i&&(l.vs=O([i,l.vs,s]),r.predecessors(i).length)){var m=r.node(r.predecessors(i)[0]),v=r.node(r.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+m.order+v.order)/(l.weight+2),l.weight+=2}return l}function Ue(r,e){f(r,function(n){n.vs=O(n.vs.map(function(t){return e[t]?e[t].vs:t}))})}function We(r,e){x(r.barycenter)?(r.barycenter=e.barycenter,r.weight=e.weight):(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight)}function de(r){var e=nr(r),n=fe(r,g(1,e+1),"inEdges"),t=fe(r,g(e-1,-1,-1),"outEdges"),o=te(r);ue(r,o);for(var a=Number.POSITIVE_INFINITY,i,s=0,u=0;u<4;++s,++u){qe(s%2?n:t,s%4>=2),o=j(r);var d=ne(r,o);d<a&&(u=0,i=wr(o),a=d)}ue(r,i)}function fe(r,e,n){return w(e,function(t){return ee(r,t,n)})}function qe(r,e){var n=new y;f(r,function(t){var o=t.graph().root,a=lr(t,o,n,e);f(a.vs,function(i,s){t.node(i).order=s}),re(t,n,a.vs)})}function ue(r,e){f(e,function(n){f(n,function(t,o){r.node(t).order=o})})}h();function ce(r){var e=He(r);f(r.graph().dummyChains,function(n){for(var t=r.node(n),o=t.edgeObj,a=Xe(r,e,o.v,o.w),i=a.path,s=a.lca,u=0,d=i[u],c=!0;n!==o.w;){if(t=r.node(n),c){for(;(d=i[u])!==s&&r.node(d).maxRank<t.rank;)u++;d===s&&(c=!1)}if(!c){for(;u<i.length-1&&r.node(d=i[u+1]).minRank<=t.rank;)u++;d=i[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Xe(r,e,n,t){var o=[],a=[],i=Math.min(e[n].low,e[t].low),s=Math.max(e[n].lim,e[t].lim),u,d;u=n;do u=r.parent(u),o.push(u);while(u&&(e[u].low>i||s>e[u].lim));for(d=u,u=t;(u=r.parent(u))!==d;)a.push(u);return{path:o.concat(a.reverse()),lca:d}}function He(r){var e={},n=0;function t(o){var a=n;f(r.children(o),t),e[o]={low:a,lim:n++}}return f(r.children(),t),e}h();h();function Je(r,e){var n={};function t(o,a){var i=0,s=0,u=o.length,d=S(a);return f(a,function(c,l){var m=Qe(r,c),v=m?r.node(m).order:u;(m||c===d)&&(f(a.slice(s,l+1),function(_){f(r.predecessors(_),function(E){var Y=r.node(E),vr=Y.order;(vr<i||v<vr)&&!(Y.dummy&&r.node(_).dummy)&&he(n,E,_)})}),s=l+1,i=v)}),a}return M(e,t),n}function Ke(r,e){var n={};function t(a,i,s,u,d){var c;f(g(i,s),function(l){c=a[l],r.node(c).dummy&&f(r.predecessors(c),function(m){var v=r.node(m);v.dummy&&(v.order<u||v.order>d)&&he(n,m,c)})})}function o(a,i){var s=-1,u,d=0;return f(i,function(c,l){if(r.node(c).dummy==="border"){var m=r.predecessors(c);m.length&&(u=r.node(m[0]).order,t(i,d,l,s,u),d=l,s=u)}t(i,d,i.length,u,a.length)}),i}return M(e,o),n}function Qe(r,e){if(r.node(e).dummy)return z(r.predecessors(e),function(n){return r.node(n).dummy})}function he(r,e,n){if(e>n){var t=e;e=n,n=t}Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=r[e];Object.defineProperty(o,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ze(r,e,n){if(e>n){var t=e;e=n,n=t}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function $e(r,e,n,t){var o={},a={},i={};return f(e,function(s){f(s,function(u,d){o[u]=u,a[u]=u,i[u]=d})}),f(e,function(s){var u=-1;f(s,function(d){var c=t(d);if(c.length){c=P(c,function(E){return i[E]});for(var l=(c.length-1)/2,m=Math.floor(l),v=Math.ceil(l);m<=v;++m){var _=c[m];a[d]===d&&u<i[_]&&!Ze(n,d,_)&&(a[_]=d,a[d]=o[d]=o[_],u=i[_])}}})}),{root:o,align:a}}function rn(r,e,n,t,o){var a={},i=en(r,e,n,o),s=o?"borderLeft":"borderRight";function u(l,m){for(var v=i.nodes(),_=v.pop(),E={};_;)E[_]?l(_):(E[_]=!0,v.push(_),v=v.concat(m(_))),_=v.pop()}function d(l){a[l]=i.inEdges(l).reduce(function(m,v){return Math.max(m,a[v.v]+i.edge(v))},0)}function c(l){var m=i.outEdges(l).reduce(function(_,E){return Math.min(_,a[E.w]-i.edge(E))},Number.POSITIVE_INFINITY),v=r.node(l);m!==Number.POSITIVE_INFINITY&&v.borderType!==s&&(a[l]=Math.max(a[l],m))}return u(d,i.predecessors.bind(i)),u(c,i.successors.bind(i)),f(t,function(l){a[l]=a[n[l]]}),a}function en(r,e,n,t){var o=new y,a=r.graph(),i=an(a.nodesep,a.edgesep,t);return f(e,function(s){var u;f(s,function(d){var c=n[d];if(o.setNode(c),u){var l=n[u],m=o.edge(l,c);o.setEdge(l,c,Math.max(i(r,d,u),m||0))}u=d})}),o}function nn(r,e){return B(L(e),function(n){var t=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return Er(n,function(a,i){var s=sn(r,i)/2;t=Math.max(a+s,t),o=Math.min(a-s,o)}),t-o})}function tn(r,e){var n=L(e),t=C(n),o=k(n);f(["u","d"],function(a){f(["l","r"],function(i){var s=a+i,u=r[s],d;if(u!==e){var c=L(u);d=i==="l"?t-C(c):o-k(c),d&&(r[s]=V(u,function(l){return l+d}))}})})}function on(r,e){return V(r.ul,function(n,t){if(e)return r[e.toLowerCase()][t];var o=P(w(r,t));return(o[1]+o[2])/2})}function le(r){var e=j(r),n=U(Je(r,e),Ke(r,e)),t={},o;f(["u","d"],function(i){o=i==="u"?e:L(e).reverse(),f(["l","r"],function(s){s==="r"&&(o=w(o,function(l){return L(l).reverse()}));var u=(i==="u"?r.predecessors:r.successors).bind(r),d=$e(r,o,n,u),c=rn(r,o,d.root,d.align,s==="r");s==="r"&&(c=V(c,function(l){return-l})),t[i+s]=c})});var a=nn(r,t);return tn(t,a),on(t,r.graph().align)}function an(r,e,n){return function(t,o,a){var i=t.node(o),s=t.node(a),u=0,d;if(u+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":d=-i.width/2;break;case"r":d=i.width/2;break}if(d&&(u+=n?d:-d),d=0,u+=(i.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}return d&&(u+=n?d:-d),d=0,u}}function sn(r,e){return r.node(e).width}function pe(r){r=H(r),fn(r),yr(le(r),function(e,n){r.node(n).x=e})}function fn(r){var e=j(r),n=r.graph().ranksep,t=0;f(e,function(o){var a=k(w(o,function(i){return r.node(i).height}));f(o,function(i){r.node(i).y=t+a/2}),t+=a+n})}function un(r,e){var n=e&&e.debugTiming?Ir:Pr;n("layout",()=>{var t=n(" buildLayoutGraph",()=>En(r));n(" runLayout",()=>dn(t,n)),n(" updateInputGraph",()=>cn(r,t))})}function dn(r,e){e(" makeSpaceForEdgeLabels",()=>yn(r)),e(" removeSelfEdges",()=>Cn(r)),e(" acyclic",()=>Gr(r)),e(" nestingGraph.run",()=>Qr(r)),e(" rank",()=>hr(H(r))),e(" injectEdgeLabelProxies",()=>xn(r)),e(" removeEmptyRanks",()=>Nr(r)),e(" nestingGraph.cleanup",()=>$r(r)),e(" normalizeRanks",()=>gr(r)),e(" assignRankMinMax",()=>kn(r)),e(" removeEdgeLabelProxies",()=>gn(r)),e(" normalize.run",()=>Ar(r)),e(" parentDummyChains",()=>ce(r)),e(" addBorderSegments",()=>Cr(r)),e(" order",()=>de(r)),e(" insertSelfEdges",()=>jn(r)),e(" adjustCoordinateSystem",()=>Tr(r)),e(" position",()=>pe(r)),e(" positionSelfEdges",()=>Tn(r)),e(" removeBorderNodes",()=>Ln(r)),e(" normalize.undo",()=>Dr(r)),e(" fixupEdgeLabelCoords",()=>In(r)),e(" undoCoordinateSystem",()=>Rr(r)),e(" translateGraph",()=>Nn(r)),e(" assignNodeIntersects",()=>On(r)),e(" reversePoints",()=>Pn(r)),e(" acyclic.undo",()=>Vr(r))}function cn(r,e){f(r.nodes(),function(n){var t=r.node(n),o=e.node(n);t&&(t.x=o.x,t.y=o.y,e.children(n).length&&(t.width=o.width,t.height=o.height))}),f(r.edges(),function(n){var t=r.edge(n),o=e.edge(n);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var hn=["nodesep","edgesep","ranksep","marginx","marginy"],ln={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},pn=["acyclicer","ranker","rankdir","align"],mn=["width","height"],vn={width:0,height:0},_n=["minlen","weight","width","height","labeloffset"],wn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},bn=["labelpos"];function En(r){var e=new y({multigraph:!0,compound:!0}),n=mr(r.graph());return e.setGraph(U({},ln,pr(n,hn),A(n,pn))),f(r.nodes(),function(t){var o=mr(r.node(t));e.setNode(t,br(pr(o,mn),vn)),e.setParent(t,r.parent(t))}),f(r.edges(),function(t){var o=mr(r.edge(t));e.setEdge(t,U({},wn,pr(o,_n),A(o,bn)))}),e}function yn(r){var e=r.graph();e.ranksep/=2,f(r.edges(),function(n){var t=r.edge(n);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function xn(r){f(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var t=r.node(e.v),o=r.node(e.w),a={rank:(o.rank-t.rank)/2+t.rank,e};N(r,"edge-proxy",a,"_ep")}})}function kn(r){var e=0;f(r.nodes(),function(n){var t=r.node(n);t.borderTop&&(t.minRank=r.node(t.borderTop).rank,t.maxRank=r.node(t.borderBottom).rank,e=k(e,t.maxRank))}),r.graph().maxRank=e}function gn(r){f(r.nodes(),function(e){var n=r.node(e);n.dummy==="edge-proxy"&&(r.edge(n.e).labelRank=n.rank,r.removeNode(e))})}function Nn(r){var e=Number.POSITIVE_INFINITY,n=0,t=Number.POSITIVE_INFINITY,o=0,a=r.graph(),i=a.marginx||0,s=a.marginy||0;function u(d){var c=d.x,l=d.y,m=d.width,v=d.height;e=Math.min(e,c-m/2),n=Math.max(n,c+m/2),t=Math.min(t,l-v/2),o=Math.max(o,l+v/2)}f(r.nodes(),function(d){u(r.node(d))}),f(r.edges(),function(d){var c=r.edge(d);Object.prototype.hasOwnProperty.call(c,"x")&&u(c)}),e-=i,t-=s,f(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=t}),f(r.edges(),function(d){var c=r.edge(d);f(c.points,function(l){l.x-=e,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=e),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),a.width=n-e+i,a.height=o-t+s}function On(r){f(r.edges(),function(e){var n=r.edge(e),t=r.node(e.v),o=r.node(e.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=t),n.points.unshift(rr(t,a)),n.points.push(rr(o,i))})}function In(r){f(r.edges(),function(e){var n=r.edge(e);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 Pn(r){f(r.edges(),function(e){var n=r.edge(e);n.reversed&&n.points.reverse()})}function Ln(r){f(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),t=r.node(n.borderTop),o=r.node(n.borderBottom),a=r.node(S(n.borderLeft)),i=r.node(S(n.borderRight));n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-t.y),n.x=a.x+n.width/2,n.y=t.y+n.height/2}}),f(r.nodes(),function(e){r.node(e).dummy==="border"&&r.removeNode(e)})}function Cn(r){f(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function jn(r){var e=j(r);f(e,function(n){var t=0;f(n,function(o,a){var i=r.node(o);i.order=a+t,f(i.selfEdges,function(s){N(r,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:a+ ++t,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function Tn(r){f(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var t=r.node(n.e.v),o=t.x+t.width/2,a=t.y,i=n.x-o,s=t.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:o+2*i/3,y:a-s},{x:o+5*i/6,y:a-s},{x:o+i,y:a},{x:o+5*i/6,y:a+s},{x:o+2*i/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function pr(r,e){return V(A(r,e),Number)}function mr(r){var e={};return f(r,function(n,t){e[t.toLowerCase()]=n}),e}h();export{un as a};
2
- //# sourceMappingURL=chunk-4TORDSRR.js.map
1
+ import{A as D,B as $,C as y,a as _r,b as G,c as O,d as wr,e as Z,f as br,g as S,h as f,i as I,j as z,k as w,l as Er,m as yr,n as X,o as L,p as x,q as V,r as k,s as U,t as C,u as B,v as A,w as g,x as M,y as xr,z as P}from"./chunk-I6RMTJPN.js";import{d as h}from"./chunk-SOAWGUAD.js";h();h();h();function N(r,e,n,t){var o;do o=D(t);while(r.hasNode(o));return n.dummy=e,r.setNode(o,n),o}function kr(r){var e=new y().setGraph(r.graph());return f(r.nodes(),function(n){e.setNode(n,r.node(n))}),f(r.edges(),function(n){var t=e.edge(n.v,n.w)||{weight:0,minlen:1},o=r.edge(n);e.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),e}function H(r){var e=new y({multigraph:r.isMultigraph()}).setGraph(r.graph());return f(r.nodes(),function(n){r.children(n).length||e.setNode(n,r.node(n))}),f(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function rr(r,e){var n=r.x,t=r.y,o=e.x-n,a=e.y-t,i=r.width/2,s=r.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,d;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),u=s*o/a,d=s):(o<0&&(i=-i),u=i,d=i*a/o),{x:n+u,y:t+d}}function j(r){var e=w(g(nr(r)+1),function(){return[]});return f(r.nodes(),function(n){var t=r.node(n),o=t.rank;x(o)||(e[o][t.order]=n)}),e}function gr(r){var e=C(w(r.nodes(),function(n){return r.node(n).rank}));f(r.nodes(),function(n){var t=r.node(n);X(t,"rank")&&(t.rank-=e)})}function Nr(r){var e=C(w(r.nodes(),function(a){return r.node(a).rank})),n=[];f(r.nodes(),function(a){var i=r.node(a).rank-e;n[i]||(n[i]=[]),n[i].push(a)});var t=0,o=r.graph().nodeRankFactor;f(n,function(a,i){x(a)&&i%o!==0?--t:t&&f(a,function(s){r.node(s).rank+=t})})}function er(r,e,n,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=t),N(r,"border",o,e)}function nr(r){return k(w(r.nodes(),function(e){var n=r.node(e).rank;if(!x(n))return n}))}function Or(r,e){var n={lhs:[],rhs:[]};return f(r,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function Ir(r,e){var n=Z();try{return e()}finally{console.log(r+" time: "+(Z()-n)+"ms")}}function Pr(r,e){return e()}function Cr(r){function e(n){var t=r.children(n),o=r.node(n);if(t.length&&f(t,e),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)Lr(r,"borderLeft","_bl",n,o,a),Lr(r,"borderRight","_br",n,o,a)}}f(r.children(),e)}function Lr(r,e,n,t,o,a){var i={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],u=N(r,"border",i,n);o[e][a]=u,r.setParent(u,t),s&&r.setEdge(s,u,{weight:1})}h();function Tr(r){var e=r.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Sr(r)}function Rr(r){var e=r.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&me(r),(e==="lr"||e==="rl")&&(ve(r),Sr(r))}function Sr(r){f(r.nodes(),function(e){jr(r.node(e))}),f(r.edges(),function(e){jr(r.edge(e))})}function jr(r){var e=r.width;r.width=r.height,r.height=e}function me(r){f(r.nodes(),function(e){tr(r.node(e))}),f(r.edges(),function(e){var n=r.edge(e);f(n.points,tr),Object.prototype.hasOwnProperty.call(n,"y")&&tr(n)})}function tr(r){r.y=-r.y}function ve(r){f(r.nodes(),function(e){or(r.node(e))}),f(r.edges(),function(e){var n=r.edge(e);f(n.points,or),Object.prototype.hasOwnProperty.call(n,"x")&&or(n)})}function or(r){var e=r.x;r.x=r.y,r.y=e}h();h();h();var J=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return Mr(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&Mr(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,t=n._prev;t!==n;)e.push(JSON.stringify(t,we)),t=t._prev;return"["+e.join(", ")+"]"}};function Mr(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function we(r,e){if(r!=="_next"&&r!=="_prev")return e}var be=G(1);function Fr(r,e){if(r.nodeCount()<=1)return[];var n=ye(r,e||be),t=Ee(n.graph,n.buckets,n.zeroIdx);return O(w(t,function(o){return r.outEdges(o.v,o.w)}))}function Ee(r,e,n){for(var t=[],o=e[e.length-1],a=e[0],i;r.nodeCount();){for(;i=a.dequeue();)ar(r,e,n,i);for(;i=o.dequeue();)ar(r,e,n,i);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(i=e[s].dequeue(),i){t=t.concat(ar(r,e,n,i,!0));break}}}return t}function ar(r,e,n,t,o){var a=o?[]:void 0;return f(r.inEdges(t.v),function(i){var s=r.edge(i),u=r.node(i.v);o&&a.push({v:i.v,w:i.w}),u.out-=s,ir(e,n,u)}),f(r.outEdges(t.v),function(i){var s=r.edge(i),u=i.w,d=r.node(u);d.in-=s,ir(e,n,d)}),r.removeNode(t.v),a}function ye(r,e){var n=new y,t=0,o=0;f(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),f(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),o=Math.max(o,n.node(s.v).out+=d),t=Math.max(t,n.node(s.w).in+=d)});var a=g(o+t+3).map(function(){return new J}),i=t+1;return f(n.nodes(),function(s){ir(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function ir(r,e,n){n.out?n.in?r[n.out-n.in+e].enqueue(n):r[r.length-1].enqueue(n):r[0].enqueue(n)}function Gr(r){var e=r.graph().acyclicer==="greedy"?Fr(r,n(r)):xe(r);f(e,function(t){var o=r.edge(t);r.removeEdge(t),o.forwardName=t.name,o.reversed=!0,r.setEdge(t.w,t.v,o,D("rev"))});function n(t){return function(o){return t.edge(o).weight}}}function xe(r){var e=[],n={},t={};function o(a){Object.prototype.hasOwnProperty.call(t,a)||(t[a]=!0,n[a]=!0,f(r.outEdges(a),function(i){Object.prototype.hasOwnProperty.call(n,i.w)?e.push(i):o(i.w)}),delete n[a])}return f(r.nodes(),o),e}function Vr(r){f(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var t=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,t)}})}h();function Ar(r){r.graph().dummyChains=[],f(r.edges(),function(e){ke(r,e)})}function ke(r,e){var n=e.v,t=r.node(n).rank,o=e.w,a=r.node(o).rank,i=e.name,s=r.edge(e),u=s.labelRank;if(a!==t+1){r.removeEdge(e);var d=void 0,c,l;for(l=0,++t;t<a;++l,++t)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:t},c=N(r,"edge",d,"_d"),t===u&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),r.setEdge(n,c,{weight:s.weight},i),l===0&&r.graph().dummyChains.push(c),n=c;r.setEdge(n,o,{weight:s.weight},i)}}function Dr(r){f(r.graph().dummyChains,function(e){var n=r.node(e),t=n.edgeLabel,o;for(r.setEdge(n.edgeObj,t);n.dummy;)o=r.successors(e)[0],r.removeNode(e),t.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height),e=o,n=r.node(e)})}h();h();h();function W(r){var e={};function n(t){var o=r.node(t);if(Object.prototype.hasOwnProperty.call(e,t))return o.rank;e[t]=!0;var a=C(w(r.outEdges(t),function(i){return n(i.w)-r.edge(i).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),o.rank=a}f(r.sources(),n)}function F(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function K(r){var e=new y({directed:!1}),n=r.nodes()[0],t=r.nodeCount();e.setNode(n,{});for(var o,a;ge(e,r)<t;)o=Ne(e,r),a=e.hasNode(o.v)?F(r,o):-F(r,o),Oe(e,r,a);return e}function ge(r,e){function n(t){f(e.nodeEdges(t),function(o){var a=o.v,i=t===a?o.w:a;!r.hasNode(i)&&!F(e,o)&&(r.setNode(i,{}),r.setEdge(t,i,{}),n(i))})}return f(r.nodes(),n),r.nodeCount()}function Ne(r,e){return B(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return F(e,n)})}function Oe(r,e,n){f(r.nodes(),function(t){e.node(t).rank+=n})}h();h();h();h();h();var ot=G(1);h();h();h();h();var mt=G(1);h();h();sr.CycleException=q;function sr(r){var e={},n={},t=[];function o(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new q;Object.prototype.hasOwnProperty.call(e,a)||(n[a]=!0,e[a]=!0,f(r.predecessors(a),o),delete n[a],t.push(a))}if(f(r.sinks(),o),xr(e)!==r.nodeCount())throw new q;return t}function q(){}q.prototype=new Error;h();h();function Q(r,e,n){_r(e)||(e=[e]);var t=(r.isDirected()?r.successors:r.neighbors).bind(r),o=[],a={};return f(e,function(i){if(!r.hasNode(i))throw new Error("Graph does not have node: "+i);zr(r,i,n==="post",a,t,o)}),o}function zr(r,e,n,t,o,a){Object.prototype.hasOwnProperty.call(t,e)||(t[e]=!0,n||a.push(e),f(o(e),function(i){zr(r,i,n,t,o,a)}),n&&a.push(e))}function fr(r,e){return Q(r,e,"post")}h();function ur(r,e){return Q(r,e,"pre")}h();R.initLowLimValues=cr;R.initCutValues=dr;R.calcCutValue=Wr;R.leaveEdge=Xr;R.enterEdge=Hr;R.exchangeEdges=Jr;function R(r){r=kr(r),W(r);var e=K(r);cr(e),dr(e,r);for(var n,t;n=Xr(e);)t=Hr(e,r,n),Jr(e,r,n,t)}function dr(r,e){var n=fr(r,r.nodes());n=n.slice(0,n.length-1),f(n,function(t){je(r,e,t)})}function je(r,e,n){var t=r.node(n),o=t.parent;r.edge(n,o).cutvalue=Wr(r,e,n)}function Wr(r,e,n){var t=r.node(n),o=t.parent,a=!0,i=e.edge(n,o),s=0;return i||(a=!1,i=e.edge(o,n)),s=i.weight,f(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==o){var l=d===a,m=e.edge(u).weight;if(s+=l?m:-m,Re(r,n,c)){var v=r.edge(n,c).cutvalue;s+=l?-v:v}}}),s}function cr(r,e){arguments.length<2&&(e=r.nodes()[0]),qr(r,{},1,e)}function qr(r,e,n,t,o){var a=n,i=r.node(t);return e[t]=!0,f(r.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(e,s)||(n=qr(r,e,n,s,t))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function Xr(r){return z(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Hr(r,e,n){var t=n.v,o=n.w;e.hasEdge(t,o)||(t=n.w,o=n.v);var a=r.node(t),i=r.node(o),s=a,u=!1;a.lim>i.lim&&(s=i,u=!0);var d=I(e.edges(),function(c){return u===Ur(r,r.node(c.v),s)&&u!==Ur(r,r.node(c.w),s)});return B(d,function(c){return F(e,c)})}function Jr(r,e,n,t){var o=n.v,a=n.w;r.removeEdge(o,a),r.setEdge(t.v,t.w,{}),cr(r),dr(r,e),Te(r,e)}function Te(r,e){var n=z(r.nodes(),function(o){return!e.node(o).parent}),t=ur(r,n);t=t.slice(1),f(t,function(o){var a=r.node(o).parent,i=e.edge(o,a),s=!1;i||(i=e.edge(a,o),s=!0),e.node(o).rank=e.node(a).rank+(s?i.minlen:-i.minlen)})}function Re(r,e,n){return r.hasEdge(e,n)}function Ur(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function hr(r){switch(r.graph().ranker){case"network-simplex":Kr(r);break;case"tight-tree":Me(r);break;case"longest-path":Se(r);break;default:Kr(r)}}var Se=W;function Me(r){W(r),K(r)}function Kr(r){R(r)}h();function Qr(r){var e=N(r,"root",{},"_root"),n=Fe(r),t=k(L(n))-1,o=2*t+1;r.graph().nestingRoot=e,f(r.edges(),function(i){r.edge(i).minlen*=o});var a=Ge(r)+1;f(r.children(),function(i){Zr(r,e,o,a,t,n,i)}),r.graph().nodeRankFactor=o}function Zr(r,e,n,t,o,a,i){var s=r.children(i);if(!s.length){i!==e&&r.setEdge(e,i,{weight:0,minlen:n});return}var u=er(r,"_bt"),d=er(r,"_bb"),c=r.node(i);r.setParent(u,i),c.borderTop=u,r.setParent(d,i),c.borderBottom=d,f(s,function(l){Zr(r,e,n,t,o,a,l);var m=r.node(l),v=m.borderTop?m.borderTop:l,_=m.borderBottom?m.borderBottom:l,E=m.borderTop?t:2*t,Y=v!==_?1:o-a[i]+1;r.setEdge(u,v,{weight:E,minlen:Y,nestingEdge:!0}),r.setEdge(_,d,{weight:E,minlen:Y,nestingEdge:!0})}),r.parent(i)||r.setEdge(e,u,{weight:0,minlen:o+a[i]})}function Fe(r){var e={};function n(t,o){var a=r.children(t);a&&a.length&&f(a,function(i){n(i,o+1)}),e[t]=o}return f(r.children(),function(t){n(t,1)}),e}function Ge(r){return M(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function $r(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,f(r.edges(),function(n){var t=r.edge(n);t.nestingEdge&&r.removeEdge(n)})}h();h();function re(r,e,n){var t={},o;f(n,function(a){for(var i=r.parent(a),s,u;i;){if(s=r.parent(i),s?(u=t[s],t[s]=i):(u=o,o=i),u&&u!==i){e.setEdge(u,i);return}i=s}})}h();function ee(r,e,n){var t=Be(r),o=new y({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(a){return r.node(a)});return f(r.nodes(),function(a){var i=r.node(a),s=r.parent(a);(i.rank===e||i.minRank<=e&&e<=i.maxRank)&&(o.setNode(a),o.setParent(a,s||t),f(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=o.edge(d,a),l=x(c)?0:c.weight;o.setEdge(d,a,{weight:r.edge(u).weight+l})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[e],borderRight:i.borderRight[e]}))}),o}function Be(r){for(var e;r.hasNode(e=D("_root")););return e}h();function ne(r,e){for(var n=0,t=1;t<e.length;++t)n+=Ae(r,e[t-1],e[t]);return n}function Ae(r,e,n){for(var t=$(n,w(n,function(d,c){return c})),o=O(w(e,function(d){return P(w(r.outEdges(d),function(c){return{pos:t[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;a<n.length;)a<<=1;var i=2*a-1;a-=1;var s=w(new Array(i),function(){return 0}),u=0;return f(o.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;for(var l=0;c>0;)c%2&&(l+=s[c+1]),c=c-1>>1,s[c]+=d.weight;u+=d.weight*l})),u}h();function te(r){var e={},n=I(r.nodes(),function(s){return!r.children(s).length}),t=k(w(n,function(s){return r.node(s).rank})),o=w(g(t+1),function(){return[]});function a(s){if(!X(e,s)){e[s]=!0;var u=r.node(s);o[u.rank].push(s),f(r.successors(s),a)}}var i=P(n,function(s){return r.node(s).rank});return f(i,a),o}h();h();function oe(r,e){return w(e,function(n){var t=r.inEdges(n);if(t.length){var o=M(t,function(a,i){var s=r.edge(i),u=r.node(i.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:n}})}h();function ae(r,e){var n={};f(r,function(o,a){var i=n[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:a};x(o.barycenter)||(i.barycenter=o.barycenter,i.weight=o.weight)}),f(e.edges(),function(o){var a=n[o.v],i=n[o.w];!x(a)&&!x(i)&&(i.indegree++,a.out.push(n[o.w]))});var t=I(n,function(o){return!o.indegree});return De(t)}function De(r){var e=[];function n(a){return function(i){i.merged||(x(i.barycenter)||x(a.barycenter)||i.barycenter>=a.barycenter)&&Ye(a,i)}}function t(a){return function(i){i.in.push(a),--i.indegree===0&&r.push(i)}}for(;r.length;){var o=r.pop();e.push(o),f(o.in.reverse(),n(o)),f(o.out,t(o))}return w(I(e,function(a){return!a.merged}),function(a){return A(a,["vs","i","barycenter","weight"])})}function Ye(r,e){var n=0,t=0;r.weight&&(n+=r.barycenter*r.weight,t+=r.weight),e.weight&&(n+=e.barycenter*e.weight,t+=e.weight),r.vs=e.vs.concat(r.vs),r.barycenter=n/t,r.weight=t,r.i=Math.min(e.i,r.i),e.merged=!0}h();function se(r,e){var n=Or(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=n.lhs,o=P(n.rhs,function(c){return-c.i}),a=[],i=0,s=0,u=0;t.sort(ze(!!e)),u=ie(a,o,u),f(t,function(c){u+=c.vs.length,a.push(c.vs),i+=c.barycenter*c.weight,s+=c.weight,u=ie(a,o,u)});var d={vs:O(a)};return s&&(d.barycenter=i/s,d.weight=s),d}function ie(r,e,n){for(var t;e.length&&(t=S(e)).i<=n;)e.pop(),r.push(t.vs),n++;return n}function ze(r){return function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:r?n.i-e.i:e.i-n.i}}function lr(r,e,n,t){var o=r.children(e),a=r.node(e),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};i&&(o=I(o,function(_){return _!==i&&_!==s}));var d=oe(r,o);f(d,function(_){if(r.children(_.v).length){var E=lr(r,_.v,n,t);u[_.v]=E,Object.prototype.hasOwnProperty.call(E,"barycenter")&&We(_,E)}});var c=ae(d,n);Ue(c,u);var l=se(c,t);if(i&&(l.vs=O([i,l.vs,s]),r.predecessors(i).length)){var m=r.node(r.predecessors(i)[0]),v=r.node(r.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+m.order+v.order)/(l.weight+2),l.weight+=2}return l}function Ue(r,e){f(r,function(n){n.vs=O(n.vs.map(function(t){return e[t]?e[t].vs:t}))})}function We(r,e){x(r.barycenter)?(r.barycenter=e.barycenter,r.weight=e.weight):(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight)}function de(r){var e=nr(r),n=fe(r,g(1,e+1),"inEdges"),t=fe(r,g(e-1,-1,-1),"outEdges"),o=te(r);ue(r,o);for(var a=Number.POSITIVE_INFINITY,i,s=0,u=0;u<4;++s,++u){qe(s%2?n:t,s%4>=2),o=j(r);var d=ne(r,o);d<a&&(u=0,i=wr(o),a=d)}ue(r,i)}function fe(r,e,n){return w(e,function(t){return ee(r,t,n)})}function qe(r,e){var n=new y;f(r,function(t){var o=t.graph().root,a=lr(t,o,n,e);f(a.vs,function(i,s){t.node(i).order=s}),re(t,n,a.vs)})}function ue(r,e){f(e,function(n){f(n,function(t,o){r.node(t).order=o})})}h();function ce(r){var e=He(r);f(r.graph().dummyChains,function(n){for(var t=r.node(n),o=t.edgeObj,a=Xe(r,e,o.v,o.w),i=a.path,s=a.lca,u=0,d=i[u],c=!0;n!==o.w;){if(t=r.node(n),c){for(;(d=i[u])!==s&&r.node(d).maxRank<t.rank;)u++;d===s&&(c=!1)}if(!c){for(;u<i.length-1&&r.node(d=i[u+1]).minRank<=t.rank;)u++;d=i[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Xe(r,e,n,t){var o=[],a=[],i=Math.min(e[n].low,e[t].low),s=Math.max(e[n].lim,e[t].lim),u,d;u=n;do u=r.parent(u),o.push(u);while(u&&(e[u].low>i||s>e[u].lim));for(d=u,u=t;(u=r.parent(u))!==d;)a.push(u);return{path:o.concat(a.reverse()),lca:d}}function He(r){var e={},n=0;function t(o){var a=n;f(r.children(o),t),e[o]={low:a,lim:n++}}return f(r.children(),t),e}h();h();function Je(r,e){var n={};function t(o,a){var i=0,s=0,u=o.length,d=S(a);return f(a,function(c,l){var m=Qe(r,c),v=m?r.node(m).order:u;(m||c===d)&&(f(a.slice(s,l+1),function(_){f(r.predecessors(_),function(E){var Y=r.node(E),vr=Y.order;(vr<i||v<vr)&&!(Y.dummy&&r.node(_).dummy)&&he(n,E,_)})}),s=l+1,i=v)}),a}return M(e,t),n}function Ke(r,e){var n={};function t(a,i,s,u,d){var c;f(g(i,s),function(l){c=a[l],r.node(c).dummy&&f(r.predecessors(c),function(m){var v=r.node(m);v.dummy&&(v.order<u||v.order>d)&&he(n,m,c)})})}function o(a,i){var s=-1,u,d=0;return f(i,function(c,l){if(r.node(c).dummy==="border"){var m=r.predecessors(c);m.length&&(u=r.node(m[0]).order,t(i,d,l,s,u),d=l,s=u)}t(i,d,i.length,u,a.length)}),i}return M(e,o),n}function Qe(r,e){if(r.node(e).dummy)return z(r.predecessors(e),function(n){return r.node(n).dummy})}function he(r,e,n){if(e>n){var t=e;e=n,n=t}Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=r[e];Object.defineProperty(o,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ze(r,e,n){if(e>n){var t=e;e=n,n=t}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function $e(r,e,n,t){var o={},a={},i={};return f(e,function(s){f(s,function(u,d){o[u]=u,a[u]=u,i[u]=d})}),f(e,function(s){var u=-1;f(s,function(d){var c=t(d);if(c.length){c=P(c,function(E){return i[E]});for(var l=(c.length-1)/2,m=Math.floor(l),v=Math.ceil(l);m<=v;++m){var _=c[m];a[d]===d&&u<i[_]&&!Ze(n,d,_)&&(a[_]=d,a[d]=o[d]=o[_],u=i[_])}}})}),{root:o,align:a}}function rn(r,e,n,t,o){var a={},i=en(r,e,n,o),s=o?"borderLeft":"borderRight";function u(l,m){for(var v=i.nodes(),_=v.pop(),E={};_;)E[_]?l(_):(E[_]=!0,v.push(_),v=v.concat(m(_))),_=v.pop()}function d(l){a[l]=i.inEdges(l).reduce(function(m,v){return Math.max(m,a[v.v]+i.edge(v))},0)}function c(l){var m=i.outEdges(l).reduce(function(_,E){return Math.min(_,a[E.w]-i.edge(E))},Number.POSITIVE_INFINITY),v=r.node(l);m!==Number.POSITIVE_INFINITY&&v.borderType!==s&&(a[l]=Math.max(a[l],m))}return u(d,i.predecessors.bind(i)),u(c,i.successors.bind(i)),f(t,function(l){a[l]=a[n[l]]}),a}function en(r,e,n,t){var o=new y,a=r.graph(),i=an(a.nodesep,a.edgesep,t);return f(e,function(s){var u;f(s,function(d){var c=n[d];if(o.setNode(c),u){var l=n[u],m=o.edge(l,c);o.setEdge(l,c,Math.max(i(r,d,u),m||0))}u=d})}),o}function nn(r,e){return B(L(e),function(n){var t=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return Er(n,function(a,i){var s=sn(r,i)/2;t=Math.max(a+s,t),o=Math.min(a-s,o)}),t-o})}function tn(r,e){var n=L(e),t=C(n),o=k(n);f(["u","d"],function(a){f(["l","r"],function(i){var s=a+i,u=r[s],d;if(u!==e){var c=L(u);d=i==="l"?t-C(c):o-k(c),d&&(r[s]=V(u,function(l){return l+d}))}})})}function on(r,e){return V(r.ul,function(n,t){if(e)return r[e.toLowerCase()][t];var o=P(w(r,t));return(o[1]+o[2])/2})}function le(r){var e=j(r),n=U(Je(r,e),Ke(r,e)),t={},o;f(["u","d"],function(i){o=i==="u"?e:L(e).reverse(),f(["l","r"],function(s){s==="r"&&(o=w(o,function(l){return L(l).reverse()}));var u=(i==="u"?r.predecessors:r.successors).bind(r),d=$e(r,o,n,u),c=rn(r,o,d.root,d.align,s==="r");s==="r"&&(c=V(c,function(l){return-l})),t[i+s]=c})});var a=nn(r,t);return tn(t,a),on(t,r.graph().align)}function an(r,e,n){return function(t,o,a){var i=t.node(o),s=t.node(a),u=0,d;if(u+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":d=-i.width/2;break;case"r":d=i.width/2;break}if(d&&(u+=n?d:-d),d=0,u+=(i.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}return d&&(u+=n?d:-d),d=0,u}}function sn(r,e){return r.node(e).width}function pe(r){r=H(r),fn(r),yr(le(r),function(e,n){r.node(n).x=e})}function fn(r){var e=j(r),n=r.graph().ranksep,t=0;f(e,function(o){var a=k(w(o,function(i){return r.node(i).height}));f(o,function(i){r.node(i).y=t+a/2}),t+=a+n})}function un(r,e){var n=e&&e.debugTiming?Ir:Pr;n("layout",()=>{var t=n(" buildLayoutGraph",()=>En(r));n(" runLayout",()=>dn(t,n)),n(" updateInputGraph",()=>cn(r,t))})}function dn(r,e){e(" makeSpaceForEdgeLabels",()=>yn(r)),e(" removeSelfEdges",()=>Cn(r)),e(" acyclic",()=>Gr(r)),e(" nestingGraph.run",()=>Qr(r)),e(" rank",()=>hr(H(r))),e(" injectEdgeLabelProxies",()=>xn(r)),e(" removeEmptyRanks",()=>Nr(r)),e(" nestingGraph.cleanup",()=>$r(r)),e(" normalizeRanks",()=>gr(r)),e(" assignRankMinMax",()=>kn(r)),e(" removeEdgeLabelProxies",()=>gn(r)),e(" normalize.run",()=>Ar(r)),e(" parentDummyChains",()=>ce(r)),e(" addBorderSegments",()=>Cr(r)),e(" order",()=>de(r)),e(" insertSelfEdges",()=>jn(r)),e(" adjustCoordinateSystem",()=>Tr(r)),e(" position",()=>pe(r)),e(" positionSelfEdges",()=>Tn(r)),e(" removeBorderNodes",()=>Ln(r)),e(" normalize.undo",()=>Dr(r)),e(" fixupEdgeLabelCoords",()=>In(r)),e(" undoCoordinateSystem",()=>Rr(r)),e(" translateGraph",()=>Nn(r)),e(" assignNodeIntersects",()=>On(r)),e(" reversePoints",()=>Pn(r)),e(" acyclic.undo",()=>Vr(r))}function cn(r,e){f(r.nodes(),function(n){var t=r.node(n),o=e.node(n);t&&(t.x=o.x,t.y=o.y,e.children(n).length&&(t.width=o.width,t.height=o.height))}),f(r.edges(),function(n){var t=r.edge(n),o=e.edge(n);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var hn=["nodesep","edgesep","ranksep","marginx","marginy"],ln={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},pn=["acyclicer","ranker","rankdir","align"],mn=["width","height"],vn={width:0,height:0},_n=["minlen","weight","width","height","labeloffset"],wn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},bn=["labelpos"];function En(r){var e=new y({multigraph:!0,compound:!0}),n=mr(r.graph());return e.setGraph(U({},ln,pr(n,hn),A(n,pn))),f(r.nodes(),function(t){var o=mr(r.node(t));e.setNode(t,br(pr(o,mn),vn)),e.setParent(t,r.parent(t))}),f(r.edges(),function(t){var o=mr(r.edge(t));e.setEdge(t,U({},wn,pr(o,_n),A(o,bn)))}),e}function yn(r){var e=r.graph();e.ranksep/=2,f(r.edges(),function(n){var t=r.edge(n);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function xn(r){f(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var t=r.node(e.v),o=r.node(e.w),a={rank:(o.rank-t.rank)/2+t.rank,e};N(r,"edge-proxy",a,"_ep")}})}function kn(r){var e=0;f(r.nodes(),function(n){var t=r.node(n);t.borderTop&&(t.minRank=r.node(t.borderTop).rank,t.maxRank=r.node(t.borderBottom).rank,e=k(e,t.maxRank))}),r.graph().maxRank=e}function gn(r){f(r.nodes(),function(e){var n=r.node(e);n.dummy==="edge-proxy"&&(r.edge(n.e).labelRank=n.rank,r.removeNode(e))})}function Nn(r){var e=Number.POSITIVE_INFINITY,n=0,t=Number.POSITIVE_INFINITY,o=0,a=r.graph(),i=a.marginx||0,s=a.marginy||0;function u(d){var c=d.x,l=d.y,m=d.width,v=d.height;e=Math.min(e,c-m/2),n=Math.max(n,c+m/2),t=Math.min(t,l-v/2),o=Math.max(o,l+v/2)}f(r.nodes(),function(d){u(r.node(d))}),f(r.edges(),function(d){var c=r.edge(d);Object.prototype.hasOwnProperty.call(c,"x")&&u(c)}),e-=i,t-=s,f(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=t}),f(r.edges(),function(d){var c=r.edge(d);f(c.points,function(l){l.x-=e,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=e),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),a.width=n-e+i,a.height=o-t+s}function On(r){f(r.edges(),function(e){var n=r.edge(e),t=r.node(e.v),o=r.node(e.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=t),n.points.unshift(rr(t,a)),n.points.push(rr(o,i))})}function In(r){f(r.edges(),function(e){var n=r.edge(e);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 Pn(r){f(r.edges(),function(e){var n=r.edge(e);n.reversed&&n.points.reverse()})}function Ln(r){f(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),t=r.node(n.borderTop),o=r.node(n.borderBottom),a=r.node(S(n.borderLeft)),i=r.node(S(n.borderRight));n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-t.y),n.x=a.x+n.width/2,n.y=t.y+n.height/2}}),f(r.nodes(),function(e){r.node(e).dummy==="border"&&r.removeNode(e)})}function Cn(r){f(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function jn(r){var e=j(r);f(e,function(n){var t=0;f(n,function(o,a){var i=r.node(o);i.order=a+t,f(i.selfEdges,function(s){N(r,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:a+ ++t,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function Tn(r){f(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var t=r.node(n.e.v),o=t.x+t.width/2,a=t.y,i=n.x-o,s=t.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:o+2*i/3,y:a-s},{x:o+5*i/6,y:a-s},{x:o+i,y:a},{x:o+5*i/6,y:a+s},{x:o+2*i/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function pr(r,e){return V(A(r,e),Number)}function mr(r){var e={};return f(r,function(n,t){e[t.toLowerCase()]=n}),e}h();export{un as a};
2
+ //# sourceMappingURL=chunk-CKJRXIX7.js.map