@hachej/boring-ui-cli 0.1.81 → 0.1.83
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/package.json +9 -9
- package/public/assets/{DebugDrawer-oHMzROCO.js → DebugDrawer-BUfAuTAi.js} +1 -1
- package/public/assets/{DiagramPane-CyriYA3p.js → DiagramPane-C0VmftGU.js} +4 -4
- package/public/assets/{abnfDiagram-VRR7QNED-ohNLyg_u.js → abnfDiagram-VRR7QNED--CNq_MQP.js} +1 -1
- package/public/assets/{architectureDiagram-ZJ3FMSHR-CQTmkARx.js → architectureDiagram-ZJ3FMSHR-BNSImHKv.js} +1 -1
- package/public/assets/{blockDiagram-677ZJIJ3-3XzAvzjt.js → blockDiagram-677ZJIJ3-M7cRMCof.js} +1 -1
- package/public/assets/{c4Diagram-LMCZKHZV-edWhL390.js → c4Diagram-LMCZKHZV-Bc-Zm78g.js} +1 -1
- package/public/assets/channel-DGmRWDZF.js +1 -0
- package/public/assets/{chunk-32BRIVSS-CfsB94-5.js → chunk-32BRIVSS-CGd9zFPr.js} +1 -1
- package/public/assets/{chunk-C7G6YPKG-DQ2TCigV.js → chunk-C7G6YPKG-BPbg-Z4N.js} +1 -1
- package/public/assets/{chunk-EX3LRPZG-Db-vlK9C.js → chunk-EX3LRPZG-BjJg8JUH.js} +1 -1
- package/public/assets/{chunk-HOUHSVGY-CdZetdWH.js → chunk-HOUHSVGY-DTZPduF8.js} +1 -1
- package/public/assets/{chunk-ICXQ74PX-BymQ2bTJ.js → chunk-ICXQ74PX-ul7urQ-O.js} +1 -1
- package/public/assets/{chunk-MOJQB5TN-BqvPlZkD.js → chunk-MOJQB5TN-DmL90VtN.js} +1 -1
- package/public/assets/{chunk-OGEWGWER-BfALDzD0.js → chunk-OGEWGWER-oC3NFfk1.js} +1 -1
- package/public/assets/{chunk-PUDLZKDR-JbrAAVP-.js → chunk-PUDLZKDR-BI0TC76C.js} +1 -1
- package/public/assets/{chunk-Q4XR5HBZ-C-kuUu1x.js → chunk-Q4XR5HBZ-BEgLgPw6.js} +1 -1
- package/public/assets/{chunk-V7JOEXUC-yEAqrHvQ.js → chunk-V7JOEXUC-Dd4DUNpE.js} +1 -1
- package/public/assets/{chunk-VR4S4FIN-C_qWc7EX.js → chunk-VR4S4FIN-DgBVcAIW.js} +1 -1
- package/public/assets/{chunk-WYO6CB5R-B30LkIxf.js → chunk-WYO6CB5R-DyuwB_K1.js} +2 -2
- package/public/assets/{chunk-ZGVPDNZ5-BGe_IigJ.js → chunk-ZGVPDNZ5-C8jJ41Go.js} +1 -1
- package/public/assets/classDiagram-OUVF2IWQ-D_o_voa0.js +1 -0
- package/public/assets/classDiagram-v2-EOCWNBFH-D_o_voa0.js +1 -0
- package/public/assets/{cynefinDiagram-TSTJHNR4-CWs6ShhJ.js → cynefinDiagram-TSTJHNR4-B8bh9Ms6.js} +1 -1
- package/public/assets/{dagre-VKFMJZFB-CXov2rB_.js → dagre-VKFMJZFB-BH5ZSRQa.js} +1 -1
- package/public/assets/{diagram-FQU43EPY-C-Bv0UXL.js → diagram-FQU43EPY-bS8zO1r5.js} +1 -1
- package/public/assets/{diagram-G47NLZAW-DWh1qY2-.js → diagram-G47NLZAW-jZPRJzlW.js} +1 -1
- package/public/assets/{diagram-NH7WQ7WH-CWI77Bey.js → diagram-NH7WQ7WH-C5NNCk6n.js} +1 -1
- package/public/assets/{diagram-OA4YK3LP-CLaeCWnA.js → diagram-OA4YK3LP-DpwLyQLV.js} +1 -1
- package/public/assets/{diagram-WEI45ONY-Dg5FwxtP.js → diagram-WEI45ONY-B3W4GWOw.js} +1 -1
- package/public/assets/{dist-Cqb7ytQh.js → dist-C0wc4-1I.js} +1 -1
- package/public/assets/{ebnfDiagram-CCIWWBDH-QEjWlfgA.js → ebnfDiagram-CCIWWBDH-DgiVMcKP.js} +1 -1
- package/public/assets/{erDiagram-Q63AITRT-DU6Xhc7O.js → erDiagram-Q63AITRT-BARwwX1c.js} +1 -1
- package/public/assets/flowDiagram-23GEKE2U-BRPoFbwd.js +1 -0
- package/public/assets/{ganttDiagram-NO4QXBWP-CBgZAEu1.js → ganttDiagram-NO4QXBWP-B7NO9SU1.js} +1 -1
- package/public/assets/{gitGraphDiagram-IHSO6WYX-8qrlkfd9.js → gitGraphDiagram-IHSO6WYX-CkYy3eMN.js} +1 -1
- package/public/assets/{highlighted-body-OFNGDK62-mSlcR2mB.js → highlighted-body-OFNGDK62-BhgLirq4.js} +1 -1
- package/public/assets/{index-FymDtfca.js → index-DR6NR8XX.js} +9 -9
- package/public/assets/{index-BlhPFh_2.css → index-UA_cHl90.css} +1 -1
- package/public/assets/{infoDiagram-FWYZ7A6U-CqrDbcNU.js → infoDiagram-FWYZ7A6U-DSxfOwgR.js} +1 -1
- package/public/assets/{ishikawaDiagram-FXEZZL3T-CarpAUkv.js → ishikawaDiagram-FXEZZL3T-IzDevevr.js} +1 -1
- package/public/assets/{journeyDiagram-5HDEW3XC-DVs-OFLg.js → journeyDiagram-5HDEW3XC-CUzKcEpw.js} +1 -1
- package/public/assets/{kanban-definition-HUTT4EX6-BShAN71B.js → kanban-definition-HUTT4EX6-BhIaDqtD.js} +1 -1
- package/public/assets/{line-CanIenkS.js → line-BE4RfLON.js} +1 -1
- package/public/assets/mermaid-GHXKKRXX-CmK9rI1x.js +1 -0
- package/public/assets/{mindmap-definition-LN4V7U3C-rH1zG95f.js → mindmap-definition-LN4V7U3C-BVd6y6cG.js} +1 -1
- package/public/assets/{pegDiagram-2B236MQR-CtnntzzM.js → pegDiagram-2B236MQR-Dc-hYwfq.js} +1 -1
- package/public/assets/{pieDiagram-ENE6RG2P-PijKQP5U.js → pieDiagram-ENE6RG2P-B6dx_Mlt.js} +1 -1
- package/public/assets/{quadrantDiagram-ABIIQ3AL-t8ifegfm.js → quadrantDiagram-ABIIQ3AL-BcfDab7J.js} +1 -1
- package/public/assets/{railroadDiagram-RFXS5EU6-Bt6KVFz7.js → railroadDiagram-RFXS5EU6-BPHd3WRa.js} +1 -1
- package/public/assets/{requirementDiagram-TGXJPOKE-CWehCVod.js → requirementDiagram-TGXJPOKE-C1uoHDhS.js} +1 -1
- package/public/assets/{sankeyDiagram-HTMAVEWB-DbzPFrEo.js → sankeyDiagram-HTMAVEWB-CzzAaY4L.js} +1 -1
- package/public/assets/{sequenceDiagram-DBY2YBRQ-7Qk6r9fv.js → sequenceDiagram-DBY2YBRQ-eHkPtR2X.js} +1 -1
- package/public/assets/{stateDiagram-2N3HPSRC-BWRPrx06.js → stateDiagram-2N3HPSRC-VpWMG6bS.js} +1 -1
- package/public/assets/stateDiagram-v2-6OUMAXLB-DwcEbRRt.js +1 -0
- package/public/assets/{swimlanes-5IMT3BWC-DDVn4DsV.js → swimlanes-5IMT3BWC-5c0pbnx8.js} +1 -1
- package/public/assets/swimlanesDiagram-G3AALYLV-BeUkKodb.js +8 -0
- package/public/assets/{timeline-definition-FHXFAJF6-CylSjaTe.js → timeline-definition-FHXFAJF6-CCOk7F-x.js} +1 -1
- package/public/assets/{vennDiagram-L72KCM5P-_WFfZyC1.js → vennDiagram-L72KCM5P-DlABH5Mp.js} +1 -1
- package/public/assets/{wardleyDiagram-EHGQE667-C_J6SBWk.js → wardleyDiagram-EHGQE667-dUgA-6W3.js} +1 -1
- package/public/assets/{xychartDiagram-FW5EYKEG-UelUGoNL.js → xychartDiagram-FW5EYKEG-CowVvrDj.js} +1 -1
- package/public/index.html +10 -10
- package/public/assets/channel-Brum6iE1.js +0 -1
- package/public/assets/classDiagram-OUVF2IWQ-D22rQfpi.js +0 -1
- package/public/assets/classDiagram-v2-EOCWNBFH-D22rQfpi.js +0 -1
- package/public/assets/flowDiagram-23GEKE2U-z73yOKZg.js +0 -1
- package/public/assets/mermaid-GHXKKRXX-DnriwlaU.js +0 -1
- package/public/assets/stateDiagram-v2-6OUMAXLB-Crmm8dd-.js +0 -1
- package/public/assets/swimlanesDiagram-G3AALYLV-CDptp1Ox.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DgGH3qgX.js";import{A as r,B as i,M as a,T as o,b as s,g as c,x as l,z as u}from"./chunk-WYO6CB5R-B30LkIxf.js";import{a as d,r as f,u as p}from"./chunk-ICXQ74PX-BymQ2bTJ.js";import{a as m,i as h,r as g,t as _}from"./chunk-C7G6YPKG-DQ2TCigV.js";import{n as v,t as y}from"./chunk-OGEWGWER-BfALDzD0.js";import{t as b}from"./chunk-HOUHSVGY-CdZetdWH.js";import{n as x}from"./chunk-Q4XR5HBZ-C-kuUu1x.js";import{t as S}from"./rough.esm-CSKSodPl.js";var C=e(async(e,t,r)=>{let i,a=t.useHtmlLabels||c(l()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),f;f=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,h=t.labelType===`markdown`,g=await x(s,u(d(f),l()),{useHtmlLabels:a,width:t.width||l().flowchart?.wrappingWidth,classes:h?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:h},l()),_=g.getBBox(),v=(t?.padding??0)/2;if(a){let e=g.children[0],t=n(g);await y(e,f),_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}return a?s.attr(`transform`,`translate(`+-_.width/2+`, `+-_.height/2+`)`):s.attr(`transform`,`translate(0, `+-_.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-_.width/2+`, `+-_.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:_,halfPadding:v,label:s}},`labelHelper`),w=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(l()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await x(a,u(d(t),l()),{useHtmlLabels:i,width:r.width||l()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=s.getBBox(),f=r.padding/2;if(o(l())){let e=s.children[0],t=n(s);c=e.getBoundingClientRect(),t.attr(`width`,c.width),t.attr(`height`,c.height)}return i?a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`):a.attr(`transform`,`translate(0, `+-c.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:c,halfPadding:f,label:a}},`insertLabel`),T=e((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),E=e((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(` `)}e(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}e(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}e(k,`generateCirclePoints`);function A(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(A,`mergePaths`);var j=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),M=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=l(),c=o(s);return await x(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`),N=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),P=e(async(e,r)=>{let i=l(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:u}=a,d=u,{labelStyles:f,nodeStyles:p,borderStyles:g,backgroundStyles:_}=h(r),v=e.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look),y=c(i.flowchart.htmlLabels),b=r.direction===`LR`,C=v.insert(`g`).attr(`class`,`cluster-label swimlane-label`),w=await x(C,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),T=w.getBBox();if(y){let e=w.children[0],t=n(w);T=e.getBoundingClientRect(),t.attr(`width`,T.width),t.attr(`height`,T.height)}let E=r.padding??0,D=r.width<=T.width+E?T.width+E:r.width;r.width<=T.width+E?r.diff=(D-r.width)/2-E:r.diff=-E;let O=r.height,k=r.y-O/2,A=r.y+O/2,M=r.x-D/2,N=r.swimlaneContentTop===void 0?k+O/3:r.swimlaneContentTop,P=b?4:0,F=T.height+2*P,I,L;if(b){let e=Math.max(F,T.height+2*P),t=M+e,n=Math.max(0,D-e);if(r.look===`handDrawn`){let i=S.svg(v),a=m(r,{roughness:.7,fill:s,stroke:d,fillWeight:3,seed:o}),c=m(r,{roughness:.7,fill:`none`,stroke:d,seed:o}),l=i.rectangle(M,k,e,O,a);I=v.insert(()=>l,`:first-child`);let u=i.rectangle(t,k,n,O,c);L=v.insert(()=>u,`:first-child`),I.select(`path:nth-child(2)`).attr(`style`,g.join(`;`)),I.select(`path`).attr(`style`,_.join(`;`).replace(`fill`,`stroke`))}else I=v.insert(`rect`,`:first-child`),L=v.insert(`rect`,`:first-child`),I.attr(`class`,`swimlane-title`).attr(`style`,p).attr(`x`,M).attr(`y`,k).attr(`width`,e).attr(`height`,O).attr(`fill`,s).attr(`stroke`,d),L.attr(`class`,`swimlane-body`).attr(`style`,p).attr(`x`,t).attr(`y`,k).attr(`width`,n).attr(`height`,O).attr(`fill`,`none`).attr(`stroke`,d);let i=M+e/2,a=r.y;C.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-T.width/2}, ${-T.height/2})`)}else{let e=Math.max(0,N-k),t=Math.min(F,e),n=k+t,i=Math.max(0,A-n),a=r.x-D/2;if(r.look===`handDrawn`){let e=S.svg(v),c=m(r,{roughness:.7,fill:s,stroke:d,fillWeight:3,seed:o}),l=m(r,{roughness:.7,fill:`none`,stroke:d,seed:o}),u=e.rectangle(a,k,D,t,c);I=v.insert(()=>u,`:first-child`);let f=e.rectangle(a,n,D,i,l);L=v.insert(()=>f,`:first-child`),I.select(`path:nth-child(2)`).attr(`style`,g.join(`;`)),I.select(`path`).attr(`style`,_.join(`;`).replace(`fill`,`stroke`))}else I=v.insert(`rect`,`:first-child`),L=v.insert(`rect`,`:first-child`),I.attr(`class`,`swimlane-title`).attr(`style`,p).attr(`x`,a).attr(`y`,k).attr(`width`,D).attr(`height`,t).attr(`fill`,s).attr(`stroke`,d),L.attr(`class`,`swimlane-body`).attr(`style`,p).attr(`x`,a).attr(`y`,n).attr(`width`,D).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,d);let c=r.x-T.width/2,l=k+(t-T.height)/2;C.attr(`transform`,`translate(${c}, ${l})`)}if(t.trace(`Swimlane data `,r,JSON.stringify(r)),f){let e=C.select(`span`);e&&e.attr(`style`,f)}return r.offsetX=0,r.width=D,r.height=O,r.offsetY=T.height-E/2,r.intersect=function(e){return j(r,e)},{cluster:v,labelBBox:T}},`swimlane`),F=e(async(e,r)=>{t.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:g}=h(r),_=e.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=o(i),b=_.insert(`g`).attr(`class`,`cluster-label `),C;C=r.labelType===`markdown`?await x(b,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}):await M(b,r.label,r.labelStyle||``,!1,!0);let w=C.getBBox();if(o(i)){let 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;t.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),n=m(r,{roughness:.7,fill:c,stroke:u,fillWeight:3,seed:s}),i=e.path(N(D,O,T,E,0),n);k=_.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,g.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=v(i);if(b.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let P=k.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`rect`),I={rect:F,squareRect:F,roundedWithTitle:e(async(e,t)=>{let r=l(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:s,compositeBackground:c,compositeTitleBackground:u,nodeBorder:d}=i,f=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=await M(m,t.label,t.labelStyle,void 0,!0),_=g.getBBox();if(o(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(f),r=t.rx||t.ry?n.path(N(w,T,b,x,10),{roughness:.7,fill:u,fillStyle:`solid`,stroke:d,seed:a}):n.rectangle(w,T,b,x,{seed:a});D=f.insert(()=>r,`:first-child`);let i=n.rectangle(w,E,b,C,{fill:e?s:c,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});D=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else D=p.insert(`rect`,`:first-child`),D.attr(`class`,`outer`).attr(`x`,w).attr(`y`,T).attr(`width`,b).attr(`height`,x).attr(`data-look`,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-(o(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:f,labelBBox:_}},`roundedWithTitle`),noteGroup:e((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:e((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=l(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,c=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-c/2,f=t.y-u/2;t.width=c;let p;if(t.look===`handDrawn`){let e=S.svg(a).rectangle(d,f,c,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,d).attr(`y`,f).attr(`width`,c).attr(`height`,u).attr(`data-look`,t.look)}return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return j(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:e(async(e,r)=>{t.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:g}=h(r),_=e.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=o(i),b=_.insert(`g`).attr(`class`,`cluster-label `),C=await x(b,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),w=C.getBBox();if(o(i)){let 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;t.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),n=m(r,{roughness:.7,fill:c,stroke:u,fillWeight:4,seed:s}),i=e.path(N(D,O,T,E,r.rx),n);k=_.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,g.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=v(i);if(b.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let M=k.node().getBBox();return r.offsetX=0,r.width=M.width,r.height=M.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`kanbanSection`),swimlane:P},L=new Map,ee=e(async(e,t)=>{let n=await I[t.shape||`rect`](e,t);return L.set(t.id,n),n},`insertCluster`),R=e(()=>{L=new Map},`clear`);function z(e,t){return e.intersect(t)}e(z,`intersectNode`);var te=z;function B(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(B,`intersectEllipse`);var V=B;function H(e,t,n){return V(e,t,t,n)}e(H,`intersectCircle`);var U=H;function ne(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&re(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&re(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}e(ne,`intersectLine`);function re(e,t){return e*t>0}e(re,`sameSign`);var ie=ne;function W(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ie(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(W,`intersectPolygon`);var G={node:te,circle:U,ellipse:V,polygon:W,rect:j};function K(e,n){let{labelStyles:r}=h(n);n.labelStyle=r;let i=E(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=S.svg(o),l=m(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,p(s)),T(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),G.circle(n,1,e)},o}e(K,`anchor`);function ae(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(ae,`generateArcPoints`);function oe(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(oe,`calculateArcSagitta`);async function se(t,n){let{labelStyles:r,nodeStyles:i}=h(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await C(t,n,E(n)),f=c(n?.height?n?.height:d.height),[p,g]=l(f),_=oe(f,p,g),v=(n?.width?n?.width:d.width)+o*2+_-_,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...ae(-v/2,-y/2,-v/2,y/2,p,g,!1),{x:v/2,y:y/2},...ae(v/2,y/2,v/2,-y/2,p,g,!0)],w=S.svg(u),O=m(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`);let k=D(x),A=w.path(k,O),j=u.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,i),j.attr(`transform`,`translate(${p/2}, 0)`),T(n,j),n.intersect=function(e){return G.polygon(n,x,e)},u}e(se,`bowTieRect`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(q,`insertPolygonShape`);var ce=12;async function le(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+ce),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+ce,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+ce},{x:0+ce,y:f}],g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(p),i=e.path(r,n);g=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),_&&g.attr(`style`,_)}else g=q(s,l,u,p);return r&&g.attr(`style`,r),T(t,g),t.intersect=function(e){return G.polygon(t,p,e)},s}e(le,`card`);function ue(e,t){let{nodeStyles:n}=h(t);t.label=``;let r=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=S.svg(r),c=m(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=D(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return G.polygon(t,o,e)},r}e(ue,`choice`);async function de(e,n,r){let{labelStyles:i,nodeStyles:a}=h(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await C(e,n,E(n)),l=r?.padding??c,u=n.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:f}=n;if(n.look===`handDrawn`){let e=S.svg(o),t=m(n,{}),r=e.circle(0,0,u*2,t);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return T(n,d),n.calcIntersect=function(e,t){let n=e.width/2;return G.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,u,e),G.circle(n,u,e)},o}e(de,`circle`);function fe(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DgGH3qgX.js";import{A as r,B as i,M as a,T as o,b as s,g as c,x as l,z as u}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{a as d,r as f,u as p}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{a as m,i as h,r as g,t as _}from"./chunk-C7G6YPKG-BPbg-Z4N.js";import{n as v,t as y}from"./chunk-OGEWGWER-oC3NFfk1.js";import{t as b}from"./chunk-HOUHSVGY-DTZPduF8.js";import{n as x}from"./chunk-Q4XR5HBZ-BEgLgPw6.js";import{t as S}from"./rough.esm-CSKSodPl.js";var C=e(async(e,t,r)=>{let i,a=t.useHtmlLabels||c(l()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),f;f=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,h=t.labelType===`markdown`,g=await x(s,u(d(f),l()),{useHtmlLabels:a,width:t.width||l().flowchart?.wrappingWidth,classes:h?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:h},l()),_=g.getBBox(),v=(t?.padding??0)/2;if(a){let e=g.children[0],t=n(g);await y(e,f),_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}return a?s.attr(`transform`,`translate(`+-_.width/2+`, `+-_.height/2+`)`):s.attr(`transform`,`translate(0, `+-_.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-_.width/2+`, `+-_.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:_,halfPadding:v,label:s}},`labelHelper`),w=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(l()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await x(a,u(d(t),l()),{useHtmlLabels:i,width:r.width||l()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=s.getBBox(),f=r.padding/2;if(o(l())){let e=s.children[0],t=n(s);c=e.getBoundingClientRect(),t.attr(`width`,c.width),t.attr(`height`,c.height)}return i?a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`):a.attr(`transform`,`translate(0, `+-c.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-c.width/2+`, `+-c.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:c,halfPadding:f,label:a}},`insertLabel`),T=e((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),E=e((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(` `)}e(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}e(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}e(k,`generateCirclePoints`);function A(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(A,`mergePaths`);var j=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),M=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=l(),c=o(s);return await x(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`),N=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),P=e(async(e,r)=>{let i=l(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:u}=a,d=u,{labelStyles:f,nodeStyles:p,borderStyles:g,backgroundStyles:_}=h(r),v=e.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look),y=c(i.flowchart.htmlLabels),b=r.direction===`LR`,C=v.insert(`g`).attr(`class`,`cluster-label swimlane-label`),w=await x(C,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),T=w.getBBox();if(y){let e=w.children[0],t=n(w);T=e.getBoundingClientRect(),t.attr(`width`,T.width),t.attr(`height`,T.height)}let E=r.padding??0,D=r.width<=T.width+E?T.width+E:r.width;r.width<=T.width+E?r.diff=(D-r.width)/2-E:r.diff=-E;let O=r.height,k=r.y-O/2,A=r.y+O/2,M=r.x-D/2,N=r.swimlaneContentTop===void 0?k+O/3:r.swimlaneContentTop,P=b?4:0,F=T.height+2*P,I,L;if(b){let e=Math.max(F,T.height+2*P),t=M+e,n=Math.max(0,D-e);if(r.look===`handDrawn`){let i=S.svg(v),a=m(r,{roughness:.7,fill:s,stroke:d,fillWeight:3,seed:o}),c=m(r,{roughness:.7,fill:`none`,stroke:d,seed:o}),l=i.rectangle(M,k,e,O,a);I=v.insert(()=>l,`:first-child`);let u=i.rectangle(t,k,n,O,c);L=v.insert(()=>u,`:first-child`),I.select(`path:nth-child(2)`).attr(`style`,g.join(`;`)),I.select(`path`).attr(`style`,_.join(`;`).replace(`fill`,`stroke`))}else I=v.insert(`rect`,`:first-child`),L=v.insert(`rect`,`:first-child`),I.attr(`class`,`swimlane-title`).attr(`style`,p).attr(`x`,M).attr(`y`,k).attr(`width`,e).attr(`height`,O).attr(`fill`,s).attr(`stroke`,d),L.attr(`class`,`swimlane-body`).attr(`style`,p).attr(`x`,t).attr(`y`,k).attr(`width`,n).attr(`height`,O).attr(`fill`,`none`).attr(`stroke`,d);let i=M+e/2,a=r.y;C.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-T.width/2}, ${-T.height/2})`)}else{let e=Math.max(0,N-k),t=Math.min(F,e),n=k+t,i=Math.max(0,A-n),a=r.x-D/2;if(r.look===`handDrawn`){let e=S.svg(v),c=m(r,{roughness:.7,fill:s,stroke:d,fillWeight:3,seed:o}),l=m(r,{roughness:.7,fill:`none`,stroke:d,seed:o}),u=e.rectangle(a,k,D,t,c);I=v.insert(()=>u,`:first-child`);let f=e.rectangle(a,n,D,i,l);L=v.insert(()=>f,`:first-child`),I.select(`path:nth-child(2)`).attr(`style`,g.join(`;`)),I.select(`path`).attr(`style`,_.join(`;`).replace(`fill`,`stroke`))}else I=v.insert(`rect`,`:first-child`),L=v.insert(`rect`,`:first-child`),I.attr(`class`,`swimlane-title`).attr(`style`,p).attr(`x`,a).attr(`y`,k).attr(`width`,D).attr(`height`,t).attr(`fill`,s).attr(`stroke`,d),L.attr(`class`,`swimlane-body`).attr(`style`,p).attr(`x`,a).attr(`y`,n).attr(`width`,D).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,d);let c=r.x-T.width/2,l=k+(t-T.height)/2;C.attr(`transform`,`translate(${c}, ${l})`)}if(t.trace(`Swimlane data `,r,JSON.stringify(r)),f){let e=C.select(`span`);e&&e.attr(`style`,f)}return r.offsetX=0,r.width=D,r.height=O,r.offsetY=T.height-E/2,r.intersect=function(e){return j(r,e)},{cluster:v,labelBBox:T}},`swimlane`),F=e(async(e,r)=>{t.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:g}=h(r),_=e.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=o(i),b=_.insert(`g`).attr(`class`,`cluster-label `),C;C=r.labelType===`markdown`?await x(b,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}):await M(b,r.label,r.labelStyle||``,!1,!0);let w=C.getBBox();if(o(i)){let 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;t.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),n=m(r,{roughness:.7,fill:c,stroke:u,fillWeight:3,seed:s}),i=e.path(N(D,O,T,E,0),n);k=_.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,g.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=v(i);if(b.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let P=k.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`rect`),I={rect:F,squareRect:F,roundedWithTitle:e(async(e,t)=>{let r=l(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:s,compositeBackground:c,compositeTitleBackground:u,nodeBorder:d}=i,f=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=await M(m,t.label,t.labelStyle,void 0,!0),_=g.getBBox();if(o(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(f),r=t.rx||t.ry?n.path(N(w,T,b,x,10),{roughness:.7,fill:u,fillStyle:`solid`,stroke:d,seed:a}):n.rectangle(w,T,b,x,{seed:a});D=f.insert(()=>r,`:first-child`);let i=n.rectangle(w,E,b,C,{fill:e?s:c,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});D=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else D=p.insert(`rect`,`:first-child`),D.attr(`class`,`outer`).attr(`x`,w).attr(`y`,T).attr(`width`,b).attr(`height`,x).attr(`data-look`,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-(o(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:f,labelBBox:_}},`roundedWithTitle`),noteGroup:e((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:e((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=l(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,c=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-c/2,f=t.y-u/2;t.width=c;let p;if(t.look===`handDrawn`){let e=S.svg(a).rectangle(d,f,c,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,d).attr(`y`,f).attr(`width`,c).attr(`height`,u).attr(`data-look`,t.look)}return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return j(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:e(async(e,r)=>{t.info(`Creating subgraph rect for `,r.id,r);let i=l(),{themeVariables:a,handDrawnSeed:s}=i,{clusterBkg:c,clusterBorder:u}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:g}=h(r),_=e.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.domId).attr(`data-look`,r.look),y=o(i),b=_.insert(`g`).attr(`class`,`cluster-label `),C=await x(b,r.label,{style:r.labelStyle,useHtmlLabels:y,isNode:!0,width:r.width}),w=C.getBBox();if(o(i)){let 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;t.trace(`Data `,r,JSON.stringify(r));let k;if(r.look===`handDrawn`){let e=S.svg(_),n=m(r,{roughness:.7,fill:c,stroke:u,fillWeight:4,seed:s}),i=e.path(N(D,O,T,E,r.rx),n);k=_.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,g.join(`;`).replace(`fill`,`stroke`))}else k=_.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=v(i);if(b.attr(`transform`,`translate(${r.x-w.width/2}, ${r.y-r.height/2+A})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let M=k.node().getBBox();return r.offsetX=0,r.width=M.width,r.height=M.height,r.offsetY=w.height-r.padding/2,r.intersect=function(e){return j(r,e)},{cluster:_,labelBBox:w}},`kanbanSection`),swimlane:P},L=new Map,ee=e(async(e,t)=>{let n=await I[t.shape||`rect`](e,t);return L.set(t.id,n),n},`insertCluster`),R=e(()=>{L=new Map},`clear`);function z(e,t){return e.intersect(t)}e(z,`intersectNode`);var te=z;function B(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(B,`intersectEllipse`);var V=B;function H(e,t,n){return V(e,t,t,n)}e(H,`intersectCircle`);var U=H;function ne(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&re(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&re(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}e(ne,`intersectLine`);function re(e,t){return e*t>0}e(re,`sameSign`);var ie=ne;function W(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ie(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(W,`intersectPolygon`);var G={node:te,circle:U,ellipse:V,polygon:W,rect:j};function K(e,n){let{labelStyles:r}=h(n);n.labelStyle=r;let i=E(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=S.svg(o),l=m(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,p(s)),T(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),G.circle(n,1,e)},o}e(K,`anchor`);function ae(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(ae,`generateArcPoints`);function oe(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(oe,`calculateArcSagitta`);async function se(t,n){let{labelStyles:r,nodeStyles:i}=h(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await C(t,n,E(n)),f=c(n?.height?n?.height:d.height),[p,g]=l(f),_=oe(f,p,g),v=(n?.width?n?.width:d.width)+o*2+_-_,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...ae(-v/2,-y/2,-v/2,y/2,p,g,!1),{x:v/2,y:y/2},...ae(v/2,y/2,v/2,-y/2,p,g,!0)],w=S.svg(u),O=m(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`);let k=D(x),A=w.path(k,O),j=u.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,i),j.attr(`transform`,`translate(${p/2}, 0)`),T(n,j),n.intersect=function(e){return G.polygon(n,x,e)},u}e(se,`bowTieRect`);function q(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(q,`insertPolygonShape`);var ce=12;async function le(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+ce),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+ce,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+ce},{x:0+ce,y:f}],g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(p),i=e.path(r,n);g=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),_&&g.attr(`style`,_)}else g=q(s,l,u,p);return r&&g.attr(`style`,r),T(t,g),t.intersect=function(e){return G.polygon(t,p,e)},s}e(le,`card`);function ue(e,t){let{nodeStyles:n}=h(t);t.label=``;let r=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=S.svg(r),c=m(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=D(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return G.polygon(t,o,e)},r}e(ue,`choice`);async function de(e,n,r){let{labelStyles:i,nodeStyles:a}=h(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await C(e,n,E(n)),l=r?.padding??c,u=n.look===`neo`?s.width/2+32:s.width/2+l,d,{cssStyles:f}=n;if(n.look===`handDrawn`){let e=S.svg(o),t=m(n,{}),r=e.circle(0,0,u*2,t);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return T(n,d),n.calcIntersect=function(e,t){let n=e.width/2;return G.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,u,e),G.circle(n,u,e)},o}e(de,`circle`);function fe(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
2
2
|
M ${i.x},${i.y} L ${o.x},${o.y}`}e(fe,`createLine`);function pe(e,n){let{labelStyles:r,nodeStyles:i}=h(n);n.labelStyle=r,n.label=``;let a=e.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=m(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=fe(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&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(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),G.circle(n,o,e)},a}e(pe,`crossedCircle`);function J(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(J,`generateCirclePoints`);async function me(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],g=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],_=S.svg(i),v=m(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=_.path(y,v),x=D(g),w=_.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return G.polygon(t,g,e)},i}e(me,`curlyBraceLeft`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}e(Y,`generateCirclePoints`);async function he(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90)],g=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],_=S.svg(i),v=m(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=_.path(y,v),x=D(g),w=_.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,O),t.intersect=function(e){return G.polygon(t,g,e)},i}e(he,`curlyBraceRight`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(X,`generateCirclePoints`);async function ge(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...X(l/2,u/2,d,20,0,90)],g=[...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],_=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],v=S.svg(i),y=m(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=D(p).replace(`Z`,``),x=v.path(b,y),w=D(g).replace(`Z`,``),O=v.path(w,y),k=D(_),A=v.path(k,{...y}),j=i.insert(`g`,`:first-child`);return j.insert(()=>A,`:first-child`).attr(`stroke-opacity`,0),j.insert(()=>x,`:first-child`),j.insert(()=>O,`:first-child`),j.attr(`class`,`text`),f&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),T(t,j),t.intersect=function(e){return G.polygon(t,_,e)},i}e(ge,`curlyBraces`);async function _e(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=S.svg(s),g=m(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=l,v=u,y=_-d,b=v/4,x=[{x:y,y:0},{x:b,y:0},{x:0,y:v/2},{x:b,y:v},{x:y,y:v},...k(-y,-v/2,d,50,270,90)],w=D(x),O=p.path(w,g),A=s.insert(()=>O,`:first-child`);return A.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,r),A.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,A),t.intersect=function(e){return G.polygon(t,x,e)},s}e(_e,`curvedTrapezoid`);var ve=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),ye=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),be=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),xe=8,Se=8;async function Ce(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-o,t.width<Se&&(t.width=Se);let n=e/2/(2.5+e/50);t.height=(t.height??0)-a-n*3,t.height<xe&&(t.height=xe)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t.width?t.width:c.width)+o,d=u/2,f=d/(2.5+u/50),g=(t.height?t.height:c.height)+a+f,_,{cssStyles:v}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=ye(0,0,u,g,d,f),r=be(0,f,u,g,d,f),i=m(t,{}),a=e.path(n,i),o=e.path(r,m(t,{fill:`none`}));_=s.insert(()=>o,`:first-child`),_=s.insert(()=>a,`:first-child`),_.attr(`class`,`basic label-container`),v&&_.attr(`style`,v)}else{let e=ve(0,0,u,g,d,f);_=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(v)).attr(`style`,r)}return _.attr(`label-offset-y`,f),_.attr(`transform`,`translate(${-u/2}, ${-(g/2+f)})`),T(t,_),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(e){let n=G.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(Ce,`cylinder`);async function we(e,t,n){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await C(e,t,E(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:g}=t,{cssStyles:_}=t;if(n?.rx&&n.ry&&(f=n.rx,g=n.ry),t.look===`handDrawn`){let e=S.svg(a),n=m(t,{}),r=f||g?e.path(N(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(_))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,p(f)).attr(`ry`,p(g)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return T(t,d),t.calcIntersect=function(e,t){return G.rect(e,t)},t.intersect=function(e){return G.rect(t,e)},a}e(we,`drawRect`);async function Te(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await we(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=S.svg(c),n=m(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(Te,`datastore`);async function Ee(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:g}=t,_=S.svg(o),v=m(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=_.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),T(t,x),t.intersect=function(e){return G.rect(t,e)},o}e(Ee,`dividedRectangle`);async function De(e,n){let{labelStyles:r,nodeStyles:i}=h(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await C(e,n,E(n)),u=(n?.width?n?.width/2:l.width/2)+(s??0),d=u-a,f,{cssStyles:g}=n;if(n.look===`handDrawn`){let e=S.svg(c),t=m(n,{roughness:.2,strokeWidth:2.5}),r=m(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,t),a=e.circle(0,0,d*2,r);f=c.insert(`g`,`:first-child`),f.attr(`class`,p(n.cssClasses)).attr(`style`,p(g)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=c.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return T(n,f),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,u,e),G.circle(n,u,e)},c}e(De,`doublecircle`);function Oe(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=h(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,E(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=S.svg(o),{nodeBorder:l}=r,u=m(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(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),G.circle(n,7,e)},o}e(Oe,`filledCircle`);var ke=10,Ae=10;async function je(e,n){let{labelStyles:r,nodeStyles:i}=h(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<ke&&(n.height=ke),n.width=(n?.width??0)-o-o/2,n.width<Ae&&(n.width=Ae));let{shapeSvg:s,bbox:c,label:l}=await C(e,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:g}=n,_=S.svg(s),v=m(n,{});n.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p),b=_.path(y,v),x=s.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return g&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,g),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(e){return t.info(`Triangle intersect`,n,p,e),G.polygon(n,p,e)},s}e(je,`flippedTriangle`);function Me(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=h(t);t.label=``;let o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=S.svg(o),p=m(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let g=f.rectangle(u,d,c,l,p),_=o.insert(()=>g,`:first-child`);s&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,a),T(t,_);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return G.rect(t,e)},o}e(Me,`forkJoin`);async function Ne(e,n){let{labelStyles:r,nodeStyles:i}=h(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(e,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),g=m(n,{});n.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...k(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],v=D(_),y=p.path(v,g),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&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(e){return t.info(`Pill intersect`,n,{radius:d,point:e}),G.polygon(n,_,e)},s}e(Ne,`halfRoundedRectangle`);var Pe=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=h(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await C(e,t,E(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=S.svg(c),n=m(t,{}),r=Pe(0,0,f,u,d),i=e.path(r,n);g=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),_&&g.attr(`style`,_)}else g=q(c,f,u,p);return r&&g.attr(`style`,r),t.width=f,t.height=u,T(t,g),t.intersect=function(e){return G.polygon(t,p,e)},c}e(Fe,`hexagon`);async function Ie(e,n){let{labelStyles:r,nodeStyles:i}=h(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await C(e,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=m(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),g=a.insert(()=>p,`:first-child`);return g.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,i),g.attr(`transform`,`translate(${-o/2}, ${-s/2})`),T(n,g),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),G.polygon(n,d,e)},a}e(Ie,`hourglass`);async function Le(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(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(e,n,`icon-shape default`),p=n.pos===`t`,g=c,v=c,{nodeBorder:y}=r,{stylesMap:x}=_(n),w=-v/2,E=-g/2,D=n.label?8:0,O=S.svg(u),k=m(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`);let A=O.rectangle(w,E,v,g,k),j=Math.max(v,d.width),M=g+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),P=u.insert(()=>A,`:first-child`),F=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`<g>${await b(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: ${x.get(`stroke`)??y};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-M/2:M/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+D/2:-d.height/2-D/2})`),T(n,F),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return G.rect(n,e);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+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+g},{x:r+d.width/2,y:i-a/2+g},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+g},{x:r-v/2,y:i-a/2+g}],G.polygon(n,o,e)},u}e(Le,`icon`);async function Re(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(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(e,n,`icon-shape default`),p=n.label?8:0,g=n.pos===`t`,{nodeBorder:v,mainBkg:y}=r,{stylesMap:x}=_(n),w=S.svg(u),E=m(n,{});n.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`),E.stroke=x.get(`fill`)??y;let D=u.append(`g`);n.icon&&D.html(`<g>${await b(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,L=w.rectangle(-F/2,-I/2,F,I,{...E,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>P,`:first-child`),R=u.insert(()=>L);return D.attr(`transform`,`translate(${-k/2-j},${g?d.height/2+p/2-A/2-M:-d.height/2-p/2-A/2-M})`),D.attr(`style`,`color: ${x.get(`stroke`)??v};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${g?-I/2:I/2-d.height})`),ee.attr(`transform`,`translate(0,${g?d.height/2+p/2:-d.height/2-p/2})`),T(n,R),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),G.rect(n,e)},u}e(Re,`iconCircle`);async function ze(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(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(e,n,`icon-shape default`),g=n.pos===`t`,v=c+f*2,y=c+f*2,{nodeBorder:x,mainBkg:w}=r,{stylesMap:E}=_(n),D=-y/2,O=-v/2,k=n.label?8:0,A=S.svg(u),j=m(n,{});n.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,y,v,5),j),P=Math.max(y,d.width),F=v+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),L=u.insert(()=>M,`:first-child`).attr(`class`,`icon-shape2`),ee=u.insert(()=>I);if(n.icon){let e=u.append(`g`);e.html(`<g>${await b(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},${g?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??x};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${g?-F/2:F/2-d.height})`),L.attr(`transform`,`translate(0,${g?d.height/2+k/2:-d.height/2-k/2})`),T(n,ee),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return G.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=g?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+k},{x:r+y/2,y:i-a/2+d.height+k},{x:r+y/2,y:i+a/2},{x:r-y/2,y:i+a/2},{x:r-y/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-y/2,y:i-a/2},{x:r+y/2,y:i-a/2},{x:r+y/2,y:i-a/2+v},{x:r+d.width/2,y:i-a/2+v},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+v},{x:r-y/2,y:i-a/2+v}],G.polygon(n,o,e)},u}e(ze,`iconRounded`);async function Be(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=h(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(e,n,`icon-shape default`),g=n.pos===`t`,v=c+f*2,y=c+f*2,{nodeBorder:x,mainBkg:w}=r,{stylesMap:E}=_(n),D=-y/2,O=-v/2,k=n.label?8:0,A=S.svg(u),j=m(n,{});n.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,y,v,.1),j),P=Math.max(y,d.width),F=v+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),L=u.insert(()=>M,`:first-child`),ee=u.insert(()=>I);if(n.icon){let e=u.append(`g`);e.html(`<g>${await b(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},${g?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??x};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${g?-F/2:F/2-d.height})`),L.attr(`transform`,`translate(0,${g?d.height/2+k/2:-d.height/2-k/2})`),T(n,ee),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return G.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=g?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+k},{x:r+y/2,y:i-a/2+d.height+k},{x:r+y/2,y:i+a/2},{x:r-y/2,y:i+a/2},{x:r-y/2,y:i-a/2+d.height+k},{x:r-d.width/2,y:i-a/2+d.height+k}]:[{x:r-y/2,y:i-a/2},{x:r+y/2,y:i-a/2},{x:r+y/2,y:i-a/2+v},{x:r+d.width/2,y:i-a/2+v},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+v},{x:r-y/2,y:i-a/2+v}],G.polygon(n,o,e)},u}e(Be,`iconSquare`);async function Ve(e,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}=h(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:g}=await C(e,n,`image-shape default`),_=n.pos===`t`,v=-u/2,y=-d/2,b=n.label?8:0,x=S.svg(f),w=m(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},${_?O/2-d:-O/2})`)}return g.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${_?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),A.attr(`transform`,`translate(0,${_?p.height/2+b/2:-p.height/2-b/2})`),T(n,j),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return G.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=_?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],G.polygon(n,o,e)},f}e(Ve,`imageSquare`);async function He(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(c.width+(o??0)*2,t?.width??0),u=Math.max(c.height+(a??0)*2,t?.height??0),d=[{x:0,y:0},{x:l,y:0},{x:l+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),p&&f.attr(`style`,p)}else f=q(s,l,u,d);return r&&f.attr(`style`,r),t.width=l,t.height=u,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}e(He,`inv_trapezoid`);async function Ue(e,t){let{shapeSvg:n,bbox:r,label:i}=await C(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),T(t,a),t.intersect=function(e){return G.rect(t,e)},n}e(Ue,`labelRect`);async function We(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}e(We,`lean_left`);async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return G.polygon(t,d,e)},s}e(Ge,`lean_right`);function Ke(e,n){let{labelStyles:r,nodeStyles:i}=h(n);n.label=``,n.labelStyle=r;let a=e.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=m(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=D(l),p=u.path(f,d),g=a.insert(()=>p,`:first-child`);return g.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,i),g.attr(`transform`,`translate(-${s/2},${-c})`),T(n,g),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),G.polygon(n,l,e)},a}e(Ke,`lightningBolt`);var qe=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),Je=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),Ye=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Xe=10,Ze=10;async function Qe(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<Ze&&(t.width=Ze);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<Xe&&(t.height=Xe)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),g=(t?.height?t?.height:c.height)+f+o*2,_=g*.1,v,{cssStyles:y}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=Je(0,0,u,g,d,f,_),r=Ye(0,f,u,g,d,f),i=m(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),v=s.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=qe(0,0,u,g,d,f,_);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(y)).attr(`style`,r)}return v.attr(`label-offset-y`,f),v.attr(`transform`,`translate(${-u/2}, ${-(g/2+f)})`),T(t,v),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=G.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(Qe,`linedCylinder`);async function $e(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:g}=t,_=S.svg(s),v=m(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...O(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=_.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),T(t,x),t.intersect=function(e){return G.polygon(t,y,e)},s}e($e,`linedWaveEdgedRect`);async function et(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,g=f-2*s,_=-p/2,v=-g/2,{cssStyles:y}=t,b=S.svg(c),x=m(t,{}),w=[{x:_-s,y:v+s},{x:_-s,y:v+g+s},{x:_+p-s,y:v+g+s},{x:_+p-s,y:v+g},{x:_+p,y:v+g},{x:_+p,y:v+g-s},{x:_+p+s,y:v+g-s},{x:_+p+s,y:v-s},{x:_+s,y:v-s},{x:_+s,y:v},{x:_,y:v},{x:_,y:v+s}],O=[{x:_,y:v+s},{x:_+p-s,y:v+s},{x:_+p-s,y:v+g},{x:_+p,y:v+g},{x:_+p,y:v},{x:_,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let k=D(w),j=b.path(k,x),M=D(O),N=b.path(M,x);t.look!==`handDrawn`&&(j=A(j),N=A(N));let P=c.insert(`g`,`:first-child`);return P.insert(()=>j),P.insert(()=>N),P.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),T(t,P),t.intersect=function(e){return G.polygon(t,w,e)},c}e(et,`multiRect`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,g=f+(u?p/2:-p/2),_=-d/2,v=-g/2,{cssStyles:y}=t,b=O(_-10,v+g+10,_+d-10,v+g+10,p,.8),x=b?.[b.length-1],w=[{x:_-10,y:v+10},{x:_-10,y:v+g+10},...b,{x:_+d-10,y:x.y-10},{x:_+d,y:x.y-10},{x:_+d,y:x.y-20},{x:_+d+10,y:x.y-20},{x:_+d+10,y:v-10},{x:_+10,y:v-10},{x:_+10,y:v},{x:_,y:v},{x:_,y:v+10}],k=[{x:_,y:v+10},{x:_+d-10,y:v+10},{x:_+d-10,y:x.y-10},{x:_+d,y:x.y-10},{x:_+d,y:v},{x:_,y:v}],A=S.svg(i),j=m(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let M=D(w),N=A.path(M,j),P=D(k),F=A.path(P,j),I=i.insert(()=>N,`:first-child`);return I.insert(()=>F),I.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,r),I.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),T(t,I),t.intersect=function(e){return G.polygon(t,w,e)},i}e(tt,`multiWaveEdgedRectangle`);async function nt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await C(e,t,E(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:g}=t,_=S.svg(a),v=m(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=_.rectangle(f,p,u,d,v),b=a.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),g&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,g),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,b),t.intersect=function(e){return G.rect(t,e)},a}e(nt,`note`);var rt=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function it(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=S.svg(i),n=m(t,{}),r=rt(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),T(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=G.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(it,`question`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width??c.width)+(t.look===`neo`?a*2:a),d=(t?.height??c.height)+(t.look===`neo`?o*2:o),f=-u/2,p=-d/2,g=p/2,_=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:v}=t,y=S.svg(s),b=m(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=D(_),w=y.path(x,b),O=s.insert(()=>w,`:first-child`);return O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-g/2},0)`),l.attr(`transform`,`translate(${-g/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,O),t.intersect=function(e){return G.polygon(t,_,e)},s}e(at,`rect_left_inv_arrow`);async function ot(e,r){let{labelStyles:i,nodeStyles:a}=h(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),u=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,g=await M(d,p,r.labelStyle,!0,!0),_={width:0,height:0};if(o(l())){let e=g.children[0],t=n(g);_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}t.info(`Text 2`,f);let v=f||[],y=g.getBBox(),b=await M(d,Array.isArray(v)?v.join(`<br/>`):v,r.labelStyle,!0,!0),x=b.children[0],C=n(b);_=x.getBoundingClientRect(),C.attr(`width`,_.width),C.attr(`height`,_.height);let w=(r.padding||0)/2;n(b).attr(`transform`,`translate( `+(_.width>y.width?0:(y.width-_.width)/2)+`, `+(y.height+w+5)+`)`),n(g).attr(`transform`,`translate( `+(_.width<y.width?0:-(y.width-_.width)/2)+`, 0)`),_=d.node().getBBox(),d.attr(`transform`,`translate(`+-_.width/2+`, `+(-_.height/2-w+3)+`)`);let E=_.width+(r.padding||0),D=_.height+(r.padding||0),O=-_.width/2-w,k=-_.height/2-w,A,j;if(r.look===`handDrawn`){let e=S.svg(c),n=m(r,{}),i=e.path(N(O,k,E,D,r.rx||0),n),a=e.line(-_.width/2-w,-_.height/2-w+y.height+w,_.width/2+w,-_.height/2-w+y.height+w,n);j=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),A=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else A=u.insert(`rect`,`:first-child`),j=u.insert(`line`),A.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-_.width/2-w).attr(`y`,-_.height/2-w).attr(`width`,_.width+(r.padding||0)).attr(`height`,_.height+(r.padding||0)),j.attr(`class`,`divider`).attr(`x1`,-_.width/2-w).attr(`x2`,_.width/2+w).attr(`y1`,-_.height/2-w+y.height+w).attr(`y2`,-_.height/2-w+y.height+w);return T(r,A),r.intersect=function(e){return G.rect(r,e)},c}e(ot,`rectWithTitle`);async function st(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return we(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(st,`roundedRect`);var Z=8;async function ct(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,f=u,g=Z-l/2,_=-u/2,{cssStyles:v}=t,y=S.svg(o),b=m(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:g,y:_},{x:g+d,y:_},{x:g+d,y:_+f},{x:g-Z,y:_+f},{x:g-Z,y:_},{x:g,y:_},{x:g,y:_+f}],w=y.polygon(x.map(e=>[e.x,e.y]),b),D=o.insert(()=>w,`:first-child`);return D.attr(`class`,`basic label-container outer-path`).attr(`style`,p(v)),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return G.rect(t,e)},o}e(ct,`shadedProcess`);async function lt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,g=-f/2,_=-p/2,{cssStyles:v}=t,y=S.svg(s),b=m(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:g,y:_},{x:g,y:_+p},{x:g+f,y:_+p},{x:g+f,y:_-p/2}],w=D(x),O=y.path(w,b),k=s.insert(()=>O,`:first-child`);return k.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,r),k.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),T(t,k),t.intersect=function(e){return G.polygon(t,x,e)},s}e(lt,`slopedRect`);async function ut(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return we(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}e(ut,`squareRect`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=S.svg(s),g=m(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...k(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...k(u/2-d,0,d,50,270,450)],v=D(_),y=p.path(v,g),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),T(t,b),t.intersect=function(e){return G.polygon(t,_,e)},s}e(dt,`stadium`);async function ft(e,t){return we(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(ft,`state`);function pt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=h(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=S.svg(u),f=m(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),g=s??c,_=(t.width??0)*5/14,v=d.circle(0,0,_,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;y.attr(`style`,`filter:url(#${n})`)}return T(t,y),t.intersect=function(e){return G.circle(t,(t.width??0)/2,e)},u}e(pt,`stateEnd`);function mt(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=S.svg(a).circle(0,0,t.width,g(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return T(t,o),t.intersect=function(e){return G.circle(t,(t.width??7)/2,e)},a}e(mt,`stateStart`);var ht=8;async function gt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width??c.width)+2*ht+a,u=(t?.height??c.height)+o,d=l-2*ht,f=u,g=-l/2,_=-u/2,v=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=S.svg(s),n=m(t,{}),r=e.rectangle(g,_,d+16,f,n),i=e.line(g+ht,_,g+ht,_+f,n),a=e.line(g+ht+d,_,g+ht+d,_+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,p(c)),T(t,o)}else{let e=q(s,d,f,v);r&&e.attr(`style`,r),T(t,e)}return t.intersect=function(e){return G.polygon(t,v,e)},s}e(gt,`subroutine`);var _t=.2;async function vt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-_t*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height?t?.height:c.height)+o*2,u=_t*l,d=_t*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,g=-f/2,_=-p/2,{cssStyles:v}=t,y=S.svg(s),b=m(t,{}),x=[{x:g-u/2,y:_},{x:g+f+u/2,y:_},{x:g+f+u/2,y:_+p},{x:g-u/2,y:_+p}],w=[{x:g+f-u/2,y:_+p},{x:g+f+u/2,y:_+p},{x:g+f+u/2,y:_+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let O=D(x),k=y.path(O,b),A=D(w),j=y.path(A,{...b,fillStyle:`solid`}),M=s.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),T(t,M),t.intersect=function(e){return G.polygon(t,x,e)},s}e(vt,`taggedRect`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,g=S.svg(i),_=m(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...O(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...O(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],w=D(v),k=g.path(w,_),A=D(x),j=g.path(A,{..._,fillStyle:`solid`}),M=i.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),T(t,M),t.intersect=function(e){return G.polygon(t,v,e)},i}e(yt,`taggedWaveEdgedRectangle`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=h(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),T(t,u),t.intersect=function(e){return G.rect(t,e)},i}e(bt,`text`);var xt=e((e,t,n,r,i,a)=>`M${e},${t}
|
|
3
3
|
a${i},${a} 0,0,1 0,${-r}
|
|
4
4
|
l${n},0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DgGH3qgX.js";import"./chunk-WYO6CB5R-DyuwB_K1.js";import"./chunk-ICXQ74PX-ul7urQ-O.js";import"./chunk-C7G6YPKG-BPbg-Z4N.js";import"./chunk-OGEWGWER-oC3NFfk1.js";import"./chunk-HOUHSVGY-DTZPduF8.js";import"./chunk-Q4XR5HBZ-BEgLgPw6.js";import"./chunk-ZGVPDNZ5-C8jJ41Go.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./index-DR6NR8XX.js";import"./chunk-32BRIVSS-CGd9zFPr.js";import"./chunk-XXDRQBXY-DoU4wU65.js";import"./chunk-VR4S4FIN-DgBVcAIW.js";import{i as t,n,r,t as i}from"./chunk-V7JOEXUC-Dd4DUNpE.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DgGH3qgX.js";import"./chunk-WYO6CB5R-DyuwB_K1.js";import"./chunk-ICXQ74PX-ul7urQ-O.js";import"./chunk-C7G6YPKG-BPbg-Z4N.js";import"./chunk-OGEWGWER-oC3NFfk1.js";import"./chunk-HOUHSVGY-DTZPduF8.js";import"./chunk-Q4XR5HBZ-BEgLgPw6.js";import"./chunk-ZGVPDNZ5-C8jJ41Go.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./index-DR6NR8XX.js";import"./chunk-32BRIVSS-CGd9zFPr.js";import"./chunk-XXDRQBXY-DoU4wU65.js";import"./chunk-VR4S4FIN-DgBVcAIW.js";import{i as t,n,r,t as i}from"./chunk-V7JOEXUC-Dd4DUNpE.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
package/public/assets/{cynefinDiagram-TSTJHNR4-CWs6ShhJ.js → cynefinDiagram-TSTJHNR4-B8bh9Ms6.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f}from"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{i as p}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{C as m}from"./index-DR6NR8XX.js";import{n as h}from"./mermaid-parser.core-D7RD-ESl.js";import{t as g}from"./chunk-JWPE2WC7-DVXcaiue.js";var _=e(()=>({domains:new Map,transitions:[]}),`createDefaultData`),v=_(),y={getDomains:e(()=>v.domains,`getDomains`),getTransitions:e(()=>v.transitions,`getTransitions`),setDomains:e(e=>{if(e)for(let t of e){let e=t.domain,n=(t.items??[]).map(e=>({label:e.label}));v.domains.set(e,{name:e,items:n})}},`setDomains`),setTransitions:e(e=>{e&&(v.transitions=e.filter(e=>e.from===e.to?(t.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},`setTransitions`),getConfig:e(()=>p({...l.cynefin,...s().cynefin}),`getConfig`),clear:e(()=>{o(),v=_()},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r},b=e(e=>{g(e,y),y.setDomains(e.domains),y.setTransitions(e.transitions)},`populate`),x={parse:e(async e=>{let n=await h(`cynefin`,e);t.debug(n),b(n)},`parse`)};function S(e){let t=e+1831565813|0;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}e(S,`seededRandom`);function C(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}e(C,`hashString`);function w(e,t){return typeof e==`number`&&Number.isFinite(e)&&e!==0?e:C(t)}e(w,`resolveSeed`);function T(e,t,n,r){let i=e/2,a=r??e*.015,o=t/7,s=[];for(let e=0;e<=7;e++){let t=S(n+e*17)*a*2-a;s.push({x:i+t,y:e*o})}let c=`M${s[0].x},${s[0].y}`;for(let e=0;e<s.length-1;e++){let t=s[e],r=s[e+1],i=(t.y+r.y)/2,o=e%2==0?1:-1,l=a*1.5*o*S(n+e*31+7),u=t.x+l,d=i,f=r.x-l;c+=` C${u},${d} ${f},${i} ${r.x},${r.y}`}return c}e(T,`generateFoldPath`);function E(e,t,n,r){let i=t/2,a=r??t*.015,o=e/7,s=[];for(let e=0;e<=7;e++){let t=S(n+e*23)*a*2-a;s.push({x:e*o,y:i+t})}let c=`M${s[0].x},${s[0].y}`;for(let e=0;e<s.length-1;e++){let t=s[e],r=s[e+1],i=(t.x+r.x)/2,o=e%2==0?1:-1,l=a*1.5*o*S(n+e*37+11),u=i,d=t.y+l,f=i,p=r.y-l;c+=` C${u},${d} ${f},${p} ${r.x},${r.y}`}return c}e(E,`generateHorizontalBoundary`);function D(e,t){let n=e/2,r=t*.5,i=t,a=e*.03;return[`M${n},${r}`,`C${n+a},${r+(i-r)*.2}`,`${n-a*1.5},${r+(i-r)*.55}`,`${n+a*.5},${r+(i-r)*.75}`,`C${n-a},${r+(i-r)*.85}`,`${n+a*.3},${r+(i-r)*.95}`,`${n},${i}`].join(` `)}e(D,`generateCliffPath`);function O(e,t,n,r){return[`M${e-n},${t}`,`A${n},${r} 0 1,1 ${e+n},${t}`,`A${n},${r} 0 1,1 ${e-n},${t}`,`Z`].join(` `)}e(O,`generateConfusionPath`);var k={complex:{model:`Probe → Sense → Respond`,practice:`Emergent Practices`},complicated:{model:`Sense → Analyse → Respond`,practice:`Good Practices`},clear:{model:`Sense → Categorise → Respond`,practice:`Best Practices`},chaotic:{model:`Act → Sense → Respond`,practice:`Novel Practices`},confusion:{model:``,practice:`Disorder`}},A=e((e,t)=>{let n=e/2,r=t/2;return{complex:{cx:n/2,cy:r/2,x:0,y:0,w:n,h:r},complicated:{cx:n+n/2,cy:r/2,x:n,y:0,w:n,h:r},chaotic:{cx:n/2,cy:r+r/2,x:0,y:r,w:n,h:r},clear:{cx:n+n/2,cy:r+r/2,x:n,y:r,w:n,h:r},confusion:{cx:n,cy:r,x:n*.7,y:r*.7,w:n*.6,h:r*.6}}},`getDomainLayouts`),j=e(()=>p(n(),s().themeVariables).cynefin,`getCynefinDomainColors`),M=3,N={draw:e((e,n,r,i)=>{let a=i.db,o=a.getDomains(),s=a.getTransitions(),l=a.getDiagramTitle(),u=a.getAccTitle(),d=a.getAccDescription(),f=a.getConfig(),p=j();t.debug(`Rendering Cynefin diagram`);let h=f.width,g=f.height,_=f.padding,v=f.showDomainDescriptions,y=f.boundaryAmplitude,b=h+_*2,x=g+_*2,S={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},C=m(n);c(C,x,b,f.useMaxWidth??!0),C.attr(`viewBox`,`0 0 ${b} ${x}`),u&&C.append(`title`).text(u),d&&C.append(`desc`).text(d);let N=C.append(`g`).attr(`transform`,`translate(${_}, ${_})`),P=A(h,g),F=w(f.seed,n),I=N.append(`g`).attr(`class`,`cynefin-backgrounds`),L=[`complex`,`complicated`,`chaotic`,`clear`];for(let e of L){let t=P[e];I.append(`rect`).attr(`class`,`cynefinDomain`).attr(`x`,t.x).attr(`y`,t.y).attr(`width`,t.w).attr(`height`,t.h).attr(`fill`,S[e]).attr(`fill-opacity`,.4).attr(`stroke`,`none`)}let R=N.append(`g`).attr(`class`,`cynefin-boundaries`);R.append(`path`).attr(`class`,`cynefinBoundary`).attr(`d`,T(h,g,F,y)).attr(`fill`,`none`),R.append(`path`).attr(`class`,`cynefinBoundary`).attr(`d`,E(h,g,F+100,y)).attr(`fill`,`none`),R.append(`path`).attr(`class`,`cynefinCliff`).attr(`d`,D(h,g)).attr(`fill`,`none`);let z=h*.15,B=g*.15;N.append(`path`).attr(`class`,`cynefinConfusion`).attr(`d`,O(h/2,g/2,z,B)).attr(`fill`,S.confusion).attr(`fill-opacity`,.5);let V=N.append(`g`).attr(`class`,`cynefin-labels`);for(let e of L){let t=P[e];V.append(`text`).attr(`class`,`cynefinDomainLabel`).attr(`x`,t.cx).attr(`y`,v?t.cy-30:t.cy).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(e.charAt(0).toUpperCase()+e.slice(1))}if(V.append(`text`).attr(`class`,`cynefinDomainLabel`).attr(`x`,h/2).attr(`y`,v?g/2-10:g/2).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(`Confusion`),v){let e=N.append(`g`).attr(`class`,`cynefin-subtitles`);for(let t of L){let n=P[t],r=k[t];e.append(`text`).attr(`class`,`cynefinSubtitle`).attr(`x`,n.cx).attr(`y`,n.cy-10).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(r.model),e.append(`text`).attr(`class`,`cynefinSubtitle`).attr(`x`,n.cx).attr(`y`,n.cy+5).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(r.practice)}e.append(`text`).attr(`class`,`cynefinSubtitle`).attr(`x`,h/2).attr(`y`,g/2+8).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(k.confusion.practice)}let H=N.append(`g`).attr(`class`,`cynefin-items`);for(let e of[`complex`,`complicated`,`chaotic`,`clear`,`confusion`]){let t=o.get(e);if(!t||t.items.length===0)continue;let n=P[e],r=e===`confusion`,i=t.items,a=0;r&&t.items.length>M&&(a=t.items.length-M,i=t.items.slice(0,M));let s;if(r){let e=v?22:14;s=n.cy+e}else s=n.cy+(v?25:15);if([...i].forEach((t,r)=>{let i=s+r*30,a=H.append(`g`),o=a.append(`text`).attr(`class`,`cynefinItemText`).attr(`x`,0).attr(`y`,26/2).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).text(t.label),c=t.label.length*7,l=o.node();if(l&&typeof l.getBBox==`function`){let e=l.getBBox();e.width>0&&(c=e.width)}let u=c+20,d=n.cx-u/2;a.attr(`transform`,`translate(${d}, ${i})`),a.insert(`rect`,`text`).attr(`class`,`cynefinItem`).attr(`x`,0).attr(`y`,0).attr(`width`,u).attr(`height`,26).attr(`rx`,4).attr(`ry`,4).attr(`fill`,S[e]).attr(`fill-opacity`,.95),o.attr(`x`,u/2).attr(`y`,26/2)}),a>0){let t=s+i.length*30,r=`+${a} more`,o=H.append(`g`),c=o.append(`text`).attr(`class`,`cynefinItemText`).attr(`x`,0).attr(`y`,26/2).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).text(r),l=r.length*7,u=c.node();if(u&&typeof u.getBBox==`function`){let e=u.getBBox();e.width>0&&(l=e.width)}let d=l+20,f=n.cx-d/2;o.attr(`transform`,`translate(${f}, ${t})`),o.insert(`rect`,`text`).attr(`class`,`cynefinItemOverflow`).attr(`x`,0).attr(`y`,0).attr(`width`,d).attr(`height`,26).attr(`rx`,4).attr(`ry`,4).attr(`fill`,S[e]).attr(`fill-opacity`,.6),c.attr(`x`,d/2).attr(`y`,26/2)}}if(s.length>0){let e=C.select(`defs`).empty()?C.append(`defs`):C.select(`defs`),r=`cynefin-arrow-${n}`;e.append(`marker`).attr(`id`,r).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`cynefinArrowHead`);let i=N.append(`g`).attr(`class`,`cynefin-arrows`);s.forEach(e=>{let n=P[e.from],a=P[e.to];if(!n||!a)return;if(e.from===e.to){t.warn(`Cynefin renderer: skipping self-loop on domain "${e.from}"`);return}let o=n.cx,s=n.cy,c=a.cx,l=a.cy,u=(o+c)/2,d=(s+l)/2,f=c-o,p=l-s,m=Math.sqrt(f*f+p*p),h=m*.15,g=-p/m,_=f/m,v=u+g*h,y=d+_*h;i.append(`path`).attr(`class`,`cynefinArrowLine`).attr(`d`,`M${o},${s} Q${v},${y} ${c},${l}`).attr(`fill`,`none`).attr(`marker-end`,`url(#${r})`),e.label&&i.append(`text`).attr(`class`,`cynefinArrowLabel`).attr(`x`,v).attr(`y`,y-6).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`auto`).text(e.label)})}l&&N.append(`text`).attr(`class`,`cynefinTitle`).attr(`x`,h/2).attr(`y`,-_/2).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(l)},`draw`)},P=e(()=>p(n(),s().themeVariables).cynefin,`getCynefinTheme`),F={parser:x,db:y,renderer:N,styles:e(()=>{let e=P();return`
|
|
2
2
|
.cynefinDomain {
|
|
3
3
|
stroke: none;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{x as n}from"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{x as n}from"./chunk-WYO6CB5R-DyuwB_K1.js";import"./chunk-ICXQ74PX-ul7urQ-O.js";import"./chunk-C7G6YPKG-BPbg-Z4N.js";import{n as r}from"./chunk-OGEWGWER-oC3NFfk1.js";import"./chunk-HOUHSVGY-DTZPduF8.js";import"./chunk-Q4XR5HBZ-BEgLgPw6.js";import{a as i,c as a,i as o,l as s,n as c,t as l,u}from"./chunk-ZGVPDNZ5-C8jJ41Go.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import{_ as d,g as f,m as p,v as m,y as h}from"./index-DR6NR8XX.js";import{t as g}from"./graphlib-DS17s2tU.js";import{t as _}from"./dagre-dpRSp0QF.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./chunk-RYQCIY6F-BZKWq7vX.js";var w=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),T=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),E=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`,`shouldMergeSelfLoopSegments`),D=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return T(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:T(i)},`getSelfLoopSide`),O=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=w(Math.max(r,e.width*.35),36,c),u=w(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),k=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),A=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=D(e,l,n,c.start,a),f=O(l,d,t,u.width??0),p=k(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),j=e(async(n,c,l,p,m,g)=>{t.warn(`Graph in recursive render:XAX`,x(c),m);let b=c.graph().rankdir;t.trace(`Dir in recursive render - dir:`,b);let C=n.insert(`g`).attr(`class`,`root`);c.nodes()?t.info(`Recursive render XXX`,c.nodes()):t.info(`No nodes found for`,c),c.edges().length>0&&t.info(`Recursive edges`,c.edge(c.edges()[0]));let w=C.insert(`g`).attr(`class`,`clusters`),T=C.insert(`g`).attr(`class`,`edgePaths`),D=C.insert(`g`).attr(`class`,`edgeLabels`),O=C.insert(`g`).attr(`class`,`nodes`),k=E(l);await Promise.all(c.nodes().map(async function(e){let n=c.node(e);if(m!==void 0){let n=JSON.parse(JSON.stringify(m.clusterData));t.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,e,`
|
|
3
3
|
data=`,n.height,`
|
|
4
4
|
Parent cluster`,m.height),c.setNode(m.id,n),c.parent(e)||(t.trace(`Setting parent`,e,m.id),c.setParent(e,m.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(c.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,c.node(e));let{ranksep:r,nodesep:i}=c.graph();n.graph.setGraph({...n.graph.graph(),ranksep:r+25,nodesep:i});let a=await j(O,n.graph,l,p,c.node(e),g),o=a.elem;u(n,o),n.diff=a.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),s(o,n)}else c.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,c),t.trace(y(n.id,c)),S.set(n.id,{id:y(n.id,c),node:n})):(t.trace(`Node - the non recursive path XAX`,e,O,c.node(e),b),await i(O,c.node(e),{config:g,dir:b}))})),await e(async()=>{let e=c.edges().map(async function(e){let n=c.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(c.edge(e))),t.info(`Fix`,S,`ids:`,e.v,e.w,`Translating: `,S.get(e.v),S.get(e.w)),k&&n.selfLoop){if(n.selfLoop.order!==1)return;let e=n.id;n.id=n.selfLoop.id,await d(D,n),n.id=e;return}await d(D,n)});await Promise.all(e)},`processEdges`)(),t.info(`Graph before layout:`,JSON.stringify(x(c))),t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),_(c),t.info(`Graph after layout:`,JSON.stringify(x(c)));let M=0,{subGraphTitleTotalMargin:N}=r(g);await Promise.all(v(c).map(async function(e){let n=c.node(e);if(t.info(`Position XBX => `+e+`: (`+n.x,`,`+n.y,`) width: `,n.width,` height: `,n.height),n?.clusterNode)n.y+=N,t.info(`A tainted cluster node XBX1`,e,n.id,n.width,n.height,n.x,n.y,c.parent(e)),S.get(n.id).node=n,a(n);else if(c.children(e).length>0){t.info(`A pure cluster node XBX1`,e,n.id,n.x,n.y,n.width,n.height,c.parent(e)),n.height+=N,c.node(n.parentId);let r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;t.debug(`OffsetY`,a,`labelHeight`,i,`halfPadding`,r),await o(w,n),S.get(n.id).node=n}else{let e=c.node(n.parentId);n.y+=N/2,t.info(`A regular node XBX1 - using the padding`,n.id,`parent`,n.parentId,n.width,n.height,n.x,n.y,`offsetY`,n.offsetY,`parent`,e,e?.offsetY,n),a(n)}}));let P=N/2;return A(c,P,{mergeSelfLoops:k}).forEach(function({edge:e,start:n,end:r}){t.info(`Edge `+n+` -> `+r+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=P);let i=c.node(n),a=c.node(r);h(e,f(T,e,S,l,i,a,p))}),c.nodes().forEach(function(e){let n=c.node(e);t.info(e,n.type,n.diff),n.isGroup&&(M=n.diff)}),t.warn(`Returning from recursive render XAX`,C,M),{elem:C,diff:M}},`recursiveRender`),M=e(async(e,r)=>{let i=new g({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=r.select(`g`);m(a,e.markers,e.type,e.diagramId),c(),p(),l(),b(),e.nodes.forEach(e=>{i.setNode(e.id,{...e}),e.parentId&&i.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,n=t+`---`+t+`---1`,r=t+`---`+t+`---2`,a=i.node(t);i.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),i.setParent(n,a.parentId),i.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),i.setParent(r,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,i.setEdge(t,n,s,t+`-cyclic-special-0`),i.setEdge(n,r,c,t+`-cyclic-special-1`),i.setEdge(r,t,l,t+`-cyclic-special-2`)}else i.setEdge(e.start,e.end,{...e},e.id)}),t.warn(`Graph at first:`,JSON.stringify(x(i))),C(i),t.warn(`Graph after XAX:`,JSON.stringify(x(i)));let o=n();await j(a,i,e.type,e.diagramId,void 0,o)},`render`);export{A as getEdgesToRender,M as render};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DgGH3qgX.js";import{H as r,K as i,U as a,Y as o,a as s,b as c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DgGH3qgX.js";import{H as r,K as i,U as a,Y as o,a as s,b as c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{_ as h,i as g,t as ee}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{T as te}from"./chunk-KEIR6QF5-Dj-OpFgW.js";import{n as ne}from"./mermaid-parser.core-D7RD-ESl.js";import{t as re}from"./chunk-JWPE2WC7-DVXcaiue.js";var _=`position frame`,v=`frame positioned`,y=`position relation`,b=`relation positioned`,ie=e(function(e){t.debug(`options str`,e)},`setOptions`),ae=e(function(){return{}},`getOptions`),oe=e(function(){x(),s()},`clear`);function x(){S={}}e(x,`reset`);var se=l.eventmodeling,ce=e(()=>g({...se,...c().eventmodeling}),`getConfig`),S={};function C(){let e=le,{ast:n}=S,r=E();if(!n)throw Error(`No data for EventModel`);return n.frames.forEach((i,a)=>{let o=N(i,n.dataEntities,r);e=q(e,{$kind:_,index:a,frame:i,textProps:o});let s;B(i)?(t.debug(`source frame`,i.sourceFrames),s=n.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=q(e,{$kind:y,index:a,frame:i,sourceFrame:t})})):e=q(e,{$kind:y,index:a,frame:i})}),e={...e,sortedSwimlanesArray:L(e.swimlanes)},e}e(C,`getState`);function w(e){S.ast=e}e(w,`setAst`);var T={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function E(){return T}e(E,`getDiagramProps`);var le={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function D(e){let t=e.split(`.`);if(t.length===2)return t[0]}e(D,`extractNamespace`);function O(e){let t=e.split(`.`);return t.length===2?t[1]:e}e(O,`extractName`);function k(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}e(k,`findSwimlaneByNamespace`);function A(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}e(A,`findNextAvailableIndex`);function j(e,t){let n=D(e.entityIdentifier),r=k(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||T.labelUiAutomation}:n?{index:A(t,0,100),label:T.labelUiAutomationPrefix+n}:{index:0,label:T.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||T.labelCommandReadModel}:n?{index:A(t,100,200),label:T.labelCommandReadModelPrefix+n}:{index:100,label:T.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||T.labelEvents}:n?{index:A(t,200,300),label:T.labelEventsPrefix+n}:{index:200,label:T.labelEvents}}}e(j,`calculateSwimlaneProps`);function M(e){let{themeVariables:t}=c();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}e(M,`calculateEntityVisualProps`);function N(e,n,r){let i=c(),a=m(O(e.entityIdentifier)??``,i),o,s={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},l=`<b>${h(a,r.textMaxWidth,s)}</b>`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=m(o,i),o=h(o,r.textMaxWidth,s),o=o.replaceAll(` `,` `)),e.dataReference){let t=n.find(t=>t.name===e.dataReference?.$refText);t&&(o=t.dataBlockValue,o=o.substring(o.indexOf(`{
|
|
2
2
|
`)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=m(o,i),o=h(o,r.textMaxWidth,s),o=o.replaceAll(` `,` `),o+=`<br/>`)}let u=o!==void 0;u&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${r.textMaxWidth}px">${o}</code>`);let d={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},f=ee(l,d),p=u?f.width/3:f.width,g={content:l,width:p,height:f.height};return t.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}e(N,`calculateTextProps`);function P(e,t){let n=t,r=M(n.frame),i={width:n.textProps.width+2*T.boxTextPadding,height:n.textProps.height+2*T.boxTextPadding};return[{$kind:v,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}e(P,`decidePositionFrame`);function F(e,t,n){return t===void 0?T.contentStartX:t.index===e.index&&e.r?e.r+T.boxPadding:n===void 0?T.contentStartX:n.r-T.boxOverlap+T.boxPadding}e(F,`calculateX`);function I(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}e(I,`calculateMaxRight`);function L(e){return Object.values(e).sort((e,t)=>e.index-t.index)}e(L,`sortedSwimlanesArray`);function R(e,t){let n=t,r=j(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*T.swimlaneMinHeight+T.swimlaneGap,height:T.swimlaneMinHeight,maxHeight:T.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(T.boxMinWidth,Math.min(T.boxMaxWidth,n.dimension.width))+2*T.boxPadding,height:Math.max(T.boxMinHeight,Math.min(T.boxMaxHeight,n.dimension.height))+2*T.boxPadding},c=F(i,o,a),l=c+s.width+T.boxPadding,u=I(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(T.swimlaneMinHeight,i.maxHeight)+2*T.swimlanePadding;let d={x:c,y:T.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=L(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+T.swimlaneGap}return f}e(R,`evolveFramePositioned`);function z(e,t){return e===0&&t.sourceFrames.length===0}e(z,`isFirstFrame`);function B(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}e(B,`hasSourceFrame`);function V(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}e(V,`findBoxByFrame`);function H(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}e(H,`findBoxByLineIndex`);function U(e,t){let n=t;if(te(n.frame)||z(n.index,n.frame))return[];let r=V(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let i;return i=n.sourceFrame?V(e.boxes,n.sourceFrame):H(e.boxes,r.swimlane.index,n.index-1),i===void 0?[]:[{$kind:b,frame:n.frame,index:n.index,sourceBox:i,targetBox:r}]}e(U,`decidePositionRelation`);function W(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}e(W,`evolveRelationPositioned`);var ue={[_]:P,[y]:U},de={[v]:R,[b]:W};function G(e,n){let r=ue[n.$kind];if(r==null)return[];let i=r(e,n);return t.debug(`decided events`,i),i}e(G,`decide`);function K(e,n){let r=n.reduce((e,t)=>{let n=de[t.$kind];return n==null?e:n(e,t)},e);return t.debug(`evolve events`,{state:e,newState:r,events:n}),r}e(K,`evolve`);function q(e,t){return K(e,G(e,t))}e(q,`dispatch`);var J={getConfig:ce,setOptions:ie,getOptions:ae,clear:oe,setAccTitle:a,getAccTitle:p,getAccDescription:u,setAccDescription:r,setDiagramTitle:i,getDiagramTitle:d,setAst:w,getDiagramProps:E,getState:C},fe={parse:e(async e=>{let n=await ne(`eventmodeling`,e);t.debug(n),J.setAst(n),re(n,J)},`parse`)},Y=f()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}e(X,`renderD3Box`);function Z(e,t){return e>t}e(Z,`dirUpwards`);function Q(e,n,r,i){return a=>{let o=a.sourceBox.swimlane.y+n.swimlanePadding,s=a.targetBox.swimlane.y+n.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;t.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${r})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}e(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}e($,`renderD3Swimlane`);var pe={parser:fe,db:J,renderer:{draw:e(function(e,r,i,a){if(t.debug(`in eventmodeling renderer`,e+`
|
|
3
3
|
`,`id:`,r,i),!Y)throw Error(`EventModeling config not found`);let s=a.db,{themeVariables:c,eventmodeling:l}=f(),u=n(`[id="${r}"]`),d=s.getDiagramProps(),p=s.getState(),m=`em-arrowhead-${r}`,h=c.emArrowhead??`#000000`;p.sortedSwimlanesArray.forEach($(u,p.maxR,d,c)),p.boxes.forEach(X(u,d)),p.relations.forEach(Q(u,d,m,c)),u.append(`defs`).append(`marker`).attr(`id`,m).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),o(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:e(e=>``,`getStyles`)};export{pe as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DgGH3qgX.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,f as u,v as d,w as f,y as p}from"./chunk-WYO6CB5R-B30LkIxf.js";import{t as m}from"./ordinal-hYBb2elL.js";import{t as h}from"./defaultLocale-C8Fc0cco.js";import{i as g}from"./chunk-ICXQ74PX-BymQ2bTJ.js";import{i as _,n as v}from"./chunk-C7G6YPKG-DQ2TCigV.js";import{C as y}from"./index-FymDtfca.js";import{n as b}from"./mermaid-parser.core-D7RD-ESl.js";import{t as x}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as S}from"./chunk-VR4S4FIN-C_qWc7EX.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var ne=(1+Math.sqrt(5))/2;function re(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ee(c,n,r,i,h?r+=m*g/h:a):te(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ie=(function e(t){function n(e,n,r,i,a){re(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=p,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=d,this.setAccDescription=i}static{e(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=c();return g({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{v(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){s(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{x(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await b(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let s=o.db,u=s.getConfig(),d=u.padding??ce,f=s.getDiagramTitle(),p=s.getRoot(),{themeVariables:g}=c();if(!p)return;let v=f?30:0,b=y(i),x=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=x,T=C+v;b.attr(`viewBox`,`0 0 ${w} ${T}`),l(b,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&b.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=b.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=_({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>_({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(o<U||s<U){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(u<V&&c===B));)t.style(`font-size`,`${c}px`),d=c+W+u;t.style(`font-size`,`${c}px`),I?(c<B||s<B)&&t.style(`display`,`none`):(a.getComputedTextLength()>o||c<B||s<c)&&t.style(`display`,`none`)}),u.showValues!==!1&&G.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o<V?t.style(`display`,`none`):t.style(`display`,null)}),S(b,u.diagramPadding??8,`flowchart`,u?.useMaxWidth||!1)},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:Z,get db(){return new Y},renderer:le,styles:e(({treemap:e}={})=>{let t=g(r(),c().themeVariables),n=g(ue,e),i=n.titleColor??t.titleColor,a=n.labelColor??t.textColor,o=n.valueColor??t.textColor;return`
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DgGH3qgX.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,f as u,v as d,w as f,y as p}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{t as m}from"./ordinal-hYBb2elL.js";import{t as h}from"./defaultLocale-C8Fc0cco.js";import{i as g}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{i as _,n as v}from"./chunk-C7G6YPKG-BPbg-Z4N.js";import{C as y}from"./index-DR6NR8XX.js";import{n as b}from"./mermaid-parser.core-D7RD-ESl.js";import{t as x}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as S}from"./chunk-VR4S4FIN-DgBVcAIW.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var ne=(1+Math.sqrt(5))/2;function re(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ee(c,n,r,i,h?r+=m*g/h:a):te(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ie=(function e(t){function n(e,n,r,i,a){re(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=p,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=d,this.setAccDescription=i}static{e(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=c();return g({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{v(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){s(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{x(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await b(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let s=o.db,u=s.getConfig(),d=u.padding??ce,f=s.getDiagramTitle(),p=s.getRoot(),{themeVariables:g}=c();if(!p)return;let v=f?30:0,b=y(i),x=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=x,T=C+v;b.attr(`viewBox`,`0 0 ${w} ${T}`),l(b,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&b.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=b.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=_({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>_({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(o<U||s<U){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(u<V&&c===B));)t.style(`font-size`,`${c}px`),d=c+W+u;t.style(`font-size`,`${c}px`),I?(c<B||s<B)&&t.style(`display`,`none`):(a.getComputedTextLength()>o||c<B||s<c)&&t.style(`display`,`none`)}),u.showValues!==!1&&G.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+_({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o<V?t.style(`display`,`none`):t.style(`display`,null)}),S(b,u.diagramPadding??8,`flowchart`,u?.useMaxWidth||!1)},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:Z,get db(){return new Y},renderer:le,styles:e(({treemap:e}={})=>{let t=g(r(),c().themeVariables),n=g(ue,e),i=n.titleColor??t.titleColor,a=n.labelColor??t.textColor,o=n.valueColor??t.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${n.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${n.sectionStrokeWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{H as n,K as r,U as i,a,b as o,c as s,f as c,v as l,w as u,y as d}from"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{H as n,K as r,U as i,a,b as o,c as s,f as c,v as l,w as u,y as d}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{i as f}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{C as p}from"./index-DR6NR8XX.js";import{n as m}from"./mermaid-parser.core-D7RD-ESl.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";var g=c.packet,_=class{constructor(){this.packet=[],this.setAccTitle=i,this.getAccTitle=d,this.setDiagramTitle=r,this.getDiagramTitle=u,this.getAccDescription=l,this.setAccDescription=n}static{e(this,`PacketDB`)}getConfig(){let e=f({...g,...o().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){a(),this.packet=[]}},v=1e4,y=e((e,n)=>{h(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=e((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:e(async e=>{let n=await m(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=e((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:c,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+c,h=m*(d.length+1)-(f?0:o),g=l*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),s(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=e((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:e(({packet:e}={})=>{let t=f(T,e);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${t.byteFontSize};
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{H as n,K as r,U as i,a,b as o,c as s,f as c,v as l,w as u,y as d,z as f}from"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{H as n,K as r,U as i,a,b as o,c as s,f as c,v as l,w as u,y as d,z as f}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{i as p}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{r as m,t as h}from"./chunk-HOUHSVGY-DTZPduF8.js";import{C as g}from"./index-DR6NR8XX.js";import{n as _}from"./mermaid-parser.core-D7RD-ESl.js";import{t as v}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as y}from"./chunk-2Q5K7J3B-C1jixKkw.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}e(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}e(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}e(k,`remapErrorLines`);function A(e){let t=e.split(`
|
|
2
2
|
`),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``){o.push(r),s++,n.set(s,c);continue}if(T.test(r)){o.push(r),s++,n.set(s,c);continue}if(w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
|
|
3
3
|
`),lineMap:n}}e(A,`preprocessBoxDrawing`);var j=new y(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=e(()=>{j.reset(),a()},`clear`),N=e(()=>j.records.stack[0],`getRoot`),P=e(()=>j.records.cnt,`getCount`),F=c.treeView,I={clear:M,addNode:e((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:e(()=>p(F,o().treeView),`getConfig`),getAccTitle:d,getAccDescription:l,getDiagramTitle:u,setAccDescription:n,setAccTitle:i,setDiagramTitle:r},L=e(e=>{v(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,a=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?f(l,o()):void 0;I.addNode(e,n,i,a,c,u)}},`populate`),R={parse:e(async e=>{let{text:n,lineMap:r}=A(e);try{let e=await _(`treeView`,n);t.debug(e),L(e)}catch(e){throw r.size>0&&e instanceof Error&&(e.message=k(e.message,r)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:`<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>`},file:{body:`<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>`}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}e(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}e(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}e(H,`getNodeIcon`),m([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=e((e,t)=>`tv-icon-${e}-${t.replace(/[^\w-]/g,`-`)}`,`iconSymbolId`),q=e(async(t,n,r,i)=>{let a=new Set,o=e(e=>{let t=H(e,r);t&&a.add(t),e.children.forEach(o)},`collect`);if(o(n),a.size===0)return;let s=await Promise.all([...a].map(async e=>({icon:e,svg:await h(e,{height:U,width:U})}))),c=t.append(`defs`);for(let{icon:e,svg:t}of s)c.append(`g`).attr(`id`,K(i,e)).html(t)},`injectIconDefs`),J=e((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`use`).attr(`xlink:href`,`#${K(a,l)}`).attr(`x`,e+i.paddingX).attr(`y`,t+i.paddingY).attr(`class`,`treeView-node-icon`);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),Y=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),X=e((t,n,r,i)=>{let a=0,o=0,s=[],c=e((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=J(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;Y(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=e((e,n=0)=>{c(t,e,r,n),e.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=e.BBox;if(e.children.length){let{y:n,height:s}=e.children[e.children.length-1].BBox;Y(t,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),Z={draw:e(async(e,n,r,i)=>{t.debug(`Rendering treeView diagram
|
|
4
4
|
`+e);let a=i.db,o=a.getRoot(),c=a.getConfig(),l=g(n);await q(l,o,c,n);let u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=X(u,o,c,n);l.attr(`viewBox`,`-${c.lineThickness/2} 0 ${f} ${d}`),s(l,d,f,c.useMaxWidth)},`draw`)},Q={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},$={db:I,renderer:Z,parser:R,styles:e(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=p(Q,e);return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f}from"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f}from"./chunk-WYO6CB5R-DyuwB_K1.js";import{i as p}from"./chunk-ICXQ74PX-ul7urQ-O.js";import{C as m}from"./index-DR6NR8XX.js";import{n as h}from"./mermaid-parser.core-D7RD-ESl.js";import{t as g}from"./chunk-JWPE2WC7-DVXcaiue.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=l.radar,x=e(()=>p({...b,...s().radar}),`getConfig`),S=e(()=>y.axes,`getAxes`),C=e(()=>y.curves,`getCurves`),w=e(()=>y.options,`getOptions`),T=e(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=e(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=e(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:e(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:e(()=>{o(),y=structuredClone(v)},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r},k=e(e=>{g(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:e(async e=>{let n=await h(`radar`,e);t.debug(n),k(n)},`parse`)},j=e((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=e((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return c(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=e((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=e((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}e(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}e(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}e(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}e(R,`drawLegend`);var z={draw:j},B=e((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
|
|
2
2
|
.radarCurve-${r} {
|
|
3
3
|
color: ${i};
|
|
4
4
|
fill: ${i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DAXXjFlN.js";import{d as t}from"./index-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DAXXjFlN.js";import{d as t}from"./index-DR6NR8XX.js";var n={rect:`rectangle`,circle:`ellipse`},r={startOnLoad:!1,flowchart:{curve:`linear`},themeVariables:{fontSize:`20px`},maxEdges:500,maxTextSize:5e4},i=class{constructor({converter:e}){this.convert=(e,t)=>this.converter(e,{...t,fontSize:t.fontSize||20}),this.converter=e}},a;(function(e){e.ROUND=`round`,e.STADIUM=`stadium`,e.DOUBLECIRCLE=`doublecircle`,e.CIRCLE=`circle`,e.DIAMOND=`diamond`,e.CYLINDER=`cylinder`})(a||={});var o;(function(e){e.COLOR=`color`})(o||={});var s;(function(e){e.FILL=`fill`,e.STROKE=`stroke`,e.STROKE_WIDTH=`stroke-width`,e.STROKE_DASHARRAY=`stroke-dasharray`})(s||={});var c=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeMarkdown=void 0,e.removeMarkdown=function(e,t){t===void 0&&(t={listUnicodeChar:``}),t||={},t.listUnicodeChar=t.hasOwnProperty(`listUnicodeChar`)?t.listUnicodeChar:!1,t.stripListLeaders=!t.hasOwnProperty(`stripListLeaders`)||t.stripListLeaders,t.gfm=!t.hasOwnProperty(`gfm`)||t.gfm,t.useImgAltText=!t.hasOwnProperty(`useImgAltText`)||t.useImgAltText,t.preserveLinks=t.hasOwnProperty(`preserveLinks`)?t.preserveLinks:!1;var n=e||``;n=n.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,``);try{t.stripListLeaders&&(n=t.listUnicodeChar?n.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,t.listUnicodeChar+` $1`):n.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,`$1`)),t.gfm&&(n=n.replace(/\n={2,}/g,`
|
|
2
2
|
`).replace(/~{3}.*\n/g,``).replace(/~~/g,``).replace(/`{3}.*\n/g,``)),t.preserveLinks&&(n=n.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,`$1 ($2)`)),n=n.replace(/<[^>]*>/g,``).replace(/^[=\-]{2,}\s*$/g,``).replace(/\[\^.+?\](\: .*?$)?/g,``).replace(/\s{0,2}\[.*?\]: .*?$/g,``).replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,t.useImgAltText?`$1`:``).replace(/\[(.*?)\][\[\(].*?[\]\)]/g,`$1`).replace(/^\s{0,3}>\s?/g,``).replace(/(^|\n)\s{0,3}>\s?/g,`
|
|
3
3
|
|
|
4
4
|
`).replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,``).replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,`$1$2$3`).replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,`$2`).replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,`$2`).replace(/(`{3,})(.*?)\1/gm,`$2`).replace(/`(.+?)`/g,`$1`).replace(/\n{2,}/g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import"./chunk-WYO6CB5R-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-DgGH3qgX.js";import"./chunk-WYO6CB5R-DyuwB_K1.js";import"./index-DR6NR8XX.js";import{f as n,t as r}from"./mermaid-parser.core-D7RD-ESl.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-DmL90VtN.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=n().RailroadEbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=e(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=e((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=e(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{o.clear(),t.debug(`[EBNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new r(n);let i=n.value;t.debug(`[EBNF Parser] Parsed rules:`,i.rules.length),h(i),t.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
|