@abuswami1996/agent-md 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/agent-md-preview.vsix +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +932 -0
- package/package.json +45 -0
- package/viewer-dist/assets/arc-BGWRvh4A.js +1 -0
- package/viewer-dist/assets/architecture-7EHR7CIX-tMtXFVEB.js +1 -0
- package/viewer-dist/assets/architectureDiagram-3BPJPVTR-BpnMGpeV.js +36 -0
- package/viewer-dist/assets/array-CLXCPui0.js +1 -0
- package/viewer-dist/assets/blockDiagram-GPEHLZMM-BHk4-xwc.js +132 -0
- package/viewer-dist/assets/c4Diagram-AAUBKEIU-BShCidQJ.js +10 -0
- package/viewer-dist/assets/channel-BeF3oGSA.js +1 -0
- package/viewer-dist/assets/chunk-2J33WTMH-D_hBYQSk.js +1 -0
- package/viewer-dist/assets/chunk-3OPIFGDE-yFgTZecx.js +62 -0
- package/viewer-dist/assets/chunk-4BX2VUAB-BrcCtoyJ.js +1 -0
- package/viewer-dist/assets/chunk-4EGX6M5U-sKH2Isf8.js +1 -0
- package/viewer-dist/assets/chunk-55IACEB6-DbDA7kYA.js +1 -0
- package/viewer-dist/assets/chunk-5DO6E6H7-DVriMWxp.js +1 -0
- package/viewer-dist/assets/chunk-5ZQYHXKU-DQ5fX41l.js +2 -0
- package/viewer-dist/assets/chunk-727SXJPM-SK34XSEC.js +206 -0
- package/viewer-dist/assets/chunk-AQP2D5EJ-DXK-1dYB.js +231 -0
- package/viewer-dist/assets/chunk-BR22UD5L-BCm2xrxa.js +1 -0
- package/viewer-dist/assets/chunk-BSJP7CBP-B3Tyh4s5.js +1 -0
- package/viewer-dist/assets/chunk-CSCIHK7Q-BmRiMG-E.js +123 -0
- package/viewer-dist/assets/chunk-FHYWG6QK-B_z4diOF.js +1 -0
- package/viewer-dist/assets/chunk-FMBD7UC4-Dxft-q4P.js +15 -0
- package/viewer-dist/assets/chunk-KSCS5N6A-eA-nZKPR.js +10 -0
- package/viewer-dist/assets/chunk-L5ZTLDWV-CJt5R1DD.js +1 -0
- package/viewer-dist/assets/chunk-MPE355IW-BrU23f3r.js +1 -0
- package/viewer-dist/assets/chunk-MZUSXYTE-BGj-wpbJ.js +1 -0
- package/viewer-dist/assets/chunk-N66VUXT2-Bx9F_D4P.js +1 -0
- package/viewer-dist/assets/chunk-ND2GUHAM-DhxorC-R.js +1 -0
- package/viewer-dist/assets/chunk-NNHCCRGN-DSaPFNsL.js +159 -0
- package/viewer-dist/assets/chunk-NZK2D7GU-DaLfDAf-.js +1 -0
- package/viewer-dist/assets/chunk-O5CBEL6O-D0rppU0M.js +70 -0
- package/viewer-dist/assets/chunk-PUPMXCY4-C2l0dHY4.js +1 -0
- package/viewer-dist/assets/chunk-QZHKN3VN-CqO4Iw07.js +1 -0
- package/viewer-dist/assets/chunk-UIBZB4QT-DXVjm6Jo.js +1 -0
- package/viewer-dist/assets/chunk-WCWK7LTN-zc10zcLo.js +1 -0
- package/viewer-dist/assets/classDiagram-4FO5ZUOK-tR_J6scJ.js +1 -0
- package/viewer-dist/assets/classDiagram-v2-Q7XG4LA2-DStV2Q4p.js +1 -0
- package/viewer-dist/assets/cose-bilkent-S5V4N54A-SSDlF1_a.js +1 -0
- package/viewer-dist/assets/cytoscape.esm-mg8EQp5B.js +321 -0
- package/viewer-dist/assets/dagre-BM42HDAG-CbZJzBab.js +4 -0
- package/viewer-dist/assets/dagre-CdwzCXQr.js +1 -0
- package/viewer-dist/assets/defaultLocale-Dda4OpKy.js +1 -0
- package/viewer-dist/assets/diagram-2AECGRRQ-BB3K5hE5.js +43 -0
- package/viewer-dist/assets/diagram-5GNKFQAL-DWmbyuQH.js +10 -0
- package/viewer-dist/assets/diagram-KO2AKTUF-CYSKyVh3.js +3 -0
- package/viewer-dist/assets/diagram-LMA3HP47-CyTMJfPw.js +24 -0
- package/viewer-dist/assets/diagram-OG6HWLK6-72YuHoex.js +24 -0
- package/viewer-dist/assets/dist-Cz_gOj_F.js +1 -0
- package/viewer-dist/assets/erDiagram-TEJ5UH35-B7Z-qey-.js +85 -0
- package/viewer-dist/assets/eventmodeling-FCH6USID-Cmphiy0Z.js +1 -0
- package/viewer-dist/assets/flowDiagram-I6XJVG4X-Bd8YQF0F.js +162 -0
- package/viewer-dist/assets/ganttDiagram-6RSMTGT7-B0R6fBcN.js +292 -0
- package/viewer-dist/assets/gitGraph-WXDBUCRP-CABAU2x_.js +1 -0
- package/viewer-dist/assets/gitGraphDiagram-PVQCEYII-DgTF7l00.js +106 -0
- package/viewer-dist/assets/graphlib-B0DVs0bw.js +1 -0
- package/viewer-dist/assets/index-BiU7pYUM.css +1 -0
- package/viewer-dist/assets/index-C_Rab63U.js +99 -0
- package/viewer-dist/assets/info-J43DQDTF-CtHtznhp.js +1 -0
- package/viewer-dist/assets/infoDiagram-5YYISTIA-D3ae-MRJ.js +2 -0
- package/viewer-dist/assets/init-Ct4VudL3.js +1 -0
- package/viewer-dist/assets/ishikawaDiagram-YF4QCWOH-BpRQFD12.js +70 -0
- package/viewer-dist/assets/journeyDiagram-JHISSGLW-DTbccBmQ.js +139 -0
- package/viewer-dist/assets/kanban-definition-UN3LZRKU-DBpDPAaX.js +89 -0
- package/viewer-dist/assets/katex-pVJiI_rc.js +257 -0
- package/viewer-dist/assets/line-CSkXZgM5.js +1 -0
- package/viewer-dist/assets/linear-C69MUSpN.js +1 -0
- package/viewer-dist/assets/mermaid-parser.core-BxtmlK9F.js +4 -0
- package/viewer-dist/assets/mindmap-definition-RKZ34NQL-CJfLUd4u.js +96 -0
- package/viewer-dist/assets/ordinal-bHkc4Rpt.js +1 -0
- package/viewer-dist/assets/packet-YPE3B663-DmtvbI4l.js +1 -0
- package/viewer-dist/assets/path-ZGOlHDxT.js +1 -0
- package/viewer-dist/assets/pie-LRSECV5Y-Y82O9nng.js +1 -0
- package/viewer-dist/assets/pieDiagram-4H26LBE5-BsHXB8IC.js +30 -0
- package/viewer-dist/assets/quadrantDiagram-W4KKPZXB-B3RaddW4.js +7 -0
- package/viewer-dist/assets/radar-GUYGQ44K-BHcHsGeF.js +1 -0
- package/viewer-dist/assets/requirementDiagram-4Y6WPE33-CanuKYuP.js +84 -0
- package/viewer-dist/assets/rough.esm-C6nrIGLg.js +1 -0
- package/viewer-dist/assets/sankeyDiagram-5OEKKPKP-B92qVA_9.js +40 -0
- package/viewer-dist/assets/sequenceDiagram-3UESZ5HK-IBhScJkH.js +162 -0
- package/viewer-dist/assets/src--c83fjKW.js +1 -0
- package/viewer-dist/assets/stateDiagram-AJRCARHV-D9ORfcYk.js +1 -0
- package/viewer-dist/assets/stateDiagram-v2-BHNVJYJU-CCmjUx_g.js +1 -0
- package/viewer-dist/assets/timeline-definition-PNZ67QCA-D4afYQ3m.js +120 -0
- package/viewer-dist/assets/treeView-BLDUP644-Cmu4mPLp.js +1 -0
- package/viewer-dist/assets/treemap-LRROVOQU-_N62KlUg.js +1 -0
- package/viewer-dist/assets/vennDiagram-CIIHVFJN-DjSaUOWp.js +34 -0
- package/viewer-dist/assets/wardley-L42UT6IY-DWSXD3L4.js +1 -0
- package/viewer-dist/assets/wardleyDiagram-YWT4CUSO-CBn2PjeZ.js +78 -0
- package/viewer-dist/assets/xychartDiagram-2RQKCTM6-CAAAsGIb.js +7 -0
- package/viewer-dist/index.html +22 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{i as e,r as t,t as n}from"./src--c83fjKW.js";import{a as r,r as i,u as a}from"./chunk-5ZQYHXKU-DQ5fX41l.js";import{A as o,B as s,M as c,T as l,b as u,g as d,x as f,z as p}from"./chunk-CSCIHK7Q-BmRiMG-E.js";import{n as m,t as h}from"./chunk-L5ZTLDWV-CJt5R1DD.js";import{a as g,i as _,r as v,t as y}from"./chunk-NZK2D7GU-DaLfDAf-.js";import{n as b,r as x}from"./chunk-O5CBEL6O-D0rppU0M.js";import{t as S}from"./rough.esm-C6nrIGLg.js";var C=t(async(e,t,i)=>{let o,s=t.useHtmlLabels||d(f()?.htmlLabels);o=i||`node default`;let c=e.insert(`g`).attr(`class`,o).attr(`id`,t.domId||t.id),l=c.insert(`g`).attr(`class`,`label`).attr(`style`,a(t.labelStyle)),u;u=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,g=t.labelType===`markdown`,_=await b(l,p(r(u),f()),{useHtmlLabels:s,width:t.width||f().flowchart?.wrappingWidth,classes:g?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:g},f()),v=_.getBBox(),y=(t?.padding??0)/2;if(s){let e=_.children[0],t=n(_);await h(e,u),v=e.getBoundingClientRect(),t.attr(`width`,v.width),t.attr(`height`,v.height)}return s?l.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`):l.attr(`transform`,`translate(0, `+-v.height/2+`)`),t.centerLabel&&l.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`),l.insert(`rect`,`:first-child`),{shapeSvg:c,bbox:v,halfPadding:y,label:l}},`labelHelper`),w=t(async(e,t,i)=>{let a=i.useHtmlLabels??l(f()),o=e.insert(`g`).attr(`class`,`label`).attr(`style`,i.labelStyle||``),s=await b(o,p(r(t),f()),{useHtmlLabels:a,width:i.width||f()?.flowchart?.wrappingWidth,style:i.labelStyle,addSvgBackground:!!i.icon||!!i.img}),c=s.getBBox(),u=i.padding/2;if(l(f())){let e=s.children[0],t=n(s);c=e.getBoundingClientRect(),t.attr(`width`,c.width),t.attr(`height`,c.height)}return a?o.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`):o.attr(`transform`,`translate(0, `+-c.height/2+`)`),i.centerLabel&&o.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:c,halfPadding:u,label:o}},`insertLabel`),T=t((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),E=t((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function D(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}t(D,`createPathFromPoints`);function O(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}t(O,`generateFullSineWavePoints`);function k(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(k,`generateCirclePoints`);function A(e){let n=Array.from(e.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=t((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}t(A,`mergePaths`);var j=t((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),M=t(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let o=f(),s=l(o);return await b(e,a,{style:n,isTitle:r,useHtmlLabels:s,markdown:!1,isNode:i,width:1/0},o)},`createLabel`),N=t((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),P=t(async(t,r)=>{e.info(`Creating subgraph rect for `,r.id,r);let i=f(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:c}=a,{labelStyles:u,nodeStyles:d,borderStyles:p,backgroundStyles:h}=_(r),v=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=l(i),x=v.insert(`g`).attr(`class`,`cluster-label `),C;C=r.labelType===`markdown`?await b(x,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}):await M(x,r.label,r.labelStyle||``,!1,!0);let w=C.getBBox();if(l(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=r.width<=w.width+r.padding?w.width+r.padding:r.width;r.width<=w.width+r.padding?r.diff=(T-r.width)/2-r.padding:r.diff=-r.padding;let E=r.height,D=r.x-T/2,O=r.y-E/2;e.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let t=S.svg(v),n=g(r,{roughness:.7,fill:s,stroke:c,fillWeight:3,seed:o}),i=t.path(N(D,O,T,E,0),n);k=v.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,h.join(`;`).replace(`fill`,`stroke`))}else k=v.insert(`rect`,`:first-child`),k.attr(`style`,d).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=m(i);if(x.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),u){let e=x.select(`span`);e&&e.attr(`style`,u)}let P=k.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:v,labelBBox:w}},`rect`),F={rect:P,squareRect:P,roundedWithTitle:t(async(e,t)=>{let r=f(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:o,compositeBackground:s,compositeTitleBackground:c,nodeBorder:u}=i,d=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look),p=d.insert(`g`,`:first-child`),m=d.insert(`g`).attr(`class`,`cluster-label`),h=d.append(`rect`),g=await M(m,t.label,t.labelStyle,void 0,!0),_=g.getBBox();if(l(r)){let e=g.children[0],t=n(g);_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}let v=0*t.padding,y=v/2,b=(t.width<=_.width+t.padding?_.width+t.padding:t.width)+v;t.width<=_.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height+v,C=t.height+v-_.height-6,w=t.x-b/2,T=t.y-x/2;t.width=b;let E=t.y-t.height/2-y+_.height+2,D;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=S.svg(d),r=t.rx||t.ry?n.path(N(w,T,b,x,10),{roughness:.7,fill:c,fillStyle:`solid`,stroke:u,seed:a}):n.rectangle(w,T,b,x,{seed:a});D=d.insert(()=>r,`:first-child`);let i=n.rectangle(w,E,b,C,{fill:e?o:s,fillStyle:e?`hachure`:`solid`,stroke:u,seed:a});D=d.insert(()=>r,`:first-child`),h=d.insert(()=>i)}else D=p.insert(`rect`,`:first-child`),D.attr(`class`,`outer`).attr(`x`,w).attr(`y`,T).attr(`width`,b).attr(`height`,x).attr(`data-look`,t.look),h.attr(`class`,`inner`).attr(`x`,w).attr(`y`,E).attr(`width`,b).attr(`height`,C);return m.attr(`transform`,`translate(${t.x-_.width/2}, ${T+1-(l(r)?0:3)})`),t.height=D.node().getBBox().height,t.offsetX=0,t.offsetY=_.height-t.padding/2,t.labelBBox=_,t.intersect=function(e){return j(t,e)},{cluster:d,labelBBox:_}},`roundedWithTitle`),noteGroup:t((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return j(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:t((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=f(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,c=t.width+s;t.diff=-t.padding;let l=t.height+s,u=t.x-c/2,d=t.y-l/2;t.width=c;let p;if(t.look===`handDrawn`){let e=S.svg(a).rectangle(u,d,c,l,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l).attr(`data-look`,t.look)}return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return j(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:t(async(t,r)=>{e.info(`Creating subgraph rect for `,r.id,r);let i=f(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:c}=a,{labelStyles:u,nodeStyles:d,borderStyles:p,backgroundStyles:h}=_(r),v=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=l(i),x=v.insert(`g`).attr(`class`,`cluster-label `),C=await b(x,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),w=C.getBBox();if(l(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=r.width<=w.width+r.padding?w.width+r.padding:r.width;r.width<=w.width+r.padding?r.diff=(T-r.width)/2-r.padding:r.diff=-r.padding;let E=r.height,D=r.x-T/2,O=r.y-E/2;e.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let t=S.svg(v),n=g(r,{roughness:.7,fill:s,stroke:c,fillWeight:4,seed:o}),i=t.path(N(D,O,T,E,r.rx),n);k=v.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,h.join(`;`).replace(`fill`,`stroke`))}else k=v.insert(`rect`,`:first-child`),k.attr(`style`,d).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=m(i);if(x.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),u){let e=x.select(`span`);e&&e.attr(`style`,u)}let M=k.node().getBBox();return r.offsetX=0,r.width=M.width,r.height=M.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:v,labelBBox:w}},`kanbanSection`)},I=new Map,ee=t(async(e,t)=>{let n=await F[t.shape||`rect`](e,t);return I.set(t.id,n),n},`insertCluster`),te=t(()=>{I=new Map},`clear`);function L(e,t){return e.intersect(t)}t(L,`intersectNode`);var R=L;function ne(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}t(ne,`intersectEllipse`);var z=ne;function B(e,t,n){return z(e,t,t,n)}t(B,`intersectCircle`);var V=B;function H(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&re(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&re(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}t(H,`intersectLine`);function re(e,t){return e*t>0}t(re,`sameSign`);var ie=H;function U(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ie(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}t(U,`intersectPolygon`);var W={node:R,circle:V,ellipse:z,polygon:U,rect:j};function G(t,n){let{labelStyles:r}=_(n);n.labelStyle=r;let i=E(n),o=i;i||(o=`anchor`);let s=t.insert(`g`).attr(`class`,o).attr(`id`,n.domId||n.id),{cssStyles:c}=n,l=S.svg(s),u=g(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=l.circle(0,0,2,u),f=s.insert(()=>d,`:first-child`);return f.attr(`class`,`anchor`).attr(`style`,a(c)),T(n,f),n.intersect=function(t){return e.info(`Circle intersect`,n,1,t),W.circle(n,1,t)},s}t(G,`anchor`);function K(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}t(K,`generateArcPoints`);function ae(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}t(ae,`calculateArcSagitta`);async function oe(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=t(e=>e+s,`calcTotalHeight`),l=t(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await C(e,n,E(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ae(f,p,m),v=(n?.width?n?.width:d.width)+o*2+h-h,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...K(-v/2,-y/2,-v/2,y/2,p,m,!1),{x:v/2,y:y/2},...K(v/2,y/2,v/2,-y/2,p,m,!0)],w=S.svg(u),O=g(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`);let k=D(x),A=w.path(k,O),j=u.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,i),j.attr(`transform`,`translate(${p/2}, 0)`),T(n,j),n.intersect=function(e){return W.polygon(n,x,e)},u}t(oe,`bowTieRect`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}t(q,`insertPolygonShape`);var se=12;async function ce(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+se),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+se,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+se},{x:0+se,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(s,l,u,p);return r&&m.attr(`style`,r),T(t,m),t.intersect=function(e){return W.polygon(t,p,e)},s}t(ce,`card`);function le(e,t){let{nodeStyles:n}=_(t);t.label=``;let r=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=S.svg(r),c=g(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=D(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return W.polygon(t,o,e)},r}t(le,`choice`);async function ue(t,n,r){let{labelStyles:i,nodeStyles:o}=_(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,halfPadding:l}=await C(t,n,E(n)),u=r?.padding??l,d=n.look===`neo`?c.width/2+32:c.width/2+u,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=S.svg(s),t=g(n,{}),r=e.circle(0,0,d*2,t);f=s.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,a(p))}else f=s.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,o).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return T(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return W.circle(e,n,t)},n.intersect=function(t){return e.info(`Circle intersect`,n,d,t),W.circle(n,d,t)},s}t(ue,`circle`);function de(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
2
|
+
M ${i.x},${i.y} L ${o.x},${o.y}`}t(de,`createLine`);function fe(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r,n.label=``;let a=t.insert(`g`).attr(`class`,E(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=S.svg(a),l=g(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=de(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),T(n,p),n.intersect=function(t){return e.info(`crossedCircle intersect`,n,{radius:o,point:t}),W.circle(n,o,t)},a}t(fe,`crossedCircle`);function J(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(J,`generateCirclePoints`);async function pe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],m=[{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}],h=S.svg(i),v=g(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=h.path(y,v),x=D(m),w=h.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,m,e)},i}t(pe,`curlyBraceLeft`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}t(Y,`generateCirclePoints`);async function me(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],m=[{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}],h=S.svg(i),v=g(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=h.path(y,v),x=D(m),w=h.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,m,e)},i}t(me,`curlyBraceRight`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(X,`generateCirclePoints`);async function he(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],m=[...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)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],v=S.svg(i),y=g(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=D(p).replace(`Z`,``),x=v.path(b,y),w=D(m).replace(`Z`,``),O=v.path(w,y),k=D(h),A=v.path(k,{...y}),j=i.insert(`g`,`:first-child`);return j.insert(()=>A,`:first-child`).attr(`stroke-opacity`,0),j.insert(()=>x,`:first-child`),j.insert(()=>O,`:first-child`),j.attr(`class`,`text`),f&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,j),t.intersect=function(e){return W.polygon(t,h,e)},i}t(he,`curlyBraces`);async function ge(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=S.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=l,v=u,y=h-d,b=v/4,x=[{x:y,y:0},{x:b,y:0},{x:0,y:v/2},{x:b,y:v},{x:y,y:v},...k(-y,-v/2,d,50,270,90)],w=D(x),O=p.path(w,m),A=s.insert(()=>O,`:first-child`);return A.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,r),A.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,A),t.intersect=function(e){return W.polygon(t,x,e)},s}t(ge,`curvedTrapezoid`);var _e=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),ve=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),ye=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),be=8,xe=8;async function Se(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,o=t.look===`neo`?24:i,s=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-s,t.width<xe&&(t.width=xe);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<be&&(t.height=be)}let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t.width?t.width:l.width)+s,f=d/2,p=f/(2.5+d/50),m=(t.height?t.height:l.height)+o+p,h,{cssStyles:v}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=ve(0,0,d,m,f,p),r=ye(0,p,d,m,f,p),i=g(t,{}),a=e.path(n,i),o=e.path(r,g(t,{fill:`none`}));h=c.insert(()=>o,`:first-child`),h=c.insert(()=>a,`:first-child`),h.attr(`class`,`basic label-container`),v&&h.attr(`style`,v)}else{let e=_e(0,0,d,m,f,p);h=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,a(v)).attr(`style`,r)}return h.attr(`label-offset-y`,p),h.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),T(t,h),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=W.rect(t,e),r=n.x-(t.x??0);if(f!=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-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}t(Se,`cylinder`);async function Ce(e,t,n){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:o,bbox:s}=await C(e,t,E(t)),c=Math.max(s.width+n.labelPaddingX*2,t?.width||0),l=Math.max(s.height+n.labelPaddingY*2,t?.height||0),u=-c/2,d=-l/2,f,{rx:p,ry:m}=t,{cssStyles:h}=t;if(n?.rx&&n.ry&&(p=n.rx,m=n.ry),t.look===`handDrawn`){let e=S.svg(o),n=g(t,{}),r=p||m?e.path(N(u,d,c,l,p||0),n):e.rectangle(u,d,c,l,n);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,a(h))}else f=o.insert(`rect`,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,a(p)).attr(`ry`,a(m)).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l);return T(t,f),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return W.rect(t,e)},o}t(Ce,`drawRect`);async function we(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ce(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=S.svg(c),n=g(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}t(we,`datastore`);async function Te(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=S.svg(o),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),T(t,x),t.intersect=function(e){return W.rect(t,e)},o}t(Te,`dividedRectangle`);async function Ee(t,n){let{labelStyles:r,nodeStyles:i}=_(n),o=n.look===`neo`?12:5;n.labelStyle=r;let s=n.padding??0,c=n.look===`neo`?16:s,{shapeSvg:l,bbox:u}=await C(t,n,E(n)),d=(n?.width?n?.width/2:u.width/2)+(c??0),f=d-o,p,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=S.svg(l),t=g(n,{roughness:.2,strokeWidth:2.5}),r=g(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,d*2,t),o=e.circle(0,0,f*2,r);p=l.insert(`g`,`:first-child`),p.attr(`class`,a(n.cssClasses)).attr(`style`,a(m)),p.node()?.appendChild(i),p.node()?.appendChild(o)}else{p=l.insert(`g`,`:first-child`);let e=p.insert(`circle`,`:first-child`),t=p.insert(`circle`);p.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0)}return T(n,p),n.intersect=function(t){return e.info(`DoubleCircle intersect`,n,d,t),W.circle(n,d,t)},l}t(Ee,`doublecircle`);function De(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.label=``,n.labelStyle=i;let o=t.insert(`g`).attr(`class`,E(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=S.svg(o),{nodeBorder:l}=r,u=g(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),T(n,f),n.intersect=function(t){return e.info(`filledCircle intersect`,n,{radius:7,point:t}),W.circle(n,7,t)},o}t(De,`filledCircle`);var Oe=10,ke=10;async function Ae(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.height<Oe&&(n.height=Oe),n.width=(n?.width??0)-o-o/2,n.width<ke&&(n.width=ke));let{shapeSvg:s,bbox:c,label:l}=await C(t,n,E(n)),u=(n?.width?n?.width:c.width)+(o??0),d=n?.height?n?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=n,h=S.svg(s),v=g(n,{});n.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p),b=h.path(y,v),x=s.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,T(n,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(t){return e.info(`Triangle intersect`,n,p,t),W.polygon(n,p,t)},s}t(Ae,`flippedTriangle`);function je(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=_(t);t.label=``;let o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=S.svg(o),p=g(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),T(t,h);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return W.rect(t,e)},o}t(je,`forkJoin`);async function Me(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await C(t,n,E(n)),l=(n?.width?n?.width:Math.max(15,c.width))+a*2,u=(n?.height?n?.height:Math.max(10,c.height))+o*2,d=u/2,{cssStyles:f}=n,p=S.svg(s),m=g(n,{});n.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...k(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],v=D(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&n.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),i&&n.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,i),T(n,b),n.intersect=function(t){return e.info(`Pill intersect`,n,{radius:d,point:t}),W.polygon(n,h,t)},s}t(Me,`halfRoundedRectangle`);var Ne=t((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function Pe(e,t){let{labelStyles:n,nodeStyles:r}=_(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=g(t,{}),r=Ne(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=q(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,T(t,m),t.intersect=function(e){return W.polygon(t,p,e)},c}t(Pe,`hexagon`);async function Fe(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await C(t,n,E(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=S.svg(a),u=g(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=D(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),T(n,m),n.intersect=function(t){return e.info(`Pill intersect`,n,{points:d}),W.polygon(n,d,t)},a}t(Fe,`hourglass`);async function Ie(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(t,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:v}=r,{stylesMap:b}=y(n),w=-h/2,E=-m/2,D=n.label?8:0,O=S.svg(u),k=g(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`);let A=O.rectangle(w,E,h,m,k),j=Math.max(h,d.width),M=m+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),P=u.insert(()=>A,`:first-child`),F=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`<g>${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??v};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-M/2:M/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+D/2:-d.height/2-D/2})`),T(n,F),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return W.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+h/2,y:i-a/2+d.height+D},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{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+m},{x:r-h/2,y:i-a/2+m}],W.polygon(n,o,t)},u}t(Ie,`icon`);async function Le(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(t,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:v}=r,{stylesMap:b}=y(n),w=S.svg(u),E=g(n,{});n.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`),E.stroke=b.get(`fill`)??v;let D=u.append(`g`);n.icon&&D.html(`<g>${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let O=D.node().getBBox(),k=O.width,A=O.height,j=O.x,M=O.y,N=Math.max(k,A)*Math.SQRT2+40,P=w.circle(0,0,N,E),F=Math.max(N,d.width),I=N+d.height+p,ee=w.rectangle(-F/2,-I/2,F,I,{...E,fill:`transparent`,stroke:`none`}),te=u.insert(()=>P,`:first-child`),L=u.insert(()=>ee);return D.attr(`transform`,`translate(${-k/2-j},${m?d.height/2+p/2-A/2-M:-d.height/2-p/2-A/2-M})`),D.attr(`style`,`color: ${b.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),te.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),T(n,L),n.intersect=function(t){return e.info(`iconSquare intersect`,n,t),W.rect(n,t)},u}t(Le,`iconCircle`);async function Re(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(t,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:b,mainBkg:w}=r,{stylesMap:E}=y(n),D=-v/2,O=-h/2,k=n.label?8:0,A=S.svg(u),j=g(n,{});n.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,v,h,5),j),P=Math.max(v,d.width),F=h+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>M,`:first-child`).attr(`class`,`icon-shape2`),te=u.insert(()=>I);if(n.icon){let e=u.append(`g`);e.html(`<g>${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+k/2:-d.height/2-k/2})`),T(n,te),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return W.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+k},{x:r+v/2,y:i-a/2+d.height+k},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{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+h},{x:r-v/2,y:i-a/2+h}],W.polygon(n,o,t)},u}t(Re,`iconRounded`);async function ze(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(t,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:b,mainBkg:w}=r,{stylesMap:E}=y(n),D=-v/2,O=-h/2,k=n.label?8:0,A=S.svg(u),j=g(n,{});n.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,v,h,.1),j),P=Math.max(v,d.width),F=h+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>M,`:first-child`),te=u.insert(()=>I);if(n.icon){let e=u.append(`g`);e.html(`<g>${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+k/2:-d.height/2-k/2})`),T(n,te),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return W.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+k},{x:r+v/2,y:i-a/2+d.height+k},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{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+h},{x:r-v/2,y:i-a/2+h}],W.polygon(n,o,t)},u}t(ze,`iconSquare`);async function Be(t,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=_(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await C(t,n,`image-shape default`),h=n.pos===`t`,v=-u/2,y=-d/2,b=n.label?8:0,x=S.svg(f),w=g(n,{});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let E=x.rectangle(v,y,u,d,w),D=Math.max(u,p.width),O=d+p.height+b,k=x.rectangle(-D/2,-O/2,D,O,{...w,fill:`none`,stroke:`none`}),A=f.insert(()=>E,`:first-child`),j=f.insert(()=>k);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?O/2-d:-O/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),A.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),T(n,j),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return W.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],W.polygon(n,o,t)},f}t(Be,`imageSquare`);async function Ve(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(c.width+(o??0)*2,t?.width??0),u=Math.max(c.height+(a??0)*2,t?.height??0),d=[{x:0,y:0},{x:l,y:0},{x:l+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),p&&f.attr(`style`,p)}else f=q(s,l,u,d);return r&&f.attr(`style`,r),t.width=l,t.height=u,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(Ve,`inv_trapezoid`);async function He(e,t){let{shapeSvg:n,bbox:r,label:i}=await C(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),T(t,a),t.intersect=function(e){return W.rect(t,e)},n}t(He,`labelRect`);async function Ue(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(Ue,`lean_left`);async function We(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(We,`lean_right`);function Ge(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let a=t.insert(`g`).attr(`class`,E(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=S.svg(a),d=g(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=D(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),T(n,m),n.intersect=function(t){return e.info(`lightningBolt intersect`,n,t),W.polygon(n,l,t)},a}t(Ge,`lightningBolt`);var Ke=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),qe=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),Je=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ye=10,Xe=10;async function Ze(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,o=t.look===`neo`?16:i,s=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-o,t.width<Xe&&(t.width=Xe);let n=e/2/(2.5+e/50);t.height=(t.height??0)-s-n*3,t.height<Ye&&(t.height=Ye)}let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+o*2,f=d/2,p=f/(2.5+d/50),m=(t?.height?t?.height:l.height)+p+s*2,h=m*.1,v,{cssStyles:y}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=qe(0,0,d,m,f,p,h),r=Je(0,p,d,m,f,p),i=g(t,{}),a=e.path(n,i),o=e.path(r,i);c.insert(()=>o,`:first-child`).attr(`class`,`line`),v=c.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=Ke(0,0,d,m,f,p,h);v=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,a(y)).attr(`style`,r)}return v.attr(`label-offset-y`,p),v.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),T(t,v),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+p-(l.y-(l.top??0))})`),t.intersect=function(e){let n=W.rect(t,e),r=n.x-(t.x??0);if(f!=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-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}t(Ze,`linedCylinder`);async function Qe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=S.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...O(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),T(t,x),t.intersect=function(e){return W.polygon(t,y,e)},s}t(Qe,`linedWaveEdgedRect`);async function $e(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,v=-m/2,{cssStyles:y}=t,b=S.svg(c),x=g(t,{}),w=[{x:h-s,y:v+s},{x:h-s,y:v+m+s},{x:h+p-s,y:v+m+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v+m-s},{x:h+p+s,y:v+m-s},{x:h+p+s,y:v-s},{x:h+s,y:v-s},{x:h+s,y:v},{x:h,y:v},{x:h,y:v+s}],O=[{x:h,y:v+s},{x:h+p-s,y:v+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v},{x:h,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let k=D(w),j=b.path(k,x),M=D(O),N=b.path(M,x);t.look!==`handDrawn`&&(j=A(j),N=A(N));let P=c.insert(`g`,`:first-child`);return P.insert(()=>j),P.insert(()=>N),P.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),T(t,P),t.intersect=function(e){return W.polygon(t,w,e)},c}t($e,`multiRect`);async function et(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,v=-m/2,{cssStyles:y}=t,b=O(h-10,v+m+10,h+d-10,v+m+10,p,.8),x=b?.[b.length-1],w=[{x:h-10,y:v+10},{x:h-10,y:v+m+10},...b,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:v-10},{x:h+10,y:v-10},{x:h+10,y:v},{x:h,y:v},{x:h,y:v+10}],k=[{x:h,y:v+10},{x:h+d-10,y:v+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:v},{x:h,y:v}],A=S.svg(i),j=g(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let M=D(w),N=A.path(M,j),P=D(k),F=A.path(P,j),I=i.insert(()=>N,`:first-child`);return I.insert(()=>F),I.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,r),I.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),T(t,I),t.intersect=function(e){return W.polygon(t,w,e)},i}t(et,`multiWaveEdgedRectangle`);async function tt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r,t.useHtmlLabels||l(u())||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await C(e,t,E(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),d=Math.max(o.height+(t.padding??0)*2,t?.height??0),f=-c/2,p=-d/2,{cssStyles:m}=t,h=S.svg(a),v=g(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=h.rectangle(f,p,c,d,v),b=a.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),s.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),T(t,b),t.intersect=function(e){return W.rect(t,e)},a}t(tt,`note`);var nt=t((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function rt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=S.svg(i),n=g(t,{}),r=nt(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),T(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=W.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}t(rt,`question`);async function it(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width??c.width)+(t.look===`neo`?a*2:a),d=(t?.height??c.height)+(t.look===`neo`?o*2:o),f=-u/2,p=-d/2,m=p/2,h=[{x:f+m,y:p},{x:f,y:0},{x:f+m,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:v}=t,y=S.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=D(h),w=y.path(x,b),O=s.insert(()=>w,`:first-child`);return O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-m/2},0)`),l.attr(`transform`,`translate(${-m/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,h,e)},s}t(it,`rect_left_inv_arrow`);async function at(t,r){let{labelStyles:i,nodeStyles:a}=_(r);r.labelStyle=i;let o;o=r.cssClasses?`node `+r.cssClasses:`node default`;let s=t.insert(`g`).attr(`class`,o).attr(`id`,r.domId||r.id),c=s.insert(`g`),u=s.insert(`g`).attr(`class`,`label`).attr(`style`,a),d=r.description,p=r.label,m=await M(u,p,r.labelStyle,!0,!0),h={width:0,height:0};if(l(f())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}e.info(`Text 2`,d);let v=d||[],y=m.getBBox(),b=await M(u,Array.isArray(v)?v.join(`<br/>`):v,r.labelStyle,!0,!0),x=b.children[0],C=n(b);h=x.getBoundingClientRect(),C.attr(`width`,h.width),C.attr(`height`,h.height);let w=(r.padding||0)/2;n(b).attr(`transform`,`translate( `+(h.width>y.width?0:(y.width-h.width)/2)+`, `+(y.height+w+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<y.width?0:-(y.width-h.width)/2)+`, 0)`),h=u.node().getBBox(),u.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-w+3)+`)`);let E=h.width+(r.padding||0),D=h.height+(r.padding||0),O=-h.width/2-w,k=-h.height/2-w,A,j;if(r.look===`handDrawn`){let t=S.svg(s),n=g(r,{}),i=t.path(N(O,k,E,D,r.rx||0),n),a=t.line(-h.width/2-w,-h.height/2-w+y.height+w,h.width/2+w,-h.height/2-w+y.height+w,n);j=s.insert(()=>(e.debug(`Rough node insert CXC`,i),a),`:first-child`),A=s.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`)}else A=c.insert(`rect`,`:first-child`),j=c.insert(`line`),A.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-w).attr(`y`,-h.height/2-w).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),j.attr(`class`,`divider`).attr(`x1`,-h.width/2-w).attr(`x2`,h.width/2+w).attr(`y1`,-h.height/2-w+y.height+w).attr(`y2`,-h.height/2-w+y.height+w);return T(r,A),r.intersect=function(e){return W.rect(r,e)},s}t(at,`rectWithTitle`);async function ot(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ce(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}t(ot,`roundedRect`);var Z=8;async function st(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,o=t.look===`neo`?12:t.padding??0,{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width??c.width)+i*2+(t.look===`neo`?Z:Z*2),d=(t?.height??c.height)+o*2,f=u-Z,p=d,m=Z-u/2,h=-d/2,{cssStyles:v}=t,y=S.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m+f,y:h},{x:m+f,y:h+p},{x:m-Z,y:h+p},{x:m-Z,y:h},{x:m,y:h},{x:m,y:h+p}],w=y.polygon(x.map(e=>[e.x,e.y]),b),D=s.insert(()=>w,`:first-child`);return D.attr(`class`,`basic label-container outer-path`).attr(`style`,a(v)),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),l.attr(`transform`,`translate(${Z/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,D),t.intersect=function(e){return W.rect(t,e)},s}t(st,`shadedProcess`);async function ct(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:v}=t,y=S.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],w=D(x),O=y.path(w,b),k=s.insert(()=>O,`:first-child`);return k.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,r),k.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),T(t,k),t.intersect=function(e){return W.polygon(t,x,e)},s}t(ct,`slopedRect`);async function lt(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Ce(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}t(lt,`squareRect`);async function ut(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=S.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...k(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...k(u/2-d,0,d,50,270,450)],v=D(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),T(t,b),t.intersect=function(e){return W.polygon(t,h,e)},s}t(ut,`stadium`);async function dt(e,t){return Ce(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}t(dt,`state`);function ft(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=S.svg(u),f=g(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,v=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;y.attr(`style`,`filter:url(#${n})`)}return T(t,y),t.intersect=function(e){return W.circle(t,(t.width??0)/2,e)},u}t(ft,`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=S.svg(a).circle(0,0,t.width,v(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return T(t,o),t.intersect=function(e){return W.circle(t,(t.width??7)/2,e)},a}t(pt,`stateStart`);var mt=8;async function ht(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t?.padding??8,o=t.look===`neo`?28:i,s=t.look===`neo`?12:i,{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.width??l.width)+2*mt+o,d=(t?.height??l.height)+s,f=u-2*mt,p=d,m=-u/2,h=-d/2,v=[{x:0,y:0},{x:f,y:0},{x:f,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:f+8,y:0},{x:f+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look===`handDrawn`){let e=S.svg(c),n=g(t,{}),r=e.rectangle(m,h,f+16,p,n),i=e.line(m+mt,h,m+mt,h+p,n),o=e.line(m+mt+f,h,m+mt+f,h+p,n);c.insert(()=>i,`:first-child`),c.insert(()=>o,`:first-child`);let s=c.insert(()=>r,`:first-child`),{cssStyles:l}=t;s.attr(`class`,`basic label-container`).attr(`style`,a(l)),T(t,s)}else{let e=q(c,f,p,v);r&&e.attr(`style`,r),T(t,e)}return t.intersect=function(e){return W.polygon(t,v,e)},c}t(ht,`subroutine`);var gt=.2;async function _t(e,t){let{labelStyles:n,nodeStyles:r}=_(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-gt*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height?t?.height:c.height)+o*2,u=gt*l,d=gt*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:v}=t,y=S.svg(s),b=g(t,{}),x=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],w=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let O=D(x),k=y.path(O,b),A=D(w),j=y.path(A,{...b,fillStyle:`solid`}),M=s.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),T(t,M),t.intersect=function(e){return W.polygon(t,x,e)},s}t(_t,`taggedRect`);async function vt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=S.svg(i),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...O(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...O(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],w=D(v),k=m.path(w,h),A=D(x),j=m.path(A,{...h,fillStyle:`solid`}),M=i.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),T(t,M),t.intersect=function(e){return W.polygon(t,v,e)},i}t(vt,`taggedWaveEdgedRectangle`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),T(t,u),t.intersect=function(e){return W.rect(t,e)},i}t(yt,`text`);var bt=t((e,t,n,r,i,a)=>`M${e},${t}
|
|
3
|
+
a${i},${a} 0,0,1 0,${-r}
|
|
4
|
+
l${n},0
|
|
5
|
+
a${i},${a} 0,0,1 0,${r}
|
|
6
|
+
M${n},${-r}
|
|
7
|
+
a${i},${a} 0,0,0 0,${r}
|
|
8
|
+
l${-n},0`,`createCylinderPathD`),xt=t((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),St=t((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Ct=5,wt=10;async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,o=t.look===`neo`?12:i/2;if(t.width||t.height){let e=t.height??0;t.height=(t.height??0)-o,t.height<Ct&&(t.height=Ct);let n=e/2/(2.5+e/50);t.width=(t.width??0)-o-n*3,t.width<wt&&(t.width=wt)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t.height?t.height:c.height)+o,d=u/2,f=d/(2.5+u/50),p=(t.width?t.width:c.width)+f+o,{cssStyles:m}=t,h;if(t.look===`handDrawn`){let e=S.svg(s),n=xt(0,0,p,u,f,d),r=St(0,0,p,u,f,d),i=e.path(n,g(t,{})),a=e.path(r,g(t,{fill:`none`}));h=s.insert(()=>a,`:first-child`),h=s.insert(()=>i,`:first-child`),h.attr(`class`,`basic label-container`),m&&h.attr(`style`,m)}else{let e=bt(0,0,p,u,f,d);h=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,a(m)).attr(`style`,r),h.attr(`class`,`basic label-container outer-path`),m&&h.selectAll(`path`).attr(`style`,m),r&&h.selectAll(`path`).attr(`style`,r)}return h.attr(`label-offset-x`,f),h.attr(`transform`,`translate(${-p/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-f-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,h),t.intersect=function(e){let n=W.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-f)){let i=f*f*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=f-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}t(Tt,`tiltedCylinder`);async function Et(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}t(Et,`trapezoid`);async function Dt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=S.svg(s),p=g(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{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}],h=D(m),v=f.path(h,p),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),T(t,y),t.intersect=function(e){return W.polygon(t,m,e)},s}t(Dt,`trapezoidalPentagon`);var Ot=10,kt=10;async function At(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.width=((n?.width??0)-o)/2,n.width<kt&&(n.width=kt),n.height=n?.height??0,n.height<Ot&&(n.height=Ot));let{shapeSvg:s,bbox:c,label:l}=await C(t,n,E(n)),u=d(f().flowchart?.htmlLabels),p=(n?.width?n?.width:c.width)+o,m=n?.height?n?.height:p+c.height,h=m,v=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-m}],{cssStyles:y}=n,b=S.svg(s),x=g(n,{});n.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=D(v),O=b.path(w,x),k=s.insert(()=>O,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return y&&n.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,y),i&&n.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,i),n.width=p,n.height=m,T(n,k),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${m/2-(c.height+(n.padding??0)/(u?2:1)-(c.y-(c.top??0)))})`),n.intersect=function(t){return e.info(`Triangle intersect`,n,v,t),W.polygon(n,v,t)},s}t(At,`triangle`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,v=14-d,y=v>0?v/2:0,b=S.svg(c),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=[{x:-d/2-y,y:m/2},...O(-d/2-y,m/2,d/2+y,m/2,p,.8),{x:d/2+y,y:-m/2},{x:-d/2-y,y:-m/2}],k=D(w),A=b.path(k,x),j=c.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),T(t,j),t.intersect=function(e){return W.polygon(t,w,e)},c}t(jt,`waveEdgedRectangle`);async function Mt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=S.svg(s),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-l/2,y:f/2},...O(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...O(l/2,-f/2,-l/2,-f/2,d,-1)],y=D(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),T(t,x),t.intersect=function(e){return W.polygon(t,v,e)},s}t(Mt,`waveRectangle`);var Q=10;async function Nt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,v=S.svg(o),y=g(t,{}),b=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],x=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q}
|
|
9
|
+
M${p-Q},${m} L${p+d},${m}
|
|
10
|
+
M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let w=v.path(x,y),D=o.insert(()=>w,`:first-child`);return D.attr(`transform`,`translate(${Q/2}, ${Q/2})`),D.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return W.polygon(t,b,e)},o}t(Nt,`windowPane`);var Pt=new Set([`redux-color`,`redux-dark-color`]),Ft=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function It(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:a,themeVariables:o}=u(),{rowEven:s,rowOdd:c,nodeBorder:l,borderColorArray:f}=o;if(t.look===`handDrawn`){let{themeVariables:n}=u(),{background:r}=n;await It(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let p=u();t.useHtmlLabels=p.htmlLabels;let m=p.er?.diagramPadding??10,h=p.er?.entityPadding??6,{cssStyles:v}=t,{labelStyles:y,nodeStyles:b}=_(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:m,labelPaddingY:m*1.5,classes:``};i(t.label,p)+n.labelPaddingX*2<p.er.minEntityWidth&&(t.width=p.er.minEntityWidth);let o=await Ce(e,t,n);if(a!=null&&Pt.has(a)){let e=r.colorIndex??0;o.attr(`data-color-id`,`color-${e%f.length}`)}if(!d(p.htmlLabels)){let e=o.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return o}p.htmlLabels||(m*=1.25,h*=1.25);let x=E(t);x||=`node default`;let C=e.insert(`g`).attr(`class`,x).attr(`id`,t.domId||t.id),w=await Lt(C,t.label??``,p,0,0,[`name`],y);w.height+=h;let D=0,O=[],k=[],A=0,j=0,M=0,N=0,P=!0,F=!0;for(let e of r.attributes){let t=await Lt(C,e.type,p,0,D,[`attribute-type`],y);A=Math.max(A,t.width+m);let n=await Lt(C,e.name,p,0,D,[`attribute-name`],y);j=Math.max(j,n.width+m);let r=await Lt(C,e.keys.join(),p,0,D,[`attribute-keys`],y);M=Math.max(M,r.width+m);let i=await Lt(C,e.comment,p,0,D,[`attribute-comment`],y);N=Math.max(N,i.width+m);let a=Math.max(t.height,n.height,r.height,i.height)+h;k.push({yOffset:D,rowHeight:a}),D+=a}let I=4;M<=m&&(P=!1,M=0,I--),N<=m&&(F=!1,N=0,I--);let ee=C.node().getBBox();if(w.width+m*2-(A+j+M+N)>0){let e=w.width+m*2-(A+j+M+N);A+=e/I,j+=e/I,M>0&&(M+=e/I),N>0&&(N+=e/I)}let te=A+j+M+N,L=S.svg(C),R=g(t,{});t.look!==`handDrawn`&&(R.roughness=0,R.fillStyle=`solid`);let ne=0;k.length>0&&(ne=k.reduce((e,t)=>e+(t?.rowHeight??0),0));let z=Math.max(ee.width+m*2,t?.width||0,te),B=Math.max((ne??0)+w.height,t?.height||0),V=-z/2,H=-B/2;if(C.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=A:i.attr(`class`).includes(`attribute-keys`)?o+=A+j:i.attr(`class`).includes(`attribute-comment`)&&(o+=A+j+M))}i.attr(`transform`,`translate(${V+m/2+o}, ${s+H+w.height+h/2})`)}),C.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(H+h/2)+`)`),a!=null&&Pt.has(a)){let e=r.colorIndex??0;C.attr(`data-color-id`,`color-${e%f.length}`)}let re=L.rectangle(V,H,z,B,R),ie=C.insert(()=>re,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));O.push(0);for(let[e,t]of k.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=L.rectangle(V,w.height+H+t?.yOffset,z,t?.rowHeight,{...R,fill:n?s:c,stroke:l});C.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let U=1e-4,G=Rt(V,w.height+H,z+V,w.height+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R);if(C.insert(()=>K).attr(`class`,`divider`),G=Rt(A+V,w.height+H,A+V,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`),P){let e=A+j+V;G=Rt(e,w.height+H,e,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}if(F){let e=A+j+M+V;G=Rt(e,w.height+H,e,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}for(let e of O){let t=w.height+H+e;G=Rt(V,t,z+V,t,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}if(T(t,ie),b&&t.look!==`handDrawn`)if(a!=null&&Ft.has(a))C.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);C.selectAll(`path`).attr(`style`,e??``),C.selectAll(`.row-rect-even path`).attr(`style`,b)}return t.intersect=function(e){return W.rect(t,e)},C}t(It,`erBox`);async function Lt(e,t,r,a=0,o=0,s=[],l=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${a}, ${o})`).attr(`style`,l);t!==c(t)&&(t=c(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let f=u.node().appendChild(await b(u,t,{width:i(t,r)+100,style:l,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=f.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let p=f.getBBox();if(d(r.htmlLabels)){let e=f.children[0];e.style.textAlign=`start`;let t=n(f);p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}return p}t(Lt,`addText`);function Rt(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}t(Rt,`lineToPolygon`);async function zt(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Bt(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Bt(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 Bt(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 Bt(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}t(zt,`textHelper`);async function Bt(e,a,c,l=[]){let f=e.insert(`g`).attr(`class`,`label`).attr(`style`,l.join(`; `)),p=u(),m=`useHtmlLabels`in a?a.useHtmlLabels:d(p.htmlLabels)??!0,h=``;h=`text`in a?a.text:a.label,!m&&h.startsWith(`\\`)&&(h=h.substring(1)),o(h)&&(m=!0);let g=await b(f,s(r(h)),{width:i(h,p)+50,classes:`markdown-node-label`,useHtmlLabels:m},p),_,v=1;if(m){let e=g.children[0],r=n(g);v=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(v+=e.innerHTML.split(`<mrow>`).length-1);let i=e.getElementsByTagName(`img`);if(i){let e=h.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...i].map(n=>new Promise(r=>{function i(){if(n.style.display=`flex`,n.style.flexDirection=`column`,e){let e=p.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,t=parseInt(e,10)*5+`px`;n.style.minWidth=t,n.style.maxWidth=t}else n.style.width=`100%`;r(n)}t(i,`setupImage`),setTimeout(()=>{n.complete&&i()}),n.addEventListener(`error`,i),n.addEventListener(`load`,i)})))}_=e.getBoundingClientRect(),r.attr(`width`,_.width),r.attr(`height`,_.height)}else{l.includes(`font-weight: bolder`)&&n(g).selectAll(`tspan`).attr(`font-weight`,``),v=g.children.length;let e=g.children[0];(g.textContent===``||g.textContent.includes(`>`))&&(e.textContent=h[0]+h.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),h[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),_=g.getBBox()}return f.attr(`transform`,`translate(0,`+(-_.height/(2*v)+c)+`)`),_.height}t(Bt,`addText`);async function Vt(e,t){let r=f(),{themeVariables:i}=r,{useGradient:a}=i,o=r.class.padding??12,s=o,c=t.useHtmlLabels??d(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];let{shapeSvg:u,bbox:p}=await zt(e,t,r,c,s),{labelStyles:m,nodeStyles:h}=_(t);t.labelStyle=m,t.cssStyles=l.styles||``;let v=l.styles?.join(`;`)||h||``;t.cssStyles||=v.replaceAll(`!important`,``).split(`;`);let y=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,b=S.svg(u),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let C=Math.max(t.width??0,p.width),w=Math.max(t.height??0,p.height),E=(t.height??0)>p.height;l.members.length===0&&l.methods.length===0?w+=s:l.members.length>0&&l.methods.length===0&&(w+=s*2);let D=-C/2,O=-w/2,k=y?o*2:l.members.length===0&&l.methods.length===0?-o:0;E&&(k=o*2);let A=b.rectangle(D-o,O-o-(y?o:l.members.length===0&&l.methods.length===0?-o/2:0),C+2*o,w+2*o+k,x),j=u.insert(()=>A,`:first-child`);j.attr(`class`,`basic label-container outer-path`);let M=j.node().getBBox(),N=u.select(`.annotation-group`).node().getBBox().height-(y?o/2:0)||0,P=u.select(`.label-group`).node().getBBox().height-(y?o/2:0)||0,F=u.select(`.members-group`).node().getBBox().height-(y?o/2:0)||0,I=(N+P+O+o-(O-o-(y?o:l.members.length===0&&l.methods.length===0?-o/2:0)))/2;if(u.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),d=a.attr(`transform`),f=0;if(d){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(d);e&&(f=parseFloat(e[2]))}let p=f+O+o-(y?o:l.members.length===0&&l.methods.length===0?-o/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(F,s/2);p=E?Math.max(I,N+P+e+O+s*2+o)+s*2:N+P+e+O+s*4+o}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(p=l.annotations.length>0?f-s:f),c||(p-=4);let m=D;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(m=-a.node()?.getBBox().width/2||0,u.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),a.attr(`transform`,`translate(${m}, ${p})`)}),l.members.length>0||l.methods.length>0||y){let e=N+P+O+o,n=b.line(M.x,e,M.x+M.width,e+.001,x);u.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,v)}if(y||l.members.length>0||l.methods.length>0){let e=N+P+F+O+s*2+o,n=b.line(M.x,E?Math.max(I,e):e,M.x+M.width,(E?Math.max(I,e):e)+.001,x);u.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!a?` neo-line`:``}`).attr(`style`,v)}if(l.look!==`handDrawn`&&u.selectAll(`path`).attr(`style`,v),j.select(`:nth-child(2)`).attr(`style`,v),u.selectAll(`.divider`).select(`path`).attr(`style`,v),t.labelStyle?u.selectAll(`span`).attr(`style`,t.labelStyle):u.selectAll(`span`).attr(`style`,v),!c){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);u.selectAll(`tspan`).attr(`style`,e)}else if(m){let t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);u.selectAll(`tspan`).attr(`style`,e)}}}return T(t,j),t.intersect=function(e){return W.rect(t,e)},u}t(Vt,`classBox`);async function Ht(e,t){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=E(t),{themeVariables:l}=f(),{borderColorArray:u,requirementEdgeLabelBackground:d}=l,p=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),m;m=s?await $(p,`<<${a.type}>>`,0,t.labelStyle):await $(p,`<<Element>>`,0,t.labelStyle);let h=m,v=await $(p,a.name,h,t.labelStyle+`; font-weight: bold;`);if(h+=v+20,s){let e=await $(p,`${a.requirementId?`ID: ${a.requirementId}`:``}`,h,t.labelStyle);h+=e;let n=await $(p,`${a.text?`Text: ${a.text}`:``}`,h,t.labelStyle);h+=n;let r=await $(p,`${a.risk?`Risk: ${a.risk}`:``}`,h,t.labelStyle);h+=r,await $(p,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,h,t.labelStyle)}else{let e=await $(p,`${o.type?`Type: ${o.type}`:``}`,h,t.labelStyle);h+=e,await $(p,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,h,t.labelStyle)}let y=(p.node()?.getBBox().width??200)+20,b=(p.node()?.getBBox().height??200)+20,x=-y/2,C=-b/2,w=S.svg(p),D=g(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=w.rectangle(x,C,y,b,D),k=p.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),u?.length){let e=t.colorIndex??0;p.attr(`data-color-id`,`color-${e%u.length}`)}if(p.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-b/2,l=x+20/2;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),h>m+v+20){let e=C+m+v+20,n;if(t.look===`neo`){let t=.001,r=[[x,e],[x+y,e],[x+y,e+t],[x,e+t]];n=w.polygon(r,D)}else n=w.line(x,e,x+y,e,D);p.insert(()=>n).attr(`class`,`divider`)}return T(t,k),t.intersect=function(e){return W.rect(t,e)},i&&t.look!==`handDrawn`&&(d||u?.length)&&p.selectAll(`path`).attr(`style`,i),p}t(Ht,`requirementBox`);async function $(e,t,a,o=``){if(t===``)return 0;let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o),l=f(),u=l.htmlLabels??!0,d=await b(c,s(r(t)),{width:i(t,l)+50,classes:`markdown-node-label`,useHtmlLabels:u,style:o},l),p;if(u){let e=d.children[0],t=n(d);p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)o&&t.setAttribute(`style`,o);p=d.getBBox(),p.height+=6}return c.attr(`transform`,`translate(${-p.width/2},${-p.height/2+a})`),p.height}t($,`addText`);var Ut=t(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function Wt(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await w(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await w(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:v}=await w(o,`assigned`in t&&t.assigned||``,f);t.width=a;let y=t?.width||0,b=Math.max(m.height,v.height)/2,x=Math.max(s.height+20,t?.height||0)+b,D=-y/2,O=-x/2;c.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+y/2-v.width-20)+`, `+(-b+s.height/2)+`)`);let k,{rx:A,ry:j}=t,{cssStyles:M}=t;if(t.look===`handDrawn`){let e=S.svg(o),n=g(t,{}),r=A||j?e.path(N(D,O,y,x,A||0),n):e.rectangle(D,O,y,x,n);k=o.insert(()=>r,`:first-child`),k.attr(`class`,`basic label-container`).attr(`style`,M||null)}else{k=o.insert(`rect`,`:first-child`),k.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,A??5).attr(`ry`,j??5).attr(`x`,D).attr(`y`,O).attr(`width`,y).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=D+2,r=O+Math.floor((A??0)/2),i=O+x-Math.floor((A??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Ut(e))}}return T(t,k),t.height=x,t.intersect=function(e){return W.rect(t,e)},o}t(Wt,`kanbanItem`);async function Gt(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:o,bbox:s,halfPadding:c,label:l}=await C(t,n,E(n)),u=s.width+10*c,d=s.height+8*c,f=.15*u,{cssStyles:p}=n,m=s.width+20,h=s.height+20,v=Math.max(u,m),y=Math.max(d,h);l.attr(`transform`,`translate(${-s.width/2}, ${-s.height/2})`);let b,x=`M0 0
|
|
11
|
+
a${f},${f} 1 0,0 ${v*.25},${-1*y*.1}
|
|
12
|
+
a${f},${f} 1 0,0 ${v*.25},0
|
|
13
|
+
a${f},${f} 1 0,0 ${v*.25},0
|
|
14
|
+
a${f},${f} 1 0,0 ${v*.25},${y*.1}
|
|
15
|
+
|
|
16
|
+
a${f},${f} 1 0,0 ${v*.15},${y*.33}
|
|
17
|
+
a${f*.8},${f*.8} 1 0,0 0,${y*.34}
|
|
18
|
+
a${f},${f} 1 0,0 ${-1*v*.15},${y*.33}
|
|
19
|
+
|
|
20
|
+
a${f},${f} 1 0,0 ${-1*v*.25},${y*.15}
|
|
21
|
+
a${f},${f} 1 0,0 ${-1*v*.25},0
|
|
22
|
+
a${f},${f} 1 0,0 ${-1*v*.25},0
|
|
23
|
+
a${f},${f} 1 0,0 ${-1*v*.25},${-1*y*.15}
|
|
24
|
+
|
|
25
|
+
a${f},${f} 1 0,0 ${-1*v*.1},${-1*y*.33}
|
|
26
|
+
a${f*.8},${f*.8} 1 0,0 0,${-1*y*.34}
|
|
27
|
+
a${f},${f} 1 0,0 ${v*.1},${-1*y*.33}
|
|
28
|
+
H0 V0 Z`;if(n.look===`handDrawn`){let e=S.svg(o),t=g(n,{}),r=e.path(x,t);b=o.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,a(p))}else b=o.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-v/2}, ${-y/2})`),T(n,b),n.calcIntersect=function(e,t){return W.rect(e,t)},n.intersect=function(t){return e.info(`Bang intersect`,n,t),W.rect(n,t)},o}t(Gt,`bang`);async function Kt(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:o,bbox:s,halfPadding:c,label:l}=await C(t,n,E(n)),u=s.width+2*c,d=s.height+2*c,f=.15*u,p=.25*u,m=.35*u,h=.2*u,{cssStyles:v}=n,y,b=`M0 0
|
|
29
|
+
a${f},${f} 0 0,1 ${u*.25},${-1*u*.1}
|
|
30
|
+
a${m},${m} 1 0,1 ${u*.4},${-1*u*.1}
|
|
31
|
+
a${p},${p} 1 0,1 ${u*.35},${u*.2}
|
|
32
|
+
|
|
33
|
+
a${f},${f} 1 0,1 ${u*.15},${d*.35}
|
|
34
|
+
a${h},${h} 1 0,1 ${-1*u*.15},${d*.65}
|
|
35
|
+
|
|
36
|
+
a${p},${f} 1 0,1 ${-1*u*.25},${u*.15}
|
|
37
|
+
a${m},${m} 1 0,1 ${-1*u*.5},0
|
|
38
|
+
a${f},${f} 1 0,1 ${-1*u*.25},${-1*u*.15}
|
|
39
|
+
|
|
40
|
+
a${f},${f} 1 0,1 ${-1*u*.1},${-1*d*.35}
|
|
41
|
+
a${h},${h} 1 0,1 ${u*.1},${-1*d*.65}
|
|
42
|
+
H0 V0 Z`;if(n.look===`handDrawn`){let e=S.svg(o),t=g(n,{}),r=e.path(b,t);y=o.insert(()=>r,`:first-child`),y.attr(`class`,`basic label-container`).attr(`style`,a(v))}else y=o.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return l.attr(`transform`,`translate(${-s.width/2}, ${-s.height/2})`),y.attr(`transform`,`translate(${-u/2}, ${-d/2})`),T(n,y),n.calcIntersect=function(e,t){return W.rect(e,t)},n.intersect=function(t){return e.info(`Cloud intersect`,n,t),W.rect(n,t)},o}t(Kt,`cloud`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await C(e,t,E(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
|
|
43
|
+
M${-c/2} ${l/2-5}
|
|
44
|
+
v${-l+10}
|
|
45
|
+
q0,-5 5,-5
|
|
46
|
+
h${c-10}
|
|
47
|
+
q5,0 5,5
|
|
48
|
+
v${l-5}
|
|
49
|
+
H${-c/2}
|
|
50
|
+
Z
|
|
51
|
+
`:`
|
|
52
|
+
M${-c/2} ${l/2-5}
|
|
53
|
+
v${-l+10}
|
|
54
|
+
q0,-5 5,-5
|
|
55
|
+
h${c-10}
|
|
56
|
+
q5,0 5,5
|
|
57
|
+
v${l-10}
|
|
58
|
+
q0,5 -5,5
|
|
59
|
+
h${-(c-10)}
|
|
60
|
+
q-5,0 -5,-5
|
|
61
|
+
Z
|
|
62
|
+
`;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let d=i.append(`path`).attr(`id`,t.domId).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),T(t,d),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return W.rect(t,e)},i}t(qt,`defaultMindmapNode`);async function Jt(e,t){return ue(e,t,{padding:t.padding??0})}t(Jt,`mindmapCircle`);var Yt=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:lt},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:ot},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:ut},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:ht},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:Se},{semanticName:`Data Store`,name:`Data Store`,shortName:`datastore`,description:`Data flow diagram data store`,aliases:[`data-store`],handler:we},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:ue},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Gt},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:Kt},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:rt},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:Pe},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:We},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:Ue},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:Et},{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:Ve},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:Ee},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:yt},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:ce},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:st},{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:ft},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:je},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:Fe},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:pe},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:me},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:he},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:Ge},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:jt},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:Me},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:Tt},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:Ze},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:ge},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Te},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:At},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:Nt},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:De},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:Dt},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:Ae},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:ct},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:et},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:$e},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:oe},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:fe},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:vt},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:_t},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:Mt},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:it},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:Qe}],Xt=t(()=>{let e=[...Object.entries({state:dt,choice:le,note:tt,rectWithTitle:at,labelRect:He,iconSquare:ze,iconCircle:Le,icon:Ie,iconRounded:Re,imageSquare:Be,anchor:G,kanbanItem:Wt,mindmapCircle:Jt,defaultMindmapNode:qt,classBox:Vt,erBox:It,requirementBox:Ht}),...Yt.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 Zt(e){return e in Xt}t(Zt,`isValidShape`);var Qt=new Map;async function $t(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let o=t.shape?Xt[t.shape]:void 0;if(!o)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;n.config.securityLevel===`sandbox`?a=`_top`:t.linkTarget&&(a=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,a??null),i=await o(r,t,n)}else i=await o(e,t,n),r=i;return r.attr(`data-look`,a(t.look)),t.tooltip&&i.attr(`title`,t.tooltip),Qt.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}t($t,`insertNode`);var en=t((e,t)=>{Qt.set(t.id,e)},`setNodeElem`),tn=t(()=>{Qt.clear()},`clear`),nn=t(t=>{let n=Qt.get(t.id);e.trace(`Transforming node`,t.diff,t,`translate(`+(t.x-t.width/2-5)+`, `+t.width/2+`)`);let r=t.diff||0;return t.clusterNode?n.attr(`transform`,`translate(`+(t.x+r-t.width/2)+`, `+(t.y-t.height/2-8)+`)`):n.attr(`transform`,`translate(`+t.x+`, `+t.y+`)`),r},`positionNode`);export{$t as a,nn as c,ee as i,en as l,tn as n,Zt as o,M as r,C as s,te as t,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./src--c83fjKW.js";function t(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}e(t,`populateCommonDb`);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,g as n,l as r,n as i,r as a,t as o,v as s,y as c}from"./chunk-NNHCCRGN-DSaPFNsL.js";var l=class extends o{static{n(this,`ArchitectureTokenBuilder`)}constructor(){super([`architecture`])}},u=class extends i{static{n(this,`ArchitectureValueConverter`)}runCustomConverter(e,t,n){if(e.name===`ARCH_ICON`)return t.replace(/[()]/g,``).trim();if(e.name===`ARCH_TEXT_ICON`)return t.replace(/["()]/g,``);if(e.name===`ARCH_TITLE`){let e=t.replace(/^\[|]$/g,``).trim();return(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))&&(e=e.slice(1,-1),e=e.replace(/\\"/g,`"`).replace(/\\'/g,`'`)),e.trim()}}},d={parser:{TokenBuilder:n(()=>new l,`TokenBuilder`),ValueConverter:n(()=>new u,`ValueConverter`)}};function f(n=t){let i=c(s(n),r),o=c(e({shared:i}),a,d);return i.ServiceRegistry.register(o),{shared:i,Architecture:o}}n(f,`createArchitectureServices`);export{f as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./src--c83fjKW.js";var n=e((e,n)=>{let r;return n===`sandbox`&&(r=t(`#i`+e)),t(n===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${e}"]`)},`getDiagramElement`);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,c as n,g as r,i,l as a,t as o,v as s,y as c}from"./chunk-NNHCCRGN-DSaPFNsL.js";var l=class extends o{static{r(this,`InfoTokenBuilder`)}constructor(){super([`info`,`showInfo`])}},u={parser:{TokenBuilder:r(()=>new l,`TokenBuilder`),ValueConverter:r(()=>new i,`ValueConverter`)}};function d(r=t){let i=c(s(r),a),o=c(e({shared:i}),n,u);return i.ServiceRegistry.register(o),{shared:i,Info:o}}r(d,`createInfoServices`);export{d as n,u as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,r as t,t as n}from"./src--c83fjKW.js";import{t as r}from"./dist-Cz_gOj_F.js";import{R as i,h as a,p as o,r as s,s as c}from"./chunk-CSCIHK7Q-BmRiMG-E.js";function l(e){this._context=e}l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function u(e){return new l(e)}var d=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function f(e){return new d(e,!0)}function ee(e){return new d(e,!1)}function p(){}function m(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function h(e){this._context=e}h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:m(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function te(e){return new h(e)}function ne(e){this._context=e}ne.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function re(e){return new ne(e)}function ie(e){this._context=e}ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ae(e){return new ie(e)}function oe(e,t){this._basis=new h(e),this._beta=t}oe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var se=(function e(t){function n(e){return t===1?new h(e):new oe(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function g(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _(e,t){this._context=e,this._k=(1-t)/6}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:g(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:g(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ce=(function e(t){function n(e){return new _(e,t)}return n.tension=function(t){return e(+t)},n})(0);function v(e,t){this._context=e,this._k=(1-t)/6}v.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:g(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var le=(function e(t){function n(e){return new v(e,t)}return n.tension=function(t){return e(+t)},n})(0);function y(e,t){this._context=e,this._k=(1-t)/6}y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:g(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ue=(function e(t){function n(e){return new y(e,t)}return n.tension=function(t){return e(+t)},n})(0);function b(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function de(e,t){this._context=e,this._alpha=t}de.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:b(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var fe=(function e(t){function n(e){return t?new de(e,t):new _(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function pe(e,t){this._context=e,this._alpha=t}pe.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:b(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var me=(function e(t){function n(e){return t?new pe(e,t):new v(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function he(e,t){this._context=e,this._alpha=t}he.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:b(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ge=(function e(t){function n(e){return t?new he(e,t):new y(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function _e(e){this._context=e}_e.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ve(e){return new _e(e)}function ye(e){return e<0?-1:1}function be(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(ye(a)+ye(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function x(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function S(e){this._context=e}S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:x(this,this._t0,xe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,x(this,xe(this,n=be(this,e,t)),n);break;default:x(this,this._t0,n=be(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Se(e){this._context=new Ce(e)}(Se.prototype=Object.create(S.prototype)).point=function(e,t){S.prototype.point.call(this,t,e)};function Ce(e){this._context=e}Ce.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function we(e){return new S(e)}function Te(e){return new Se(e)}function Ee(e){this._context=e}Ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=De(e),i=De(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function De(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Oe(e){return new Ee(e)}function C(e,t){this._context=e,this._t=t}C.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function w(e){return new C(e,.5)}function T(e){return new C(e,0)}function ke(e){return new C(e,1)}function Ae(e){return Number.isSafeInteger(e)&&e>=0}function je(e){return e!=null&&typeof e!=`function`&&Ae(e.length)}function Me(e){return e===`__proto__`}function E(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Ne(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function D(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Pe=`[object RegExp]`,O=`[object String]`,k=`[object Number]`,A=`[object Boolean]`,j=`[object Arguments]`,Fe=`[object Symbol]`,Ie=`[object Date]`,Le=`[object Map]`,Re=`[object Set]`,ze=`[object Array]`,Be=`[object ArrayBuffer]`,Ve=`[object Object]`,He=`[object DataView]`,Ue=`[object Uint8Array]`,We=`[object Uint8ClampedArray]`,Ge=`[object Uint16Array]`,Ke=`[object Uint32Array]`,qe=`[object Int8Array]`,M=`[object Int16Array]`,Je=`[object Int32Array]`,Ye=`[object Float32Array]`,Xe=`[object Float64Array]`,Ze=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)();function N(e){return Ze.Buffer!==void 0&&Ze.Buffer.isBuffer(e)}function P(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Qe(e,t){return F(e,void 0,e,new Map,t)}function F(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(E(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=F(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,F(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(F(a,void 0,n,r,i));return t}if(N(e))return e.subarray();if(P(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=F(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),I(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),I(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),I(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,I(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),I(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),I(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),I(t,e,n,r,i),t}if(typeof e==`object`&&$e(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),I(t,e,n,r,i),t}return e}function I(e,t,n=e,r,i){let a=[...Object.keys(t),...Ne(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=F(t[s],s,n,r,i))}}function $e(e){switch(D(e)){case j:case ze:case Be:case He:case A:case Ie:case Ye:case Xe:case qe:case M:case Je:case Le:case k:case Ve:case Pe:case Re:case O:case Fe:case Ue:case We:case Ge:case Ke:return!0;default:return!1}}function et(e,t){return Qe(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(D(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),I(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case k:case O:case A:{let t=new e.constructor(e?.valueOf());return I(t,e),t}case j:{let t={};return I(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function tt(e){return et(e)}function L(e){return typeof e==`object`&&!!e&&D(e)===`[object Arguments]`}function R(e){return typeof e==`object`&&!!e}function nt(e){return R(e)&&je(e)}function z(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(z.Cache||Map),n}z.Cache=Map;function rt(){}function B(e){return P(e)}function V(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function it(e){if(E(e))return e;if(Array.isArray(e)||P(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function at(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=H(i,t,r,new Map)}return i}function H(e,t,n,r){if(E(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return it(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...Ne(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Me(o))continue;let s=t[o],c=e[o];if(L(s)&&(s={...s}),L(c)&&(c={...c}),N(s)&&(s=tt(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(nt(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||R(c)&&R(s)&&(V(c)||V(s)||B(c)||B(s))?e[o]=H(c,s,n,r):c==null&&V(s)?e[o]=H({},s,n,r):c==null&&B(s)?e[o]=tt(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function ot(e,...t){return at(e,...t,rt)}var st=r(),ct={curveBasis:te,curveBasisClosed:re,curveBasisOpen:ae,curveBumpX:f,curveBumpY:ee,curveBundle:se,curveCardinalClosed:le,curveCardinalOpen:ue,curveCardinal:ce,curveCatmullRomClosed:me,curveCatmullRomOpen:ge,curveCatmullRom:fe,curveLinear:u,curveLinearClosed:ve,curveMonotoneX:we,curveMonotoneY:Te,curveNatural:Oe,curveStep:w,curveStepAfter:ke,curveStepBefore:T},lt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ut=t(function(e,t){let n=dt(e,/(?:init\b)|(?:initialize\b)/),r={};if(Array.isArray(n)){let e=n.map(e=>e.args);i(e),r=s(r,[...e])}else r=n.args;if(!r)return;let a=o(e,t),c=`config`;return r[c]!==void 0&&(a===`flowchart-v2`&&(a=`flowchart`),r[a]=r[c],delete r[c]),r},`detectInit`),dt=t(function(t,n=null){try{let r=RegExp(`[%]{2}(?![{]${lt.source})(?=[}][%]{2}).*
|
|
2
|
+
`,`ig`);t=t.trim().replace(r,``).replace(/'/gm,`"`),e.debug(`Detecting diagram directive${n===null?``:` type:`+n} based on the text:${t}`);let i,o=[];for(;(i=a.exec(t))!==null;)if(i.index===a.lastIndex&&a.lastIndex++,i&&!n||n&&i[1]?.match(n)||n&&i[2]?.match(n)){let e=i[1]?i[1]:i[2],t=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:e,args:t})}return o.length===0?{type:t,args:null}:o.length===1?o[0]:o}catch(r){return e.error(`ERROR: ${r.message} - Unable to parse directive type: '${n}' based on the text: '${t}'`),{type:void 0,args:null}}},`detectDirective`),ft=t(function(e){return e.replace(a,``)},`removeDirectives`),pt=t(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`);function U(e,t){return e?ct[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}t(U,`interpolateToCurve`);function mt(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,st.sanitizeUrl)(n)}t(mt,`formatUrl`);var ht=t((t,...n)=>{let r=t.split(`.`),i=r.length-1,a=r[i],o=window;for(let n=0;n<i;n++)if(o=o[r[n]],!o){e.error(`Function name: ${t} not found in window`);return}o[a](...n)},`runFunc`);function W(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}t(W,`distance`);function gt(e){let t,n=0;return e.forEach(e=>{n+=W(e,t),t=e}),G(e,n/2)}t(gt,`traverseEdge`);function _t(e){return e.length===1?e[0]:gt(e)}t(_t,`calcLabelPosition`);var vt=t((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),G=t((e,t)=>{let n,r=t;for(let t of e){if(n){let e=W(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:vt((1-i)*n.x+i*t.x,5),y:vt((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),yt=t((t,n,r)=>{e.info(`our points ${JSON.stringify(n)}`),n[0]!==r&&(n=n.reverse());let i=G(n,25),a=t?10:5,o=Math.atan2(n[0].y-i.y,n[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(n[0].x+i.x)/2,s.y=-Math.cos(o)*a+(n[0].y+i.y)/2,s},`calcCardinalityPosition`);function bt(t,n,r){let i=structuredClone(r);e.info(`our points`,i),n!==`start_left`&&n!==`start_right`&&i.reverse();let a=G(i,25+t),o=10+t*.5,s=Math.atan2(i[0].y-a.y,i[0].x-a.x),c={x:0,y:0};return n===`start_left`?(c.x=Math.sin(s+Math.PI)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s+Math.PI)*o+(i[0].y+a.y)/2):n===`end_right`?(c.x=Math.sin(s-Math.PI)*o+(i[0].x+a.x)/2-5,c.y=-Math.cos(s-Math.PI)*o+(i[0].y+a.y)/2-5):n===`end_left`?(c.x=Math.sin(s)*o+(i[0].x+a.x)/2-5,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2-5):(c.x=Math.sin(s)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2),c}t(bt,`calcTerminalLabelPosition`);function K(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}t(K,`getStylesFromArray`);var xt=0,St=t(()=>(xt++,`id-`+Math.random().toString(36).substr(2,12)+`-`+xt),`generateId`);function Ct(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}t(Ct,`makeRandomHex`);var wt=t(e=>Ct(e.length),`random`),Tt=t(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),Et=t(function(e,t){let n=t.text.replace(c.lineBreakRegex,` `),[,r]=Z(t.fontSize),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.style(`text-anchor`,t.anchor),i.style(`font-family`,t.fontFamily),i.style(`font-size`,r),i.style(`font-weight`,t.fontWeight),i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.attr(`fill`,t.fill),a.text(n),i},`drawSimpleText`),Dt=z((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),c.lineBreakRegex.test(e)))return e;let r=e.split(` `).filter(Boolean),i=[],a=``;return r.forEach((e,o)=>{let s=J(`${e} `,n),c=J(a,n);if(s>t){let{hyphenatedStrings:r,remainingWord:o}=Ot(e,t,`-`,n);i.push(a,...r),a=o}else c+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(` `);o+1===r.length&&i.push(a)}),i.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),Ot=z((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let c=`${o}${e}`;if(J(c,r)>=t){let e=s+1,t=i.length===e,r=`${c}${n}`;a.push(t?c:r),o=``}else o=c}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function q(e,t){return Y(e,t).height}t(q,`calculateTextHeight`);function J(e,t){return Y(e,t).width}t(J,`calculateTextWidth`);var Y=z((e,t)=>{let{fontSize:r=12,fontFamily:i=`Arial`,fontWeight:a=400}=t;if(!e)return{width:0,height:0};let[,o]=Z(r),s=[`sans-serif`,i],l=e.split(c.lineBreakRegex),u=[],d=n(`body`);if(!d.remove)return{width:0,height:0,lineHeight:0};let f=d.append(`svg`);for(let e of s){let t=0,n={width:0,height:0,lineHeight:0};for(let r of l){let i=Tt();i.text=r||``;let s=Et(f,i).style(`font-size`,o).style(`font-weight`,a).style(`font-family`,e),c=(s._groups||s)[0][0].getBBox();if(c.width===0&&c.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,c.width)),t=Math.round(c.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}u.push(n)}return f.remove(),u[isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),kt=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{t(this,`InitIDGenerator`)}},X,At=t(function(e){return X||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),X.innerHTML=e,unescape(X.textContent)},`entityDecode`);function jt(e){return`str`in e}t(jt,`isDetailedError`);var Mt=t((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),Z=t(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`);function Q(e,t){return ot({},e,t)}t(Q,`cleanAndMerge`);var Nt={assignWithDepth:s,wrapLabel:Dt,calculateTextHeight:q,calculateTextWidth:J,calculateTextDimensions:Y,cleanAndMerge:Q,detectInit:ut,detectDirective:dt,isSubstringInArray:pt,interpolateToCurve:U,calcLabelPosition:_t,calcCardinalityPosition:yt,calcTerminalLabelPosition:bt,formatUrl:mt,getStylesFromArray:K,generateId:St,random:wt,runFunc:ht,entityDecode:At,insertTitle:Mt,isLabelCoordinateInPath:$,parseFontSize:Z,InitIDGenerator:kt},Pt=t(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),Ft=t(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),It=t((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`);function Lt(e){return e??null}t(Lt,`handleUndefinedAttr`);function $(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}t($,`isLabelCoordinateInPath`);export{fe as $,Je as A,Ke as B,ze as C,Ye as D,Ie as E,Pe as F,je as G,We as H,Re as I,w as J,ke as K,O as L,Le as M,k as N,Xe as O,Ve as P,ve as Q,Fe as R,Be as S,He as T,D as U,Ue as V,E as W,we as X,Oe as Y,Te as Z,Dt as _,Ft as a,ee as at,N as b,It as c,U as d,ce as et,jt as f,Nt as g,ft as h,Q as i,f as it,qe as j,M as k,K as l,wt as m,q as n,re as nt,Pt as o,u as ot,Z as p,T as q,J as r,te as rt,St as s,Y as t,ae as tt,Lt as u,B as v,A as w,j as x,L as y,Ge as z};
|