mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
63 lines • 106 kB
JavaScript
import{a as k}from"./chunk-5IMINLNL.mjs";import{a as Jt,b as bt,d as v,e as P}from"./chunk-ZNLK7HRR.mjs";import{b as Tt,d as ot}from"./chunk-DZP67EKU.mjs";import{d as xt}from"./chunk-2NMSUPJH.mjs";import{k as $t,n as Kt,r as gt,t as q}from"./chunk-VY2OSTJR.mjs";import{A as kt,C as It,D as Zt,_ as U,ba as Ct,j as Ut,n as lt,t as ut,x as ct}from"./chunk-QJSWEUOL.mjs";import{b as _,h as K}from"./chunk-H7VHZCWX.mjs";import{a as x}from"./chunk-AQ6EADP3.mjs";var Is=1,Ls=3;async function Rt(p){let t=p.getElementsByTagName("img");if(!t||t.length===0)return;let o=!Qt(p);await Promise.all([...t].map(l=>new Promise(h=>{function a(){if(l.style.display="flex",l.style.flexDirection="column",o){let f=U().fontSize?U().fontSize:window.getComputedStyle(document.body).fontSize,i=5,[n=Ut.fontSize]=Kt(f),r=n*i+"px";l.style.minWidth=r,l.style.maxWidth=r}else l.style.width="100%";h(l)}x(a,"setupImage"),setTimeout(()=>{l.complete&&a()}),l.addEventListener("error",a),l.addEventListener("load",a)})))}x(Rt,"configureLabelImages");function Qt(p){return p.nodeType===Ls?p.textContent?.trim()!=="":p.nodeType!==Is||p.tagName.toLowerCase()==="img"?!1:[...p.childNodes].some(Qt)}x(Qt,"hasTextBesidesImages");var te=3,Vs=32,ee=x(async(p,t,o)=>{let l=U(),h=p.insert("g").attr("class",o??"node default").attr("id",t.domId||t.id),a=h.insert("g").attr("class","label").attr("style",q(t.labelStyle)),i=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),n=t.width?Math.max(t.width-2*(t.padding??0),Vs):U().flowchart?.wrappingWidth??200,e=l.c4?.wrap??!0?n:Number.POSITIVE_INFINITY,s=await Promise.all(i.map(async y=>{let b=a.append("g").attr("class",y.cssClass),S=await ot(b,kt(gt(y.text??""),l),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:e,style:t.labelStyle},l);return K(S).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),K(S).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:b,box:b.node().getBBox()}})),c=Math.max(...s.map(({box:y})=>y.width),0),m=0;for(let{el:y,box:b}of s)y.attr("transform",`translate(${c/2-b.x-b.width/2}, ${m-b.y})`),m+=b.height+te;let g=s.length>0?m-te:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-c/2}, ${-g/2})`);let d=a.node().getBBox(),u=(t.padding??0)/2;return{shapeSvg:h,bbox:d,halfPadding:u,label:a}},"c4LabelHelper");var B=x(async(p,t,o)=>{if(t.stereotype!==void 0)return ee(p,t,o);let l,h=t.useHtmlLabels||lt(U()?.htmlLabels);o?l=o:l="node default";let a=p.insert("g").attr("class",l).attr("id",t.domId||t.id),f=a.insert("g").attr("class","label").attr("style",q(t.labelStyle)),i;t.label===void 0?i="":i=typeof t.label=="string"?t.label:t.label[0];let n=!!t.icon||!!t.img,r=t.labelType==="markdown",e=await ot(f,kt(gt(i),U()),{useHtmlLabels:h,width:t.width||t.wrappingWidth||U().flowchart?.wrappingWidth,classes:r?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:n,markdown:r},U()),s=(t?.padding??0)/2,c;if(h){let m=e.children[0],g=K(e);await Rt(m),c=await Tt.measure(()=>m.getBoundingClientRect()),g.attr("width",c.width),g.attr("height",c.height)}else c=await Tt.measure(()=>e.getBBox());return h?f.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):f.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&f.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),f.insert("rect",":first-child"),{shapeSvg:a,bbox:c,halfPadding:s,label:f}},"labelHelper"),Gt=x(async(p,t,o)=>{let l=o.useHtmlLabels??ct(U()),h=p.insert("g").attr("class","label").attr("style",o.labelStyle||""),a=await ot(h,kt(gt(t),U()),{useHtmlLabels:l,width:o.width||U()?.flowchart?.wrappingWidth,style:o.labelStyle,addSvgBackground:!!o.icon||!!o.img}),f=o.padding/2,i;if(ct(U())){let n=a.children[0],r=K(a);i=await Tt.measure(()=>n.getBoundingClientRect()),r.attr("width",i.width),r.attr("height",i.height)}else i=await Tt.measure(()=>a.getBBox());return l?h.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"):h.attr("transform","translate(0, "+-i.height/2+")"),o.centerLabel&&h.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),h.insert("rect",":first-child"),{shapeSvg:p,bbox:i,halfPadding:f,label:h}},"insertLabel"),D=x((p,t,o)=>{if(o){p.width=o.width,p.height=o.height;return}let l=t.node().getBBox();p.width=l.width,p.height=l.height},"updateNodeBounds");var T=x((p,t)=>(p.look==="handDrawn"?"rough-node":"node")+" "+p.cssClasses+" "+(t||""),"getNodeClasses");function W(p){let t=p.map((o,l)=>`${l===0?"M":"L"}${o.x},${o.y}`);return t.push("Z"),t.join(" ")}x(W,"createPathFromPoints");function at(p,t,o,l,h,a){let f=[],n=o-p,r=l-t,e=n/a,s=2*Math.PI/e,c=t+r/2;for(let m=0;m<=50;m++){let g=m/50,d=p+g*n,u=c+h*Math.sin(s*(d-p));f.push({x:d,y:u})}return f}x(at,"generateFullSineWavePoints");function it(p,t,o,l,h,a){let f=[],i=h*Math.PI/180,e=(a*Math.PI/180-i)/(l-1);for(let s=0;s<l;s++){let c=i+s*e,m=p+o*Math.cos(c),g=t+o*Math.sin(c);f.push({x:-m,y:-g})}return f}x(it,"generateCirclePoints");function Lt(p){let t=Array.from(p.childNodes).filter(n=>n.tagName==="path"),o=document.createElementNS("http://www.w3.org/2000/svg","path"),l=t.map(n=>n.getAttribute("d")).filter(n=>n!==null).join(" ");o.setAttribute("d",l);let h=t.find(n=>n.getAttribute("fill")!=="none"),a=t.find(n=>n.getAttribute("stroke")!=="none"),f=x((n,r)=>n?.getAttribute(r)??void 0,"getAttr");if(h){let n={fill:f(h,"fill"),"fill-opacity":f(h,"fill-opacity")??"1"};Object.entries(n).forEach(([r,e])=>{e&&o.setAttribute(r,e)})}if(a){let n={stroke:f(a,"stroke"),"stroke-width":f(a,"stroke-width")??"1","stroke-opacity":f(a,"stroke-opacity")??"1"};Object.entries(n).forEach(([r,e])=>{e&&o.setAttribute(r,e)})}let i=document.createElementNS("http://www.w3.org/2000/svg","g");return i.appendChild(o),i}x(Lt,"mergePaths");var Ws=x((p,t)=>{var o=p.x,l=p.y,h=t.x-o,a=t.y-l,f=p.width/2,i=p.height/2,n,r;return Math.abs(a)*f>Math.abs(h)*i?(a<0&&(i=-i),n=a===0?0:i*h/a,r=i):(h<0&&(f=-f),n=f,r=h===0?0:f*a/h),{x:o+n,y:l+r}},"intersectRect"),se=Ws;var tt=x((p,t,o,l,h)=>["M",p+h,t,"H",p+o-h,"A",h,h,0,0,1,p+o,t+h,"V",t+l-h,"A",h,h,0,0,1,p+o-h,t+l,"H",p+h,"A",h,h,0,0,1,p,t+l-h,"V",t+h,"A",h,h,0,0,1,p+h,t,"Z"].join(" "),"createRoundedRectPathD");var Ys=x(async(p,t,o,l=!1,h=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);let f=U(),i=ct(f);return await ot(p,a,{style:o,isTitle:l,useHtmlLabels:i,markdown:!1,isNode:h,width:Number.POSITIVE_INFINITY},f)},"createLabel"),Vt=Ys;function Fs(p,t){return p.intersect(t)}x(Fs,"intersectNode");var re=Fs;function _s(p,t,o,l){var h=p.x,a=p.y,f=h-l.x,i=a-l.y,n=Math.sqrt(t*t*i*i+o*o*f*f),r=Math.abs(t*o*f/n);l.x<h&&(r=-r);var e=Math.abs(t*o*i/n);return l.y<a&&(e=-e),{x:h+r,y:a+e}}x(_s,"intersectEllipse");var Et=_s;function Xs(p,t,o){return Et(p,t,t,o)}x(Xs,"intersectCircle");var oe=Xs;function qs(p,t,o,l){{let h=t.y-p.y,a=p.x-t.x,f=t.x*p.y-p.x*t.y,i=h*o.x+a*o.y+f,n=h*l.x+a*l.y+f,r=1e-6;if(i!==0&&n!==0&&ie(i,n))return;let e=l.y-o.y,s=o.x-l.x,c=l.x*o.y-o.x*l.y,m=e*p.x+s*p.y+c,g=e*t.x+s*t.y+c;if(Math.abs(m)<r&&Math.abs(g)<r&&ie(m,g))return;let d=h*s-e*a;if(d===0)return;let u=Math.abs(d/2),y=a*c-s*f,b=y<0?(y-u)/d:(y+u)/d;y=e*f-h*c;let S=y<0?(y-u)/d:(y+u)/d;return{x:b,y:S}}}x(qs,"intersectLine");function ie(p,t){return p*t>0}x(ie,"sameSign");var ae=qs;function zs(p,t,o){let l=p.x,h=p.y,a=[],f=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(e){f=Math.min(f,e.x),i=Math.min(i,e.y)}):(f=Math.min(f,t.x),i=Math.min(i,t.y));let n=l-p.width/2-f,r=h-p.height/2-i;for(let e=0;e<t.length;e++){let s=t[e],c=t[e<t.length-1?e+1:0],m=ae(p,o,{x:n+s.x,y:r+s.y},{x:n+c.x,y:r+c.y});m&&a.push(m)}return a.length?(a.length>1&&a.sort(function(e,s){let c=e.x-o.x,m=e.y-o.y,g=Math.sqrt(c*c+m*m),d=s.x-o.x,u=s.y-o.y,y=Math.sqrt(d*d+u*u);return g<y?-1:g===y?0:1}),a[0]):p}x(zs,"intersectPolygon");var ne=zs;var N={node:re,circle:oe,ellipse:Et,polygon:ne,rect:se};function le(p,t){let{labelStyles:o}=v(t);t.labelStyle=o;let l=T(t),h=l;l||(h="anchor");let a=p.insert("g").attr("class",h).attr("id",t.domId||t.id),f=1,{cssStyles:i}=t,n=k.svg(a),r=P(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(r.roughness=0);let e=n.circle(0,0,f*2,r),s=a.insert(()=>e,":first-child");return s.attr("class","anchor").attr("style",q(i)),D(t,s),t.intersect=function(c){return _.info("Circle intersect",t,f,c),N.circle(t,f,c)},a}x(le,"anchor");function ce(p,t,o,l,h,a,f){let n=(p+o)/2,r=(t+l)/2,e=Math.atan2(l-t,o-p),s=(o-p)/2,c=(l-t)/2,m=s/h,g=c/a,d=Math.sqrt(m**2+g**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");let u=Math.sqrt(1-d**2),y=n+u*a*Math.sin(e)*(f?-1:1),b=r-u*h*Math.cos(e)*(f?-1:1),S=Math.atan2((t-b)/a,(p-y)/h),w=Math.atan2((l-b)/a,(o-y)/h)-S;f&&w<0&&(w+=2*Math.PI),!f&&w>0&&(w-=2*Math.PI);let M=[];for(let R=0;R<20;R++){let C=R/19,O=S+C*w,E=y+h*Math.cos(O),G=b+a*Math.sin(O);M.push({x:E,y:G})}return M}x(ce,"generateArcPoints");function Us(p,t,o){let[l,h]=[t,o].sort((a,f)=>f-a);return h*(1-Math.sqrt(1-(p/l/2)**2))}x(Us,"calculateArcSagitta");async function he(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h,i=x(O=>O+f,"calcTotalHeight"),n=x(O=>{let E=O/2;return[E/(2.5+O/50),E]},"calcEllipseRadius"),{shapeSvg:r,bbox:e}=await B(p,t,T(t)),s=i(t?.height?t?.height:e.height),[c,m]=n(s),g=Us(s,c,m),u=(t?.width?t?.width:e.width)+a*2+g-g,y=s,{cssStyles:b}=t,S=[{x:u/2,y:-y/2},{x:-u/2,y:-y/2},...ce(-u/2,-y/2,-u/2,y/2,c,m,!1),{x:u/2,y:y/2},...ce(u/2,y/2,u/2,-y/2,c,m,!0)],$=k.svg(r),w=P(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let M=W(S),R=$.path(M,w),C=r.insert(()=>R,":first-child");return C.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${c/2}, 0)`),D(t,C),t.intersect=function(O){return N.polygon(t,S,O)},r}x(he,"bowTieRect");async function pe(p,t,{config:{themeVariables:o}}){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l;let{shapeSvg:a,bbox:f,label:i}=await B(p,t,T(t)),n=o?.nodeBorder??o?.lineColor??"currentColor",r=t.padding??12,e=Math.max(f.width+r*2,t.width??0,80),s=Math.max(Math.min(e*.08,12),5),c=Math.max(f.height+r*2+s,t.height??0),m=-c/2+s,g=c/2,d=e*.72,u=[`M${-e/2},${m}`,`L${-d/2},${g}`,`A${d/2},${s} 0 0 0 ${d/2},${g}`,`L${e/2},${m}`,`A${e/2},${s} 0 0 0 ${-e/2},${m}`,"Z"].join(" "),{cssStyles:y}=t,b=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let C=k.svg(a).path(u,P(t,{}));b.node()?.appendChild(C),y&&b.attr("style",y)}else b.append("path").attr("d",u).attr("style",h);b.append("ellipse").attr("cx",0).attr("cy",m).attr("rx",e/2).attr("ry",s).attr("style",`fill:none;stroke:${n};stroke-width:1px`),D(t,b);let S=m+(g-m)/2;i.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${S-f.height/2-(f.y-(f.top??0))})`);let $=12,w=x((R,C,O)=>Array.from({length:$+1},(E,G)=>{let L=Math.PI-G*Math.PI/$;return{x:R*Math.cos(L),y:C+O*s*Math.sin(L)}}),"arc"),M=[...w(e/2,m,-1),...w(d/2,g,1).reverse()];return t.intersect=function(R){return N.polygon(t,M,R)},a}x(pe,"bucket");var Wt=20,Yt=8,Zs=80,Ft=8;async function me(p,t){let{themeVariables:o}=U(),l=o.clusterBkg,h=o.clusterBorder,{nodeStyles:a}=v(t),{shapeSvg:f,bbox:i}=await B(p,t,T(t)),n=t.padding??8,r=i.height,e=Math.max(i.width+n*2,Zs,t?.width??0),s=Math.max(r+Yt+Wt+n*2,t?.height??0),c=-e/2,m=-s/2,g=-(Yt+Wt)/2,d=f.select(".label");d&&(t.useHtmlLabels??ct(U())?d.attr("transform",`translate(${-i.width/2}, ${-i.height/2+g})`):d.attr("transform",`translate(0, ${-i.height/2+g})`));let u;if(t.look==="handDrawn"){let w=k.svg(f),M=P(t,{fill:l,stroke:h,fillStyle:"solid"}),R=w.path(tt(c,m,e,s,Ft),M);u=f.insert(()=>R,":first-child"),u.attr("class","basic label-container collapsed-group").attr("style",q(t.cssStyles))}else u=f.insert("rect",":first-child"),u.attr("class","basic label-container collapsed-group").attr("style",a).attr("rx",Ft).attr("ry",Ft).attr("x",c).attr("y",m).attr("width",e).attr("height",s).attr("fill",l).attr("stroke",h);let y=m+n+r+Yt;f.append("line").attr("class","collapsed-separator").attr("x1",c+8).attr("y1",y).attr("x2",c+e-8).attr("y2",y).attr("stroke",h).attr("stroke-dasharray","3, 3");let b=y+Wt/2,S=2.5,$=10;for(let w=-1;w<=1;w++)f.append("circle").attr("class","collapsed-indicator").attr("cx",w*$).attr("cy",b).attr("r",S).attr("fill",h);return D(t,u),t.calcIntersect=function(w,M){return N.rect(w,M)},t.intersect=function(w){return N.rect(t,w)},f}x(me,"collapsedGroup");function et(p,t,o,l){return p.insert("polygon",":first-child").attr("points",l.map(function(h){return h.x+","+h.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+o/2+")")}x(et,"insertPolygonShape");var Ks=["right","left","up","down"],_t="point",Js=x(p=>{let t=new Set;for(let o of p)switch(o){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(o);break}return t},"expandAndDeduplicateDirections"),Qs=x(p=>Ks.filter(t=>p.has(t)).join("|")||_t,"getDirectionKey"),fe={"right|left|up|down":x(({height:p,midpoint:t,padding:o,width:l})=>[{x:0,y:0},{x:t,y:0},{x:l/2,y:2*o},{x:l-t,y:0},{x:l,y:0},{x:l,y:-p/3},{x:l+2*o,y:-p/2},{x:l,y:-2*p/3},{x:l,y:-p},{x:l-t,y:-p},{x:l/2,y:-p-2*o},{x:t,y:-p},{x:0,y:-p},{x:0,y:-2*p/3},{x:-2*o,y:-p/2},{x:0,y:-p/3}],"right|left|up|down"),"right|left|up":x(({height:p,midpoint:t,width:o})=>[{x:t,y:0},{x:o-t,y:0},{x:o,y:-p/2},{x:o-t,y:-p},{x:t,y:-p},{x:0,y:-p/2}],"right|left|up"),"right|left|down":x(({height:p,midpoint:t,width:o})=>[{x:0,y:0},{x:t,y:-p},{x:o-t,y:-p},{x:o,y:0}],"right|left|down"),"right|up|down":x(({height:p,midpoint:t,width:o})=>[{x:0,y:0},{x:o,y:-t},{x:o,y:-p+t},{x:0,y:-p}],"right|up|down"),"left|up|down":x(({height:p,midpoint:t,width:o})=>[{x:o,y:0},{x:0,y:-t},{x:0,y:-p+t},{x:o,y:-p}],"left|up|down"),"right|left":x(({height:p,midpoint:t,padding:o,width:l})=>[{x:t,y:0},{x:t,y:-o},{x:l-t,y:-o},{x:l-t,y:0},{x:l,y:-p/2},{x:l-t,y:-p},{x:l-t,y:-p+o},{x:t,y:-p+o},{x:t,y:-p},{x:0,y:-p/2}],"right|left"),"up|down":x(({height:p,midpoint:t,padding:o,width:l})=>[{x:l/2,y:0},{x:0,y:-o},{x:t,y:-o},{x:t,y:-p+o},{x:0,y:-p+o},{x:l/2,y:-p},{x:l,y:-p+o},{x:l-t,y:-p+o},{x:l-t,y:-o},{x:l,y:-o}],"up|down"),"right|up":x(({height:p,midpoint:t,width:o})=>[{x:0,y:0},{x:o,y:-t},{x:0,y:-p}],"right|up"),"right|down":x(({height:p,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-p}],"right|down"),"left|up":x(({height:p,midpoint:t,width:o})=>[{x:o,y:0},{x:0,y:-t},{x:o,y:-p}],"left|up"),"left|down":x(({height:p,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-p}],"left|down"),right:x(({height:p,midpoint:t,padding:o,width:l})=>[{x:t,y:-o},{x:t,y:-o},{x:l-t,y:-o},{x:l-t,y:0},{x:l,y:-p/2},{x:l-t,y:-p},{x:l-t,y:-p+o},{x:t,y:-p+o},{x:t,y:-p+o}],"right"),left:x(({height:p,midpoint:t,padding:o,width:l})=>[{x:t,y:0},{x:t,y:-o},{x:l-t,y:-o},{x:l-t,y:-p+o},{x:t,y:-p+o},{x:t,y:-p},{x:0,y:-p/2}],"left"),up:x(({height:p,midpoint:t,padding:o,width:l})=>[{x:t,y:-o},{x:t,y:-p+o},{x:0,y:-p+o},{x:l/2,y:-p},{x:l,y:-p+o},{x:l-t,y:-p+o},{x:l-t,y:-o}],"up"),down:x(({height:p,midpoint:t,padding:o,width:l})=>[{x:l/2,y:0},{x:0,y:-o},{x:t,y:-o},{x:t,y:-p+o},{x:l-t,y:-p+o},{x:l-t,y:-o},{x:l,y:-o}],"down"),[_t]:()=>[{x:0,y:0}]},tr=x((p,t,o,l)=>{let h=Js(p),a=(o.padding??0)/2,f=t.height+4*a,i=f/2,n=l??t.width+2*i+2*a,r=Qs(h);return(fe[r]??fe[_t])({height:f,midpoint:i,padding:a,width:n})},"getArrowPoints");async function ge(p,t){let o=t,{shapeSvg:l,bbox:h}=await B(p,o,T(o)),a=o.padding??0,f=h.height+2*a,i=f/2,n=h.width+2*i+a,r=o.width??0,s=o.positioned&&(o.widthInColumns??1)>1&&r>n?r:n,c=tr(o.directions??[],h,o,s),m=et(l,s,f,c);return m.attr("style",o.style??null),D(o,m),o.intersect=function(g){return N.polygon(o,c,g)},l}x(ge,"block_arrow");async function de(p,t,{config:{themeVariables:o}}){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l;let{shapeSvg:a,bbox:f,label:i}=await B(p,t,T(t)),n=o?.nodeBorder??o?.lineColor??"currentColor",r=t.padding??12,e=18,s=12,c=Math.max(f.width+r*2,t.width??0,90),m=Math.max(f.height+r*2+e,t.height??0),g=-m/2,{cssStyles:d}=t,u=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=k.svg(a).path(tt(-c/2,g,c,m,s),P(t,{}));u.node()?.appendChild(S),d&&u.attr("style",d)}else u.append("rect").attr("x",-c/2).attr("y",g).attr("width",c).attr("height",m).attr("rx",s).attr("ry",s).attr("style",h);u.append("line").attr("x1",-c/2).attr("y1",g+e).attr("x2",c/2).attr("y2",g+e).attr("style",`stroke:${n};stroke-width:1px`);for(let b=0;b<3;b++)u.append("circle").attr("cx",-c/2+12+b*9).attr("cy",g+e/2).attr("r",2.5).attr("style",`fill:${n};stroke:none`);u.append("rect").attr("class","browser-address-bar").attr("x",-c/2+44).attr("y",g+4).attr("width",Math.max(c-56,10)).attr("height",e-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${n};stroke-width:1px;opacity:0.6`),D(t,u);let y=g+e+(m-e)/2;return i.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${y-f.height/2-(f.y-(f.top??0))})`),t.intersect=function(b){return N.rect(t,b)},a}x(de,"browser");var Ht=12;async function ye(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?28:h,f=t.look==="neo"?24:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=(t?.width??n.width)+(t.look==="neo"?a*2:a+Ht),e=(t?.height??n.height)+(t.look==="neo"?f*2:f),s=0,c=r,m=-e,g=0,d=[{x:s+Ht,y:m},{x:c,y:m},{x:c,y:g},{x:s,y:g},{x:s,y:m+Ht},{x:s+Ht,y:m}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let b=k.svg(i),S=P(t,{}),$=W(d),w=b.path($,S);u=i.insert(()=>w,":first-child").attr("transform",`translate(${-r/2}, ${e/2})`),y&&u.attr("style",y)}else u=et(i,r,e,d);return l&&u.attr("style",l),D(t,u),t.intersect=function(b){return N.polygon(t,d,b)},i}x(ye,"card");function ue(p,t){let{nodeStyles:o}=v(t);t.label="";let l=p.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:h}=t,a=Math.max(28,t.width??0),f=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],i=k.svg(l),n=P(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let r=W(f),e=i.path(r,n),s=l.insert(()=>e,":first-child");return h&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",h),o&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",o),t.width=28,t.height=28,t.intersect=function(c){return N.polygon(t,f,c)},l}x(ue,"choice");async function jt(p,t,o){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l;let{shapeSvg:a,bbox:f,halfPadding:i}=await B(p,t,T(t)),n=16,r=o?.padding??i,e=t.look==="neo"?f.width/2+n*2:f.width/2+r,s,{cssStyles:c}=t;if(t.look==="handDrawn"){let m=k.svg(a),g=P(t,{}),d=m.circle(0,0,e*2,g);s=a.insert(()=>d,":first-child"),s.attr("class","basic label-container").attr("style",q(c))}else s=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",h).attr("r",e).attr("cx",0).attr("cy",0);return D(t,s),t.calcIntersect=function(m,g){let d=m.width/2;return N.circle(m,d,g)},t.intersect=function(m){return _.info("Circle intersect",t,e,m),N.circle(t,e,m)},a}x(jt,"circle");async function xe(p,t){let o=t,l=["node",o.cssClasses,o.class].filter(Boolean).join(" "),{shapeSvg:h,bbox:a,halfPadding:f}=await B(p,o,l),i=h.insert("rect",":first-child"),n=o.padding??0,r=o.positioned?o.width??0:a.width+n,e=o.positioned?o.height??0:a.height+n,s=o.positioned?-r/2:-a.width/2-f,c=o.positioned?-e/2:-a.height/2-f;return i.attr("class","basic cluster composite label-container").attr("style",o.style??null).attr("rx",o.rx??null).attr("ry",o.ry??null).attr("x",s).attr("y",c).attr("width",r).attr("height",e),D(o,i),o.intersect=function(m){return N.rect(o,m)},h}x(xe,"composite");async function be(p,t,{config:{themeVariables:o}}){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l;let{shapeSvg:a,bbox:f,label:i}=await B(p,t,T(t)),n=o?.nodeBorder??o?.lineColor??"currentColor",r=t.padding??12,e=20,s=12,c=Math.max(f.width+r*2,t.width??0,90),m=Math.max(f.height+r*2+e,t.height??0),g=-m/2,{cssStyles:d}=t,u=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=k.svg(a).path(tt(-c/2,g,c,m,s),P(t,{}));u.node()?.appendChild(S),d&&u.attr("style",d)}else u.append("rect").attr("x",-c/2).attr("y",g).attr("width",c).attr("height",m).attr("rx",s).attr("ry",s).attr("style",h);u.append("text").attr("x",-c/2+12).attr("y",g+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${n}`).text(">_"),D(t,u);let y=g+e+(m-e)/2;return i.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${y-f.height/2-(f.y-(f.top??0))})`),t.intersect=function(b){return N.rect(t,b)},a}x(be,"consoleWindow");function er(p){let t=Math.cos(Math.PI/4),o=Math.sin(Math.PI/4),l=p*2,h={x:l/2*t,y:l/2*o},a={x:-(l/2)*t,y:l/2*o},f={x:-(l/2)*t,y:-(l/2)*o},i={x:l/2*t,y:-(l/2)*o};return`M ${a.x},${a.y} L ${i.x},${i.y}
M ${h.x},${h.y} L ${f.x},${f.y}`}x(er,"createLine");function Se(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o,t.label="";let h=p.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:f}=t,i=k.svg(h),n=P(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let r=i.circle(0,0,a*2,n),e=er(a),s=i.path(e,n),c=h.insert(()=>r,":first-child");return c.insert(()=>s),c.attr("class","outer-path"),f&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",f),l&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",l),D(t,c),t.intersect=function(m){return _.info("crossedCircle intersect",t,{radius:a,point:m}),N.circle(t,a,m)},h}x(Se,"crossedCircle");function St(p,t,o,l=100,h=0,a=180){let f=[],i=h*Math.PI/180,e=(a*Math.PI/180-i)/(l-1);for(let s=0;s<l;s++){let c=i+s*e,m=p+o*Math.cos(c),g=t+o*Math.sin(c);f.push({x:-m,y:-g})}return f}x(St,"generateCirclePoints");async function we(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=a.width+i,e=a.height+n,s=Math.max(5,e*.1),{cssStyles:c}=t,m=[...St(r/2,-e/2,s,30,-90,0),{x:-r/2-s,y:s},...St(r/2+s*2,-s,s,20,-180,-270),...St(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:-e/2},...St(r/2,e/2,s,20,0,90)],g=[{x:r/2,y:-e/2-s},{x:-r/2,y:-e/2-s},...St(r/2,-e/2,s,20,-90,0),{x:-r/2-s,y:-s},...St(r/2+r*.1,-s,s,20,-180,-270),...St(r/2+r*.1,s,s,20,-90,-180),{x:-r/2-s,y:e/2},...St(r/2,e/2,s,20,0,90),{x:-r/2,y:e/2+s},{x:r/2,y:e/2+s}],d=k.svg(h),u=P(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=W(m).replace("Z",""),S=d.path(b,u),$=W(g),w=d.path($,{...u}),M=h.insert("g",":first-child");return M.insert(()=>w,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.attr("class","text"),c&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",c),l&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${s}, 0)`),f.attr("transform",`translate(${-r/2+s-(a.x-(a.left??0))},${-e/2+(t.padding??0)/2-(a.y-(a.top??0))})`),D(t,M),t.intersect=function(R){return N.polygon(t,g,R)},h}x(we,"curlyBraceLeft");function wt(p,t,o,l=100,h=0,a=180){let f=[],i=h*Math.PI/180,e=(a*Math.PI/180-i)/(l-1);for(let s=0;s<l;s++){let c=i+s*e,m=p+o*Math.cos(c),g=t+o*Math.sin(c);f.push({x:m,y:g})}return f}x(wt,"generateCirclePoints");async function Ne(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=a.width+(t.look==="neo"?i*2:i),e=a.height+(t.look==="neo"?n*2:n),s=Math.max(5,e*.1),{cssStyles:c}=t,m=[...wt(r/2,-e/2,s,20,-90,0),{x:r/2+s,y:-s},...wt(r/2+s*2,-s,s,20,-180,-270),...wt(r/2+s*2,s,s,20,-90,-180),{x:r/2+s,y:e/2},...wt(r/2,e/2,s,20,0,90)],g=[{x:-r/2,y:-e/2-s},{x:r/2,y:-e/2-s},...wt(r/2,-e/2,s,20,-90,0),{x:r/2+s,y:-s},...wt(r/2+s*2,-s,s,20,-180,-270),...wt(r/2+s*2,s,s,20,-90,-180),{x:r/2+s,y:e/2},...wt(r/2,e/2,s,20,0,90),{x:r/2,y:e/2+s},{x:-r/2,y:e/2+s}],d=k.svg(h),u=P(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=W(m).replace("Z",""),S=d.path(b,u),$=W(g),w=d.path($,{...u}),M=h.insert("g",":first-child");return M.insert(()=>w,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.attr("class","text"),c&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",c),l&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${-s}, 0)`),f.attr("transform",`translate(${-r/2+(t.padding??0)/2-(a.x-(a.left??0))},${-e/2+(t.padding??0)/2-(a.y-(a.top??0))})`),D(t,M),t.intersect=function(R){return N.polygon(t,g,R)},h}x(Ne,"curlyBraceRight");function st(p,t,o,l=100,h=0,a=180){let f=[],i=h*Math.PI/180,e=(a*Math.PI/180-i)/(l-1);for(let s=0;s<l;s++){let c=i+s*e,m=p+o*Math.cos(c),g=t+o*Math.sin(c);f.push({x:-m,y:-g})}return f}x(st,"generateCirclePoints");async function $e(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=a.width+(t.look==="neo"?i*2:i),e=a.height+(t.look==="neo"?n*2:n),s=Math.max(5,e*.1),{cssStyles:c}=t,m=[...st(r/2,-e/2,s,30,-90,0),{x:-r/2-s,y:s},...st(r/2+s*2,-s,s,20,-180,-270),...st(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:-e/2},...st(r/2,e/2,s,20,0,90)],g=[...st(-r/2+s+s/2,-e/2,s,20,-90,-180),{x:r/2-s/2,y:s},...st(-r/2-s/2,-s,s,20,0,90),...st(-r/2-s/2,s,s,20,-90,0),{x:r/2-s/2,y:-s},...st(-r/2+s+s/2,e/2,s,30,-180,-270)],d=[{x:r/2,y:-e/2-s},{x:-r/2,y:-e/2-s},...st(r/2,-e/2,s,20,-90,0),{x:-r/2-s,y:-s},...st(r/2+s*2,-s,s,20,-180,-270),...st(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:e/2},...st(r/2,e/2,s,20,0,90),{x:-r/2,y:e/2+s},{x:r/2-s-s/2,y:e/2+s},...st(-r/2+s+s/2,-e/2,s,20,-90,-180),{x:r/2-s/2,y:s},...st(-r/2-s/2,-s,s,20,0,90),...st(-r/2-s/2,s,s,20,-90,0),{x:r/2-s/2,y:-s},...st(-r/2+s+s/2,e/2,s,30,-180,-270)],u=k.svg(h),y=P(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let S=W(m).replace("Z",""),$=u.path(S,y),M=W(g).replace("Z",""),R=u.path(M,y),C=W(d),O=u.path(C,{...y}),E=h.insert("g",":first-child");return E.insert(()=>O,":first-child").attr("stroke-opacity",0),E.insert(()=>$,":first-child"),E.insert(()=>R,":first-child"),E.attr("class","text"),c&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",c),l&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",l),E.attr("transform",`translate(${s-s/4}, 0)`),f.attr("transform",`translate(${-r/2+(t.padding??0)/2-(a.x-(a.left??0))},${-e/2+(t.padding??0)/2-(a.y-(a.top??0))})`),D(t,E),t.intersect=function(G){return N.polygon(t,d,G)},h}x($e,"curlyBraces");async function De(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h,i=20,n=5,{shapeSvg:r,bbox:e}=await B(p,t,T(t)),s=Math.max(i,(e.width+a*2)*1.25,t?.width??0),c=Math.max(n,e.height+f*2,t?.height??0),m=c/2,{cssStyles:g}=t,d=k.svg(r),u=P(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=s,b=c,S=y-m,$=b/4,w=[{x:S,y:0},{x:$,y:0},{x:0,y:b/2},{x:$,y:b},{x:S,y:b},...it(-S,-b/2,m,50,270,90)],M=W(w),R=d.path(M,u),C=r.insert(()=>R,":first-child");return C.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",g),l&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",l),C.attr("transform",`translate(${-s/2}, ${-c/2})`),D(t,C),t.intersect=function(O){return N.polygon(t,w,O)},r}x(De,"curvedTrapezoid");async function Pe(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=t.padding??20,n=Math.max(a.width+i*2,t.width??0,100),r=Math.min(Math.max(n*.23,16),56),e=r*.27,s=Math.max(a.height+i*2,t.height?t.height-(2*r-e):0),c=Math.min(n*.177,s*.45),m=s+2*r-e,g=-m/2,d=g+2*r-e,u=h.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:y}=t;if(t.look==="handDrawn"){let C=k.svg(h),O=P(t,{}),E=C.path(tt(-n/2,d,n,s,c),O),G=C.circle(0,g+r,r*2,O);u.insert(()=>G,":first-child"),u.insert(()=>E,":first-child"),y&&u.attr("style",y)}else u.append("rect").attr("x",-n/2).attr("y",d).attr("width",n).attr("height",s).attr("rx",c).attr("ry",c).attr("style",l),u.append("circle").attr("cx",0).attr("cy",g+r).attr("r",r).attr("style",l);D(t,u);let b=d+s/2;f.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`);let S=g+r,$=Math.asin(Math.min(1,(d-S)/r))*180/Math.PI,R=[...it(0,-S,r,24,180+$,-$),...it(-(-n/2+c),-(d+c),c,12,90,0),...it(-(-n/2+c),-(m/2-c),c,12,360,270),...it(-(n/2-c),-(m/2-c),c,12,270,180),...it(-(n/2-c),-(d+c),c,12,180,90)];return t.intersect=function(C){return N.polygon(t,R,C)},h}x(Pe,"person");var sr=x((p,t,o,l,h,a)=>[`M${p},${t+a}`,`a${h},${a} 0,0,0 ${o},0`,`a${h},${a} 0,0,0 ${-o},0`,`l0,${l}`,`a${h},${a} 0,0,0 ${o},0`,`l0,${-l}`].join(" "),"createCylinderPathD"),rr=x((p,t,o,l,h,a)=>[`M${p},${t+a}`,`M${p+o},${t+a}`,`a${h},${a} 0,0,0 ${-o},0`,`l0,${l}`,`a${h},${a} 0,0,0 ${o},0`,`l0,${-l}`].join(" "),"createOuterCylinderPathD"),or=x((p,t,o,l,h,a)=>[`M${p-o/2},${-l/2}`,`a${h},${a} 0,0,0 ${o},0`].join(" "),"createInnerCylinderPathD"),ve=8,ke=8;async function Te(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?24:h,f=t.look==="neo"?24:h,i=t.width??0;if(t.width&&(t.width=t.width-f,t.width<ke&&(t.width=ke)),t.height){let b=i/2/(2.5+i/50);t.height=t.height-a-b*3,t.height<ve&&(t.height=ve)}let{shapeSvg:n,bbox:r,label:e}=await B(p,t,T(t)),s=Math.max(t.width??0,r.width)+f,c=s/2,m=c/(2.5+s/50),g=Math.max(t.height??0,r.height)+a+m,d,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=k.svg(n),b=rr(0,0,s,g,c,m),S=or(0,m,s,g,c,m),$=P(t,{}),w=y.path(b,$),M=y.path(S,P(t,{fill:"none"}));d=n.insert(()=>M,":first-child"),d=n.insert(()=>w,":first-child"),d.attr("class","basic label-container"),u&&d.attr("style",u)}else{let y=sr(0,0,s,g,c,m);d=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",l)}return d.attr("label-offset-y",m),d.attr("transform",`translate(${-s/2}, ${-(g/2+m)})`),D(t,d),e.attr("transform",`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)+(t.padding??0)/1.5-(r.y-(r.top??0))})`),t.intersect=function(y){let b=N.rect(t,y),S=b.x-(t.x??0);if(c!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-m)){let $=m*m*(1-S*S/(c*c));$>0&&($=Math.sqrt($)),$=m-$,y.y-(t.y??0)>0&&($=-$),b.y+=$}return b},n}x(Te,"cylinder");async function ht(p,t,o){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l;let{shapeSvg:a,bbox:f}=await B(p,t,T(t)),i=Math.max(f.width+o.labelPaddingX*2,t?.width||0),n=Math.max(f.height+o.labelPaddingY*2,t?.height||0),r=-i/2,e=-n/2,s,{rx:c,ry:m}=t,{cssStyles:g}=t;if(o?.rx&&o.ry&&(c=o.rx,m=o.ry),t.look==="handDrawn"){let d=k.svg(a),u=P(t,{}),y=c||m?d.path(tt(r,e,i,n,c||0),u):d.rectangle(r,e,i,n,u);s=a.insert(()=>y,":first-child"),s.attr("class","basic label-container").attr("style",q(g))}else s=a.insert("rect",":first-child"),s.attr("class","basic label-container").attr("style",h).attr("rx",q(c)).attr("ry",q(m)).attr("x",r).attr("y",e).attr("width",i).attr("height",n);return D(t,s,t.look==="handDrawn"?void 0:{width:i,height:n}),t.calcIntersect=function(d,u){return N.rect(d,u)},t.intersect=function(d){return N.rect(t,d)},a}x(ht,"drawRect");async function Be(p,t){let{cssClasses:o,labelPaddingX:l,labelPaddingY:h,padding:a,width:f,height:i}=t,n={rx:0,ry:0,classes:o??"",labelPaddingX:l??(a??0)*2,labelPaddingY:h??a??0},r=await ht(p,t,n);if(t.look==="handDrawn"){let m=k.svg(r),g=P(t,{}),d=r.select(".basic.label-container > path:nth-child(2)"),u=d.node();if(!u)return r;let y=null;if(u instanceof SVGGraphicsElement)y=u.getBBox();else return r;return r.insert(()=>m.line(y.x,y.y,y.x+y.width,y.y,g),".basic.label-container g.label"),r.insert(()=>m.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,g),".basic.label-container g.label"),d.remove(),r}let e=r.select(".basic.label-container"),s=(Number(e.attr("width"))||f)??0,c=(Number(e.attr("height"))||i)??0;return s>0&&c>0&&e.attr("stroke-dasharray",`${s} ${c}`),r}x(Be,"datastore");async function Me(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:f,bbox:i,label:n}=await B(p,t,T(t)),r=i.width+h,e=i.height+a,s=e*.2,c=-r/2,m=-e/2-s/2,{cssStyles:g}=t,d=k.svg(f),u=P(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:c,y:m+s},{x:-c,y:m+s},{x:-c,y:-m},{x:c,y:-m},{x:c,y:m},{x:-c,y:m},{x:-c,y:m+s}],b=d.polygon(y.map($=>[$.x,$.y]),u),S=f.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),n.attr("transform",`translate(${c+(t.padding??0)/2-(i.x-(i.left??0))}, ${m+s+(t.padding??0)/2-(i.y-(i.top??0))})`),D(t,S),t.intersect=function($){return N.rect(t,$)},f}x(Me,"dividedRectangle");async function Ce(p,t){let{labelStyles:o,nodeStyles:l}=v(t),h=t.look==="neo"?12:5;t.labelStyle=o;let a=t.padding??0,f=t.look==="neo"?16:a,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=(t?.width?t?.width/2:n.width/2)+(f??0),e=r-h,s,{cssStyles:c}=t;if(t.look==="handDrawn"){let m=k.svg(i),g=P(t,{roughness:.2,strokeWidth:2.5}),d=P(t,{roughness:.2,strokeWidth:1.5}),u=m.circle(0,0,r*2,g),y=m.circle(0,0,e*2,d);s=i.insert("g",":first-child"),s.attr("class",q(t.cssClasses)).attr("style",q(c)),s.node()?.appendChild(u),s.node()?.appendChild(y)}else{s=i.insert("g",":first-child");let m=s.insert("circle",":first-child"),g=s.insert("circle");s.attr("class","basic label-container").attr("style",l),m.attr("class","outer-circle").attr("style",l).attr("r",r).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",l).attr("r",e).attr("cx",0).attr("cy",0)}return D(t,s),t.intersect=function(m){return _.info("DoubleCircle intersect",t,r,m),N.circle(t,r,m)},i}x(Ce,"doublecircle");function Re(p,t,{config:{themeVariables:o}}){let{labelStyles:l,nodeStyles:h}=v(t);t.label="",t.labelStyle=l;let a=p.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),f=7,{cssStyles:i}=t,n=k.svg(a),{nodeBorder:r}=o,e=P(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let s=n.circle(0,0,f*2,e),c=a.insert(()=>s,":first-child");return c.selectAll("path").attr("style",`fill: ${r} !important;`),i&&i.length>0&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",i),h&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",h),D(t,c),t.intersect=function(m){return _.info("filledCircle intersect",t,{radius:f,point:m}),N.circle(t,f,m)},a}x(Re,"filledCircle");var Ge=10,Ee=10;async function He(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?h*2:h;(t.width||t.height)&&(t.height=t?.height??0,t.height<Ge&&(t.height=Ge),t.width=(t?.width??0)-a-a/2,t.width<Ee&&(t.width=Ee));let{shapeSvg:f,bbox:i,label:n}=await B(p,t,T(t)),r=(t?.width?t?.width:i.width)+(a??0),e=t?.height?t?.height:r+i.height,s=e,c=[{x:0,y:-e},{x:s,y:-e},{x:s/2,y:0}],{cssStyles:m}=t,g=k.svg(f),d=P(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=W(c),y=g.path(u,d),b=f.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",l),t.width=r,t.height=e,D(t,b),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-e/2+(t.padding??0)/2+(i.y-(i.top??0))})`),t.intersect=function(S){return _.info("Triangle intersect",t,c,S),N.polygon(t,c,S)},f}x(He,"flippedTriangle");async function je(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=t.padding??12,n=Math.max(a.width+i*2,t.width??0,90),r=a.height+i*2,e=Math.max(Math.min(r*.16,14),8),s=Math.max(r+e,t.height??0),c=s-e,m=Math.max(n*.38,28),g=-s/2,d=[{x:-n/2,y:g},{x:-n/2+m,y:g},{x:-n/2+m,y:g+e},{x:n/2,y:g+e},{x:n/2,y:s/2},{x:-n/2,y:s/2}],u=[`M${d[0].x},${d[0].y}`,...d.slice(1).map($=>`L${$.x},${$.y}`),"Z"].join(" "),{cssStyles:y}=t,b;if(t.look==="handDrawn"){let w=k.svg(h).path(u,P(t,{}));b=h.insert(()=>w,":first-child").attr("class","basic label-container"),y&&b.attr("style",y)}else b=h.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",l);t.look==="handDrawn"?D(t,b):D(t,b,{width:n,height:s});let S=g+e+c/2;return f.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${S-a.height/2-(a.y-(a.top??0))})`),t.intersect=function($){return N.polygon(t,d,$)},h}x(je,"folder");function Ae(p,t,{dir:o,config:{state:l,themeVariables:h}}){let{nodeStyles:a}=v(t);t.label="";let f=p.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,n=Math.max(70,t?.width??0),r=Math.max(10,t?.height??0);o==="LR"&&(n=Math.max(10,t?.width??0),r=Math.max(70,t?.height??0));let e=-1*n/2,s=-1*r/2,c=k.svg(f),m=P(t,{stroke:h.lineColor,fill:h.lineColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=c.rectangle(e,s,n,r,m),d=f.insert(()=>g,":first-child");i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),D(t,d);let u=l?.padding??0;return t.width&&t.height&&(t.width+=u/2||0,t.height+=u/2||0),t.intersect=function(y){return N.rect(t,y)},f}x(Ae,"forkJoin");async function Oe(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=15,a=10,f=t.look==="neo"?16:t.padding??0,i=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-i*2,t.height<a&&(t.height=a),t.width=(t?.width??0)-f*2,t.width<h&&(t.width=h));let{shapeSvg:n,bbox:r}=await B(p,t,T(t)),e=(t?.width?t?.width:Math.max(h,r.width))+f*2,s=(t?.height?t?.height:Math.max(a,r.height))+i*2,c=s/2,{cssStyles:m}=t,g=k.svg(n),d=P(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=[{x:-e/2,y:-s/2},{x:e/2-c,y:-s/2},...it(-e/2+c,0,c,50,90,270),{x:e/2-c,y:s/2},{x:-e/2,y:s/2}],y=W(u),b=g.path(y,d),S=n.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),D(t,S),t.intersect=function($){return _.info("Pill intersect",t,{radius:c,point:$}),N.polygon(t,u,$)},n}x(Oe,"halfRoundedRectangle");var ir=x((p,t,o,l,h)=>[`M${p+h},${t}`,`L${p+o-h},${t}`,`L${p+o},${t-l/2}`,`L${p+o-h},${t-l}`,`L${p+h},${t-l}`,`L${p},${t-l/2}`,"Z"].join(" "),"createHexagonPathD");async function Ie(p,t){let{labelStyles:o,nodeStyles:l}=v(t),h=t.look==="neo"?3.5:4;t.labelStyle=o;let a=t.padding??0,f=70,i=32,n=t.look==="neo"?f:a,r=t.look==="neo"?i:a;if(t.width||t.height){let S=(t.height??0)/h;t.width=(t?.width??0)-2*S-r,t.height=(t.height??0)-n}let{shapeSvg:e,bbox:s}=await B(p,t,T(t)),c=(t?.height?t?.height:s.height)+n,m=c/h,g=(t?.width?t?.width:s.width)+2*m+r,d=[{x:m,y:0},{x:g-m,y:0},{x:g,y:-c/2},{x:g-m,y:-c},{x:m,y:-c},{x:0,y:-c/2}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let b=k.svg(e),S=P(t,{}),$=ir(0,0,g,c,m),w=b.path($,S);u=e.insert(()=>w,":first-child").attr("transform",`translate(${-g/2}, ${c/2})`),y&&u.attr("style",y)}else u=et(e,g,c,d);return l&&u.attr("style",l),t.width=g,t.height=c,D(t,u),t.intersect=function(b){return N.polygon(t,d,b)},e}x(Ie,"hexagon");async function Le(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.label="",t.labelStyle=o;let{shapeSvg:h}=await B(p,t,T(t)),a=Math.max(30,t?.width??0),f=Math.max(30,t?.height??0),{cssStyles:i}=t,n=k.svg(h),r=P(t,{});t.look!=="handDrawn"&&(r.roughness=0,r.fillStyle="solid");let e=[{x:0,y:0},{x:a,y:0},{x:0,y:f},{x:a,y:f}],s=W(e),c=n.path(s,r),m=h.insert(()=>c,":first-child");return m.attr("class","basic label-container outer-path"),i&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),l&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",l),m.attr("transform",`translate(${-a/2}, ${-f/2})`),D(t,m),t.intersect=function(g){return _.info("Pill intersect",t,{points:e}),N.polygon(t,e,g)},h}x(Le,"hourglass");async function Ve(p,t,{config:{themeVariables:o,flowchart:l}}){let{labelStyles:h}=v(t);t.labelStyle=h;let a=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(a,f),n=l?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,label:s}=await B(p,t,"icon-shape default"),c=t.pos==="t",m=i,g=i,{nodeBorder:d}=o,{stylesMap:u}=bt(t),y=-g/2,b=-m/2,S=t.label?8:0,$=k.svg(r),w=P(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let M=$.rectangle(y,b,g,m,w),R=Math.max(g,e.width),C=m+e.height+S,O=$.rectangle(-R/2,-C/2,R,C,{...w,fill:"transparent",stroke:"none"}),E=r.insert(()=>M,":first-child"),G=r.insert(()=>O);if(t.icon){let L=r.append("g");L.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let H=L.node().getBBox(),I=H.width,A=H.height,j=H.x,V=H.y;L.attr("transform",`translate(${-I/2-j},${c?e.height/2+S/2-A/2-V:-e.height/2-S/2-A/2-V})`),L.attr("style",`color: ${u.get("stroke")??d};`)}return s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${c?-C/2:C/2-e.height})`),E.attr("transform",`translate(0,${c?e.height/2+S/2:-e.height/2-S/2})`),D(t,G),t.intersect=function(L){if(_.info("iconSquare intersect",t,L),!t.label)return N.rect(t,L);let H=t.x??0,I=t.y??0,A=t.height??0,j=[];return c?j=[{x:H-e.width/2,y:I-A/2},{x:H+e.width/2,y:I-A/2},{x:H+e.width/2,y:I-A/2+e.height+S},{x:H+g/2,y:I-A/2+e.height+S},{x:H+g/2,y:I+A/2},{x:H-g/2,y:I+A/2},{x:H-g/2,y:I-A/2+e.height+S},{x:H-e.width/2,y:I-A/2+e.height+S}]:j=[{x:H-g/2,y:I-A/2},{x:H+g/2,y:I-A/2},{x:H+g/2,y:I-A/2+m},{x:H+e.width/2,y:I-A/2+m},{x:H+e.width/2/2,y:I+A/2},{x:H-e.width/2,y:I+A/2},{x:H-e.width/2,y:I-A/2+m},{x:H-g/2,y:I-A/2+m}],N.polygon(t,j,L)},r}x(Ve,"icon");async function We(p,t,{config:{themeVariables:o,flowchart:l}}){let{labelStyles:h}=v(t);t.labelStyle=h;let a=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(a,f),n=l?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,label:s}=await B(p,t,"icon-shape default"),c=20,m=t.label?8:0,g=t.pos==="t",{nodeBorder:d,mainBkg:u}=o,{stylesMap:y}=bt(t),b=k.svg(r),S=P(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let $=y.get("fill");S.stroke=$??u;let w=r.append("g");t.icon&&w.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let M=w.node().getBBox(),R=M.width,C=M.height,O=M.x,E=M.y,G=Math.max(R,C)*Math.SQRT2+c*2,L=b.circle(0,0,G,S),H=Math.max(G,e.width),I=G+e.height+m,A=b.rectangle(-H/2,-I/2,H,I,{...S,fill:"transparent",stroke:"none"}),j=r.insert(()=>L,":first-child"),V=r.insert(()=>A);return w.attr("transform",`translate(${-R/2-O},${g?e.height/2+m/2-C/2-E:-e.height/2-m/2-C/2-E})`),w.attr("style",`color: ${y.get("stroke")??d};`),s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${g?-I/2:I/2-e.height})`),j.attr("transform",`translate(0,${g?e.height/2+m/2:-e.height/2-m/2})`),D(t,V),t.intersect=function(Y){return _.info("iconSquare intersect",t,Y),N.rect(t,Y)},r}x(We,"iconCircle");async function Ye(p,t,{config:{themeVariables:o,flowchart:l}}){let{labelStyles:h}=v(t);t.labelStyle=h;let a=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(a,f),n=l?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,halfPadding:s,label:c}=await B(p,t,"icon-shape default"),m=t.pos==="t",g=i+s*2,d=i+s*2,{nodeBorder:u,mainBkg:y}=o,{stylesMap:b}=bt(t),S=-d/2,$=-g/2,w=t.label?8:0,M=k.svg(r),R=P(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let C=b.get("fill");R.stroke=C??y;let O=M.path(tt(S,$,d,g,5),R),E=Math.max(d,e.width),G=g+e.height+w,L=M.rectangle(-E/2,-G/2,E,G,{...R,fill:"transparent",stroke:"none"}),H=r.insert(()=>O,":first-child").attr("class","icon-shape2"),I=r.insert(()=>L);if(t.icon){let A=r.append("g");A.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let j=A.node().getBBox(),V=j.width,Y=j.height,X=j.x,z=j.y;A.attr("transform",`translate(${-V/2-X},${m?e.height/2+w/2-Y/2-z:-e.height/2-w/2-Y/2-z})`),A.attr("style",`color: ${b.get("stroke")??u};`)}return c.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-G/2:G/2-e.height})`),H.attr("transform",`translate(0,${m?e.height/2+w/2:-e.height/2-w/2})`),D(t,I),t.intersect=function(A){if(_.info("iconSquare intersect",t,A),!t.label)return N.rect(t,A);let j=t.x??0,V=t.y??0,Y=t.height??0,X=[];return m?X=[{x:j-e.width/2,y:V-Y/2},{x:j+e.width/2,y:V-Y/2},{x:j+e.width/2,y:V-Y/2+e.height+w},{x:j+d/2,y:V-Y/2+e.height+w},{x:j+d/2,y:V+Y/2},{x:j-d/2,y:V+Y/2},{x:j-d/2,y:V-Y/2+e.height+w},{x:j-e.width/2,y:V-Y/2+e.height+w}]:X=[{x:j-d/2,y:V-Y/2},{x:j+d/2,y:V-Y/2},{x:j+d/2,y:V-Y/2+g},{x:j+e.width/2,y:V-Y/2+g},{x:j+e.width/2/2,y:V+Y/2},{x:j-e.width/2,y:V+Y/2},{x:j-e.width/2,y:V-Y/2+g},{x:j-d/2,y:V-Y/2+g}],N.polygon(t,X,A)},r}x(Ye,"iconRounded");async function Fe(p,t,{config:{themeVariables:o,flowchart:l}}){let{labelStyles:h}=v(t);t.labelStyle=h;let a=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(a,f),n=l?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,halfPadding:s,label:c}=await B(p,t,"icon-shape default"),m=t.pos==="t",g=i+s*2,d=i+s*2,{nodeBorder:u,mainBkg:y}=o,{stylesMap:b}=bt(t),S=-d/2,$=-g/2,w=t.label?8:0,M=k.svg(r),R=P(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let C=b.get("fill");R.stroke=C??y;let O=M.path(tt(S,$,d,g,.1),R),E=Math.max(d,e.width),G=g+e.height+w,L=M.rectangle(-E/2,-G/2,E,G,{...R,fill:"transparent",stroke:"none"}),H=r.insert(()=>O,":first-child"),I=r.insert(()=>L);if(t.icon){let A=r.append("g");A.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let j=A.node().getBBox(),V=j.width,Y=j.height,X=j.x,z=j.y;A.attr("transform",`translate(${-V/2-X},${m?e.height/2+w/2-Y/2-z:-e.height/2-w/2-Y/2-z})`),A.attr("style",`color: ${b.get("stroke")??u};`)}return c.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-G/2:G/2-e.height})`),H.attr("transform",`translate(0,${m?e.height/2+w/2:-e.height/2-w/2})`),D(t,I),t.intersect=function(A){if(_.info("iconSquare intersect",t,A),!t.label)return N.rect(t,A);let j=t.x??0,V=t.y??0,Y=t.height??0,X=[];return m?X=[{x:j-e.width/2,y:V-Y/2},{x:j+e.width/2,y:V-Y/2},{x:j+e.width/2,y:V-Y/2+e.height+w},{x:j+d/2,y:V-Y/2+e.height+w},{x:j+d/2,y:V+Y/2},{x:j-d/2,y:V+Y/2},{x:j-d/2,y:V-Y/2+e.height+w},{x:j-e.width/2,y:V-Y/2+e.height+w}]:X=[{x:j-d/2,y:V-Y/2},{x:j+d/2,y:V-Y/2},{x:j+d/2,y:V-Y/2+g},{x:j+e.width/2,y:V-Y/2+g},{x:j+e.width/2/2,y:V+Y/2},{x:j-e.width/2,y:V+Y/2},{x:j-e.width/2,y:V-Y/2+g},{x:j-d/2,y:V-Y/2+g}],N.polygon(t,X,A)},r}x(Fe,"iconSquare");async function _e(p,t,{config:{flowchart:o}}){let l=new Image;l.src=t?.img??"",await l.decode();let h=Number(l.naturalWidth.toString().replace("px","")),a=Number(l.naturalHeight.toString().replace("px",""));t.imageAspectRatio=h/a;let{labelStyles:f}=v(t);t.labelStyle=f;let i=o?.wrappingWidth;t.defaultWidth=o?.wrappingWidth;let n=Math.max(t.label?i??0:0,t?.assetWidth??h),r=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:n,e=t.constraint==="on"?r/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(r,i??0);let{shapeSvg:s,bbox:c,label:m}=await B(p,t,"image-shape default"),g=t.pos==="t",d=-r/2,u=-e/2,y=t.label?8:0,b=k.svg(s),S=P(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let $=b.rectangle(d,u,r,e,S),w=Math.max(r,c.width),M=e+c.height+y,R=b.rectangle(-w/2,-M/2,w,M,{...S,fill:"none",stroke:"none"}),C=s.insert(()=>$,":first-child"),O=s.insert(()=>R);if(t.img){let E=s.append("image");E.attr("href",t.img),E.attr("width",r),E.attr("height",e),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-r/2},${g?M/2-e:-M/2})`)}return m.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${g?-e/2-c.height/2-y/2:e/2-c.height/2+y/2})`),C.attr("transform",`translate(0,${g?c.height/2+y/2:-c.height/2-y/2})`),D(t,O),t.intersect=function(E){if(_.info("iconSquare intersect",t,E),!t.label)return N.rect(t,E);let G=t.x??0,L=t.y??0,H=t.height??0,I=[];return g?I=[{x:G-c.width/2,y:L-H/2},{x:G+c.width/2,y:L-H/2},{x:G+c.width/2,y:L-H/2+c.height+y},{x:G+r/2,y:L-H/2+c.height+y},{x:G+r/2,y:L+H/2},{x:G-r/2,y:L+H/2},{x:G-r/2,y:L-H/2+c.height+y},{x:G-c.width/2,y:L-H/2+c.height+y}]:I=[{x:G-r/2,y:L-H/2},{x:G+r/2,y:L-H/2},{x:G+r/2,y:L-H/2+e},{x:G+c.width/2,y:L-H/2+e},{x:G+c.width/2/2,y:L+H/2},{x:G-c.width/2,y:L+H/2},{x:G-c.width/2,y:L-H/2+e},{x:G-r/2,y:L-H/2+e}],N.polygon(t,I,E)},s}x(_e,"imageSquare");async function Xe(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=h,f=t.look==="neo"?h*2:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=Math.max(n.height+a*2,t.height??0),e=Math.max(n.width+f*2,(t.width??0)-r),s=[{x:0,y:0},{x:e,y:0},{x:e+3*r/6,y:-r},{x:-3*r/6,y:-r}],c,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=k.svg(i),d=P(t,{}),u=W(s),y=g.path(u,d);c=i.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),m&&c.attr("style",m)}else c=et(i,e,r,s);return l&&c.attr("style",l),t.width=e,t.height=r,D(t,c),t.intersect=function(g){return N.polygon(t,s,g)},i}x(Xe,"inv_trapezoid");async function qe(p,t){let{shapeSvg:o,bbox:l,label:h}=await B(p,t,"label"),a=o.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),o.attr("class","label edgeLabel"),h.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),D(t,a),t.intersect=function(n){return N.rect(t,n)},o}x(qe,"labelRect");async function ze(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=h,f=t.look==="neo"?h*2:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=Math.max(n.height+a,t.height??0),e=Math.max(n.width+f,(t.width??0)-r),s=[{x:0,y:0},{x:e+3*r/6,y:0},{x:e,y:-r},{x:-(3*r)/6,y:-r}],c,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=k.svg(i),d=P(t,{}),u=W(s),y=g.path(u,d);c=i.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),m&&c.attr("style",m)}else c=et(i,e,r,s);return l&&c.attr("style",l),t.width=e,t.height=r,D(t,c),t.intersect=function(g){return N.polygon(t,s,g)},i}x(ze,"lean_left");async function Ue(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=h,f=t.look==="neo"?h*2:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=Math.max(n.height+a,t.height??0),e=Math.max(n.width+f,(t.width??0)-r),s=[{x:-3*r/6,y:0},{x:e,y:0},{x:e+3*r/6,y:-r},{x:0,y:-r}],c,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=k.svg(i),d=P(t,{}),u=W(s),y=g.path(u,d);c=i.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),m&&c.attr("style",m)}else c=et(i,e,r,s);return l&&c.attr("style",l),t.width=e,t.height=r,D(t,c),t.intersect=function(g){return N.polygon(t,s,g)},i}x(Ue,"lean_right");function Ze(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.label="",t.labelStyle=o;let h=p.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,f=Math.max(35,t?.width??0),i=Math.max(35,t?.height??0),n=7,r=[{x:f,y:0},{x:0,y:i+n/2},{x:f-2*n,y:i+n/2},{x:0,y:2*i},{x:f,y:i-n/2},{x:2*n,y:i-n/2}],e=k.svg(h),s=P(t,{});t.look!=="handDrawn"&&(s.roughness=0,s.fillStyle="solid");let c=W(r),m=e.path(c,s),g=h.insert(()=>m,":first-child");return g.attr("class","outer-path"),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),l&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",l),g.attr("transform",`translate(-${f/2},${-i})`),D(t,g),t.intersect=function(d){return _.info("lightningBolt intersect",t,d),N.polygon(t,r,d)},h}x(Ze,"lightningBolt");var ar=x((p,t,o,l,h,a,f)=>[`M${p},${t+a}`,`a${h},${a} 0,0,0 ${o},0`,`a${h},${a} 0,0,0 ${-o},0`,`l0,${l}`,`a${h},${a} 0,0,0 ${o},0`,`l0,${-l}`,`M${p},${t+a+f}`,`a${h},${a} 0,0,0 ${o},0`].join(" "),"createCylinderPathD"),nr=x((p,t,o,l,h,a,f)=>[`M${p},${t+a}`,`M${p+o},${t+a}`,`a${h},${a} 0,0,0 ${-o},0`,`l0,${l}`,`a${h},${a} 0,0,0 ${o},0`,`l0,${-l}`,`M${p},${t+a+f}`,`a${h},${a} 0,0,0 ${o},0`].join(" "),"createOuterCylinderPathD"),lr=x((p,t,o,l,h,a)=>[`M${p-o/2},${-l/2}`,`a${h},${a} 0,0,0 ${o},0`].join(" "),"createInnerCylinderPathD"),Ke=10,Je=10;async function Qe(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?24:h;if(t.width||t.height){let y=t.width??0;t.width=(t.width??0)-a,t.width<Je&&(t.width=Je);let S=y/2/(2.5+y/50);t.height=(t.height??0)-f-S*3,t.height<Ke&&(t.height=Ke)}let{shapeSvg:i,bbox:n,label:r}=await B(p,t,T(t)),e=(t?.width?t?.width:n.width)+a*2,s=e/2,c=s/(2.5+e/50),m=(t?.height?t?.height:n.height)+c+f*2,g=m*.1,d,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=k.svg(i),b=nr(0,0,e,m,s,c,g),S=lr(0,c,e,m,s,c),$=P(t,{}),w=y.path(b,$),M=y.path(S,$);i.insert(()=>M,":first-child").attr("class","line"),d=i.insert(()=>w,":first-child"),d.attr("class","basic label-container"),u&&d.attr("style",u)}else{let y=ar(0,0,e,m,s,c,g);d=i.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",l)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-e/2}, ${-(m/2+c)})`),D(t,d),r.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+c-(n.y-(n.top??0))})`),t.intersect=function(y){let b=N.rect(t,y),S=b.x-(t.x??0);if(s!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-c)){let $=c*c*(1-S*S/(s*s));$>0&&($=Math.sqrt($)),$=c-$,y.y-(t.y??0)>0&&($=-$),b.y+=$}return b},i}x(Qe,"linedCylinder");async function ts(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h;if(t.width||t.height){let $=t.width;t.width=($??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10)}let{shapeSvg:i,bbox:n,label:r}=await B(p,t,T(t)),e=(t?.width?t?.width:n.width)+(a??0)*2,s=(t?.height?t?.height:n.height)+(f??0)*2,c=t.look==="neo"?s/4:s/8,m=s+c,{cssStyles:g}=t,d=k.svg(i),u=P(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-e/2-e/2*.1,y:-m/2},{x:-e/2-e/2*.1,y:m/2},...at(-e/2-e/2*.1,m/2,e/2+e/2*.1,m/2,c,.8),{x:e/2+e/2*.1,y:-m/2},{x:-e/2-e/2*.1,y:-m/2},{x:-e/2,y:-m/2},{x:-e/2,y:m/2*1.1},{x:-e/2,y:-m/2}],b=d.polygon(y.map($=>[$.x,$.y]),u),S=i.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(0,${-c/2})`),r.attr("transform",`translate(${-e/2+(t.padding??0)+e/2*.1/2-(n.x-(n.left??0))},${-s/2+(t.padding??0)-c/2-(n.y-(n.top??0))})`),D(t,S),t.intersect=function($){return N.polygon(t,y,$)},i}x(ts,"linedWaveEdgedRect");async function es(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h,i=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*i,10),t.height=Math.max((t?.height??0)-f*2-2*i,10));let{shapeSvg:n,bbox:r,label:e}=await B(p,t,T(t)),s=(t?.width?t?.width:r.width)+a*2+2*i,c=(t?.height?t?.height:r.height)+f*2+2*i,m=s-2*i,g=c-2*i,d=-m/2,u=-g/2,{cssStyles:y}=t,b=k.svg(n),S=P(t,{}),$=[{x:d-i,y:u+i},{x:d-i,y:u+g+i},{x:d+m-i,y:u+g+i},{x:d+m-i,y:u+g},{x:d+m,y:u+g},{x:d+m,y:u+g-i},{x:d+m+i,y:u+g-i},{x:d+m+i,y:u-i},{x:d+i,y:u-i},{x:d+i,y:u},{x:d,y:u},{x:d,y:u+i}],w=[{x:d,y:u+i},{x:d+m-i,y:u+i},{x:d+m-i,y:u+g},{x:d+m,y:u+g},{x:d+m,y:u},{x:d,y:u}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let M=W($),R=b.path(M,S),C=W(w),O=b.path(C,S);t.look!=="handDrawn"&&(R=Lt(R),O=Lt(O));let E=n.insert("g",":first-child");return E.insert(()=>R),E.insert(()=>O),E.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",y),l&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",l),e.attr("transform",`translate(${-(r.width/2)-i-(r.x-(r.left??0))}, ${-(r.height/2)+i-(r.y-(r.top??0))})`),D(t,E),t.intersect=function(G){return N.polygon(t,$,G)},n}x(es,"multiRect");async function ss(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=t.padding??0,n=t.look==="neo"?16:i,r=t.look==="neo"?12:i,e=!0;(t.width||t.height)&&(e=!1,t.width=(t?.width??0)-n*2,t.height=(t?.height??0)-r*3);let s=Math.max(a.width,t?.width??0)+n*2,c=Math.max(a.height,t?.height??0)+r*3,m=t.look==="neo"?c/4:c/8,g=c+(e?m/2:-m/2),d=-s/2,u=-g/2,y=10,{cssStyles:b}=t,S=at(d-y,u+g+y,d+s-y,u+g+y,m,.8),$=S?.[S.length-1],w=[{x:d-y,y:u+y},{x:d-y,y:u+g+y},...S,{x:d+s-y,y:$.y-y},{x:d+s,y:$.y-y},{x:d+s,y:$.y-2*y},{x:d+s+y,y:$.y-2*y},{x:d+s+y,y:u-y},{x:d+y,y:u-y},{x:d+y,y:u},{x:d,y:u},{x:d,y:u+y}],M=[{x:d,y:u+y},{x:d+s-y,y:u+y},{x:d+s-y,y:$.y-y},{x:d+s,y:$.y-y},{x:d+s,y:u},{x:d,y:u}],R=k.svg(h),C=P(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let O=W(w),E=R.path(O,C),G=W(M),L=R.path(G,C),H=h.insert(()=>E,":first-child");return H.insert(()=>L),H.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&H.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&H.selectAll("path").attr("style",l),H.attr("transform",`translate(0,${-m/2})`),f.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-m/2-(a.y-(a.top??0))})`),D(t,H),t.intersect=function(I){return N.polygon(t,w,I)},h}x(ss,"multiWaveEdgedRectangle");async function rs(p,t,{config:{themeVariables:o}}){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l,t.useHtmlLabels||ct(ut())||(t.centerLabel=!0);let{shapeSvg:f,bbox:i,label:n}=await B(p,t,T(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),e=Math.max(i.height+(t.padding??0)*2,t?.height??0),s=-r/2,c=-e/2,{cssStyles:m}=t,g=k.svg(f),d=P(t,{fill:o.noteBkgColor,stroke:o.noteBorderColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=g.rectangle(s,c,r,e,d),y=f.insert(()=>u,":first-child");return y.attr("class","basic label-container outer-path"),n.attr("class","label noteLabel"),m&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",m),h&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",h),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),D(t,y),t.intersect=function(b){return N.rect(t,b)},f}x(rs,"note");var cr=x((p,t,o)=>[`M${p+o/2},${t}`,`L${p+o},${t-o/2}`,`L${p+o/2},${t-o}`,`L${p},${t-o/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function os(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a}=await B(p,t,T(t)),f=a.width+(t.padding??0),i=a.height+(t.padding??0),n=f+i,r=.5,e=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],s,{cssStyles:c}=t;if(t.look==="handDrawn"){let m=k.svg(h),g=P(t,{}),d=cr(0,0,n),u=m.path(d,g);s=h.insert(()=>u,":first-child").attr("transform",`translate(${-n/2+r}, ${n/2})`),c&&s.attr("style",c)}else s=et(h,n,n,e),s.attr("transform",`translate(${-n/2+r}, ${n/2})`);return l&&s.attr("style",l),D(t,s),t.calcIntersect=function(m,g){let d=m.width,u=[{x:d/2,y:0},{x:d,y:-d/2},{x:d/2,y:-d},{x:0,y:-d/2}],y=N.polygon(m,u,g);return{x:y.x-.5,y:y.y-.5}},t.intersect=function(m){return this.calcIntersect(t,m)},h}x(os,"question");async function is(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?21:h??0,f=t.look==="neo"?12:h??0,{shapeSvg:i,bbox:n,label:r}=await B(p,t,T(t)),e=n.width+(t.look==="neo"?a*2:a),s=Math.max(n.height+(t.look==="neo"?f*2:f),t.height??0),c=s/4,g=-Math.max(e,(t.width??0)-c)/2,d=-s/2,u=d/2,y=[{x:g+u,y:d},{x:g,y:0},{x:g+u,y:-d},{x:-g,y:-d},{x:-g,y:d}],{cssStyles:b}=t,S=k.svg(i),$=P(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let w=W(y),M=S.path(w,$),R=i.insert(()=>M,":first-child");return R.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",l),R.attr("transform",`translate(${-u/2},0)`),r.attr("transform",`translate(${-u/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),D(t,R),t.intersect=function(C){return N.polygon(t,y,C)},i}x(is,"rect_left_inv_arrow");async function as(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h;t.cssClasses?h="node "+t.cssClasses:h="node default";let a=p.insert("g").attr("class",h).attr("id",t.domId||t.id),f=a.insert("g"),i=a.insert("g").attr("class","label").attr("style",l),n=t.description,r=t.label,e=await Vt(i,r,t.labelStyle,!0,!0),s={width:0,height:0};if(ct(U())){let C=e.children[0],O=K(e);s=C.getBoundingClientRect(),O.attr("width",s.width),O.attr("height",s.height)}_.info("Text 2",n);let c=n||[],m=e.getBBox(),g=await Vt(i,Array.isArray(c)?c.join("<br/>"):c,t.labelStyle,!0,!0),d=g.children[0],u=K(g);s=d.getBoundingClientRect(),u.attr("width",s.width),u.attr("height",s.height);let y=(t.padding||0)/2;K(g).attr("transform","translate( "+(s.width>m.width?0:(m.width-s.width)/2)+", "+(m.height+y+5)+")"),K(e).attr("transform","translate( "+(s.width<m.width?0:-(m.width-s.width)/2)+", 0)"),s=i.node().getBBox(),i.attr("transform","translate("+-s.width/2+", "+(-s.height/2-y+3)+")");let b=s.width+(t.padding||0),S=s.height+(t.padding||0),$=-s.width/2-y,w=-s.height/2-y,M,R;if(t.look==="handDrawn"){let C=k.svg(a),O=P(t,{}),E=C.path(tt($,w,b,S,t.rx||0),O),G=C.line(-s.width/2-y,-s.height/2-y+m.height+y,s.width/2+y,-s.height/2-y+m.height+y,O);R=a.insert(()=>(_.debug("Rough node insert CXC",E),G),":first-child"),M=a.insert(()=>(_.debug("Rough node insert CXC",E),E),":first-child")}else M=f.insert("rect",":first-child"),R=f.insert("line"),M.attr("class","outer title-state").attr("style",l).attr("x",-s.width/2-y).attr("y",-s.height/2-y).attr("width",s.width+(t.padding||0)).attr("height",s.height+(t.padding||0)),R.attr("class","divider").attr("x1",-s.width/2-y).attr("x2",s.width/2+y).attr("y1",-s.height/2-y+m.height+y).attr("y2",-s.height/2-y+m.height+y);return D(t,M),t.intersect=function(C){return N.rect(t,C)},a}x(as,"rectWithTitle");async function ns(p,t,{config:{themeVariables:o}}){let l=o?.radius??5,h={rx:l,ry:l,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ht(p,t,h)}x(ns,"roundedRect");var Dt=8;async function ls(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:f,bbox:i,label:n}=await B(p,t,T(t)),r=(t?.width??i.width)+h*2+(t.look==="neo"?Dt:Dt*2),e=(t?.height??i.height)+a*2,s=r-Dt,c=e,m=Dt-r/2,g=-e/2,{cssStyles:d}=t,u=k.svg(f),y=P(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let b=[{x:m,y:g},{x:m+s,y:g},{x:m+s,y:g+c},{x:m-Dt,y:g+c},{x:m-Dt,y:g},{x:m,y:g},{x:m,y:g+c}],S=u.polygon(b.map(w=>[w.x,w.y]),y),$=f.insert(()=>S,":first-child");return $.attr("class","basic label-container outer-path").attr("style",q(d)),l&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",l),d&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",l),n.attr("transform",`translate(${Dt/2-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),D(t,$),t.intersect=function(w){return N.rect(t,w)},f}x(ls,"shadedProcess");async function cs(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-f*2,10));let{shapeSvg:i,bbox:n,label:r}=await B(p,t,T(t)),e=(t?.width?t?.width:n.width)+a*2,s=((t?.height?t?.height:n.height)+f*2)*1.5,c=e,m=s/1.5,g=-c/2,d=-m/2,{cssStyles:u}=t,y=k.svg(i),b=P(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let S=[{x:g,y:d},{x:g,y:d+m},{x:g+c,y:d+m},{x:g+c,y:d-m/2}],$=W(S),w=y.path($,b),M=i.insert(()=>w,":first-child");return M.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",u),l&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(0, ${m/4})`),r.attr("transform",`translate(${-c/2+(t.padding??0)-(n.x-(n.left??0))}, ${-m/4+(t.padding??0)-(n.y-(n.top??0))})`),D(t,M),t.intersect=function(R){return N.polygon(t,S,R)},i}x(cs,"slopedRect");async function hs(p,t){let o=t.padding??0,l=t.look==="neo"?16:o*2,h=t.look==="neo"?12:o,a={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??l,labelPaddingY:h};return ht(p,t,a)}x(hs,"squareRect");async function ps(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?20:h,f=t.look==="neo"?12:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=n.height+(t.look==="neo"?f*2:f),e=n.width+r/4+(t.look==="neo"?a*2:a),s=r/2,{cssStyles:c}=t,m=k.svg(i),g=P(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let d=[{x:-e/2+s,y:-r/2},{x:e/2-s,y:-r/2},...it(-e/2+s,0,s,50,90,270),{x:e/2-s,y:r/2},...it(e/2-s,0,s,50,270,450)],u=W(d),y=m.path(u,g),b=i.insert(()=>y,":first-child");return b.attr("class","basic label-container outer-path"),c&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",c),l&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",l),D(t,b),t.intersect=function(S){return N.polygon(t,d,S)},i}x(ps,"stadium");async function ms(p,t){let o={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return ht(p,t,o)}x(ms,"state");function fs(p,t,{config:{themeVariables:o}}){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l;let{cssStyles:a}=t,{lineColor:f,stateBorder:i,nodeBorder:n,nodeShadow:r}=o;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let e=p.insert("g").attr("class","node default").attr("id",t.domId??t.id),s=k.svg(e),c=P(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let m=s.circle(0,0,t.width,{...c,stroke:f,strokeWidth:2}),g=i??n,d=(t.width??0)*5/14,u=s.circle(0,0,d,{...c,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=e.insert(()=>m,":first-child");if(y.insert(()=>u),t.look!=="handDrawn"&&y.attr("class","outer-path"),a&&y.selectAll("path").attr("style",a),h&&y.selectAll("path").attr("style",h),t.width<25&&r&&t.look!=="handDrawn"){let b=p.node()?.ownerSVGElement?.id??"",S=b?`${b}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${S})`)}return D(t,y),t.intersect=function(b){return N.circle(t,(t.width??0)/2,b)},e}x(fs,"stateEnd");function gs(p,t,{config:{themeVariables:o}}){let{lineColor:l,nodeShadow:h}=o;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let a=p.insert("g").attr("class","node default").attr("id",t.domId||t.id),f;if(t.look==="handDrawn"){let n=k.svg(a).circle(0,0,t.width,Jt(l));f=a.insert(()=>n),f.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else f=a.insert("circle",":first-child"),f.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&h&&t.look!=="handDrawn"){let i=p.node()?.ownerSVGElement?.id??"",n=i?`${i}-drop-shadow-small`:"drop-shadow-small";f.attr("style",`filter:url(#${n})`)}return D(t,f),t.intersect=function(i){return N.circle(t,(t.width??7)/2,i)},a}x(gs,"stateStart");var vt=8;async function ds(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t?.padding??8,a=t.look==="neo"?28:h,f=t.look==="neo"?12:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=Math.max(n.width+2*vt+a,t.width??0),e=Math.max(n.height+f,t.height??0),s=r-2*vt,c=e,m=-r/2,g=-e/2,d=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look==="handDrawn"){let u=k.svg(i),y=P(t,{}),b=u.rectangle(m,g,s+16,c,y),S=u.line(m+vt,g,m+vt,g+c,y),$=u.line(m+vt+s,g,m+vt+s,g+c,y);i.insert(()=>S,":first-child"),i.insert(()=>$,":first-child");let w=i.insert(()=>b,":first-child"),{cssStyles:M}=t;w.attr("class","basic label-container").attr("style",q(M)),D(t,w)}else{let u=et(i,s,c,d);l&&u.attr("style",l),D(t,u)}return t.intersect=function(u){return N.polygon(t,d,u)},i}x(ds,"subroutine");var Xt=.2;async function ys(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-f*2,10),t.width=Math.max((t?.width??0)-a*2-Xt*(t.height+f*2),10));let{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=(t?.height?t?.height:n.height)+f*2,e=Xt*r,s=Xt*r,m=(t?.width?t?.width:n.width)+a*2+e-e,g=r,d=-m/2,u=-g/2,{cssStyles:y}=t,b=k.svg(i),S=P(t,{}),$=[{x:d-e/2,y:u},{x:d+m+e/2,y:u},{x:d+m+e/2,y:u+g},{x:d-e/2,y:u+g}],w=[{x:d+m-e/2,y:u+g},{x:d+m+e/2,y:u+g},{x:d+m+e/2,y:u+g-s}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let M=W($),R=b.path(M,S),C=W(w),O=b.path(C,{...S,fillStyle:"solid"}),E=i.insert(()=>O,":first-child");return E.insert(()=>R,":first-child"),E.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",y),l&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",l),D(t,E),t.intersect=function(G){return N.polygon(t,$,G)},i}x(ys,"taggedRect");async function us(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,label:f}=await B(p,t,T(t)),i=Math.max(a.width+(t.padding??0)*2,t?.width??0),n=Math.max(a.height+(t.padding??0)*2,t?.height??0),r=n/8,e=.2*i,s=.2*n,c=n+r,{cssStyles:m}=t,g=k.svg(h),d=P(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=[{x:-i/2-i/2*.1,y:c/2},...at(-i/2-i/2*.1,c/2,i/2+i/2*.1,c/2,r,.8),{x:i/2+i/2*.1,y:-c/2},{x:-i/2-i/2*.1,y:-c/2}],y=-i/2+i/2*.1,b=-c/2-s*.4,S=[{x:y+i-e,y:(b+n)*1.3},{x:y+i,y:b+n-s},{x:y+i,y:(b+n)*.9},...at(y+i,(b+n)*1.25,y+i-e,(b+n)*1.3,-n*.02,.5)],$=W(u),w=g.path($,d),M=W(S),R=g.path(M,{...d,fillStyle:"solid"}),C=h.insert(()=>R,":first-child");return C.insert(()=>w,":first-child"),C.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",m),l&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(0,${-r/2})`),f.attr("transform",`translate(${-i/2+(t.padding??0)-(a.x-(a.left??0))},${-n/2+(t.padding??0)-r/2-(a.y-(a.top??0))})`),D(t,C),t.intersect=function(O){return N.polygon(t,u,O)},h}x(us,"taggedWaveEdgedRectangle");async function xs(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a}=await B(p,t,T(t)),f=Math.max(a.width+(t.padding??0),t?.width||0),i=Math.max(a.height+(t.padding??0),t?.height||0),n=-f/2,r=-i/2,e=h.insert("rect",":first-child");return e.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",n).attr("y",r).attr("width",f).attr("height",i),D(t,e),t.intersect=function(s){return N.rect(t,s)},h}x(xs,"text");var hr=x((p,t,o,l,h,a)=>`M${p},${t}
a${h},${a} 0,0,1 0,${-l}
l${o},0
a${h},${a} 0,0,1 0,${l}
M${o},${-l}
a${h},${a} 0,0,0 0,${l}
l${-o},0`,"createCylinderPathD"),pr=x((p,t,o,l,h,a)=>[`M${p},${t}`,`M${p+o},${t}`,`a${h},${a} 0,0,0 0,${-l}`,`l${-o},0`,`a${h},${a} 0,0,0 0,${l}`,`l${o},0`].join(" "),"createOuterCylinderPathD"),mr=x((p,t,o,l,h,a)=>[`M${p+o/2},${-l/2}`,`a${h},${a} 0,0,0 0,${l}`].join(" "),"createInnerCylinderPathD"),bs=5,Ss=10;async function ws(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?12:h/2,f=t.height??0;if(t.height&&(t.height=t.height-a,t.height<bs&&(t.height=bs)),t.width){let y=f/2/(2.5+f/50);t.width=t.width-a-y*3,t.width<Ss&&(t.width=Ss)}let{shapeSvg:i,bbox:n,label:r}=await B(p,t,T(t)),e=Math.max(t.height??0,n.height)+a,s=e/2,c=s/(2.5+e/50),m=Math.max(t.width??0,n.width)+c+a,{cssStyles:g}=t,d;if(t.look==="handDrawn"){let u=k.svg(i),y=pr(0,0,m,e,c,s),b=mr(0,0,m,e,c,s),S=u.path(y,P(t,{})),$=u.path(b,P(t,{fill:"none"}));d=i.insert(()=>$,":first-child"),d=i.insert(()=>S,":first-child"),d.attr("class","basic label-container"),g&&d.attr("style",g)}else{let u=hr(0,0,m,e,c,s);d=i.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",q(g)).attr("style",l),d.attr("class","basic label-container outer-path"),g&&d.selectAll("path").attr("style",g),l&&d.selectAll("path").attr("style",l)}return d.attr("label-offset-x",c),d.attr("transform",`translate(${-m/2}, ${e/2} )`),r.attr("transform",`translate(${-(n.width/2)-c-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),D(t,d),t.intersect=function(u){let y=N.rect(t,u),b=y.y-(t.y??0);if(s!=0&&(Math.abs(b)<(t.height??0)/2||Math.abs(b)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-c)){let S=c*c*(1-b*b/(s*s));S!=0&&(S=Math.sqrt(Math.abs(S))),S=c-S,u.x-(t.x??0)>0&&(S=-S),y.x+=S}return y},i}x(ws,"tiltedCylinder");async function Ns(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=(t.look==="neo",h),f=t.look==="neo"?h*2:h,{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=Math.max(n.height+a,t.height??0),e=Math.max(n.width+f,(t.width??0)-r),s=[{x:-3*r/6,y:0},{x:e+3*r/6,y:0},{x:e,y:-r},{x:0,y:-r}],c,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=k.svg(i),d=P(t,{}),u=W(s),y=g.path(u,d);c=i.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),m&&c.attr("style",m)}else c=et(i,e,r,s);return l&&c.attr("style",l),t.width=e,t.height=r,D(t,c),t.intersect=function(g){return N.polygon(t,s,g)},i}x(Ns,"trapezoid");async function $s(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h,i=15,n=5;(t.width||t.height)&&(t.height=(t.height??0)-f*2,t.height<n&&(t.height=n),t.width=(t.width??0)-a*2,t.width<i&&(t.width=i));let{shapeSvg:r,bbox:e}=await B(p,t,T(t)),s=(t?.width?t?.width:e.width)+a*2,c=(t?.height?t?.height:e.height)+f*2,{cssStyles:m}=t,g=k.svg(r),d=P(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=[{x:-s/2*.8,y:-c/2},{x:s/2*.8,y:-c/2},{x:s/2,y:-c/2*.6},{x:s/2,y:c/2},{x:-s/2,y:c/2},{x:-s/2,y:-c/2*.6}],y=W(u),b=g.path(y,d),S=r.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),D(t,S),t.intersect=function($){return N.polygon(t,u,$)},r}x($s,"trapezoidalPentagon");var Ds=10,Ps=10;async function vs(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?h*2:h;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.width<Ps&&(t.width=Ps),t.height=t?.height??0,t.height<Ds&&(t.height=Ds));let{shapeSvg:f,bbox:i,label:n}=await B(p,t,T(t)),r=lt(U().flowchart?.htmlLabels),e=(t?.width?t?.width:i.width)+a,s=t?.height?t?.height:e+i.height,c=s,m=[{x:0,y:0},{x:c,y:0},{x:c/2,y:-s}],{cssStyles:g}=t,d=k.svg(f),u=P(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=W(m),b=d.path(y,u),S=f.insert(()=>b,":first-child").attr("transform",`translate(${-s/2}, ${s/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",g),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),t.width=e,t.height=s,D(t,S),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${s/2-(i.height+(t.padding??0)/(r?2:1)-(i.y-(i.top??0)))})`),t.intersect=function($){return _.info("Triangle intersect",t,m,$),N.polygon(t,m,$)},f}x(vs,"triangle");async function ks(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?12:h,i=!0;(t.width||t.height)&&(i=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10));let{shapeSvg:n,bbox:r,label:e}=await B(p,t,T(t)),s=(t?.width?t?.width:r.width)+(a??0)*2,c=(t?.height?t?.height:r.height)+(f??0)*2,m=t.look==="neo"?c/4:c/8,g=c+(i?m:-m),{cssStyles:d}=t,y=14-s,b=y>0?y/2:0,S=k.svg(n),$=P(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let w=[{x:-s/2-b,y:g/2},...at(-s/2-b,g/2,s/2+b,g/2,m,.8),{x:s/2+b,y:-g/2},{x:-s/2-b,y:-g/2}],M=W(w),R=S.path(M,$),C=n.insert(()=>R,":first-child");return C.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(0,${-m/2})`),e.attr("transform",`translate(${-s/2+(t.padding??0)-(r.x-(r.left??0))},${-c/2+(t.padding??0)-m-(r.y-(r.top??0))})`),D(t,C),t.intersect=function(O){return N.polygon(t,w,O)},n}x(ks,"waveEdgedRectangle");async function Ts(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.padding??0,a=t.look==="neo"?16:h,f=t.look==="neo"?20:h;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let $=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-f-$*(20/9)),t.width=t.width-a*2}let{shapeSvg:i,bbox:n}=await B(p,t,T(t)),r=(t?.width?t?.width:n.width)+a*2,e=(t?.height?t?.height:n.height)+f,s=e/8,c=e+s*2,{cssStyles:m}=t,g=k.svg(i),d=P(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=[{x:-r/2,y:c/2},...at(-r/2,c/2,r/2,c/2,s,1),{x:r/2,y:-c/2},...at(r/2,-c/2,-r/2,-c/2,s,-1)],y=W(u),b=g.path(y,d),S=i.insert(()=>b,":first-child");return S.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),D(t,S),t.intersect=function($){return N.polygon(t,u,$)},i}x(Ts,"waveRectangle");var J=10;async function Bs(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-h*2-J,10),t.height=Math.max((t?.height??0)-a*2-J,10));let{shapeSvg:f,bbox:i,label:n}=await B(p,t,T(t)),r=(t?.width?t?.width:i.width)+h*2+J,e=(t?.height?t?.height:i.height)+a*2+J,s=r-J,c=e-J,m=-s/2,g=-c/2,{cssStyles:d}=t,u=k.svg(f),y=P(t,{}),b=[{x:m-J,y:g-J},{x:m-J,y:g+c},{x:m+s,y:g+c},{x:m+s,y:g-J}],S=`M${m-J},${g-J} L${m+s},${g-J} L${m+s},${g+c} L${m-J},${g+c} L${m-J},${g-J}
M${m-J},${g} L${m+s},${g}
M${m},${g-J} L${m},${g+c}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let $=u.path(S,y),w=f.insert(()=>$,":first-child");return w.attr("transform",`translate(${J/2}, ${J/2})`),w.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",l),n.attr("transform",`translate(${-(i.width/2)+J/2-(i.x-(i.left??0))}, ${-(i.height/2)+J/2-(i.y-(i.top??0))})`),D(t,w),t.intersect=function(M){return N.polygon(t,b,M)},f}x(Bs,"windowPane");var Ms=new Set(["redux-color","redux-dark-color"]),fr=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function qt(p,t){let o=t;o.alias&&(t.label=o.alias);let{theme:l,themeVariables:h}=ut(),{rowEven:a,rowOdd:f,nodeBorder:i,borderColorArray:n}=h;if(t.look==="handDrawn"){let{themeVariables:F}=ut(),{background:Z}=F,Q={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await qt(p,Q)}let r=ut();t.useHtmlLabels=r.htmlLabels;let e=r.er?.diagramPadding??10,s=r.er?.entityPadding??6,{cssStyles:c}=t,{labelStyles:m,nodeStyles:g}=v(t);if(o.attributes.length===0&&t.label){let F={rx:0,ry:0,labelPaddingX:e,labelPaddingY:e*1.5,classes:""};$t(t.label,r)+F.labelPaddingX*2<r.er.minEntityWidth&&(t.width=r.er.minEntityWidth);let Z=await ht(p,t,F);if(l!=null&&Ms.has(l)){let Q=o.colorIndex??0;Z.attr("data-color-id",`color-${Q%n.length}`)}if(!lt(r.htmlLabels)){let Q=Z.select("text"),rt=Q.node()?.getBBox();Q.attr("transform",`translate(${-rt.width/2}, 0)`)}return Z}r.htmlLabels||(e*=1.25,s*=1.25);let d=T(t);d||(d="node default");let u=p.insert("g").attr("class",d).attr("id",t.domId||t.id),y=await Bt(u,t.label??"",r,0,0,["name"],m);y.height+=s;let b=0,S=[],$=[],w=0,M=0,R=0,C=0,O=!0,E=!0;for(let F of o.attributes){let Z=await Bt(u,F.type,r,0,b,["attribute-type"],m);w=Math.max(w,Z.width+e);let Q=await Bt(u,F.name,r,0,b,["attribute-name"],m);M=Math.max(M,Q.width+e);let rt=await Bt(u,F.keys.join(),r,0,b,["attribute-keys"],m);R=Math.max(R,rt.width+e);let Nt=await Bt(u,F.comment,r,0,b,["attribute-comment"],m);C=Math.max(C,Nt.width+e);let yt=Math.max(Z.height,Q.height,rt.height,Nt.height)+s;$.push({yOffset:b,rowHeight:yt}),b+=yt}let G=4;R<=e&&(O=!1,R=0,G--),C<=e&&(E=!1,C=0,G--);let L=u.node().getBBox();if(y.width+e*2-(w+M+R+C)>0){let F=y.width+e*2-(w+M+R+C);w+=F/G,M+=F/G,R>0&&(R+=F/G),C>0&&(C+=F/G)}let H=w+M+R+C,I=k.svg(u),A=P(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let j=0;$.length>0&&(j=$.reduce((F,Z)=>F+(Z?.rowHeight??0),0));let V=Math.max(L.width+e*2,t?.width||0,H),Y=Math.max((j??0)+y.height,t?.height||0),X=-V/2,z=-Y/2;if(u.selectAll("g:not(:first-child)").each((F,Z,Q)=>{let rt=K(Q[Z]),Nt=rt.attr("transform"),yt=0,zt=0;if(Nt){let Ot=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Nt);Ot&&(yt=parseFloat(Ot[1]),zt=parseFloat(Ot[2]),rt.attr("class").includes("attribute-name")?yt+=w:rt.attr("class").includes("attribute-keys")?yt+=w+M:rt.attr("class").includes("attribute-comment")&&(yt+=w+M+R))}rt.attr("transform",`translate(${X+e/2+yt}, ${zt+z+y.height+s/2})`)}),u.select(".name").attr("transform","translate("+-y.width/2+", "+(z+s/2)+")"),l!=null&&Ms.has(l)){let F=o.colorIndex??0;u.attr("data-color-id",`color-${F%n.length}`)}let mt=I.rectangle(X,z,V,Y,A),Pt=u.insert(()=>mt,":first-child").attr("class","outer-path").attr("style",c.join(""));S.push(0);for(let[F,Z]of $.entries()){let rt=(F+1)%2===0&&Z.yOffset!==0,Nt=I.rectangle(X,y.height+z+Z?.yOffset,V,Z?.rowHeight,{...A,fill:rt?a:f,stroke:i});u.insert(()=>Nt,"g.label").attr("style",c.join("")).attr("class",`row-rect-${rt?"even":"odd"}`)}let pt=1e-4,nt=Mt(X,y.height+z,V+X,y.height+z,pt),ft=I.polygon(nt.map(F=>[F.x,F.y]),A);if(u.insert(()=>ft).attr("class","divider"),nt=Mt(w+X,y.height+z,w+X,Y+z,pt),ft=I.polygon(nt.map(F=>[F.x,F.y]),A),u.insert(()=>ft).attr("class","divider"),O){let F=w+M+X;nt=Mt(F,y.height+z,F,Y+z,pt),ft=I.polygon(nt.map(Z=>[Z.x,Z.y]),A),u.insert(()=>ft).attr("class","divider")}if(E){let F=w+M+R+X;nt=Mt(F,y.height+z,F,Y+z,pt),ft=I.polygon(nt.map(Z=>[Z.x,Z.y]),A),u.insert(()=>ft).attr("class","divider")}for(let F of S){let Z=y.height+z+F;nt=Mt(X,Z,V+X,Z,pt),ft=I.polygon(nt.map(Q=>[Q.x,Q.y]),A),u.insert(()=>ft).attr("class","divider")}if(D(t,Pt),g&&t.look!=="handDrawn")if(l!=null&&fr.has(l))u.selectAll("path").attr("style",g);else{let Z=g.split(";")?.filter(Q=>Q.includes("stroke"))?.map(Q=>`${Q}`).join("; ");u.selectAll("path").attr("style",Z??""),u.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(F){return N.rect(t,F)},u}x(qt,"erBox");async function Bt(p,t,o,l=0,h=0,a=[],f=""){let i=p.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${l}, ${h})`).attr("style",f);t!==It(t)&&(t=It(t),t=t.replaceAll("<","<").replaceAll(">",">"));let n=i.node().appendChild(await ot(i,t,{width:$t(t,o)+100,style:f,useHtmlLabels:o.htmlLabels},o));if(t.includes("<")||t.includes(">")){let e=n.children[0];for(e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">")}let r=n.getBBox();if(lt(o.htmlLabels)){let e=n.children[0];e.style.textAlign="start";let s=K(n);r=e.getBoundingClientRect(),s.attr("width",r.width),s.attr("height",r.height)}return r}x(Bt,"addText");function Mt(p,t,o,l,h){return p===o?[{x:p-h/2,y:t},{x:p+h/2,y:t},{x:o+h/2,y:l},{x:o-h/2,y:l}]:[{x:p,y:t-h/2},{x:p,y:t+h/2},{x:o,y:l+h/2},{x:o,y:l-h/2}]}x(Mt,"lineToPolygon");async function Cs(p,t,o,l,h=o.class.padding??12){let a=l?0:3,f=p.insert("g").attr("class",T(t)).attr("id",t.domId||t.id),i=null,n=null,r=null,e=null,s=0,c=0,m=0;if(i=f.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let b=t.annotations[0];await At(i,{text:`\xAB${b}\xBB`},0),s=i.node().getBBox().height}n=f.insert("g").attr("class","label-group text"),await At(n,t,0,["font-weight: bolder"]);let g=n.node().getBBox();c=g.height,r=f.insert("g").attr("class","members-group text");let d=0;for(let b of t.members){let S=await At(r,b,d,[b.parseClassifier()]);d+=S+a}m=r.node().getBBox().height,m<=0&&(m=h/2),e=f.insert("g").attr("class","methods-group text");let u=0;for(let b of t.methods){let S=await At(e,b,u,[b.parseClassifier()]);u+=S+a}let y=f.node().getBBox();if(i!==null){let b=i.node().getBBox();i.attr("transform",`translate(${-b.width/2})`)}return n.attr("transform",`translate(${-g.width/2}, ${s})`),y=f.node().getBBox(),r.attr("transform",`translate(0, ${s+c+h*2})`),y=f.node().getBBox(),e.attr("transform",`translate(0, ${s+c+(m?m+h*4:h*2)})`),y=f.node().getBBox(),{shapeSvg:f,bbox:y}}x(Cs,"textHelper");async function At(p,t,o,l=[]){let h=p.insert("g").attr("class","label").attr("style",l.join("; ")),a=ut(),f="useHtmlLabels"in t?t.useHtmlLabels:lt(a.htmlLabels)??!0,i="";"text"in t?i=t.text:i=t.label,!f&&i.startsWith("\\")&&(i=i.substring(1)),Zt(i)&&(f=!0);let n=await ot(h,Ct(gt(i)),{width:$t(i,a)+50,classes:"markdown-node-label",useHtmlLabels:f},a),r,e=1;if(f){let s=n.children[0],c=K(n);e=s.innerHTML.split("<br>").length,s.innerHTML.includes("</math>")&&(e+=s.innerHTML.split("<mrow>").length-1),await Rt(s),r=s.getBoundingClientRect(),c.attr("width",r.width),c.attr("height",r.height)}else{l.includes("font-weight: bolder")&&K(n).selectAll("tspan").attr("font-weight",""),e=n.children.length;let s=n.children[0];(n.textContent===""||n.textContent.includes(">"))&&(s.textContent=i[0]+i.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),i[1]===" "&&(s.textContent=s.textContent[0]+" "+s.textContent.substring(1))),s.textContent==="undefined"&&(s.textContent=""),r=n.getBBox()}return h.attr("transform","translate(0,"+(-r.height/(2*e)+o)+")"),r.height}x(At,"addText");async function Rs(p,t){let o=U(),{themeVariables:l}=o,{useGradient:h}=l,a=o.class.padding??12,f=a,i=t.useHtmlLabels??lt(o.htmlLabels)??!0,n=t;n.annotations=n.annotations??[],n.members=n.members??[],n.methods=n.methods??[];let{shapeSvg:r,bbox:e}=await Cs(p,t,o,i,f),{labelStyles:s,nodeStyles:c}=v(t);t.labelStyle=s,t.cssStyles=n.styles||"";let m=n.styles?.join(";")||c||"";t.cssStyles||(t.cssStyles=m.replaceAll("!important","").split(";"));let g=n.members.length===0&&n.methods.length===0&&!o.class?.hideEmptyMembersBox,d=k.svg(r),u=P(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=Math.max(t.width??0,e.width),b=Math.max(t.height??0,e.height),S=(t.height??0)>e.height;n.members.length===0&&n.methods.length===0?b+=f:n.members.length>0&&n.methods.length===0&&(b+=f*2);let $=-y/2,w=-b/2,M=g?a*2:n.members.length===0&&n.methods.length===0?-a:0;S&&(M=a*2);let R=d.rectangle($-a,w-a-(g?a:n.members.length===0&&n.methods.length===0?-a/2:0),y+2*a,b+2*a+M,u),C=r.insert(()=>R,":first-child");C.attr("class","basic label-container outer-path");let O=C.node().getBBox(),E=r.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,G=r.select(".label-group").node().getBBox().height-(g?a/2:0)||0,L=r.select(".members-group").node().getBBox().height-(g?a/2:0)||0,H=(E+G+w+a-(w-a-(g?a:n.members.length===0&&n.methods.length===0?-a/2:0)))/2;if(r.selectAll(".text").each((I,A,j)=>{let V=K(j[A]),Y=V.attr("transform"),X=0;if(Y){let pt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);pt&&(X=parseFloat(pt[2]))}let z=X+w+a-(g?a:n.members.length===0&&n.methods.length===0?-a/2:0);if(V.attr("class").includes("methods-group")){let Pt=Math.max(L,f/2);S?z=Math.max(H,E+G+Pt+w+f*2+a)+f*2:z=E+G+Pt+w+f*4+a}n.members.length===0&&n.methods.length===0&&o.class?.hideEmptyMembersBox&&(n.annotations.length>0?z=X-f:z=X),i||(z-=4);let mt=$;(V.attr("class").includes("label-group")||V.attr("class").includes("annotation-group"))&&(mt=-V.node()?.getBBox().width/2||0,r.selectAll("text").each(function(Pt,pt,nt){window.getComputedStyle(nt[pt]).textAnchor==="middle"&&(mt=0)})),V.attr("transform",`translate(${mt}, ${z})`)}),n.members.length>0||n.methods.length>0||g){let I=E+G+w+a,A=d.line(O.x,I,O.x+O.width,I+.001,u);r.insert(()=>A).attr("class",`divider${t.look==="neo"&&!h?" neo-line":""}`).attr("style",m)}if(g||n.members.length>0||n.methods.length>0){let I=E+G+L+w+f*2+a,A=d.line(O.x,S?Math.max(H,I):I,O.x+O.width,(S?Math.max(H,I):I)+.001,u);r.insert(()=>A).attr("class",`divider${t.look==="neo"&&!h?" neo-line":""}`).attr("style",m)}if(n.look!=="handDrawn"&&r.selectAll("path").attr("style",m),C.select(":nth-child(2)").attr("style",m),r.selectAll(".divider").select("path").attr("style",m),t.labelStyle?r.selectAll("span").attr("style",t.labelStyle):r.selectAll("span").attr("style",m),!i){let I=RegExp(/color\s*:\s*([^;]*)/),A=I.exec(m);if(A){let j=A[0].replace("color","fill");r.selectAll("tspan").attr("style",j)}else if(s){let j=I.exec(s);if(j){let V=j[0].replace("color","fill");r.selectAll("tspan").attr("style",V)}}}return D(t,C),t.intersect=function(I){return N.rect(t,I)},r}x(Rs,"classBox");async function Gs(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let h=t,a=t,f=20,i=20,n="verifyMethod"in t,r=T(t),e=U(),{themeVariables:s}=e,{borderColorArray:c,requirementEdgeLabelBackground:m}=s,g=e.layout==="elk"?"start":"center",d=p.insert("g").attr("class",r).attr("id",t.domId??t.id),u;n?u=await dt(d,`<<${h.type}>>`,0,t.labelStyle):u=await dt(d,"<<Element>>",0,t.labelStyle);let y=u,b=await dt(d,h.name,y,t.labelStyle+"; font-weight: bold;");if(y+=b+i,n){let G=await dt(d,`${h.requirementId?`ID: ${h.requirementId}`:""}`,y,t.labelStyle,g);y+=G;let L=await dt(d,`${h.text?`Text: ${h.text}`:""}`,y,t.labelStyle,g);y+=L;let H=await dt(d,`${h.risk?`Risk: ${h.risk}`:""}`,y,t.labelStyle,g);y+=H,await dt(d,`${h.verifyMethod?`Verification: ${h.verifyMethod}`:""}`,y,t.labelStyle,g)}else{let G=await dt(d,`${a.type?`Type: ${a.type}`:""}`,y,t.labelStyle,g);y+=G,await dt(d,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,y,t.labelStyle,g)}let S=(d.node()?.getBBox().width??200)+f,$=(d.node()?.getBBox().height??200)+f,w=-S/2,M=-$/2,R=k.svg(d),C=P(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let O=R.rectangle(w,M,S,$,C),E=d.insert(()=>O,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",l),c?.length){let G=t.colorIndex??0;d.attr("data-color-id",`color-${G%c.length}`)}if(d.selectAll(".label").each((G,L,H)=>{let I=K(H[L]),A=I.attr("transform"),j=0,V=0;if(A){let mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(A);mt&&(j=parseFloat(mt[1]),V=parseFloat(mt[2]))}let Y=V-$/2,X=w+f/2;(L===0||L===1)&&(X=j),I.attr("transform",`translate(${X}, ${Y+f})`)}),y>u+b+i){let G=M+u+b+i,L;if(t.look==="neo"){let A=[[w,G],[w+S,G],[w+S,G+.001],[w,G+.001]];L=R.polygon(A,C)}else L=R.line(w,G,w+S,G,C);d.insert(()=>L).attr("class","divider")}return D(t,E),t.intersect=function(G){return N.rect(t,G)},l&&t.look!=="handDrawn"&&(m||c?.length)&&d.selectAll("path").attr("style",l),d}x(Gs,"requirementBox");async function dt(p,t,o,l="",h="center"){if(t==="")return 0;let a=p.insert("g").attr("class","label").attr("style",l),f=U(),i=f.htmlLabels??!0,n=await ot(a,Ct(gt(t)),{width:$t(t,f)+50,classes:"markdown-node-label",useHtmlLabels:i,style:l},f),r;if(i){let e=n.children[0],s=K(n);h==="start"&&K(e).style("text-align","left"),r=e.getBoundingClientRect(),s.attr("width",r.width),s.attr("height",r.height)}else{let e=n.children[0];for(let s of e.children)l&&s.setAttribute("style",l);if(h==="start"){e.setAttribute("text-anchor","start");for(let s of e.children)s.setAttribute("text-anchor","start")}r=n.getBBox(),r.height+=6}return a.attr("transform",`translate(${-r.width/2},${-r.height/2+o})`),r.height}x(dt,"addText");var gr=x(p=>{switch(p){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Es(p,t,{config:o}){let{labelStyles:l,nodeStyles:h}=v(t);t.labelStyle=l||"";let a=10,f=t.width;t.width=(t.width??200)-10;let{shapeSvg:i,bbox:n,label:r}=await B(p,t,T(t)),e=t.padding||10,s="",c;"ticket"in t&&t.ticket&&o?.kanban?.ticketBaseUrl&&(s=o?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),c=i.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",s).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},g,d;c?{label:g,bbox:d}=await Gt(c,"ticket"in t&&t.ticket||"",m):{label:g,bbox:d}=await Gt(i,"ticket"in t&&t.ticket||"",m);let{label:u,bbox:y}=await Gt(i,"assigned"in t&&t.assigned||"",m);t.width=f;let b=10,S=t?.width||0,$=Math.max(d.height,y.height)/2,w=Math.max(n.height+b*2,t?.height||0)+$,M=-S/2,R=-w/2;r.attr("transform","translate("+(e-S/2)+", "+(-$-n.height/2)+")"),g.attr("transform","translate("+(e-S/2)+", "+(-$+n.height/2)+")"),u.attr("transform","translate("+(e+S/2-y.width-2*a)+", "+(-$+n.height/2)+")");let C,{rx:O,ry:E}=t,{cssStyles:G}=t;if(t.look==="handDrawn"){let L=k.svg(i),H=P(t,{}),I=O||E?L.path(tt(M,R,S,w,O||0),H):L.rectangle(M,R,S,w,H);C=i.insert(()=>I,":first-child"),C.attr("class","basic label-container").attr("style",G||null)}else{C=i.insert("rect",":first-child"),C.attr("class","basic label-container __APA__").attr("style",h).attr("rx",O??5).attr("ry",E??5).attr("x",M).attr("y",R).attr("width",S).attr("height",w);let L="priority"in t&&t.priority;if(L){let H=i.append("line"),I=M+2,A=R+Math.floor((O??0)/2),j=R+w-Math.floor((O??0)/2);H.attr("x1",I).attr("y1",A).attr("x2",I).attr("y2",j).attr("stroke-width","4").attr("stroke",gr(L))}}return D(t,C),t.height=w,t.intersect=function(L){return N.rect(t,L)},i}x(Es,"kanbanItem");async function Hs(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,halfPadding:f,label:i}=await B(p,t,T(t)),n=a.width+10*f,r=a.height+8*f,e=.15*n,{cssStyles:s}=t,c=a.width+20,m=a.height+20,g=Math.max(n,c),d=Math.max(r,m);i.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let u,y=`M0 0
a${e},${e} 1 0,0 ${g*.25},${-1*d*.1}
a${e},${e} 1 0,0 ${g*.25},0
a${e},${e} 1 0,0 ${g*.25},0
a${e},${e} 1 0,0 ${g*.25},${d*.1}
a${e},${e} 1 0,0 ${g*.15},${d*.33}
a${e*.8},${e*.8} 1 0,0 0,${d*.34}
a${e},${e} 1 0,0 ${-1*g*.15},${d*.33}
a${e},${e} 1 0,0 ${-1*g*.25},${d*.15}
a${e},${e} 1 0,0 ${-1*g*.25},0
a${e},${e} 1 0,0 ${-1*g*.25},0
a${e},${e} 1 0,0 ${-1*g*.25},${-1*d*.15}
a${e},${e} 1 0,0 ${-1*g*.1},${-1*d*.33}
a${e*.8},${e*.8} 1 0,0 0,${-1*d*.34}
a${e},${e} 1 0,0 ${g*.1},${-1*d*.33}
H0 V0 Z`;if(t.look==="handDrawn"){let b=k.svg(h),S=P(t,{}),$=b.path(y,S);u=h.insert(()=>$,":first-child"),u.attr("class","basic label-container").attr("style",q(s))}else u=h.insert("path",":first-child").attr("class","basic label-container").attr("style",l).attr("d",y);return u.attr("transform",`translate(${-g/2}, ${-d/2})`),D(t,u),t.calcIntersect=function(b,S){return N.rect(b,S)},t.intersect=function(b){return _.info("Bang intersect",t,b),N.rect(t,b)},h}x(Hs,"bang");async function js(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,halfPadding:f,label:i}=await B(p,t,T(t)),n=a.width+2*f,r=a.height+2*f,e=.15*n,s=.25*n,c=.35*n,m=.2*n,{cssStyles:g}=t,d,u=`M0 0
a${e},${e} 0 0,1 ${n*.25},${-1*n*.1}
a${c},${c} 1 0,1 ${n*.4},${-1*n*.1}
a${s},${s} 1 0,1 ${n*.35},${n*.2}
a${e},${e} 1 0,1 ${n*.15},${r*.35}
a${m},${m} 1 0,1 ${-1*n*.15},${r*.65}
a${s},${e} 1 0,1 ${-1*n*.25},${n*.15}
a${c},${c} 1 0,1 ${-1*n*.5},0
a${e},${e} 1 0,1 ${-1*n*.25},${-1*n*.15}
a${e},${e} 1 0,1 ${-1*n*.1},${-1*r*.35}
a${m},${m} 1 0,1 ${n*.1},${-1*r*.65}
H0 V0 Z`;if(t.look==="handDrawn"){let y=k.svg(h),b=P(t,{}),S=y.path(u,b);d=h.insert(()=>S,":first-child"),d.attr("class","basic label-container").attr("style",q(g))}else d=h.insert("path",":first-child").attr("class","basic label-container").attr("style",l).attr("d",u);return i.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),d.attr("transform",`translate(${-n/2}, ${-r/2})`),D(t,d),t.calcIntersect=function(y,b){return N.rect(y,b)},t.intersect=function(y){return _.info("Cloud intersect",t,y),N.rect(t,y)},h}x(js,"cloud");async function As(p,t){let{labelStyles:o,nodeStyles:l}=v(t);t.labelStyle=o;let{shapeSvg:h,bbox:a,halfPadding:f,label:i}=await B(p,t,T(t)),n=a.width+8*f,r=a.height+2*f,e=5,s=t.look==="neo"?`
M${-n/2} ${r/2-e}
v${-r+2*e}
q0,-${e} ${e},-${e}
h${n-2*e}
q${e},0 ${e},${e}
v${r-e}
H${-n/2}
Z
`:`
M${-n/2} ${r/2-e}
v${-r+2*e}
q0,-${e} ${e},-${e}
h${n-2*e}
q${e},0 ${e},${e}
v${r-2*e}
q0,${e} ${-e},${e}
h${-(n-2*e)}
q${-e},0 ${-e},${-e}
Z
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let c=h.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",l).attr("d",s);return h.append("line").attr("class","node-line-").attr("x1",-n/2).attr("y1",r/2).attr("x2",n/2).attr("y2",r/2),i.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),h.append(()=>i.node()),D(t,c),t.calcIntersect=function(m,g){return N.rect(m,g)},t.intersect=function(m){return N.rect(t,m)},h}x(As,"defaultMindmapNode");async function Os(p,t){let o={padding:t.padding??0};return jt(p,t,o)}x(Os,"mindmapCircle");var dr=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:hs},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ns},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:ps},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ds},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Te},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Be},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:je},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:pe},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:be},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:de},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Pe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:jt},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Hs},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:js},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:os},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ie},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ue},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:ze},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Ns},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Xe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ce},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:xs},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:ye},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ls},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:gs},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:fs},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Ae},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Le},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:we},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ne},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:$e},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Ze},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ks},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Oe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:ws},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Qe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:De},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Me},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:vs},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Bs},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Re},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:$s},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:He},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:cs},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ss},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:es},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:he},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Se},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:us},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ys},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Ts},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:is},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ts}],yr=x(()=>{let t=[...Object.entries({state:ms,choice:ue,note:rs,composite:xe,rectWithTitle:as,labelRect:qe,block_arrow:ge,collapsedGroup:me,iconSquare:Fe,iconCircle:We,icon:Ve,iconRounded:Ye,imageSquare:_e,anchor:le,kanbanItem:Es,mindmapCircle:Os,defaultMindmapNode:As,classBox:Rs,erBox:qt,requirementBox:Gs}),...dr.flatMap(o=>[o.shortName,..."aliases"in o?o.aliases:[],..."internalAliases"in o?o.internalAliases:[]].map(h=>[h,o.handler]))];return Object.fromEntries(t)},"generateShapeMap"),ur=yr();function dd(p){return p in ur}x(dd,"isValidShape");export{B as a,D as b,se as c,tt as d,Vt as e,ur as f,dd as g};