@staticbolt/docs 0.0.1-beta.3 → 0.0.1-beta.5

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 (117) hide show
  1. package/README.md +16 -19
  2. package/lib/index.d.mts +62 -35
  3. package/lib/mermaid/abnfDiagram-PAR5IXJI-Ibbj5eGO.js +1 -0
  4. package/lib/mermaid/architecture-7GRP2DOG-M7G3SWCO-BJAoKIRD.js +1 -0
  5. package/lib/mermaid/architectureDiagram-2PNWDENW-CI3fLWIN.js +36 -0
  6. package/lib/mermaid/blockDiagram-PUWGUBOA-DAfWpjz7.js +129 -0
  7. package/lib/mermaid/c4Diagram-3NLNHZP5-at-f4FDi.js +38 -0
  8. package/lib/mermaid/chunk-2NMSUPJH-DuxvnX1p.js +1 -0
  9. package/lib/mermaid/chunk-32MCUW2P-D8U-Oy6M.js +206 -0
  10. package/lib/mermaid/chunk-3NPNU5GP-8WYybYAh.js +1 -0
  11. package/lib/mermaid/chunk-3SMGFRGC-C0WC5bhP.js +1 -0
  12. package/lib/mermaid/chunk-4CAJECRU-C_QnaDal.js +15 -0
  13. package/lib/mermaid/chunk-4OADUZ5Q-DHE3k_pb.js +10 -0
  14. package/lib/mermaid/chunk-5IMINLNL-Cl3N81sR.js +1 -0
  15. package/lib/mermaid/chunk-5IQCK5RY-Df5Ppxew.js +3 -0
  16. package/lib/mermaid/chunk-5MVFYWFU-DgXg5u6h.js +1 -0
  17. package/lib/mermaid/chunk-AQ6EADP3-CZhslHi-.js +1 -0
  18. package/lib/mermaid/chunk-AZZRMDJM-y-xJBuMz.js +15 -0
  19. package/lib/mermaid/chunk-CLS4B6BI-BRLlisnG.js +168 -0
  20. package/lib/mermaid/chunk-DZP67EKU-9RpG5Rdc.js +70 -0
  21. package/lib/mermaid/chunk-EICP7K5X-8YS1Gtlr.js +1 -0
  22. package/lib/mermaid/chunk-GDY2UAB4-QtXfmDIW.js +1 -0
  23. package/lib/mermaid/chunk-H7VHZCWX-CwFRFlEn.js +1 -0
  24. package/lib/mermaid/chunk-IJBDOHL6-CgcssvZb.js +1 -0
  25. package/lib/mermaid/chunk-JFFVMJIA-Cx1_ZSMR.js +1 -0
  26. package/lib/mermaid/chunk-JQRUD6KW-Dbva2Z17.js +1 -0
  27. package/lib/mermaid/chunk-JZGDI5JK-BspJQ1vQ.js +1 -0
  28. package/lib/mermaid/chunk-KD6SPIPN-4bKl37hM.js +2 -0
  29. package/lib/mermaid/chunk-NF366YI6-D1lnbapv.js +231 -0
  30. package/lib/mermaid/chunk-NUDPKBEF-CL0e9XiQ.js +34 -0
  31. package/lib/mermaid/chunk-OJINMHTS-rKnCIFV0.js +1 -0
  32. package/lib/mermaid/chunk-Q6NGPIAH-CM9NYxWM.js +2 -0
  33. package/lib/mermaid/chunk-QJSWEUOL-kvKBktmc.js +133 -0
  34. package/lib/mermaid/chunk-R7JDMUKV-CSyCOfYj.js +1 -0
  35. package/lib/mermaid/chunk-RCXAM2GK-BeKcutEV.js +1 -0
  36. package/lib/mermaid/chunk-RT4MAWR3-Cv_8LyN5.js +1 -0
  37. package/lib/mermaid/chunk-SFMINX4W-BW2NSwFJ.js +1 -0
  38. package/lib/mermaid/chunk-SLDQ463B-D15xTdNW.js +88 -0
  39. package/lib/mermaid/chunk-STOV2HOB-GnExfzIX.js +1 -0
  40. package/lib/mermaid/chunk-T5OCTHI4-DdZvN-9i.js +1 -0
  41. package/lib/mermaid/chunk-TCEHX7R3-BXjgPiQF.js +1 -0
  42. package/lib/mermaid/chunk-VQC2EELJ-sGo2yn97.js +1 -0
  43. package/lib/mermaid/chunk-VRZKL3EH-BzaZ6KlD.js +1 -0
  44. package/lib/mermaid/chunk-VTHDQ7BV-BqUEu5Ml.js +1 -0
  45. package/lib/mermaid/chunk-VY2OSTJR-BYk2nUI_.js +2 -0
  46. package/lib/mermaid/chunk-WUBWJARI-Z8MI6quX.js +1 -0
  47. package/lib/mermaid/chunk-YBMQ5JGJ-DlZ1nCKo.js +2 -0
  48. package/lib/mermaid/chunk-YDMLL4PJ-BHgx6nXf.js +1 -0
  49. package/lib/mermaid/chunk-Z6V44ARX-CWGOZvke.js +62 -0
  50. package/lib/mermaid/chunk-ZJJ7VQJP-CZ7qJzqZ.js +340 -0
  51. package/lib/mermaid/chunk-ZNLK7HRR-B-wIfXTw.js +1 -0
  52. package/lib/mermaid/chunk-ZQN7UHIL-CNp35E78.js +1 -0
  53. package/lib/mermaid/chunk-ZS6VBONO-D-IFTJgn.js +175 -0
  54. package/lib/mermaid/chunk-ZUNWM646-DRKPDcQl.js +1 -0
  55. package/lib/mermaid/classDiagram-FGAMPOII-D1sf64vv.js +1 -0
  56. package/lib/mermaid/classDiagram-v2-AI5RJEK4-D1sf64vv.js +1 -0
  57. package/lib/mermaid/cose-bilkent-Q72C2OJ3-iX90typn.js +1 -0
  58. package/lib/mermaid/cynefin-OW5HDTMX-6OCTWOGG-6jDAiaRu.js +1 -0
  59. package/lib/mermaid/cynefinDiagram-2OOWUY4M-5ACKe62t.js +62 -0
  60. package/lib/mermaid/dagre-MPVFI544-BUrJjGwd.js +4 -0
  61. package/lib/mermaid/diagram-AE4NWXFW-B3Lkw8MS.js +24 -0
  62. package/lib/mermaid/diagram-BUJID5UG-p2ajLLgr.js +41 -0
  63. package/lib/mermaid/diagram-C44CZ5NI-CO0U1GX-.js +24 -0
  64. package/lib/mermaid/diagram-EYOLEXXS-DDoUndBV.js +30 -0
  65. package/lib/mermaid/diagram-P7B6PWOJ-C_dSNQyG.js +3 -0
  66. package/lib/mermaid/ebnfDiagram-FTPZ3PV6-DIwB5te0.js +1 -0
  67. package/lib/mermaid/erDiagram-H3ERR26V-CN4pCzIq.js +99 -0
  68. package/lib/mermaid/eventmodeling-NTZA5JFV-WKSWQHFS-Ruta89_N.js +1 -0
  69. package/lib/mermaid/flowDiagram-YHGXBVSY-CrSHzFwR.js +1 -0
  70. package/lib/mermaid/ganttDiagram-RWFTB7ED-C-rfEOn5.js +292 -0
  71. package/lib/mermaid/gitGraph-4MIJSDKK-JH2HKYUO-B76vihW5.js +1 -0
  72. package/lib/mermaid/gitGraphDiagram-MAR6GKOP-peAd7EYO.js +106 -0
  73. package/lib/mermaid/index.js +15 -0
  74. package/lib/mermaid/info-A6RAGUB7-3TX3OFWW-DykwOJ0Z.js +1 -0
  75. package/lib/mermaid/infoDiagram-LV547AFH-C46dOKDG.js +2 -0
  76. package/lib/mermaid/ishikawaDiagram-PUJQGNDS-DUmHXvO9.js +70 -0
  77. package/lib/mermaid/journeyDiagram-EW5QJT4W-CNAhUHsQ.js +139 -0
  78. package/lib/mermaid/kanban-definition-JSQERAZB-uOEoksHt.js +89 -0
  79. package/lib/mermaid/katex-CZ4GXH2S-CaEE-8Xf.js +257 -0
  80. package/lib/mermaid/mindmap-definition-VBJCLQLM-DZceCWFq.js +96 -0
  81. package/lib/mermaid/packet-AYTQ26CC-MKII6P3Y-XqJQX7OO.js +1 -0
  82. package/lib/mermaid/pegDiagram-7WILOQTJ-DMKA8PUf.js +1 -0
  83. package/lib/mermaid/pie-WAS4IAKB-6B4OPMJ5-DpoRuAye.js +1 -0
  84. package/lib/mermaid/pieDiagram-EFA7CBSB-BzO4xw8C.js +39 -0
  85. package/lib/mermaid/quadrantDiagram-WARVYA7P-DMQd2xKZ.js +7 -0
  86. package/lib/mermaid/radar-RG4KPBEZ-UPTR3XUL-BcwE6tO1.js +1 -0
  87. package/lib/mermaid/railroad-74A4TZTK-MEFUPFMS-B2Kwx3Uk.js +1 -0
  88. package/lib/mermaid/railroad-abnf-HS5TGJTU-R5YG2S5D-uBY3fYzG.js +1 -0
  89. package/lib/mermaid/railroad-ebnf-LZEXJU2U-G5QEX2L6-AhpzdU_3.js +1 -0
  90. package/lib/mermaid/railroad-peg-WCYAUIDC-H5I2ZRY2-CrsmP7-8.js +1 -0
  91. package/lib/mermaid/railroadDiagram-5NIQVNLQ-BGyZ628g.js +1 -0
  92. package/lib/mermaid/requirementDiagram-SXREGOKZ-CtCO7u9U.js +84 -0
  93. package/lib/mermaid/sankeyDiagram-VV74M2VP-CPXqmSKK.js +40 -0
  94. package/lib/mermaid/sequenceDiagram-52ZFIFDL-B1rSqWZp.js +162 -0
  95. package/lib/mermaid/sizeCapture-FGA5AGYP-BEqQzsxs.js +1 -0
  96. package/lib/mermaid/stateDiagram-3QAKPIVI-3KzWPUq3.js +1 -0
  97. package/lib/mermaid/stateDiagram-v2-HN2P4RDZ-dXASbYMy.js +1 -0
  98. package/lib/mermaid/swimlanes-QLVP42QD-CLpR90IY.js +1 -0
  99. package/lib/mermaid/swimlanesDiagram-JKPDBFCN-C2sgVGQE.js +8 -0
  100. package/lib/mermaid/timeline-definition-GS45XAXW-DLn0_RV5.js +120 -0
  101. package/lib/mermaid/treeView-Q6P3EWNA-ZRJGANNQ-u1bD1sZ1.js +1 -0
  102. package/lib/mermaid/treemap-WGGIJYW6-K64VN5AS-DrIaTBlj.js +1 -0
  103. package/lib/mermaid/vennDiagram-QIQU2ZRJ-FxbUp7-Z.js +34 -0
  104. package/lib/mermaid/wardley-WFR3VGLG-D67OWCCH-Br9hyuFK.js +1 -0
  105. package/lib/mermaid/wardleyDiagram-U6YNM66N-l-Kvr0Az.js +78 -0
  106. package/lib/mermaid/xychartDiagram-XJAZEDNM-O9bztWNh.js +7 -0
  107. package/lib/plugins.mjs +213 -162
  108. package/package.json +3 -10
  109. package/sources/parts/document/document.part.html +7 -7
  110. package/sources/parts/header/header.part.html +2 -2
  111. package/sources/parts/header/header.style.css +4 -2
  112. package/sources/parts/mermaid/mermaid.part.html +1 -1
  113. package/sources/parts/pagefind/pagefind.part.html +5 -3
  114. package/sources/parts/sidebar/sidebar.part.html +1 -1
  115. package/sources/parts/sidebar/sidebar.style.css +10 -0
  116. package/sources/parts/table-of-content/table-of-content-desktop.part.html +2 -2
  117. package/sources/scripts/mermaid.ts +3 -1
@@ -0,0 +1,62 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{V as t,q as n}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as r,I as i,U as a,i as o,j as s,l as c,v as l,w as u,y as d}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as f}from"./chunk-5IMINLNL-Cl3N81sR.js";import{a as p,i as m,r as h,t as g}from"./chunk-ZNLK7HRR-B-wIfXTw.js";import{t as _}from"./chunk-2NMSUPJH-DuxvnX1p.js";import{i as v,m as y,p as b,r as x}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{n as S,t as C}from"./chunk-DZP67EKU-9RpG5Rdc.js";var w=1,T=3;async function E(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let i=!D(t);await Promise.all([...n].map(t=>new Promise(n=>{function a(){if(t.style.display=`flex`,t.style.flexDirection=`column`,i){let e=r().fontSize?r().fontSize:window.getComputedStyle(document.body).fontSize,[n=l.fontSize]=b(e),i=n*5+`px`;t.style.minWidth=i,t.style.maxWidth=i}else t.style.width=`100%`;n(t)}e(a,`setupImage`),setTimeout(()=>{t.complete&&a()}),t.addEventListener(`error`,a),t.addEventListener(`load`,a)})))}e(E,`configureLabelImages`);function D(e){return e.nodeType===T?e.textContent?.trim()!==``:e.nodeType!==w||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(D)}e(D,`hasTextBesidesImages`);var O=3,k=32,A=e(async(e,n,i)=>{let a=r(),o=e.insert(`g`).attr(`class`,i??`node default`).attr(`id`,n.domId||n.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,v(n.labelStyle)),c=[{text:typeof n.label==`string`?n.label:n.label?.[0]??``,cssClass:`c4-name`},{text:n.stereotype,cssClass:`c4-type`},...(n.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),l=n.width?Math.max(n.width-2*(n.padding??0),k):r().flowchart?.wrappingWidth??200,u=a.c4?.wrap??!0?l:1/0,f=await Promise.all(c.map(async e=>{let r=s.append(`g`).attr(`class`,e.cssClass),i=await S(r,d(x(e.text??``),a),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:u,style:n.labelStyle},a);return t(i).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),t(i).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),p=Math.max(...f.map(({box:e})=>e.width),0),m=0;for(let{el:e,box:t}of f)e.attr(`transform`,`translate(${p/2-t.x-t.width/2}, ${m-t.y})`),m+=t.height+O;let h=f.length>0?m-O:0;return s.insert(`rect`,`:first-child`),s.attr(`transform`,`translate(${-p/2}, ${-h/2})`),{shapeSvg:o,bbox:s.node().getBBox(),halfPadding:(n.padding??0)/2,label:s}},`c4LabelHelper`),j=e(async(e,n,a)=>{if(n.stereotype!==void 0)return A(e,n,a);let o,s=n.useHtmlLabels||i(r()?.htmlLabels);o=a||`node default`;let c=e.insert(`g`).attr(`class`,o).attr(`id`,n.domId||n.id),l=c.insert(`g`).attr(`class`,`label`).attr(`style`,v(n.labelStyle)),u;u=n.label===void 0?``:typeof n.label==`string`?n.label:n.label[0];let f=!!n.icon||!!n.img,p=n.labelType===`markdown`,m=await S(l,d(x(u),r()),{useHtmlLabels:s,width:n.width||n.wrappingWidth||r().flowchart?.wrappingWidth,classes:p?`markdown-node-label`:``,style:n.labelStyle,addSvgBackground:f,markdown:p},r()),h=(n?.padding??0)/2,g;if(s){let e=m.children[0],n=t(m);await E(e),g=await C.measure(()=>e.getBoundingClientRect()),n.attr(`width`,g.width),n.attr(`height`,g.height)}else g=await C.measure(()=>m.getBBox());return s?l.attr(`transform`,`translate(`+-g.width/2+`, `+-g.height/2+`)`):l.attr(`transform`,`translate(0, `+-g.height/2+`)`),n.centerLabel&&l.attr(`transform`,`translate(`+-g.width/2+`, `+-g.height/2+`)`),l.insert(`rect`,`:first-child`),{shapeSvg:c,bbox:g,halfPadding:h,label:l}},`labelHelper`),M=e(async(e,n,i)=>{let a=i.useHtmlLabels??o(r()),s=e.insert(`g`).attr(`class`,`label`).attr(`style`,i.labelStyle||``),c=await S(s,d(x(n),r()),{useHtmlLabels:a,width:i.width||r()?.flowchart?.wrappingWidth,style:i.labelStyle,addSvgBackground:!!i.icon||!!i.img}),l=i.padding/2,u;if(o(r())){let e=c.children[0],n=t(c);u=await C.measure(()=>e.getBoundingClientRect()),n.attr(`width`,u.width),n.attr(`height`,u.height)}else u=await C.measure(()=>c.getBBox());return a?s.attr(`transform`,`translate(`+-u.width/2+`, `+-u.height/2+`)`):s.attr(`transform`,`translate(0, `+-u.height/2+`)`),i.centerLabel&&s.attr(`transform`,`translate(`+-u.width/2+`, `+-u.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:u,halfPadding:l,label:s}},`insertLabel`),N=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),P=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function F(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(F,`createPathFromPoints`);function I(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(I,`generateFullSineWavePoints`);function L(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(L,`generateCirclePoints`);function ee(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var R=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),z=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),te=e(async(e,t,n,i=!1,a=!1)=>{let s=t||``;typeof s==`object`&&(s=s[0]);let c=r(),l=o(c);return await S(e,s,{style:n,isTitle:i,useHtmlLabels:l,markdown:!1,isNode:a,width:1/0},c)},`createLabel`);function B(e,t){return e.intersect(t)}e(B,`intersectNode`);var ne=B;function V(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(V,`intersectEllipse`);var H=V;function re(e,t,n){return H(e,t,t,n)}e(re,`intersectCircle`);var ie=re;function U(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&W(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&W(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}e(U,`intersectLine`);function W(e,t){return e*t>0}e(W,`sameSign`);var G=U;function ae(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=G(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(ae,`intersectPolygon`);var K={node:ne,circle:ie,ellipse:H,polygon:ae,rect:R};function oe(e,t){let{labelStyles:r}=g(t);t.labelStyle=r;let i=P(t),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,t.domId||t.id),{cssStyles:s}=t,c=f.svg(o),l=p(t,{fill:`black`,stroke:`none`,fillStyle:`solid`});t.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,v(s)),N(t,d),t.intersect=function(e){return n.info(`Circle intersect`,t,1,e),K.circle(t,1,e)},o}e(oe,`anchor`);function se(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(se,`generateArcPoints`);function ce(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ce,`calculateArcSagitta`);async function le(t,n){let{labelStyles:r,nodeStyles:i}=g(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await j(t,n,P(n)),m=c(n?.height?n?.height:d.height),[h,_]=l(m),v=ce(m,h,_),y=(n?.width?n?.width:d.width)+o*2+v-v,b=m,{cssStyles:x}=n,S=[{x:y/2,y:-b/2},{x:-y/2,y:-b/2},...se(-y/2,-b/2,-y/2,b/2,h,_,!1),{x:y/2,y:b/2},...se(y/2,b/2,y/2,-b/2,h,_,!0)],C=f.svg(u),w=p(n,{});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let T=F(S),E=C.path(T,w),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),x&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,x),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${h/2}, 0)`),N(n,D),n.intersect=function(e){return K.polygon(n,S,e)},u}e(le,`bowTieRect`);async function ue(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=g(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await j(t,n,P(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),m=Math.max(Math.min(d*.08,12),5),h=Math.max(s.height+u*2+m,n.height??0),_=-h/2+m,v=h/2,y=d*.72,b=[`M${-d/2},${_}`,`L${-y/2},${v}`,`A${y/2},${m} 0 0 0 ${y/2},${v}`,`L${d/2},${_}`,`A${d/2},${m} 0 0 0 ${-d/2},${_}`,`Z`].join(` `),{cssStyles:x}=n,S=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=f.svg(o).path(b,p(n,{}));S.node()?.appendChild(e),x&&S.attr(`style`,x)}else S.append(`path`).attr(`d`,b).attr(`style`,a);S.append(`ellipse`).attr(`cx`,0).attr(`cy`,_).attr(`rx`,d/2).attr(`ry`,m).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),N(n,S);let C=_+(v-_)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${C-s.height/2-(s.y-(s.top??0))})`);let w=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*m*Math.sin(a)}}),`arc`),T=[...w(d/2,_,-1),...w(y/2,v,1).reverse()];return n.intersect=function(e){return K.polygon(n,T,e)},o}e(ue,`bucket`);var de=20,fe=8,pe=80,me=8;async function he(e,t){let{themeVariables:n}=r(),i=n.clusterBkg,a=n.clusterBorder,{nodeStyles:s}=g(t),{shapeSvg:c,bbox:l}=await j(e,t,P(t)),u=t.padding??8,d=l.height,m=Math.max(l.width+u*2,pe,t?.width??0),h=Math.max(d+fe+de+u*2,t?.height??0),_=-m/2,y=-h/2,b=-(fe+de)/2,x=c.select(`.label`);x&&(t.useHtmlLabels??o(r())?x.attr(`transform`,`translate(${-l.width/2}, ${-l.height/2+b})`):x.attr(`transform`,`translate(0, ${-l.height/2+b})`));let S;if(t.look===`handDrawn`){let e=f.svg(c),n=p(t,{fill:i,stroke:a,fillStyle:`solid`}),r=e.path(z(_,y,m,h,me),n);S=c.insert(()=>r,`:first-child`),S.attr(`class`,`basic label-container collapsed-group`).attr(`style`,v(t.cssStyles))}else S=c.insert(`rect`,`:first-child`),S.attr(`class`,`basic label-container collapsed-group`).attr(`style`,s).attr(`rx`,me).attr(`ry`,me).attr(`x`,_).attr(`y`,y).attr(`width`,m).attr(`height`,h).attr(`fill`,i).attr(`stroke`,a);let C=y+u+d+fe;c.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,_+8).attr(`y1`,C).attr(`x2`,_+m-8).attr(`y2`,C).attr(`stroke`,a).attr(`stroke-dasharray`,`3, 3`);let w=C+de/2;for(let e=-1;e<=1;e++)c.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,w).attr(`r`,2.5).attr(`fill`,a);return N(t,S),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},c}e(he,`collapsedGroup`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(q,`insertPolygonShape`);var ge=[`right`,`left`,`up`,`down`],_e=`point`,ve=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),ye=e(e=>ge.filter(t=>e.has(t)).join(`|`)||_e,`getDirectionKey`),be={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[_e]:()=>[{x:0,y:0}]},xe=e((e,t,n,r)=>{let i=ve(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(be[ye(i)]??be[_e])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Se(e,t){let n=t,{shapeSvg:r,bbox:i}=await j(e,n,P(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=xe(n.directions??[],i,n,u),f=q(r,u,o,d);return f.attr(`style`,n.style??null),N(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Se,`block_arrow`);async function Ce(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await j(e,t,P(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),m=-d/2,{cssStyles:h}=t,_=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=f.svg(a).path(z(-u/2,m,u,d,12),p(t,{}));_.node()?.appendChild(e),h&&_.attr(`style`,h)}else _.append(`rect`).attr(`x`,-u/2).attr(`y`,m).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);_.append(`line`).attr(`x1`,-u/2).attr(`y1`,m+18).attr(`x2`,u/2).attr(`y2`,m+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)_.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,m+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);_.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,m+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),N(t,_);let v=m+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${v-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ce,`browser`);var we=12;async function Te(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+we),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,m=-u,h=[{x:0+we,y:m},{x:d,y:m},{x:d,y:0},{x:0,y:0},{x:0,y:m+we},{x:0+we,y:m}],_,{cssStyles:v}=t;if(t.look===`handDrawn`){let e=f.svg(s),n=p(t,{}),r=F(h),i=e.path(r,n);_=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),v&&_.attr(`style`,v)}else _=q(s,l,u,h);return r&&_.attr(`style`,r),N(t,_),t.intersect=function(e){return K.polygon(t,h,e)},s}e(Te,`card`);function Ee(e,t){let{nodeStyles:n}=g(t);t.label=``;let r=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=f.svg(r),c=p(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=F(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(Ee,`choice`);async function De(e,t,r){let{labelStyles:i,nodeStyles:a}=g(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await j(e,t,P(t)),l=r?.padding??c,u=t.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=f.svg(o),n=p(t,{}),r=e.circle(0,0,u*2,n);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,v(m))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return N(t,d),t.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},t.intersect=function(e){return n.info(`Circle intersect`,t,u,e),K.circle(t,u,e)},o}e(De,`circle`);async function Oe(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await j(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),N(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(Oe,`composite`);async function ke(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await j(e,t,P(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),m=-d/2,{cssStyles:h}=t,_=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=f.svg(a).path(z(-u/2,m,u,d,12),p(t,{}));_.node()?.appendChild(e),h&&_.attr(`style`,h)}else _.append(`rect`).attr(`x`,-u/2).attr(`y`,m).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);_.append(`text`).attr(`x`,-u/2+12).attr(`y`,m+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),N(t,_);let v=m+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${v-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(ke,`consoleWindow`);function Ae(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
2
+ M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ae,`createLine`);function je(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r,t.label=``;let a=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:s}=t,c=f.svg(a),l=p(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ae(o),m=c.path(d,l),h=a.insert(()=>u,`:first-child`);return h.insert(()=>m),h.attr(`class`,`outer-path`),s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),i&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,i),N(t,h),t.intersect=function(e){return n.info(`crossedCircle intersect`,t,{radius:o,point:e}),K.circle(t,o,e)},a}e(je,`crossedCircle`);function J(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(J,`generateCirclePoints`);async function Me(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:m}=t,h=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],_=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],v=f.svg(i),y=p(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=F(h).replace(`Z`,``),x=v.path(b,y),S=F(_),C=v.path(S,{...y}),w=i.insert(`g`,`:first-child`);return w.insert(()=>C,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>x,`:first-child`),w.attr(`class`,`text`),m&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,_,e)},i}e(Me,`curlyBraceLeft`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}e(Y,`generateCirclePoints`);async function Ne(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:m}=t,h=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],_=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],v=f.svg(i),y=p(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=F(h).replace(`Z`,``),x=v.path(b,y),S=F(_),C=v.path(S,{...y}),w=i.insert(`g`,`:first-child`);return w.insert(()=>C,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>x,`:first-child`),w.attr(`class`,`text`),m&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,_,e)},i}e(Ne,`curlyBraceRight`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(X,`generateCirclePoints`);async function Pe(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:m}=t,h=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],_=[...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],v=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],y=f.svg(i),b=p(t,{fill:`none`});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=F(h).replace(`Z`,``),S=y.path(x,b),C=F(_).replace(`Z`,``),w=y.path(C,b),T=F(v),E=y.path(T,{...b}),D=i.insert(`g`,`:first-child`);return D.insert(()=>E,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>S,`:first-child`),D.insert(()=>w,`:first-child`),D.attr(`class`,`text`),m&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),N(t,D),t.intersect=function(e){return K.polygon(t,v,e)},i}e(Pe,`curlyBraces`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:m}=t,h=f.svg(s),_=p(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=l,y=u,b=v-d,x=y/4,S=[{x:b,y:0},{x,y:0},{x:0,y:y/2},{x,y},{x:b,y},...L(-b,-y/2,d,50,270,90)],C=F(S),w=h.path(C,_),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,r),T.attr(`transform`,`translate(${-l/2}, ${-u/2})`),N(t,T),t.intersect=function(e){return K.polygon(t,S,e)},s}e(Fe,`curvedTrapezoid`);async function Ie(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),m=Math.min(c*.177,d*.45),h=d+2*l-u,_=-h/2,v=_+2*l-u,y=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:b}=t;if(t.look===`handDrawn`){let e=f.svg(i),n=p(t,{}),r=e.path(z(-c/2,v,c,d,m),n),a=e.circle(0,_+l,l*2,n);y.insert(()=>a,`:first-child`),y.insert(()=>r,`:first-child`),b&&y.attr(`style`,b)}else y.append(`rect`).attr(`x`,-c/2).attr(`y`,v).attr(`width`,c).attr(`height`,d).attr(`rx`,m).attr(`ry`,m).attr(`style`,r),y.append(`circle`).attr(`cx`,0).attr(`cy`,_+l).attr(`r`,l).attr(`style`,r);N(t,y);let x=v+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`);let S=_+l,C=Math.asin(Math.min(1,(v-S)/l))*180/Math.PI,w=[...L(0,-S,l,24,180+C,-C),...L(-(-c/2+m),-(v+m),m,12,90,0),...L(-(-c/2+m),-(h/2-m),m,12,360,270),...L(-(c/2-m),-(h/2-m),m,12,270,180),...L(-(c/2-m),-(v+m),m,12,180,90)];return t.intersect=function(e){return K.polygon(t,w,e)},i}e(Ie,`person`);var Le=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Re=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),ze=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Be=8,Ve=8;async function He(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.width<Ve&&(t.width=Ve)),t.height){let e=s/2/(2.5+s/50);t.height=t.height-a-e*3,t.height<Be&&(t.height=Be)}let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=Math.max(t.width??0,l.width)+o,m=d/2,h=m/(2.5+d/50),_=Math.max(t.height??0,l.height)+a+h,y,{cssStyles:b}=t;if(t.look===`handDrawn`){let e=f.svg(c),n=Re(0,0,d,_,m,h),r=ze(0,h,d,_,m,h),i=p(t,{}),a=e.path(n,i),o=e.path(r,p(t,{fill:`none`}));y=c.insert(()=>o,`:first-child`),y=c.insert(()=>a,`:first-child`),y.attr(`class`,`basic label-container`),b&&y.attr(`style`,b)}else{let e=Le(0,0,d,_,m,h);y=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,v(b)).attr(`style`,r)}return y.attr(`label-offset-y`,h),y.attr(`transform`,`translate(${-d/2}, ${-(_/2+h)})`),N(t,y),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(m!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-h)){let i=h*h*(1-r*r/(m*m));i>0&&(i=Math.sqrt(i)),i=h-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(He,`cylinder`);async function Ue(e,t,n){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await j(e,t,P(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:m,ry:h}=t,{cssStyles:_}=t;if(n?.rx&&n.ry&&(m=n.rx,h=n.ry),t.look===`handDrawn`){let e=f.svg(a),n=p(t,{}),r=m||h?e.path(z(l,u,s,c,m||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,v(_))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,v(m)).attr(`ry`,v(h)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return N(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ue,`drawRect`);async function We(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ue(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=f.svg(c),n=p(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(We,`datastore`);async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=s.width+i,u=s.height+a,d=u*.2,m=-l/2,h=-u/2-d/2,{cssStyles:_}=t,v=f.svg(o),y=p(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=[{x:m,y:h+d},{x:-m,y:h+d},{x:-m,y:-h},{x:m,y:-h},{x:m,y:h},{x:-m,y:h},{x:-m,y:h+d}],x=v.polygon(b.map(e=>[e.x,e.y]),y),S=o.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${m+(t.padding??0)/2-(s.x-(s.left??0))}, ${h+d+(t.padding??0)/2-(s.y-(s.top??0))})`),N(t,S),t.intersect=function(e){return K.rect(t,e)},o}e(Ge,`dividedRectangle`);async function Ke(e,t){let{labelStyles:r,nodeStyles:i}=g(t),a=t.look===`neo`?12:5;t.labelStyle=r;let o=t.padding??0,s=t.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await j(e,t,P(t)),u=(t?.width?t?.width/2:l.width/2)+(s??0),d=u-a,m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=f.svg(c),n=p(t,{roughness:.2,strokeWidth:2.5}),r=p(t,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,n),a=e.circle(0,0,d*2,r);m=c.insert(`g`,`:first-child`),m.attr(`class`,v(t.cssClasses)).attr(`style`,v(h)),m.node()?.appendChild(i),m.node()?.appendChild(a)}else{m=c.insert(`g`,`:first-child`);let e=m.insert(`circle`,`:first-child`),t=m.insert(`circle`);m.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return N(t,m),t.intersect=function(e){return n.info(`DoubleCircle intersect`,t,u,e),K.circle(t,u,e)},c}e(Ke,`doublecircle`);function qe(e,t,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=g(t);t.label=``,t.labelStyle=i;let o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=f.svg(o),{nodeBorder:l}=r,u=p(t,{fillStyle:`solid`});t.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),m=o.insert(()=>d,`:first-child`);return m.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,a),N(t,m),t.intersect=function(e){return n.info(`filledCircle intersect`,t,{radius:7,point:e}),K.circle(t,7,e)},o}e(qe,`filledCircle`);var Je=10,Ye=10;async function Xe(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let a=t.padding??0,o=t.look===`neo`?a*2:a;(t.width||t.height)&&(t.height=t?.height??0,t.height<Je&&(t.height=Je),t.width=(t?.width??0)-o-o/2,t.width<Ye&&(t.width=Ye));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+(o??0),d=t?.height?t?.height:u+c.height,m=d,h=[{x:0,y:-d},{x:m,y:-d},{x:m/2,y:0}],{cssStyles:_}=t,v=f.svg(s),y=p(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=F(h),x=v.path(b,y),S=s.insert(()=>x,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return _&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,_),i&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,i),t.width=u,t.height=d,N(t,S),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(t.padding??0)/2+(c.y-(c.top??0))})`),t.intersect=function(e){return n.info(`Triangle intersect`,t,h,e),K.polygon(t,h,e)},s}e(Xe,`flippedTriangle`);async function Ze(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),m=d-u,h=Math.max(c*.38,28),_=-d/2,v=[{x:-c/2,y:_},{x:-c/2+h,y:_},{x:-c/2+h,y:_+u},{x:c/2,y:_+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],y=[`M${v[0].x},${v[0].y}`,...v.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:b}=t,x;if(t.look===`handDrawn`){let e=f.svg(i).path(y,p(t,{}));x=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),b&&x.attr(`style`,b)}else x=i.insert(`path`,`:first-child`).attr(`d`,y).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?N(t,x):N(t,x,{width:c,height:d});let S=_+u+m/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${S-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,v,e)},i}e(Ze,`folder`);function Qe(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=g(t);t.label=``;let o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,m=f.svg(o),h=p(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let _=m.rectangle(u,d,c,l,h),v=o.insert(()=>_,`:first-child`);s&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,a),N(t,v);let y=r?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(Qe,`forkJoin`);async function $e(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let a=t.look===`neo`?16:t.padding??0,o=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10),t.width=(t?.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width?t?.width:Math.max(15,c.width))+a*2,u=(t?.height?t?.height:Math.max(10,c.height))+o*2,d=u/2,{cssStyles:m}=t,h=f.svg(s),_=p(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...L(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],y=F(v),b=h.path(y,_),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),N(t,x),t.intersect=function(e){return n.info(`Pill intersect`,t,{radius:d,point:e}),K.polygon(t,v,e)},s}e($e,`halfRoundedRectangle`);var et=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=g(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await j(e,t,P(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,m=(t?.width?t?.width:l.width)+2*d+s,h=[{x:d,y:0},{x:m-d,y:0},{x:m,y:-u/2},{x:m-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],_,{cssStyles:v}=t;if(t.look===`handDrawn`){let e=f.svg(c),n=p(t,{}),r=et(0,0,m,u,d),i=e.path(r,n);_=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-m/2}, ${u/2})`),v&&_.attr(`style`,v)}else _=q(c,m,u,h);return r&&_.attr(`style`,r),t.width=m,t.height=u,N(t,_),t.intersect=function(e){return K.polygon(t,h,e)},c}e(tt,`hexagon`);async function nt(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.label=``,t.labelStyle=r;let{shapeSvg:a}=await j(e,t,P(t)),o=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:c}=t,l=f.svg(a),u=p(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],m=F(d),h=l.path(m,u),_=a.insert(()=>h,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),c&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,c),i&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,i),_.attr(`transform`,`translate(${-o/2}, ${-s/2})`),N(t,_),t.intersect=function(e){return n.info(`Pill intersect`,t,{points:d}),K.polygon(t,d,e)},a}e(nt,`hourglass`);async function rt(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=g(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:h}=await j(e,t,`icon-shape default`),v=t.pos===`t`,y=c,b=c,{nodeBorder:x}=r,{stylesMap:S}=m(t),C=-b/2,w=-y/2,T=t.label?8:0,E=f.svg(u),D=p(t,{stroke:`none`,fill:`none`});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(C,w,b,y,D),k=Math.max(b,d.width),A=y+d.height+T,M=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),P=u.insert(()=>O,`:first-child`),F=u.insert(()=>M);if(t.icon){let e=u.append(`g`);e.html(`<g>${await _(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${v?d.height/2+T/2-i/2-o:-d.height/2-T/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??x};`)}return h.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${v?-A/2:A/2-d.height})`),P.attr(`transform`,`translate(0,${v?d.height/2+T/2:-d.height/2-T/2})`),N(t,F),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return K.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=v?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+T},{x:r+b/2,y:i-a/2+d.height+T},{x:r+b/2,y:i+a/2},{x:r-b/2,y:i+a/2},{x:r-b/2,y:i-a/2+d.height+T},{x:r-d.width/2,y:i-a/2+d.height+T}]:[{x:r-b/2,y:i-a/2},{x:r+b/2,y:i-a/2},{x:r+b/2,y:i-a/2+y},{x:r+d.width/2,y:i-a/2+y},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+y},{x:r-b/2,y:i-a/2+y}],K.polygon(t,o,e)},u}e(rt,`icon`);async function it(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=g(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:h}=await j(e,t,`icon-shape default`),v=t.label?8:0,y=t.pos===`t`,{nodeBorder:b,mainBkg:x}=r,{stylesMap:S}=m(t),C=f.svg(u),w=p(t,{});t.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`),w.stroke=S.get(`fill`)??x;let T=u.append(`g`);t.icon&&T.html(`<g>${await _(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let E=T.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,M=Math.max(D,O)*Math.SQRT2+40,P=C.circle(0,0,M,w),F=Math.max(M,d.width),I=M+d.height+v,L=C.rectangle(-F/2,-I/2,F,I,{...w,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>P,`:first-child`),R=u.insert(()=>L);return T.attr(`transform`,`translate(${-D/2-k},${y?d.height/2+v/2-O/2-A:-d.height/2-v/2-O/2-A})`),T.attr(`style`,`color: ${S.get(`stroke`)??b};`),h.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${y?-I/2:I/2-d.height})`),ee.attr(`transform`,`translate(0,${y?d.height/2+v/2:-d.height/2-v/2})`),N(t,R),t.intersect=function(e){return n.info(`iconSquare intersect`,t,e),K.rect(t,e)},u}e(it,`iconCircle`);async function at(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=g(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:h,label:v}=await j(e,t,`icon-shape default`),y=t.pos===`t`,b=c+h*2,x=c+h*2,{nodeBorder:S,mainBkg:C}=r,{stylesMap:w}=m(t),T=-x/2,E=-b/2,D=t.label?8:0,O=f.svg(u),k=p(t,{});t.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=w.get(`fill`)??C;let A=O.path(z(T,E,x,b,5),k),M=Math.max(x,d.width),P=b+d.height+D,F=O.rectangle(-M/2,-P/2,M,P,{...k,fill:`transparent`,stroke:`none`}),I=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>F);if(t.icon){let e=u.append(`g`);e.html(`<g>${await _(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${y?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${w.get(`stroke`)??S};`)}return v.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${y?-P/2:P/2-d.height})`),I.attr(`transform`,`translate(0,${y?d.height/2+D/2:-d.height/2-D/2})`),N(t,L),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return K.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=y?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+x/2,y:i-a/2+d.height+D},{x:r+x/2,y:i+a/2},{x:r-x/2,y:i+a/2},{x:r-x/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-x/2,y:i-a/2},{x:r+x/2,y:i-a/2},{x:r+x/2,y:i-a/2+b},{x:r+d.width/2,y:i-a/2+b},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+b},{x:r-x/2,y:i-a/2+b}],K.polygon(t,o,e)},u}e(at,`iconRounded`);async function ot(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=g(t);t.labelStyle=a;let o=t.assetHeight??48,s=t.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:h,label:v}=await j(e,t,`icon-shape default`),y=t.pos===`t`,b=c+h*2,x=c+h*2,{nodeBorder:S,mainBkg:C}=r,{stylesMap:w}=m(t),T=-x/2,E=-b/2,D=t.label?8:0,O=f.svg(u),k=p(t,{});t.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=w.get(`fill`)??C;let A=O.path(z(T,E,x,b,.1),k),M=Math.max(x,d.width),P=b+d.height+D,F=O.rectangle(-M/2,-P/2,M,P,{...k,fill:`transparent`,stroke:`none`}),I=u.insert(()=>A,`:first-child`),L=u.insert(()=>F);if(t.icon){let e=u.append(`g`);e.html(`<g>${await _(t.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${y?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${w.get(`stroke`)??S};`)}return v.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${y?-P/2:P/2-d.height})`),I.attr(`transform`,`translate(0,${y?d.height/2+D/2:-d.height/2-D/2})`),N(t,L),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return K.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=y?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+x/2,y:i-a/2+d.height+D},{x:r+x/2,y:i+a/2},{x:r-x/2,y:i+a/2},{x:r-x/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-x/2,y:i-a/2},{x:r+x/2,y:i-a/2},{x:r+x/2,y:i-a/2+b},{x:r+d.width/2,y:i-a/2+b},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+b},{x:r-x/2,y:i-a/2+b}],K.polygon(t,o,e)},u}e(ot,`iconSquare`);async function st(e,t,{config:{flowchart:r}}){let i=new Image;i.src=t?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));t.imageAspectRatio=a/o;let{labelStyles:s}=g(t);t.labelStyle=s;let c=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let l=Math.max(t.label?c??0:0,t?.assetWidth??a),u=t.constraint===`on`&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,d=t.constraint===`on`?u/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(u,c??0);let{shapeSvg:m,bbox:h,label:_}=await j(e,t,`image-shape default`),v=t.pos===`t`,y=-u/2,b=-d/2,x=t.label?8:0,S=f.svg(m),C=p(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=S.rectangle(y,b,u,d,C),T=Math.max(u,h.width),E=d+h.height+x,D=S.rectangle(-T/2,-E/2,T,E,{...C,fill:`none`,stroke:`none`}),O=m.insert(()=>w,`:first-child`),k=m.insert(()=>D);if(t.img){let e=m.append(`image`);e.attr(`href`,t.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${v?E/2-d:-E/2})`)}return _.attr(`transform`,`translate(${-h.width/2-(h.x-(h.left??0))},${v?-d/2-h.height/2-x/2:d/2-h.height/2+x/2})`),O.attr(`transform`,`translate(0,${v?h.height/2+x/2:-h.height/2-x/2})`),N(t,k),t.intersect=function(e){if(n.info(`iconSquare intersect`,t,e),!t.label)return K.rect(t,e);let r=t.x??0,i=t.y??0,a=t.height??0,o=[];return o=v?[{x:r-h.width/2,y:i-a/2},{x:r+h.width/2,y:i-a/2},{x:r+h.width/2,y:i-a/2+h.height+x},{x:r+u/2,y:i-a/2+h.height+x},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+h.height+x},{x:r-h.width/2,y:i-a/2+h.height+x}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+h.width/2,y:i-a/2+d},{x:r+h.width/2/2,y:i+a/2},{x:r-h.width/2,y:i+a/2},{x:r-h.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(t,o,e)},m}e(st,`imageSquare`);async function ct(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=f.svg(s),n=p(t,{}),r=F(d),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),h&&m.attr(`style`,h)}else m=q(s,u,l,d);return r&&m.attr(`style`,r),t.width=u,t.height=l,N(t,m),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ct,`inv_trapezoid`);async function lt(e,t){let{shapeSvg:n,bbox:r,label:i}=await j(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),N(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(lt,`labelRect`);async function ut(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=f.svg(s),n=p(t,{}),r=F(d),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),h&&m.attr(`style`,h)}else m=q(s,u,l,d);return r&&m.attr(`style`,r),t.width=u,t.height=l,N(t,m),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ut,`lean_left`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=f.svg(s),n=p(t,{}),r=F(d),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),h&&m.attr(`style`,h)}else m=q(s,u,l,d);return r&&m.attr(`style`,r),t.width=u,t.height=l,N(t,m),t.intersect=function(e){return K.polygon(t,d,e)},s}e(dt,`lean_right`);function ft(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.label=``,t.labelStyle=r;let a=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId??t.id),{cssStyles:o}=t,s=Math.max(35,t?.width??0),c=Math.max(35,t?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=f.svg(a),d=p(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let m=F(l),h=u.path(m,d),_=a.insert(()=>h,`:first-child`);return _.attr(`class`,`outer-path`),o&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,o),i&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,i),_.attr(`transform`,`translate(-${s/2},${-c})`),N(t,_),t.intersect=function(e){return n.info(`lightningBolt intersect`,t,e),K.polygon(t,l,e)},a}e(ft,`lightningBolt`);var pt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),mt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),ht=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),gt=10,_t=10;async function vt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<_t&&(t.width=_t);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<gt&&(t.height=gt)}let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,m=d/(2.5+u/50),h=(t?.height?t?.height:c.height)+m+o*2,_=h*.1,y,{cssStyles:b}=t;if(t.look===`handDrawn`){let e=f.svg(s),n=mt(0,0,u,h,d,m,_),r=ht(0,m,u,h,d,m),i=p(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),y=s.insert(()=>a,`:first-child`),y.attr(`class`,`basic label-container`),b&&y.attr(`style`,b)}else{let e=pt(0,0,u,h,d,m,_);y=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,v(b)).attr(`style`,r)}return y.attr(`label-offset-y`,m),y.attr(`transform`,`translate(${-u/2}, ${-(h/2+m)})`),N(t,y),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+m-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-m)){let i=m*m*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=m-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(vt,`linedCylinder`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,m=t.look===`neo`?d/4:d/8,h=d+m,{cssStyles:_}=t,v=f.svg(s),y=p(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=[{x:-u/2-u/2*.1,y:-h/2},{x:-u/2-u/2*.1,y:h/2},...I(-u/2-u/2*.1,h/2,u/2+u/2*.1,h/2,m,.8),{x:u/2+u/2*.1,y:-h/2},{x:-u/2-u/2*.1,y:-h/2},{x:-u/2,y:-h/2},{x:-u/2,y:h/2*1.1},{x:-u/2,y:-h/2}],x=v.polygon(b.map(e=>[e.x,e.y]),y),S=s.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),S.attr(`transform`,`translate(0,${-m/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-m/2-(c.y-(c.top??0))})`),N(t,S),t.intersect=function(e){return K.polygon(t,b,e)},s}e(yt,`linedWaveEdgedRect`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,m=(t?.height?t?.height:l.height)+o*2+2*s,h=d-2*s,_=m-2*s,v=-h/2,y=-_/2,{cssStyles:b}=t,x=f.svg(c),S=p(t,{}),C=[{x:v-s,y:y+s},{x:v-s,y:y+_+s},{x:v+h-s,y:y+_+s},{x:v+h-s,y:y+_},{x:v+h,y:y+_},{x:v+h,y:y+_-s},{x:v+h+s,y:y+_-s},{x:v+h+s,y:y-s},{x:v+s,y:y-s},{x:v+s,y},{x:v,y},{x:v,y:y+s}],w=[{x:v,y:y+s},{x:v+h-s,y:y+s},{x:v+h-s,y:y+_},{x:v+h,y:y+_},{x:v+h,y},{x:v,y}];t.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let T=F(C),E=x.path(T,S),D=F(w),O=x.path(D,S);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),b&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,b),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),N(t,k),t.intersect=function(e){return K.polygon(t,C,e)},c}e(bt,`multiRect`);async function xt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,m=Math.max(a.height,t?.height??0)+l*3,h=t.look===`neo`?m/4:m/8,_=m+(u?h/2:-h/2),v=-d/2,y=-_/2,{cssStyles:b}=t,x=I(v-10,y+_+10,v+d-10,y+_+10,h,.8),S=x?.[x.length-1],C=[{x:v-10,y:y+10},{x:v-10,y:y+_+10},...x,{x:v+d-10,y:S.y-10},{x:v+d,y:S.y-10},{x:v+d,y:S.y-20},{x:v+d+10,y:S.y-20},{x:v+d+10,y:y-10},{x:v+10,y:y-10},{x:v+10,y},{x:v,y},{x:v,y:y+10}],w=[{x:v,y:y+10},{x:v+d-10,y:y+10},{x:v+d-10,y:S.y-10},{x:v+d,y:S.y-10},{x:v+d,y},{x:v,y}],T=f.svg(i),E=p(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=F(C),O=T.path(D,E),k=F(w),A=T.path(k,E),M=i.insert(()=>O,`:first-child`);return M.insert(()=>A),M.attr(`class`,`basic label-container outer-path`),b&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,b),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.attr(`transform`,`translate(0,${-h/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-h/2-(a.y-(a.top??0))})`),N(t,M),t.intersect=function(e){return K.polygon(t,C,e)},i}e(xt,`multiWaveEdgedRectangle`);async function St(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r,t.useHtmlLabels||o(c())||(t.centerLabel=!0);let{shapeSvg:a,bbox:s,label:l}=await j(e,t,P(t)),u=Math.max(s.width+(t.padding??0)*2,t?.width??0),d=Math.max(s.height+(t.padding??0)*2,t?.height??0),m=-u/2,h=-d/2,{cssStyles:_}=t,v=f.svg(a),y=p(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=v.rectangle(m,h,u,d,y),x=a.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),_&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,_),i&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),N(t,x),t.intersect=function(e){return K.rect(t,e)},a}e(St,`note`);var Ct=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function wt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await j(e,t,P(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=f.svg(i),n=p(t,{}),r=Ct(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),N(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=K.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(wt,`question`);async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),m=d/4,h=-Math.max(u,(t.width??0)-m)/2,_=-d/2,v=_/2,y=[{x:h+v,y:_},{x:h,y:0},{x:h+v,y:-_},{x:-h,y:-_},{x:-h,y:_}],{cssStyles:b}=t,x=f.svg(s),S=p(t,{});t.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=F(y),w=x.path(C,S),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),b&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,b),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),T.attr(`transform`,`translate(${-v/2},0)`),l.attr(`transform`,`translate(${-v/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,T),t.intersect=function(e){return K.polygon(t,y,e)},s}e(Tt,`rect_left_inv_arrow`);async function Et(e,i){let{labelStyles:a,nodeStyles:s}=g(i);i.labelStyle=a;let c;c=i.cssClasses?`node `+i.cssClasses:`node default`;let l=e.insert(`g`).attr(`class`,c).attr(`id`,i.domId||i.id),u=l.insert(`g`),d=l.insert(`g`).attr(`class`,`label`).attr(`style`,s),m=i.description,h=i.label,_=await te(d,h,i.labelStyle,!0,!0),v={width:0,height:0};if(o(r())){let e=_.children[0],n=t(_);v=e.getBoundingClientRect(),n.attr(`width`,v.width),n.attr(`height`,v.height)}n.info(`Text 2`,m);let y=m||[],b=_.getBBox(),x=await te(d,Array.isArray(y)?y.join(`<br/>`):y,i.labelStyle,!0,!0),S=x.children[0],C=t(x);v=S.getBoundingClientRect(),C.attr(`width`,v.width),C.attr(`height`,v.height);let w=(i.padding||0)/2;t(x).attr(`transform`,`translate( `+(v.width>b.width?0:(b.width-v.width)/2)+`, `+(b.height+w+5)+`)`),t(_).attr(`transform`,`translate( `+(v.width<b.width?0:-(b.width-v.width)/2)+`, 0)`),v=d.node().getBBox(),d.attr(`transform`,`translate(`+-v.width/2+`, `+(-v.height/2-w+3)+`)`);let T=v.width+(i.padding||0),E=v.height+(i.padding||0),D=-v.width/2-w,O=-v.height/2-w,k,A;if(i.look===`handDrawn`){let e=f.svg(l),t=p(i,{}),r=e.path(z(D,O,T,E,i.rx||0),t),a=e.line(-v.width/2-w,-v.height/2-w+b.height+w,v.width/2+w,-v.height/2-w+b.height+w,t);A=l.insert(()=>(n.debug(`Rough node insert CXC`,r),a),`:first-child`),k=l.insert(()=>(n.debug(`Rough node insert CXC`,r),r),`:first-child`)}else k=u.insert(`rect`,`:first-child`),A=u.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,s).attr(`x`,-v.width/2-w).attr(`y`,-v.height/2-w).attr(`width`,v.width+(i.padding||0)).attr(`height`,v.height+(i.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-v.width/2-w).attr(`x2`,v.width/2+w).attr(`y1`,-v.height/2-w+b.height+w).attr(`y2`,-v.height/2-w+b.height+w);return N(i,k),i.intersect=function(e){return K.rect(i,e)},l}e(Et,`rectWithTitle`);async function Dt(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ue(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(Dt,`roundedRect`);var Z=8;async function Ot(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,m=u,h=Z-l/2,_=-u/2,{cssStyles:y}=t,b=f.svg(o),x=p(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=[{x:h,y:_},{x:h+d,y:_},{x:h+d,y:_+m},{x:h-Z,y:_+m},{x:h-Z,y:_},{x:h,y:_},{x:h,y:_+m}],C=b.polygon(S.map(e=>[e.x,e.y]),x),w=o.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`).attr(`style`,v(y)),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),y&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),N(t,w),t.intersect=function(e){return K.rect(t,e)},o}e(Ot,`shadedProcess`);async function kt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,m=u,h=d/1.5,_=-m/2,v=-h/2,{cssStyles:y}=t,b=f.svg(s),x=p(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=[{x:_,y:v},{x:_,y:v+h},{x:_+m,y:v+h},{x:_+m,y:v-h/2}],C=F(S),w=b.path(C,x),T=s.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,r),T.attr(`transform`,`translate(0, ${h/4})`),l.attr(`transform`,`translate(${-m/2+(t.padding??0)-(c.x-(c.left??0))}, ${-h/4+(t.padding??0)-(c.y-(c.top??0))})`),N(t,T),t.intersect=function(e){return K.polygon(t,S,e)},s}e(kt,`slopedRect`);async function At(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Ue(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}e(At,`squareRect`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:m}=t,h=f.svg(s),_=p(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...L(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...L(u/2-d,0,d,50,270,450)],y=F(v),b=h.path(y,_),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,r),N(t,x),t.intersect=function(e){return K.polygon(t,v,e)},s}e(jt,`stadium`);async function Mt(e,t){return Ue(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(Mt,`state`);function Nt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=f.svg(u),m=p(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=d.circle(0,0,t.width,{...m,stroke:o,strokeWidth:2}),_=s??c,v=(t.width??0)*5/14,y=d.circle(0,0,v,{...m,fill:_,stroke:_,strokeWidth:2,fillStyle:`solid`}),b=u.insert(()=>h,`:first-child`);if(b.insert(()=>y),t.look!==`handDrawn`&&b.attr(`class`,`outer-path`),a&&b.selectAll(`path`).attr(`style`,a),i&&b.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;b.attr(`style`,`filter:url(#${n})`)}return N(t,b),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(Nt,`stateEnd`);function Pt(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=f.svg(a).circle(0,0,t.width,h(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return N(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Pt,`stateStart`);var Ft=8;async function It(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.width+2*Ft+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Ft,m=u,h=-l/2,_=-u/2,y=[{x:0,y:0},{x:d,y:0},{x:d,y:-m},{x:0,y:-m},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-m},{x:-8,y:-m},{x:-8,y:0}];if(t.look===`handDrawn`){let e=f.svg(s),n=p(t,{}),r=e.rectangle(h,_,d+16,m,n),i=e.line(h+Ft,_,h+Ft,_+m,n),a=e.line(h+Ft+d,_,h+Ft+d,_+m,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,v(c)),N(t,o)}else{let e=q(s,d,m,y);r&&e.attr(`style`,r),N(t,e)}return t.intersect=function(e){return K.polygon(t,y,e)},s}e(It,`subroutine`);var Lt=.2;async function Rt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Lt*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.height?t?.height:c.height)+o*2,u=Lt*l,d=Lt*l,m=(t?.width?t?.width:c.width)+a*2+u-u,h=l,_=-m/2,v=-h/2,{cssStyles:y}=t,b=f.svg(s),x=p(t,{}),S=[{x:_-u/2,y:v},{x:_+m+u/2,y:v},{x:_+m+u/2,y:v+h},{x:_-u/2,y:v+h}],C=[{x:_+m-u/2,y:v+h},{x:_+m+u/2,y:v+h},{x:_+m+u/2,y:v+h-d}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=F(S),T=b.path(w,x),E=F(C),D=b.path(E,{...x,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>T,`:first-child`),O.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),N(t,O),t.intersect=function(e){return K.polygon(t,S,e)},s}e(Rt,`taggedRect`);async function zt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await j(e,t,P(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,m=c+l,{cssStyles:h}=t,_=f.svg(i),v=p(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-s/2-s/2*.1,y:m/2},...I(-s/2-s/2*.1,m/2,s/2+s/2*.1,m/2,l,.8),{x:s/2+s/2*.1,y:-m/2},{x:-s/2-s/2*.1,y:-m/2}],b=-s/2+s/2*.1,x=-m/2-d*.4,S=[{x:b+s-u,y:(x+c)*1.3},{x:b+s,y:x+c-d},{x:b+s,y:(x+c)*.9},...I(b+s,(x+c)*1.25,b+s-u,(x+c)*1.3,-c*.02,.5)],C=F(y),w=_.path(C,v),T=F(S),E=_.path(T,{...v,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>w,`:first-child`),D.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),N(t,D),t.intersect=function(e){return K.polygon(t,y,e)},i}e(zt,`taggedWaveEdgedRectangle`);async function Bt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await j(e,t,P(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),N(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(Bt,`text`);var Vt=e((e,t,n,r,i,a)=>`M${e},${t}
3
+ a${i},${a} 0,0,1 0,${-r}
4
+ l${n},0
5
+ a${i},${a} 0,0,1 0,${r}
6
+ M${n},${-r}
7
+ a${i},${a} 0,0,0 0,${r}
8
+ l${-n},0`,`createCylinderPathD`),Ht=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),Ut=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Wt=5,Gt=10;async function Kt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.height<Wt&&(t.height=Wt)),t.width){let e=o/2/(2.5+o/50);t.width=t.width-a-e*3,t.width<Gt&&(t.width=Gt)}let{shapeSvg:s,bbox:c,label:l}=await j(e,t,P(t)),u=Math.max(t.height??0,c.height)+a,d=u/2,m=d/(2.5+u/50),h=Math.max(t.width??0,c.width)+m+a,{cssStyles:_}=t,y;if(t.look===`handDrawn`){let e=f.svg(s),n=Ht(0,0,h,u,m,d),r=Ut(0,0,h,u,m,d),i=e.path(n,p(t,{})),a=e.path(r,p(t,{fill:`none`}));y=s.insert(()=>a,`:first-child`),y=s.insert(()=>i,`:first-child`),y.attr(`class`,`basic label-container`),_&&y.attr(`style`,_)}else{let e=Vt(0,0,h,u,m,d);y=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,v(_)).attr(`style`,r),y.attr(`class`,`basic label-container outer-path`),_&&y.selectAll(`path`).attr(`style`,_),r&&y.selectAll(`path`).attr(`style`,r)}return y.attr(`label-offset-x`,m),y.attr(`transform`,`translate(${-h/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-m-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),N(t,y),t.intersect=function(e){let n=K.rect(t,e),r=n.y-(t.y??0);if(d!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-m)){let i=m*m*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=m-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}e(Kt,`tiltedCylinder`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=f.svg(s),n=p(t,{}),r=F(d),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),h&&m.attr(`style`,h)}else m=q(s,u,l,d);return r&&m.attr(`style`,r),t.width=u,t.height=l,N(t,m),t.intersect=function(e){return K.polygon(t,d,e)},s}e(qt,`trapezoid`);async function Jt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,m=f.svg(s),h=p(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let _=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],v=F(_),y=m.path(v,h),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),N(t,b),t.intersect=function(e){return K.polygon(t,_,e)},s}e(Jt,`trapezoidalPentagon`);var Yt=10,Xt=10;async function Zt(e,t){let{labelStyles:a,nodeStyles:o}=g(t);t.labelStyle=a;let s=t.padding??0,c=t.look===`neo`?s*2:s;(t.width||t.height)&&(t.width=((t?.width??0)-c)/2,t.width<Xt&&(t.width=Xt),t.height=t?.height??0,t.height<Yt&&(t.height=Yt));let{shapeSvg:l,bbox:u,label:d}=await j(e,t,P(t)),m=i(r().flowchart?.htmlLabels),h=(t?.width?t?.width:u.width)+c,_=t?.height?t?.height:h+u.height,v=_,y=[{x:0,y:0},{x:v,y:0},{x:v/2,y:-_}],{cssStyles:b}=t,x=f.svg(l),S=p(t,{});t.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=F(y),w=x.path(C,S),T=l.insert(()=>w,`:first-child`).attr(`transform`,`translate(${-_/2}, ${_/2})`).attr(`class`,`outer-path`);return b&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,b),o&&t.look!==`handDrawn`&&T.selectChildren(`path`).attr(`style`,o),t.width=h,t.height=_,N(t,T),d.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))}, ${_/2-(u.height+(t.padding??0)/(m?2:1)-(u.y-(u.top??0)))})`),t.intersect=function(e){return n.info(`Triangle intersect`,t,y,e),K.polygon(t,y,e)},l}e(Zt,`triangle`);async function Qt(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await j(e,t,P(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,m=(t?.height?t?.height:l.height)+(o??0)*2,h=t.look===`neo`?m/4:m/8,_=m+(s?h:-h),{cssStyles:v}=t,y=14-d,b=y>0?y/2:0,x=f.svg(c),S=p(t,{});t.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=[{x:-d/2-b,y:_/2},...I(-d/2-b,_/2,d/2+b,_/2,h,.8),{x:d/2+b,y:-_/2},{x:-d/2-b,y:-_/2}],w=F(C),T=x.path(w,S),E=c.insert(()=>T,`:first-child`);return E.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-h/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-m/2+(t.padding??0)-h-(l.y-(l.top??0))})`),N(t,E),t.intersect=function(e){return K.polygon(t,C,e)},c}e(Qt,`waveEdgedRectangle`);async function $t(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await j(e,t,P(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,m=u+d*2,{cssStyles:h}=t,_=f.svg(s),v=p(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-l/2,y:m/2},...I(-l/2,m/2,l/2,m/2,d,1),{x:l/2,y:-m/2},...I(l/2,-m/2,-l/2,-m/2,d,-1)],b=F(y),x=_.path(b,v),S=s.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container`),h&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),N(t,S),t.intersect=function(e){return K.polygon(t,y,e)},s}e($t,`waveRectangle`);var Q=10;async function en(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,m=u-Q,h=-d/2,_=-m/2,{cssStyles:v}=t,y=f.svg(o),b=p(t,{}),x=[{x:h-Q,y:_-Q},{x:h-Q,y:_+m},{x:h+d,y:_+m},{x:h+d,y:_-Q}],S=`M${h-Q},${_-Q} L${h+d},${_-Q} L${h+d},${_+m} L${h-Q},${_+m} L${h-Q},${_-Q}
9
+ M${h-Q},${_} L${h+d},${_}
10
+ M${h},${_-Q} L${h},${_+m}`;t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let C=y.path(S,b),w=o.insert(()=>C,`:first-child`);return w.attr(`transform`,`translate(${Q/2}, ${Q/2})`),w.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),N(t,w),t.intersect=function(e){return K.polygon(t,x,e)},o}e(en,`windowPane`);var tn=new Set([`redux-color`,`redux-dark-color`]),nn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function rn(e,n){let r=n;r.alias&&(n.label=r.alias);let{theme:a,themeVariables:o}=c(),{rowEven:s,rowOdd:l,nodeBorder:u,borderColorArray:d}=o;if(n.look===`handDrawn`){let{themeVariables:t}=c(),{background:r}=t;await rn(e,{...n,id:n.id+`-background`,domId:(n.domId||n.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let m=c();n.useHtmlLabels=m.htmlLabels;let h=m.er?.diagramPadding??10,_=m.er?.entityPadding??6,{cssStyles:v}=n,{labelStyles:b,nodeStyles:x}=g(n);if(r.attributes.length===0&&n.label){let t={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5,classes:``};y(n.label,m)+t.labelPaddingX*2<m.er.minEntityWidth&&(n.width=m.er.minEntityWidth);let o=await Ue(e,n,t);if(a!=null&&tn.has(a)){let e=r.colorIndex??0;o.attr(`data-color-id`,`color-${e%d.length}`)}if(!i(m.htmlLabels)){let e=o.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return o}m.htmlLabels||(h*=1.25,_*=1.25);let S=P(n);S||=`node default`;let C=e.insert(`g`).attr(`class`,S).attr(`id`,n.domId||n.id),w=await an(C,n.label??``,m,0,0,[`name`],b);w.height+=_;let T=0,E=[],D=[],O=0,k=0,A=0,j=0,M=!0,F=!0;for(let e of r.attributes){let t=await an(C,e.type,m,0,T,[`attribute-type`],b);O=Math.max(O,t.width+h);let n=await an(C,e.name,m,0,T,[`attribute-name`],b);k=Math.max(k,n.width+h);let r=await an(C,e.keys.join(),m,0,T,[`attribute-keys`],b);A=Math.max(A,r.width+h);let i=await an(C,e.comment,m,0,T,[`attribute-comment`],b);j=Math.max(j,i.width+h);let a=Math.max(t.height,n.height,r.height,i.height)+_;D.push({yOffset:T,rowHeight:a}),T+=a}let I=4;A<=h&&(M=!1,A=0,I--),j<=h&&(F=!1,j=0,I--);let L=C.node().getBBox();if(w.width+h*2-(O+k+A+j)>0){let e=w.width+h*2-(O+k+A+j);O+=e/I,k+=e/I,A>0&&(A+=e/I),j>0&&(j+=e/I)}let ee=O+k+A+j,R=f.svg(C),z=p(n,{});n.look!==`handDrawn`&&(z.roughness=0,z.fillStyle=`solid`);let te=0;D.length>0&&(te=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let B=Math.max(L.width+h*2,n?.width||0,ee),ne=Math.max((te??0)+w.height,n?.height||0),V=-B/2,H=-ne/2;if(C.selectAll(`g:not(:first-child)`).each((e,n,r)=>{let i=t(r[n]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${V+h/2+o}, ${s+H+w.height+_/2})`)}),C.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(H+_/2)+`)`),a!=null&&tn.has(a)){let e=r.colorIndex??0;C.attr(`data-color-id`,`color-${e%d.length}`)}let re=R.rectangle(V,H,B,ne,z),ie=C.insert(()=>re,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=R.rectangle(V,w.height+H+t?.yOffset,B,t?.rowHeight,{...z,fill:n?s:l,stroke:u});C.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let U=1e-4,W=on(V,w.height+H,B+V,w.height+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z);if(C.insert(()=>G).attr(`class`,`divider`),W=on(O+V,w.height+H,O+V,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+V;W=on(e,w.height+H,e,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>G).attr(`class`,`divider`)}if(F){let e=O+k+A+V;W=on(e,w.height+H,e,ne+H,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=w.height+H+e;W=on(V,t,B+V,t,U),G=R.polygon(W.map(e=>[e.x,e.y]),z),C.insert(()=>G).attr(`class`,`divider`)}if(N(n,ie),x&&n.look!==`handDrawn`){if(a!=null&&nn.has(a))C.selectAll(`path`).attr(`style`,x);else{let e=x.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);C.selectAll(`path`).attr(`style`,e??``),C.selectAll(`.row-rect-even path`).attr(`style`,x)}}return n.intersect=function(e){return K.rect(n,e)},C}e(rn,`erBox`);async function an(e,n,r,o=0,s=0,c=[],l=``){let u=e.insert(`g`).attr(`class`,`label ${c.join(` `)}`).attr(`transform`,`translate(${o}, ${s})`).attr(`style`,l);n!==a(n)&&(n=a(n),n=n.replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`));let d=u.node().appendChild(await S(u,n,{width:y(n,r)+100,style:l,useHtmlLabels:r.htmlLabels},r));if(n.includes(`&lt;`)||n.includes(`&gt;`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`&lt;`,`<`).replaceAll(`&gt;`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`&lt;`,`<`).replaceAll(`&gt;`,`>`)}let f=d.getBBox();if(i(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let n=t(d);f=e.getBoundingClientRect(),n.attr(`width`,f.width),n.attr(`height`,f.height)}return f}e(an,`addText`);function on(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(on,`lineToPolygon`);async function sn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,P(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await cn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await cn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await cn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await cn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(sn,`textHelper`);async function cn(e,n,r,a=[]){let o=e.insert(`g`).attr(`class`,`label`).attr(`style`,a.join(`; `)),l=c(),d=`useHtmlLabels`in n?n.useHtmlLabels:i(l.htmlLabels)??!0,f=``;f=`text`in n?n.text:n.label,!d&&f.startsWith(`\\`)&&(f=f.substring(1)),u(f)&&(d=!0);let p=await S(o,s(x(f)),{width:y(f,l)+50,classes:`markdown-node-label`,useHtmlLabels:d},l),m,h=1;if(d){let e=p.children[0],n=t(p);h=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(h+=e.innerHTML.split(`<mrow>`).length-1),await E(e),m=e.getBoundingClientRect(),n.attr(`width`,m.width),n.attr(`height`,m.height)}else{a.includes(`font-weight: bolder`)&&t(p).selectAll(`tspan`).attr(`font-weight`,``),h=p.children.length;let e=p.children[0];(p.textContent===``||p.textContent.includes(`&gt`))&&(e.textContent=f[0]+f.substring(1).replaceAll(`&gt;`,`>`).replaceAll(`&lt;`,`<`).trim(),f[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),m=p.getBBox()}return o.attr(`transform`,`translate(0,`+(-m.height/(2*h)+r)+`)`),m.height}e(cn,`addText`);async function ln(e,n){let a=r(),{themeVariables:o}=a,{useGradient:s}=o,c=a.class.padding??12,l=c,u=n.useHtmlLabels??i(a.htmlLabels)??!0,d=n;d.annotations=d.annotations??[],d.members=d.members??[],d.methods=d.methods??[];let{shapeSvg:m,bbox:h}=await sn(e,n,a,u,l),{labelStyles:_,nodeStyles:v}=g(n);n.labelStyle=_,n.cssStyles=d.styles||``;let y=d.styles?.join(`;`)||v||``;n.cssStyles||=y.replaceAll(`!important`,``).split(`;`);let b=d.members.length===0&&d.methods.length===0&&!a.class?.hideEmptyMembersBox,x=f.svg(m),S=p(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=Math.max(n.width??0,h.width),w=Math.max(n.height??0,h.height),T=(n.height??0)>h.height;d.members.length===0&&d.methods.length===0?w+=l:d.members.length>0&&d.methods.length===0&&(w+=l*2);let E=-C/2,D=-w/2,O=b?c*2:d.members.length===0&&d.methods.length===0?-c:0;T&&(O=c*2);let k=x.rectangle(E-c,D-c-(b?c:d.members.length===0&&d.methods.length===0?-c/2:0),C+2*c,w+2*c+O,S),A=m.insert(()=>k,`:first-child`);A.attr(`class`,`basic label-container outer-path`);let j=A.node().getBBox(),M=m.select(`.annotation-group`).node().getBBox().height-(b?c/2:0)||0,P=m.select(`.label-group`).node().getBBox().height-(b?c/2:0)||0,F=m.select(`.members-group`).node().getBBox().height-(b?c/2:0)||0,I=(M+P+D+c-(D-c-(b?c:d.members.length===0&&d.methods.length===0?-c/2:0)))/2;if(m.selectAll(`.text`).each((e,n,r)=>{let i=t(r[n]),o=i.attr(`transform`),s=0;if(o){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[2]))}let f=s+D+c-(b?c:d.members.length===0&&d.methods.length===0?-c/2:0);if(i.attr(`class`).includes(`methods-group`)){let e=Math.max(F,l/2);f=T?Math.max(I,M+P+e+D+l*2+c)+l*2:M+P+e+D+l*4+c}d.members.length===0&&d.methods.length===0&&a.class?.hideEmptyMembersBox&&(f=d.annotations.length>0?s-l:s),u||(f-=4);let p=E;(i.attr(`class`).includes(`label-group`)||i.attr(`class`).includes(`annotation-group`))&&(p=-i.node()?.getBBox().width/2||0,m.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(p=0)})),i.attr(`transform`,`translate(${p}, ${f})`)}),d.members.length>0||d.methods.length>0||b){let e=M+P+D+c,t=x.line(j.x,e,j.x+j.width,e+.001,S);m.insert(()=>t).attr(`class`,`divider${n.look===`neo`&&!s?` neo-line`:``}`).attr(`style`,y)}if(b||d.members.length>0||d.methods.length>0){let e=M+P+F+D+l*2+c,t=x.line(j.x,T?Math.max(I,e):e,j.x+j.width,(T?Math.max(I,e):e)+.001,S);m.insert(()=>t).attr(`class`,`divider${n.look===`neo`&&!s?` neo-line`:``}`).attr(`style`,y)}if(d.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,y),A.select(`:nth-child(2)`).attr(`style`,y),m.selectAll(`.divider`).select(`path`).attr(`style`,y),n.labelStyle?m.selectAll(`span`).attr(`style`,n.labelStyle):m.selectAll(`span`).attr(`style`,y),!u){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(y);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}else if(_){let t=e.exec(_);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}}}return N(n,A),n.intersect=function(e){return K.rect(n,e)},m}e(ln,`classBox`);async function un(e,n){let{labelStyles:i,nodeStyles:a}=g(n);n.labelStyle=i;let o=n,s=n,c=`verifyMethod`in n,l=P(n),u=r(),{themeVariables:d}=u,{borderColorArray:m,requirementEdgeLabelBackground:h}=d,_=u.layout===`elk`?`start`:`center`,v=e.insert(`g`).attr(`class`,l).attr(`id`,n.domId??n.id),y;y=c?await $(v,`&lt;&lt;${o.type}&gt;&gt;`,0,n.labelStyle):await $(v,`&lt;&lt;Element&gt;&gt;`,0,n.labelStyle);let b=y,x=await $(v,o.name,b,n.labelStyle+`; font-weight: bold;`);if(b+=x+20,c){let e=await $(v,`${o.requirementId?`ID: ${o.requirementId}`:``}`,b,n.labelStyle,_);b+=e;let t=await $(v,`${o.text?`Text: ${o.text}`:``}`,b,n.labelStyle,_);b+=t;let r=await $(v,`${o.risk?`Risk: ${o.risk}`:``}`,b,n.labelStyle,_);b+=r,await $(v,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:``}`,b,n.labelStyle,_)}else{let e=await $(v,`${s.type?`Type: ${s.type}`:``}`,b,n.labelStyle,_);b+=e,await $(v,`${s.docRef?`Doc Ref: ${s.docRef}`:``}`,b,n.labelStyle,_)}let S=(v.node()?.getBBox().width??200)+20,C=(v.node()?.getBBox().height??200)+20,w=-S/2,T=-C/2,E=f.svg(v),D=p(n,{});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(w,T,S,C,D),k=v.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,a),m?.length){let e=n.colorIndex??0;v.attr(`data-color-id`,`color-${e%m.length}`)}if(v.selectAll(`.label`).each((e,n,r)=>{let i=t(r[n]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-C/2,l=w+10;(n===0||n===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),b>y+x+20){let e=T+y+x+20,t;if(n.look===`neo`){let n=[[w,e],[w+S,e],[w+S,e+.001],[w,e+.001]];t=E.polygon(n,D)}else t=E.line(w,e,w+S,e,D);v.insert(()=>t).attr(`class`,`divider`)}return N(n,k),n.intersect=function(e){return K.rect(n,e)},a&&n.look!==`handDrawn`&&(h||m?.length)&&v.selectAll(`path`).attr(`style`,a),v}e(un,`requirementBox`);async function $(e,n,i,a=``,o=`center`){if(n===``)return 0;let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),l=r(),u=l.htmlLabels??!0,d=await S(c,s(x(n)),{width:y(n,l)+50,classes:`markdown-node-label`,useHtmlLabels:u,style:a},l),f;if(u){let e=d.children[0],n=t(d);o===`start`&&t(e).style(`text-align`,`left`),f=e.getBoundingClientRect(),n.attr(`width`,f.width),n.attr(`height`,f.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}f=d.getBBox(),f.height+=6}return c.attr(`transform`,`translate(${-f.width/2},${-f.height/2+i})`),f.height}e($,`addText`);var dn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function fn(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await j(e,t,P(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},h,_;d?{label:h,bbox:_}=await M(d,`ticket`in t&&t.ticket||``,m):{label:h,bbox:_}=await M(o,`ticket`in t&&t.ticket||``,m);let{label:v,bbox:y}=await M(o,`assigned`in t&&t.assigned||``,m);t.width=a;let b=t?.width||0,x=Math.max(_.height,y.height)/2,S=Math.max(s.height+20,t?.height||0)+x,C=-b/2,w=-S/2;c.attr(`transform`,`translate(`+(l-b/2)+`, `+(-x-s.height/2)+`)`),h.attr(`transform`,`translate(`+(l-b/2)+`, `+(-x+s.height/2)+`)`),v.attr(`transform`,`translate(`+(l+b/2-y.width-20)+`, `+(-x+s.height/2)+`)`);let T,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=f.svg(o),n=p(t,{}),r=E||D?e.path(z(C,w,b,S,E||0),n):e.rectangle(C,w,b,S,n);T=o.insert(()=>r,`:first-child`),T.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{T=o.insert(`rect`,`:first-child`),T.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,C).attr(`y`,w).attr(`width`,b).attr(`height`,S);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=C+2,r=w+Math.floor((E??0)/2),i=w+S-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,dn(e))}}return N(t,T),t.height=S,t.intersect=function(e){return K.rect(t,e)},o}e(fn,`kanbanItem`);async function pn(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await j(e,t,P(t)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:m}=t,h=o.width+20,_=o.height+20,y=Math.max(l,h),b=Math.max(u,_);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let x,S=`M0 0
11
+ a${d},${d} 1 0,0 ${y*.25},${-1*b*.1}
12
+ a${d},${d} 1 0,0 ${y*.25},0
13
+ a${d},${d} 1 0,0 ${y*.25},0
14
+ a${d},${d} 1 0,0 ${y*.25},${b*.1}
15
+
16
+ a${d},${d} 1 0,0 ${y*.15},${b*.33}
17
+ a${d*.8},${d*.8} 1 0,0 0,${b*.34}
18
+ a${d},${d} 1 0,0 ${-1*y*.15},${b*.33}
19
+
20
+ a${d},${d} 1 0,0 ${-1*y*.25},${b*.15}
21
+ a${d},${d} 1 0,0 ${-1*y*.25},0
22
+ a${d},${d} 1 0,0 ${-1*y*.25},0
23
+ a${d},${d} 1 0,0 ${-1*y*.25},${-1*b*.15}
24
+
25
+ a${d},${d} 1 0,0 ${-1*y*.1},${-1*b*.33}
26
+ a${d*.8},${d*.8} 1 0,0 0,${-1*b*.34}
27
+ a${d},${d} 1 0,0 ${y*.1},${-1*b*.33}
28
+ H0 V0 Z`;if(t.look===`handDrawn`){let e=f.svg(a),n=p(t,{}),r=e.path(S,n);x=a.insert(()=>r,`:first-child`),x.attr(`class`,`basic label-container`).attr(`style`,v(m))}else x=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,S);return x.attr(`transform`,`translate(${-y/2}, ${-b/2})`),N(t,x),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return n.info(`Bang intersect`,t,e),K.rect(t,e)},a}e(pn,`bang`);async function mn(e,t){let{labelStyles:r,nodeStyles:i}=g(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await j(e,t,P(t)),l=o.width+2*s,u=o.height+2*s,d=.15*l,m=.25*l,h=.35*l,_=.2*l,{cssStyles:y}=t,b,x=`M0 0
29
+ a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}
30
+ a${h},${h} 1 0,1 ${l*.4},${-1*l*.1}
31
+ a${m},${m} 1 0,1 ${l*.35},${l*.2}
32
+
33
+ a${d},${d} 1 0,1 ${l*.15},${u*.35}
34
+ a${_},${_} 1 0,1 ${-1*l*.15},${u*.65}
35
+
36
+ a${m},${d} 1 0,1 ${-1*l*.25},${l*.15}
37
+ a${h},${h} 1 0,1 ${-1*l*.5},0
38
+ a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15}
39
+
40
+ a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}
41
+ a${_},${_} 1 0,1 ${l*.1},${-1*u*.65}
42
+ H0 V0 Z`;if(t.look===`handDrawn`){let e=f.svg(a),n=p(t,{}),r=e.path(x,n);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,v(y))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),b.attr(`transform`,`translate(${-l/2}, ${-u/2})`),N(t,b),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return n.info(`Cloud intersect`,t,e),K.rect(t,e)},a}e(mn,`cloud`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=g(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await j(e,t,P(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
43
+ M${-c/2} ${l/2-5}
44
+ v${-l+10}
45
+ q0,-5 5,-5
46
+ h${c-10}
47
+ q5,0 5,5
48
+ v${l-5}
49
+ H${-c/2}
50
+ Z
51
+ `:`
52
+ M${-c/2} ${l/2-5}
53
+ v${-l+10}
54
+ q0,-5 5,-5
55
+ h${c-10}
56
+ q5,0 5,5
57
+ v${l-10}
58
+ q0,5 -5,5
59
+ h${-(c-10)}
60
+ q-5,0 -5,-5
61
+ Z
62
+ `;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let d=i.append(`path`).attr(`id`,t.domId).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),N(t,d),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},i}e(hn,`defaultMindmapNode`);async function gn(e,t){return De(e,t,{padding:t.padding??0})}e(gn,`mindmapCircle`);var _n=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:At},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:Dt},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:jt},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:It},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:He},{semanticName:`Data Store`,name:`Data Store`,shortName:`datastore`,description:`Data flow diagram data store`,aliases:[`data-store`],handler:We},{semanticName:`Folder`,name:`Folder`,shortName:`folder`,description:`Folder or directory`,aliases:[`directory`],handler:Ze},{semanticName:`Bucket`,name:`Bucket`,shortName:`bucket`,description:`Object storage bucket`,handler:ue},{semanticName:`Console`,name:`Console (terminal window)`,shortName:`console`,description:`Terminal or console window`,handler:ke},{semanticName:`Browser`,name:`Browser`,shortName:`browser`,description:`Browser window`,handler:Ce},{semanticName:`Person`,name:`Person`,shortName:`person`,description:`Person (circular head above a rounded body)`,handler:Ie},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:De},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:pn},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:mn},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:wt},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:tt},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:dt},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:ut},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:qt},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:ct},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:Ke},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:Bt},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:Te},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:Ot},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:Pt},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:Nt},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:Qe},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:nt},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:Me},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:Ne},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:Pe},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:ft},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:Qt},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:$e},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:Kt},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:vt},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:Fe},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Ge},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:Zt},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:en},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:qe},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:Jt},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:Xe},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:kt},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:xt},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:bt},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:le},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:je},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:zt},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:Rt},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:$t},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:Tt},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:yt}],vn=e(()=>{let e=[...Object.entries({state:Mt,choice:Ee,note:St,composite:Oe,rectWithTitle:Et,labelRect:lt,block_arrow:Se,collapsedGroup:he,iconSquare:ot,iconCircle:it,icon:rt,iconRounded:at,imageSquare:st,anchor:oe,kanbanItem:fn,mindmapCircle:gn,defaultMindmapNode:hn,classBox:ln,erBox:rn,requirementBox:un}),..._n.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)();function yn(e){return e in vn}e(yn,`isValidShape`);export{R as a,yn as i,N as n,z as o,te as r,vn as s,j as t};