PageSourceSearch

https://colyseus-docs.netlify.app/_next/static/chunks/2f319141.f4e41fc3503dc05e.js

js colyseus-docs.netlify.app collected 2026-10-03 10:39:49 UTC 94,655 bytes, 10 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6995],{28733:function(t,e,a){a.d(e,{C1:function(){return d},Fh:function(){return b},Lf:function(){return insertNode},XO:function(){return u},Yn:function(){return O},ZH:function(){return R},aH:function(){return J},dW:function(){return isValidShape},gU:function(){return X},jr:function(){return g},us:function(){return D}});var l=a(9907),r=a(2133),i=a(2533),n=a(64026),s=a(24669),o=a(64665),h=a(70617),d=(0,s.eW)(async(t,e,a)=>{let l,r;let h=e.useHtmlLabels||(0,s.ku)(s.nV()?.htmlLabels);l=a||"node default";let d=t.insert("g").attr("class",l).attr("id",e.domId||e.id),c=d.insert("g").attr("class","label").attr("style",(0,n.R7)(e.labelStyle));r=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let g=await (0,i.rw)(c,(0,s.oO)((0,n.SH)(r),(0,s.nV)()),{useHtmlLabels:h,width:e.width||s.nV().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),y=g.getBBox(),p=(e?.padding??0)/2;if(h){let t=g.children[0],e=(0,o.Ys)(g),a=t.getElementsByTagName("img");if(a){let t=""===r.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function setupImage(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,s.nV)().fontSize?(0,s.nV)().fontSize:window.getComputedStyle(document.body).fontSize,[a=s.vZ.fontSize]=(0,n.VG)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,s.eW)(setupImage,"setupImage"),setTimeout(()=>{e.complete&&setupImage()}),e.addEventListener("error",setupImage),e.addEventListener("load",setupImage)})))}y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return h?c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):c.attr("transform","translate(0, "+-y.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:d,bbox:y,halfPadding:p,label:c}},"labelHelper"),c=(0,s.eW)(async(t,e,a)=>{let l=a.useHtmlLabels||(0,s.ku)(s.nV()?.flowchart?.htmlLabels),r=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),h=await (0,i.rw)(r,(0,s.oO)((0,n.SH)(e),(0,s.nV)()),{useHtmlLabels:l,width:a.width||s.nV()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=h.getBBox(),c=a.padding/2;if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=h.children[0],e=(0,o.Ys)(h);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return l?r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):r.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:r}},"insertLabel"),g=(0,s.eW)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),y=(0,s.eW)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function createPathFromPoints(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function generateFullSineWavePoints(t,e,a,l,r,i){let n=[],s=a-t,o=2*Math.PI/(s/i),h=e+(l-e)/2;for(let e=0;e<=50;e++){let a=e/50,l=t+a*s,i=h+r*Math.sin(o*(l-t));n.push({x:l,y:i})}return n}function generateCirclePoints(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,o=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*o,i=t+a*Math.cos(l),h=e+a*Math.sin(l);n.push({x:-i,y:-h})}return n}(0,s.eW)(createPathFromPoints,"createPathFromPoints"),(0,s.eW)(generateFullSineWavePoints,"generateFullSineWavePoints"),(0,s.eW)(generateCirclePoints,"generateCirclePoints");var p=(0,s.eW)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,o=t.width/2,h=t.height/2;return Math.abs(s)*o>Math.abs(n)*h?(s<0&&(h=-h),a=0===s?0:h*n/s,l=h):(n<0&&(o=-o),a=o,l=0===n?0:o*s/n),{x:r+a,y:i+l}},"intersectRect");function applyStyle(t,e){e&&t.attr("style",e)}async function addHtmlLabel(t){let e=(0,o.Ys)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=t.label;t.label&&(0,s.l0)(t.label)&&(l=await (0,s.uT)(t.label.replace(s.SY.lineBreakRegex,"\n"),(0,s.nV)()));let r=t.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+r+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+l+"</span>"),applyStyle(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,s.eW)(applyStyle,"applyStyle"),(0,s.eW)(addHtmlLabel,"addHtmlLabel");var u=(0,s.eW)(async(t,e,a,l)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),(0,s.ku)((0,s.nV)().flowchart.htmlLabels)
1){r=r.replace(/\\n|\n/g,"<br />"),s.cM.info("vertexText"+r);let t={isNode:l,label:(0,n.SH)(r).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await addHtmlLabel(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),f=(0,s.eW)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,0,0,1,t+a,e+r,"V",e+l-r,"A",r,r,0,0,1,t+a-r,e+l,"H",t+r,"A",r,r,0,0,1,t,e+l-r,"V",e+r,"A",r,r,0,0,1,t+r,e,"Z"].join(" "),"createRoundedRectPathD"),m=(0,s.eW)(t=>{let{handDrawnSeed:e}=(0,s.nV)();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),x=(0,s.eW)(t=>{let e=w([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),w=(0,s.eW)(t=>{let e=new Map;return t.forEach(t=>{let[a,l]=t.split(":");e.set(a.trim(),l?.trim())}),e},"styles2Map"),b=(0,s.eW)(t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t,"isLabelStyle"),$=(0,s.eW)(t=>{let{stylesArray:e}=x(t),a=[],l=[],r=[],i=[];return e.forEach(t=>{let e=t[0];b(e)?a.push(t.join(":")+" !important"):(l.push(t.join(":")+" !important"),e.includes("stroke")&&r.push(t.join(":")+" !important"),"fill"===e&&i.push(t.join(":")+" !important"))}),{labelStyles:a.join(";"),nodeStyles:l.join(";"),stylesArray:e,borderStyles:r,backgroundStyles:i}},"styles2String"),k=(0,s.eW)((t,e)=>{let{themeVariables:a,handDrawnSeed:l}=(0,s.nV)(),{nodeBorder:r,mainBkg:i}=a,{stylesMap:n}=x(t),o=Object.assign({roughness:.7,fill:n.get("fill")||i,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:n.get("stroke")||r,seed:l,strokeWidth:n.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e);return o},"userNodeOverrides"),S=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let r=(0,s.nV)(),{themeVariables:n,handDrawnSeed:d}=r,{clusterBkg:c,clusterBorder:g}=n,{labelStyles:y,nodeStyles:u,borderStyles:m,backgroundStyles:x}=$(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(r.flowchart.htmlLabels),S=w.insert("g").attr("class","cluster-label "),P=await (0,i.rw)(S,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0}),M=P.getBBox();if((0,s.ku)(r.flowchart.htmlLabels)){let t=P.children[0],e=(0,o.Ys)(P);M=t.getBoundingClientRect(),e.attr("width",M.width),e.attr("height",M.height)}let C=e.width<=M.width+e.padding?M.width+e.padding:e.width;e.width<=M.width+e.padding?e.diff=(C-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-C/2,D=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=h.Z.svg(w),l=k(e,{roughness:.7,fill:c,stroke:g,fillWeight:3,seed:d}),r=t.path(f(v,D,C,W,0),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",r),r),":first-child")).select("path:nth-child(2)").attr("style",m.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",D).attr("width",C).attr("height",W);let{subGraphTitleTopMargin:R}=(0,l.L)(r);if(S.attr("transform",`translate(${e.x-M.width/2}, ${e.y-e.height/2+R})`),y){let t=S.select("span");t&&t.attr("style",y)}let B=a.node().getBBox();return e.offsetX=0,e.width=B.width,e.height=B.height,e.offsetY=M.height-e.padding/2,e.intersect=function(t){return p(e,t)},{cluster:w,labelBBox:M}},"rect"),P=(0,s.eW)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.he
1ight/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return p(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),M=(0,s.eW)(async(t,e)=>{let a;let l=(0,s.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:n,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,y=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),m=y.insert("g",":first-child"),x=y.insert("g").attr("class","cluster-label"),w=y.append("rect"),b=x.node().appendChild(await u(e.label,e.labelStyle,void 0,!0)),$=b.getBBox();if((0,s.ku)(l.flowchart.htmlLabels)){let t=b.children[0],e=(0,o.Ys)(b);$=t.getBoundingClientRect(),e.attr("width",$.width),e.attr("height",$.height)}let k=0*e.padding,S=(e.width<=$.width+e.padding?$.width+e.padding:e.width)+k;e.width<=$.width+e.padding?e.diff=(S-e.width)/2-e.padding:e.diff=-e.padding;let P=e.height+k,M=e.height+k-$.height-6,C=e.x-S/2,W=e.y-P/2;e.width=S;let v=e.y-e.height/2-k/2+$.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=h.Z.svg(y),r=e.rx||e.ry?l.path(f(C,W,S,P,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(C,W,S,P,{seed:i});a=y.insert(()=>r,":first-child");let s=l.rectangle(C,v,S,M,{fill:t?n:d,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),w=y.insert(()=>s)}else(a=m.insert("rect",":first-child")).attr("class","outer").attr("x",C).attr("y",W).attr("width",S).attr("height",P).attr("data-look",e.look),w.attr("class","inner").attr("x",C).attr("y",v).attr("width",S).attr("height",M);x.attr("transform",`translate(${e.x-$.width/2}, ${W+1-((0,s.ku)(l.flowchart.htmlLabels)?0:3)})`);let D=a.node().getBBox();return e.height=D.height,e.offsetX=0,e.offsetY=$.height-e.padding/2,e.labelBBox=$,e.intersect=function(t){return p(e,t)},{cluster:y,labelBBox:$}},"roundedWithTitle"),C=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let r=(0,s.nV)(),{themeVariables:n,handDrawnSeed:d}=r,{clusterBkg:c,clusterBorder:g}=n,{labelStyles:y,nodeStyles:u,borderStyles:m,backgroundStyles:x}=$(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(r.flowchart.htmlLabels),S=w.insert("g").attr("class","cluster-label "),P=await (0,i.rw)(S,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0,width:e.width}),M=P.getBBox();if((0,s.ku)(r.flowchart.htmlLabels)){let t=P.children[0],e=(0,o.Ys)(P);M=t.getBoundingClientRect(),e.attr("width",M.width),e.attr("height",M.height)}let C=e.width<=M.width+e.padding?M.width+e.padding:e.width;e.width<=M.width+e.padding?e.diff=(C-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-C/2,D=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=h.Z.svg(w),l=k(e,{roughness:.7,fill:c,stroke:g,fillWeight:4,seed:d}),r=t.path(f(v,D,C,W,e.rx),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",r),r),":first-child")).select("path:nth-child(2)").attr("style",m.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",D).attr("width",C).attr("height",W);let{subGraphTitleTopMargin:R}=(0,l.L)(r);if(S.attr("transform",`translate(${e.x-M.width/2}, ${e.y-e.height/2+R})`),y){let t=S.select("span");t&&t.attr("style",y)}let B=a.node().getBBox();return e.offsetX=0,e.width=B.width,e.height=B.height,e.offsetY=M.height-e.padding/2,e.intersect=function(t){return p(e,t)},{cluster:w,labelBBox:M}},"kanbanSection"),W={rect:S,squareRect:S,roundedWithTitle:M,noteGroup:P,divider:(0,s.eW)((t,e)=>{let a;let l=(0,s.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{nodeBorder:n}=r,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=o.insert("g",":first-child"),c=0*e.padding,g=e.width+c;e.diff=-e.padding;let y=e.height+c,u=e.x-g/2,f=e.y-y/2;if(e.width=g,"handDrawn"===e.look){let t=h.Z.svg(o),e=t.rectangle(u,f,g,y,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:i});a=o.insert(()=>e,":first-child")}else(a=d.insert("rect",":first-child")).attr("class","divider").attr("x",u).attr("y",f).attr("width",g).attr("height",y).attr("data-look",e.look);let m=a.node().getBBox();return e.height=m.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return p(e,t)},{cluster:o,labelBBox:{}}}
1,"divider"),kanbanSection:C},v=new Map,D=(0,s.eW)(async(t,e)=>{let a=e.shape||"rect",l=await W[a](t,e);return v.set(e.id,l),l},"insertCluster"),R=(0,s.eW)(()=>{v=new Map},"clear");function intersectNode(t,e){return t.intersect(e)}function intersectEllipse(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,o=Math.sqrt(e*e*s*s+a*a*n*n),h=Math.abs(e*a*n/o);l.x<r&&(h=-h);var d=Math.abs(e*a*s/o);return l.y<i&&(d=-d),{x:r+h,y:i+d}}function intersectCircle(t,e,a){return intersectEllipse(t,e,e,a)}function intersectLine(t,e,a,l){var r,i,n,s,o,h,d,c,g,y,p,u,f;if(r=e.y-t.y,n=t.x-e.x,o=e.x*t.y-t.x*e.y,g=r*a.x+n*a.y+o,y=r*l.x+n*l.y+o,!(0!==g&&0!==y&&sameSign(g,y))&&(i=l.y-a.y,s=a.x-l.x,h=l.x*a.y-a.x*l.y,d=i*t.x+s*t.y+h,c=i*e.x+s*e.y+h,!(0!==d&&0!==c&&sameSign(d,c))&&0!=(p=r*s-i*n)))return u=Math.abs(p/2),{x:(f=n*h-s*o)<0?(f-u)/p:(f+u)/p,y:(f=i*o-r*h)<0?(f-u)/p:(f+u)/p}}function sameSign(t,e){return t*e>0}function intersectPolygon(t,e,a){let l=t.x,r=t.y,i=[],n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let o=l-t.width/2-n,h=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=intersectLine(t,a,{x:o+r.x,y:h+r.y},{x:o+n.x,y:h+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,o=Math.sqrt(n*n+s*s);return i<o?-1:i===o?0:1}),i[0]):t}(0,s.eW)(intersectNode,"intersectNode"),(0,s.eW)(intersectEllipse,"intersectEllipse"),(0,s.eW)(intersectCircle,"intersectCircle"),(0,s.eW)(intersectLine,"intersectLine"),(0,s.eW)(sameSign,"sameSign"),(0,s.eW)(intersectPolygon,"intersectPolygon");var B={node:intersectNode,circle:intersectCircle,ellipse:intersectEllipse,polygon:intersectPolygon,rect:p};function anchor(t,e){let{labelStyles:a}=$(e);e.labelStyle=a;let l=y(e),r=l;l||(r="anchor");let i=t.insert("g").attr("class",r).attr("id",e.domId||e.id),{cssStyles:o}=e,d=h.Z.svg(i),c=k(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);let p=d.circle(0,0,2,c),u=i.insert(()=>p,":first-child");return u.attr("class","anchor").attr("style",(0,n.R7)(o)),g(e,u),e.intersect=function(t){return s.cM.info("Circle intersect",e,1,t),B.circle(e,1,t)},i}function generateArcPoints(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),o=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(o>1)throw Error("The given radii are too small to create an arc between the points.");let h=Math.sqrt(1-o**2),d=(t+a)/2+h*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-h*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let p=[];for(let t=0;t<20;
1t++){let e=t/19,a=g+e*y,l=d+r*Math.cos(a),n=c+i*Math.sin(a);p.push({x:l,y:n})}return p}async function bowTieRect(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=i.width+e.padding+20,s=i.height+e.padding,o=s/2,c=o/(2.5+s/50),{cssStyles:p}=e,u=[{x:n/2,y:-s/2},{x:-n/2,y:-s/2},...generateArcPoints(-n/2,-s/2,-n/2,s/2,c,o,!1),{x:n/2,y:s/2},...generateArcPoints(n/2,s/2,n/2,-s/2,c,o,!0)],f=h.Z.svg(r),m=k(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=createPathFromPoints(u),w=f.path(x,m),b=r.insert(()=>w,":first-child");return b.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",l),b.attr("transform",`translate(${c/2}, 0)`),g(e,b),e.intersect=function(t){let a=B.polygon(e,u,t);return a},r}function insertPolygonShape(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function card(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.height+e.padding,o=n.width+e.padding+12,c=-s,p=[{x:12,y:c},{x:o,y:c},{x:o,y:0},{x:0,y:0},{x:0,y:c+12},{x:12,y:c}],{cssStyles:u}=e;
1if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=createPathFromPoints(p),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&a.attr("style",u)}else a=insertPolygonShape(i,o,s,p);return r&&a.attr("style",r),g(e,a),e.intersect=function(t){return B.polygon(e,p,t)},i}function choice(t,e){let{nodeStyles:a}=$(e);e.label="";let l=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:r}=e,i=Math.max(28,e.width??0),n=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}],s=h.Z.svg(l),o=k(e,{});"handDrawn"!==e.look&&(o.roughness=0,o.fillStyle="solid");let d=createPathFromPoints(n),c=s.path(d,o),g=l.insert(()=>c,":first-child");return r&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",r),a&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return B.polygon(e,n,t)},l}async function circle(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:o,halfPadding:c}=await d(t,e,y(e)),p=o.width/2+c,{cssStyles:u}=e;
1if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=t.circle(0,0,2*p,l);(a=i.insert(()=>r,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(u))}else a=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",p).attr("cx",0).attr("cy",0);return g(e,a),e.intersect=function(t){return s.cM.info("Circle intersect",e,p,t),B.circle(e,p,t)},i}function createLine(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y}
2                   M ${r.x},${r.y} L ${n.x},${n.y}`}function crossedCircle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a,e.label="";let r=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),i=Math.max(30,e?.width??0),{cssStyles:n}=e,o=h.Z.svg(r),d=k(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let c=o.circle(0,0,2*i,d),p=createLine(i),u=o.path(p,d),f=r.insert(()=>c,":first-child");return f.insert(()=>u),n&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",n),l&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",l),g(e,f),e.intersect=function(t){s.cM.info("crossedCircle intersect",e,{radius:i,point:t});let a=B.circle(e,i,t);return a},r}function generateCirclePoints2(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,o=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*o,i=t+a*Math.cos(l),h=e+a*Math.sin(l);n.push({x:-i,y:-h})}return n}async function curlyBraceLeft(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=i.width+(e.padding??0),o=i.height+(e.padding??0),c=Math.max(5,.1*o),{cssStyles:p}=e,u=[...generateCirclePoints2(s/2,-o/2,c,30,-90,0),{x:-s/2-c,y:c},...generateCirclePoints2(s/2+2*c,-c,c,20,-180,-270),...generateCirclePoints2(s/2+2*c,c,c,20,-90,-180),{x:-s/2-c,y:-o/2},...generateCirclePoints2(s/2,o/2,c,20,0,90)],f=[{x:s/2,y:-o/2-c},{x:-s/2,y:-o/2-c},...generateCirclePoints2(s/2,-o/2,c,20,-90,0),{x:-s/2-c,y:-c},...generateCirclePoints2(s/2+.1*s,-c,c,20,-180,-270),...generateCirclePoints2(s/2+.1*s,c,c,20,-90,-180),{x:-s/2-c,y:o/2},...generateCirclePoints2(s/2,o/2,c,20,0,90),{x:-s/2,y:o/2+c},{x:s/2,y:o/2+c}],m=h.Z.svg(r),x=k(e,{fill:"none"});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=createPathFromPoints(u),b=w.replace("Z",""),S=m.path(b,x),P=createPathFromPoints(f),M=m.path(P,{...x}),C=r.insert("g",":first-child");return C.insert(()=>M,":first-child").attr("stroke-opacity",0),C.insert(()=>S,":first-child"),C.attr("class","text"),p&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${c}, 0)`),n.attr("transform",`translate(${-s/2+c-(i.x-(i.left??0))},${-o/2+(e.padding??0)/2-(i.y-(i.top??0))})`),g(e,C),e.intersect=function(t){let a=B.polygon(e,f,t);return a},r}function generateCirclePoints3(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,o=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*o,i=t+a*Math.cos(l),h=e+a*Math.sin(l);n.push({x:i,y:h})}return n}async function curlyBraceRight(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=i.width+(e.padding??0),o=i.height+(e.padding??0),c=Math.max(5,.1*o),{cssStyles:p}=e,u=[...generateCirclePoints3(s/2,-o/2,c,20,-90,0),{x:s/2+c,y:-c},...generateCirclePoints3(s/2+2*c,-c,c,20,-180,-270),...generateCirclePoints3(s/2+2*c,c,c,20,-90,-180),{x:s/2+c,y:o/2},...generateCirclePoints3(s/2,o/2,c,20,0,90)],f=[{x:-s/2,y:-o/2-c},{x:s/2,y:-o/2-c},...generateCirclePoints3(s/2,-o/2,c,20,-90,0),{x:s/2+c,y:-c},...generateCirclePoints3(s/2+2*c,-c,c,20,-180,-270),...generateCirclePoints3(s/2+2*c,c,c,20,-90,-180),{x:s/2+c,y:o/2},...generateCirclePoints3(s/2,o/2,c,20,0,90),{x:s/2,y:o/2+c},{x:-s/2,y:o/2+c}],m=h.Z.svg(r),x=k(e,{fill:"none"});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=createPathFromPoints(u),b=w.replace("Z",""),S=m.path(b,x),P=createPathFromPoints(f),M=m.path(P,{...x}),C=r.insert("g",":first-child");return C.insert(()=>M,":first-child").attr("stroke-opacity",0),C.insert(()=>S,":first-child"),C.attr("class","text"),p&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${-c}
2, 0)`),n.attr("transform",`translate(${-s/2+(e.padding??0)/2-(i.x-(i.left??0))},${-o/2+(e.padding??0)/2-(i.y-(i.top??0))})`),g(e,C),e.intersect=function(t){let a=B.polygon(e,f,t);return a},r}function generateCirclePoints4(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,o=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*o,i=t+a*Math.cos(l),h=e+a*Math.sin(l);n.push({x:-i,y:-h})}return n}async function curlyBraces(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=i.width+(e.padding??0),o=i.height+(e.padding??0),c=Math.max(5,.1*o),{cssStyles:p}=e,u=[...generateCirclePoints4(s/2,-o/2,c,30,-90,0),{x:-s/2-c,y:c},...generateCirclePoints4(s/2+2*c,-c,c,20,-180,-270),...generateCirclePoints4(s/2+2*c,c,c,20,-90,-180),{x:-s/2-c,y:-o/2},...generateCirclePoints4(s/2,o/2,c,20,0,90)],f=[...generateCirclePoints4(-s/2+c+c/2,-o/2,c,20,-90,-180),{x:s/2-c/2,y:c},...generateCirclePoints4(-s/2-c/2,-c,c,20,0,90),...generateCirclePoints4(-s/2-c/2,c,c,20,-90,0),{x:s/2-c/2,y:-c},...generateCirclePoints4(-s/2+c+c/2,o/2,c,30,-180,-270)],m=[{x:s/2,y:-o/2-c},{x:-s/2,y:-o/2-c},...generateCirclePoints4(s/2,-o/2,c,20,-90,0),{x:-s/2-c,y:-c},...generateCirclePoints4(s/2+2*c,-c,c,20,-180,-270),...generateCirclePoints4(s/2+2*c,c,c,20,-90,-180),{x:-s/2-c,y:o/2},...generateCirclePoints4(s/2,o/2,c,20,0,90),{x:-s/2,y:o/2+c},{x:s/2-c-c/2,y:o/2+c},...generateCirclePoints4(-s/2+c+c/2,-o/2,c,20,-90,-180),{x:s/2-c/2,y:c},...generateCirclePoints4(-s/2-c/2,-c,c,20,0,90),...generateCirclePoints4(-s/2-c/2,c,c,20,-90,0),{x:s/2-c/2,y:-c},...generateCirclePoints4(-s/2+c+c/2,o/2,c,30,-180,-270)],x=h.Z.svg(r),w=k(e,{fill:"none"});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=createPathFromPoints(u),S=b.replace("Z",""),P=x.path(S,w),M=createPathFromPoints(f),C=M.replace("Z",""),W=x.path(C,w),v=createPathFromPoints(m),D=x.path(v,{...w}),R=r.insert("g",":first-child");return R.insert(()=>D,":first-child").attr("stroke-opacity",0),R.insert(()=>P,":first-child"),R.insert(()=>W,":first-child"),R.attr("class","text"),p&&"handDrawn"!==e.look&&R.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&R.selectAll("path").attr("style",l),R.attr("transform",`translate(${c-c/4}, 0)`),n.attr("transform",`translate(${-s/2+(e.padding??0)/2-(i.x-(i.left??0))},${-o/2+(e.padding??0)/2-(i.y-(i.top??0))})`),g(e,R),e.intersect=function(t){let a=B.polygon(e,m,t);return a},r}async function curvedTrapezoid(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=Math.max(80,(i.width+(e.padding??0)*2)*1.25,e?.width??0),s=Math.max(20,i.height+(e.padding??0)*2,e?.height??0),o=s/2,{cssStyles:c}=e,p=h.Z.svg(r),u=k(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let f=n-o,m=s/4,x=[{x:f,y:0},{x:m,y:0},{x:0,y:s/2},{x:m,y:s},{x:f,y:s},...generateCirclePoints(-f,-s/2,o,50,270,90)],w=createPathFromPoints(x),b=p.path(w,u),S=r.insert(()=>b,":first-child");return S.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(${-n/2}, ${-s/2})`),g(e,S),e.intersect=function(t){let a=B.polygon(e,x,t);return a},r}(0,s.eW)(anchor,"anchor"),(0,s.eW)(generateArcPoints,"generateArcPoints"),(0,s.eW)(bowTieRect,"bowTieRect"),(0,s.eW)(insertPolygonShape,"insertPolygonShape"),(0,s.eW)(card,"card"),(0,s.eW)(choice,"choice"),(0,s.eW)(circle,"circle"),(0,s.eW)(createLine,"createLine"),(0,s.eW)(crossedCircle,"crossedCircle"),(0,s.eW)(generateCirclePoints2,"generateCirclePoints"),(0,s.eW)(curlyBraceLeft,"curlyBraceLeft"),(0,s.eW)(generateCirclePoints3,"generateCirclePoints"),(0,s.eW)(curlyBraceRight,"curlyBraceRight"),(0,s.eW)(generateCirclePoints4,"generateCirclePoints"),(0,s.eW)(curlyBraces,"curlyBraces"),(0,s.eW)(curvedTrapezoid,"curvedTrapezoid");var N=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),A=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),L=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function cylinder(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:s,label:o}=await d(t,e,y(e)),c=Math.max(s.width+e.padding,e.width??0),p=c/2,u=p/(2.5+c/50),f=Math.max(s.height+u+e.padding,e.height??0),{cssStyles:m}=e;
2if("handDrawn"===e.look){let t=h.Z.svg(i),l=A(0,0,c,f,p,u),r=L(0,u,c,f,p,u),n=t.path(l,k(e,{})),s=t.path(r,k(e,{fill:"none"}));a=i.insert(()=>s,":first-child"),(a=i.insert(()=>n,":first-child")).attr("class","basic label-container"),m&&a.attr("style",m)}else{let t=N(0,0,c,f,p,u);a=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(m)).attr("style",r)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-c/2}, ${-(f/2+u)})`),g(e,a),o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+(e.padding??0)/1.5-(s.y-(s.top??0))})`),e.intersect=function(t){let a=B.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},i}async function dividedRectangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=i.width+e.padding,o=i.height+e.padding,c=.2*o,p=-s/2,u=-o/2-c/2,{cssStyles:f}=e,m=h.Z.svg(r),x=k(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=[{x:p,y:u+c},{x:-p,y:u+c},{x:-p,y:-u},{x:p,y:-u},{x:p,y:u},{x:-p,y:u},{x:-p,y:u+c}],b=m.polygon(w.map(t=>[t.x,t.y]),x),S=r.insert(()=>b,":first-child");return S.attr("class","basic label-container"),f&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",f),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),n.attr("transform",`translate(${p+(e.padding??0)/2-(i.x-(i.left??0))}, ${u+c+(e.padding??0)/2-(i.y-(i.top??0))})`),g(e,S),e.intersect=function(t){let a=B.rect(e,t);return a},r}async function doublecircle(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:o,halfPadding:c}=await d(t,e,y(e)),p=o.width/2+c+5,u=o.width/2+c,{cssStyles:f}=e;
2if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{roughness:.2,strokeWidth:2.5}),r=k(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*p,l),o=t.circle(0,0,2*u,r);(a=i.insert("g",":first-child")).attr("class",(0,n.R7)(e.cssClasses)).attr("style",(0,n.R7)(f)),a.node()?.appendChild(s),a.node()?.appendChild(o)}else{a=i.insert("g",":first-child");let t=a.insert("circle",":first-child"),e=a.insert("circle");a.attr("class","basic label-container").attr("style",r),t.attr("class","outer-circle").attr("style",r).attr("r",p).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",r).attr("r",u).attr("cx",0).attr("cy",0)}return g(e,a),e.intersect=function(t){return s.cM.info("DoubleCircle intersect",e,p,t),B.circle(e,p,t)},i}function filledCircle(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:r}=$(e);e.label="",e.labelStyle=l;let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,o=h.Z.svg(i),{nodeBorder:d}=a,c=k(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);let p=o.circle(0,0,14,c),u=i.insert(()=>p,":first-child");return u.selectAll("path").attr("style",`fill: ${d} !important;`),n&&n.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",n),r&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",r),g(e,u),e.intersect=function(t){s.cM.info("filledCircle intersect",e,{radius:7,point:t});let a=B.circle(e,7,t);return a},i}async function flippedTriangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),o=i.width+(e.padding??0),c=o+i.height,p=o+i.height,u=[{x:0,y:-c},{x:p,y:-c},{x:p/2,y:0}],{cssStyles:f}=e,m=h.Z.svg(r),x=k(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=createPathFromPoints(u),b=m.path(w,x),S=r.insert(()=>b,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return f&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",f),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),e.width=o,e.height=c,g(e,S),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-c/2+(e.padding??0)/2+(i.y-(i.top??0))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,u,t),B.polygon(e,u,t)},r}function forkJoin(t,e,{dir:a,config:{state:l,themeVariables:r}}){let{nodeStyles:i}=$(e);e.label="";let n=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=Math.max(70,e?.width??0),d=Math.max(10,e?.height??0);"LR"===a&&(o=Math.max(10,e?.width??0),d=Math.max(70,e?.height??0));let c=-1*o/2,p=-1*d/2,u=h.Z.svg(n),f=k(e,{stroke:r.lineColor,fill:r.lineColor});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let m=u.rectangle(c,p,o,d,f),x=n.insert(()=>m,":first-child");s&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",i),g(e,x);let w=l?.padding??0;return e.width&&e.height&&(e.width+=w/2||0,e.height+=w/2||0),e.intersect=function(t){return B.rect(e,t)},n}async function halfRoundedRectangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=Math.max(80,i.width+(e.padding??0)*2,e?.width??0),o=Math.max(50,i.height+(e.padding??0)*2,e?.height??0),c=o/2,{cssStyles:p}=e,u=h.Z.svg(r),f=k(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let m=[{x:-n/2,y:-o/2},{x:n/2-c,y:-o/2},...generateCirclePoints(-n/2+c,0,c,50,90,270),{x:n/2-c,y:o/2},{x:-n/2,y:o/2}],x=createPathFromPoints(m),w=u.path(x,f),b=r.insert(()=>w,":first-child");return b.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),g(e,b),e.intersect=function(t){s.cM.info("Pill intersect",e,{radius:c,point:t});let a=B.polygon(e,m,t);return a},r}(0,s.eW)(cylinder,"cylinder"),(0,s.eW)(dividedRectangle,"dividedRectangle"),(0,s.eW)(doublecircle,"doublecircle"),(0,s.eW)(filledCircle,"filledCircle"),(0,s.eW)(flippedTriangle,"flippedTriangle"),(0,s.eW)(forkJoin,"forkJoin"),(0,s.eW)(halfRoundedRectangle,"halfRoundedRectangle");var T=(0,s.eW)((t,e,a,l,r)=>`M${t+r},${e} L${t+a-r},${e} L${t+a},${e-l/2} L${t+a-r},${e-l} L${t+r},${e-l} L${t},${e-l/2} Z`,"createHexagonPathD");async function hexagon(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.height+e.padding,o=s/4,c=n.width+2*o+e.padding,p=[{x:o,y:0},{x:c-o,y:0},{x:c,y:-s/2},{x:c-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}],{cssStyles:u}=e;
2if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=T(0,0,c,s,o),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-c/2}, ${s/2})`),u&&a.attr("style",u)}else a=insertPolygonShape(i,c,s,p);return r&&a.attr("style",r),e.width=c,e.height=s,g(e,a),e.intersect=function(t){return B.polygon(e,p,t)},i}async function hourglass(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.label="",e.labelStyle=a;let{shapeSvg:r}=await d(t,e,y(e)),i=Math.max(30,e?.width??0),n=Math.max(30,e?.height??0),{cssStyles:o}=e,c=h.Z.svg(r),p=k(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let u=[{x:0,y:0},{x:i,y:0},{x:0,y:n},{x:i,y:n}],f=createPathFromPoints(u),m=c.path(f,p),x=r.insert(()=>m,":first-child");return x.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",o),l&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",l),x.attr("transform",`translate(${-i/2}, ${-n/2})`),g(e,x),e.intersect=function(t){s.cM.info("Pill intersect",e,{points:u});let a=B.polygon(e,u,t);return a},r}async function icon(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=$(e);e.labelStyle=i;let n=e.assetHeight??48,o=e.assetWidth??48,c=Math.max(n,o),y=l?.wrappingWidth;e.width=Math.max(c,y??0);let{shapeSvg:p,bbox:u,label:f}=await d(t,e,"icon-shape default"),m="t"===e.pos,{nodeBorder:w}=a,{stylesMap:b}=x(e),S=-c/2,P=-c/2,M=e.label?8:0,C=h.Z.svg(p),W=k(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=C.rectangle(S,P,c,c,W),D=Math.max(c,u.width),R=c+u.height+M,N=C.rectangle(-D/2,-R/2,D,R,{...W,fill:"transparent",stroke:"none"}),A=p.insert(()=>v,":first-child"),L=p.insert(()=>N);if(e.icon){let t=p.append("g");t.html(`<g>${await (0,r.s4)(e.icon,{height:c,width:c,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,i=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?u.height/2+M/2-i/2-s:-u.height/2-M/2-i/2-s})`),t.attr("style",`color: ${b.get("stroke")??w};`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${m?-R/2:R/2-u.height})`),A.attr("transform",`translate(0,${m?u.height/2+M/2:-u.height/2-M/2})`),g(e,L),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return B.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];i=m?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+M},{x:a+c/2,y:l-r/2+u.height+M},{x:a+c/2,y:l+r/2},{x:a-c/2,y:l+r/2},{x:a-c/2,y:l-r/2+u.height+M},{x:a-u.width/2,y:l-r/2+u.height+M}]:[{x:a-c/2,y:l-r/2},{x:a+c/2,y:l-r/2},{x:a+c/2,y:l-r/2+c},{x:a+u.width/2,y:l-r/2+c},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+c},{x:a-c/2,y:l-r/2+c}];let n=B.polygon(e,i,t);return n},p}async function iconCircle(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=$(e);e.labelStyle=i;let n=e.assetHeight??48,o=e.assetWidth??48,c=Math.max(n,o),y=l?.wrappingWidth;e.width=Math.max(c,y??0);let{shapeSvg:p,bbox:u,label:f}=await d(t,e,"icon-shape default"),m=e.label?8:0,w="t"===e.pos,{nodeBorder:b,mainBkg:S}=a,{stylesMap:P}=x(e),M=h.Z.svg(p),C=k(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let W=P.get("fill");C.stroke=W??S;let v=p.append("g");e.icon&&v.html(`<g>${await (0,r.s4)(e.icon,{height:c,width:c,fallbackPrefix:""})}</g>`);let D=v.node().getBBox(),R=D.width,N=D.height,A=D.x,L=D.y,T=Math.max(R,N)*Math.SQRT2+40,Z=M.circle(0,0,T,C),I=Math.max(T,u.width),F=T+u.height+m,E=M.rectangle(-I/2,-F/2,I,F,{...C,fill:"transparent",stroke:"none"}),H=p.insert(()=>Z,":first-child"),q=p.insert(()=>E);return v.attr("transform",`translate(${-R/2-A},${w?u.height/2+m/2-N/2-L:-u.height/2-m/2-N/2-L})`),v.attr("style",`color: ${P.get("stroke")??b};`),f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${w?-F/2:F/2-u.height})`),H.attr("transform",`translate(0,${w?u.height/2+m/2:-u.height/2-m/2})`),g(e,q),e.intersect=function(t){s.cM.info("iconSquare intersect",e,t);let a=B.rect(e,t);return a},p}async function iconRounded(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=$(e);e.labelStyle=i;let n=e.assetHeight??48,o=e.assetWidth??48,c=Math.max(n,o),y=l?.wrappingWidth;e.width=Math.max(c,y??0);let{shapeSvg:p,bbox:u,halfPadding:m,label:w}
2=await d(t,e,"icon-shape default"),b="t"===e.pos,S=c+2*m,P=c+2*m,{nodeBorder:M,mainBkg:C}=a,{stylesMap:W}=x(e),v=-P/2,D=-S/2,R=e.label?8:0,N=h.Z.svg(p),A=k(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let L=W.get("fill");A.stroke=L??C;let T=N.path(f(v,D,P,S,5),A),Z=Math.max(P,u.width),I=S+u.height+R,F=N.rectangle(-Z/2,-I/2,Z,I,{...A,fill:"transparent",stroke:"none"}),E=p.insert(()=>T,":first-child").attr("class","icon-shape2"),H=p.insert(()=>F);if(e.icon){let t=p.append("g");t.html(`<g>${await (0,r.s4)(e.icon,{height:c,width:c,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,i=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${b?u.height/2+R/2-i/2-s:-u.height/2-R/2-i/2-s})`),t.attr("style",`color: ${W.get("stroke")??M};`)}return w.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${b?-I/2:I/2-u.height})`),E.attr("transform",`translate(0,${b?u.height/2+R/2:-u.height/2-R/2})`),g(e,H),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return B.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];i=b?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+R},{x:a+P/2,y:l-r/2+u.height+R},{x:a+P/2,y:l+r/2},{x:a-P/2,y:l+r/2},{x:a-P/2,y:l-r/2+u.height+R},{x:a-u.width/2,y:l-r/2+u.height+R}]:[{x:a-P/2,y:l-r/2},{x:a+P/2,y:l-r/2},{x:a+P/2,y:l-r/2+S},{x:a+u.width/2,y:l-r/2+S},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+S},{x:a-P/2,y:l-r/2+S}];let n=B.polygon(e,i,t);return n},p}async function iconSquare(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=$(e);e.labelStyle=i;let n=e.assetHeight??48,o=e.assetWidth??48,c=Math.max(n,o),y=l?.wrappingWidth;e.width=Math.max(c,y??0);let{shapeSvg:p,bbox:u,halfPadding:m,label:w}=await d(t,e,"icon-shape default"),b="t"===e.pos,S=c+2*m,P=c+2*m,{nodeBorder:M,mainBkg:C}=a,{stylesMap:W}=x(e),v=-P/2,D=-S/2,R=e.label?8:0,N=h.Z.svg(p),A=k(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let L=W.get("fill");A.stroke=L??C;let T=N.path(f(v,D,P,S,.1),A),Z=Math.max(P,u.width),I=S+u.height+R,F=N.rectangle(-Z/2,-I/2,Z,I,{...A,fill:"transparent",stroke:"none"}),E=p.insert(()=>T,":first-child"),H=p.insert(()=>F);if(e.icon){let t=p.append("g");t.html(`<g>${await (0,r.s4)(e.icon,{height:c,width:c,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,i=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${b?u.height/2+R/2-i/2-s:-u.height/2-R/2-i/2-s})`),t.attr("style",`color: ${W.get("stroke")??M};`)}return w.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${b?-I/2:I/2-u.height})`),E.attr("transform",`translate(0,${b?u.height/2+R/2:-u.height/2-R/2})`),g(e,H),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return B.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];i=b?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+R},{x:a+P/2,y:l-r/2+u.height+R},{x:a+P/2,y:l+r/2},{x:a-P/2,y:l+r/2},{x:a-P/2,y:l-r/2+u.height+R},{x:a-u.width/2,y:l-r/2+u.height+R}]:[{x:a-P/2,y:l-r/2},{x:a+P/2,y:l-r/2},{x:a+P/2,y:l-r/2+S},{x:a+u.width/2,y:l-r/2+S},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+S},{x:a-P/2,y:l-r/2+S}];let n=B.polygon(e,i,t);return n},p}async function imageSquare(t,e,{config:{flowchart:a}}){let l=new Image;l.src=e?.img??"",await l.decode();let r=Number(l.naturalWidth.toString().replace("px","")),i=Number(l.naturalHeight.toString().replace("px",""));e.imageAspectRatio=r/i;let{labelStyles:n}=$(e);e.labelStyle=n;let o=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let c=Math.max(e.label?o??0:0,e?.assetWidth??r),y="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:c,p="on"===e.constraint?y/e.imageAspectRatio:e?.assetHeight??i;e.width=Math.max(y,o??0);let{shapeSvg:u,bbox:f,label:m}=await d(t,e,"image-shape default"),x="t"===e.pos,w=-y/2,b=-p/2,S=e.label?8:0,P=h.Z.svg(u),M=k(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let C=P.rectangle(w,b,y,p,M),W=Math.max(y,f.width),v=p+f.height+S,D=P.rectangle(-W/2,-v/2,W,v,{...M,fill:"none",stroke:"none"}),R=u.insert(()=>C,":first-child"),N=u.insert(()=>D);if(e.img){let t=u.append("image");t.attr("href",e.img),t.attr("width",y),t.attr("height",p),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-y/2},${x?v/2-p:-v/2})`)}return m.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${x?-p/2-f.height/2-S/2:p/2-f.height/2+S/2})`),R.attr("transform",`translate(0,${x?f.height/2+S/2:-f.height/2-S/2})`),g(e,N),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return B.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];i=x?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+y/2,y:l-r/2+f.height+S},{x:a+y/2,y:l+r/2},{x:a-y/2,y:l+r/2},{x:a-y/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-y/2,y:l-r/2},{x:a+y/2,y:l-r/2},{x:a+y/2,y:l-r/2+p},{x:a+f.width/2,y:l-r/2+p},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+p},{x:a-y/2,y:l-r/2+p}];let n=B.polygon(e,i,t);return n},u}async function inv_trapezoid(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),o=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}],{cssStyles:p}=e;
2if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=createPathFromPoints(c),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),p&&a.attr("style",p)}else a=insertPolygonShape(i,s,o,c);return r&&a.attr("style",r),e.width=s,e.height=o,g(e,a),e.intersect=function(t){return B.polygon(e,c,t)},i}async function drawRect(t,e,a){let l;let{labelStyles:r,nodeStyles:i}=$(e);e.labelStyle=r;let{shapeSvg:s,bbox:o}=await d(t,e,y(e)),c=Math.max(o.width+2*a.labelPaddingX,e?.width||0),p=Math.max(o.height+2*a.labelPaddingY,e?.height||0),u=-c/2,m=-p/2,{rx:x,ry:w}=e,{cssStyles:b}=e;if(a?.rx&&a.ry&&(x=a.rx,w=a.ry),"handDrawn"===e.look){let t=h.Z.svg(s),a=k(e,{}),r=x||w?t.path(f(u,m,c,p,x||0),a):t.rectangle(u,m,c,p,a);(l=s.insert(()=>r,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(b))}else(l=s.insert("rect",":first-child")).attr("class","basic label-container").attr("style",i).attr("rx",(0,n.R7)(x)).attr("ry",(0,n.R7)(w)).attr("x",u).attr("y",m).attr("width",c).attr("height",p);return g(e,l),e.intersect=function(t){return B.rect(e,t)},s}async function labelRect(t,e){let{shapeSvg:a,bbox:l,label:r}=await d(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),g(e,i),e.intersect=function(t){return B.rect(e,t)},a}async function lean_left(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0),e?.width??0),o=Math.max(n.height+(e.padding??0),e?.height??0),c=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-(3*o)/6,y:-o}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=createPathFromPoints(c),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),p&&a.attr("style",p)}else a=insertPolygonShape(i,s,o,c);return r&&a.attr("style",r),e.width=s,e.height=o,g(e,a),e.intersect=function(t){return B.polygon(e,c,t)},i}async function lean_right(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0),e?.width??0),o=Math.max(n.height+(e.padding??0),e?.height??0),c=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=createPathFromPoints(c),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),p&&a.attr("style",p)}else a=insertPolygonShape(i,s,o,c);return r&&a.attr("style",r),e.width=s,e.height=o,g(e,a),e.intersect=function(t){return B.polygon(e,c,t)},i}function lightningBolt(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.label="",e.labelStyle=a;let r=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,n=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),d=[{x:n,y:0},{x:0,y:o+3.5},{x:n-14,y:o+3.5},{x:0,y:2*o},{x:n,y:o-3.5},{x:14,y:o-3.5}],c=h.Z.svg(r),p=k(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let u=createPathFromPoints(d),f=c.path(u,p),m=r.insert(()=>f,":first-child");return i&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",i),l&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",l),m.attr("transform",`translate(-${n/2},${-o})`),g(e,m),e.intersect=function(t){s.cM.info("lightningBolt intersect",e,t);let a=B.polygon(e,d,t);return a},r}(0,s.eW)(hexagon,"hexagon"),(0,s.eW)(hourglass,"hourglass"),(0,s.eW)(icon,"icon"),(0,s.eW)(iconCircle,"iconCircle"),(0,s.eW)(iconRounded,"iconRounded"),(0,s.eW)(iconSquare,"iconSquare"),(0,s.eW)(imageSquare,"imageSquare"),(0,s.eW)(inv_trapezoid,"inv_trapezoid"),(0,s.eW)(drawRect,"drawRect"),(0,s.eW)(labelRect,"labelRect"),(0,s.eW)(lean_left,"lean_left"),(0,s.eW)(lean_right,"lean_right"),(0,s.eW)(lightningBolt,"lightningBolt");var Z=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),I=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),F=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function linedCylinder(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:s,label:o}=await d(t,e,y(e)),c=Math.max(s.width+(e.padding??0),e.width??0),p=c/2,u=p/(2.5+c/50),f=Math.max(s.height+u+(e.padding??0),e.height??0),m=.1*f,{cssStyles:x}=e;
2if("handDrawn"===e.look){let t=h.Z.svg(i),l=I(0,0,c,f,p,u,m),r=F(0,u,c,f,p,u),n=k(e,{}),s=t.path(l,n),o=t.path(r,n),d=i.insert(()=>o,":first-child");d.attr("class","line"),(a=i.insert(()=>s,":first-child")).attr("class","basic label-container"),x&&a.attr("style",x)}else{let t=Z(0,0,c,f,p,u,m);a=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(x)).attr("style",r)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-c/2}, ${-(f/2+u)})`),g(e,a),o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+u-(s.y-(s.top??0))})`),e.intersect=function(t){let a=B.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},i}async function linedWaveEdgedRect(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=o/4,p=o+c,{cssStyles:u}=e,f=h.Z.svg(r),m=k(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=[{x:-s/2-s/2*.1,y:-p/2},{x:-s/2-s/2*.1,y:p/2},...generateFullSineWavePoints(-s/2-s/2*.1,p/2,s/2+s/2*.1,p/2,c,.8),{x:s/2+s/2*.1,y:-p/2},{x:-s/2-s/2*.1,y:-p/2},{x:-s/2,y:-p/2},{x:-s/2,y:p/2*1.1},{x:-s/2,y:-p/2}],w=f.polygon(x.map(t=>[t.x,t.y]),m),b=r.insert(()=>w,":first-child");return b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",l),b.attr("transform",`translate(0,${-c/2})`),n.attr("transform",`translate(${-s/2+(e.padding??0)+s/2*.1/2-(i.x-(i.left??0))},${-o/2+(e.padding??0)-c/2-(i.y-(i.top??0))})`),g(e,b),e.intersect=function(t){let a=B.polygon(e,x,t);return a},r}async function multiRect(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=-s/2,p=-o/2,{cssStyles:u}=e,f=h.Z.svg(r),m=k(e,{}),x=[{x:c-5,y:p+5},{x:c-5,y:p+o+5},{x:c+s-5,y:p+o+5},{x:c+s-5,y:p+o},{x:c+s,y:p+o},{x:c+s,y:p+o-5},{x:c+s+5,y:p+o-5},{x:c+s+5,y:p-5},{x:c+5,y:p-5},{x:c+5,y:p},{x:c,y:p},{x:c,y:p+5}],w=[{x:c,y:p+5},{x:c+s-5,y:p+5},{x:c+s-5,y:p+o},{x:c+s,y:p+o},{x:c+s,y:p},{x:c,y:p}];"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let b=createPathFromPoints(x),S=f.path(b,m),P=createPathFromPoints(w),M=f.path(P,{...m,fill:"none"}),C=r.insert(()=>M,":first-child");return C.insert(()=>S,":first-child"),C.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),n.attr("transform",`translate(${-(i.width/2)-5-(i.x-(i.left??0))}, ${-(i.height/2)+5-(i.y-(i.top??0))})`),g(e,C),e.intersect=function(t){let a=B.polygon(e,x,t);return a},r}async function multiWaveEdgedRectangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=o/4,p=o+c,u=-s/2,f=-p/2,{cssStyles:m}=e,x=generateFullSineWavePoints(u-5,f+p+5,u+s-5,f+p+5,c,.8),w=x?.[x.length-1],b=[{x:u-5,y:f+5},{x:u-5,y:f+p+5},...x,{x:u+s-5,y:w.y-5},{x:u+s,y:w.y-5},{x:u+s,y:w.y-10},{x:u+s+5,y:w.y-10},{x:u+s+5,y:f-5},{x:u+5,y:f-5},{x:u+5,y:f},{x:u,y:f},{x:u,y:f+5}],S=[{x:u,y:f+5},{x:u+s-5,y:f+5},{x:u+s-5,y:w.y-5},{x:u+s,y:w.y-5},{x:u+s,y:f},{x:u,y:f}],P=h.Z.svg(r),M=k(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let C=createPathFromPoints(b),W=P.path(C,M),v=createPathFromPoints(S),D=P.path(v,M),R=r.insert(()=>W,":first-child");return R.insert(()=>D),R.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&R.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&R.selectAll("path").attr("style",l),R.attr("transform",`translate(0,${-c/2})`),n.attr("transform",`translate(${-(i.width/2)-5-(i.x-(i.left??0))}, ${-(i.height/2)+5-c/2-(i.y-(i.top??0))})`),g(e,R),e.intersect=function(t){let a=B.polygon(e,b,t);return a},r}async function note(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let i=e.useHtmlLabels||s.iE().flowchart?.htmlLabels!==!1;i||(e.centerLabel=!0);let{shapeSvg:n,bbox:o}=await d(t,e,y(e)),c=Math.max(o.width+(e.padding??0)*2,e?.width??0),p=Math.max(o.height+(e.padding??0)*2,e?.height??0),u=-c/2,f=-p/2,{cssStyles:m}=e,x=h.Z.svg(n),w=k(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.rectangle(u,f,c,p,w),S=n.insert(()=>b,":first-child");return S.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",m),r&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",r),g(e,S),e.intersect=function(t){return B.rect(e,t)},n}
2(0,s.eW)(linedCylinder,"linedCylinder"),(0,s.eW)(linedWaveEdgedRect,"linedWaveEdgedRect"),(0,s.eW)(multiRect,"multiRect"),(0,s.eW)(multiWaveEdgedRectangle,"multiWaveEdgedRectangle"),(0,s.eW)(note,"note");var E=(0,s.eW)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function question(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),o=n.width+e.padding,c=n.height+e.padding,p=o+c,u=[{x:p/2,y:0},{x:p,y:-p/2},{x:p/2,y:-p},{x:0,y:-p/2}],{cssStyles:f}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=E(0,0,p),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`),f&&a.attr("style",f)}else a=insertPolygonShape(i,p,p,u);return r&&a.attr("style",r),g(e,a),e.intersect=function(t){return s.cM.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",B.polygon(e,u,t)),B.polygon(e,u,t)},i}async function rect_left_inv_arrow(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0),e?.width??0),o=Math.max(i.height+(e.padding??0),e?.height??0),c=-s/2,p=-o/2,u=p/2,f=[{x:c+u,y:p},{x:c,y:0},{x:c+u,y:-p},{x:-c,y:-p},{x:-c,y:p}],{cssStyles:m}=e,x=h.Z.svg(r),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=createPathFromPoints(f),S=x.path(b,w),P=r.insert(()=>S,":first-child");return P.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(${-u/2},0)`),n.attr("transform",`translate(${-u/2-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),g(e,P),e.intersect=function(t){return B.polygon(e,f,t)},r}async function rectWithTitle(t,e){let a,l,r;let{labelStyles:i,nodeStyles:n}=$(e);e.labelStyle=i,a=e.cssClasses?"node "+e.cssClasses:"node default";let d=t.insert("g").attr("class",a).attr("id",e.domId||e.id),c=d.insert("g"),y=d.insert("g").attr("class","label").attr("style",n),p=e.description,m=e.label,x=y.node().appendChild(await u(m,e.labelStyle,!0,!0)),w={width:0,height:0};if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=x.children[0],e=(0,o.Ys)(x);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}s.cM.info("Text 2",p);let b=p||[],S=x.getBBox(),P=y.node().appendChild(await u(b.join?b.join("<br/>"):b,e.labelStyle,!0,!0)),M=P.children[0],C=(0,o.Ys)(P);w=M.getBoundingClientRect(),C.attr("width",w.width),C.attr("height",w.height);let W=(e.padding||0)/2;(0,o.Ys)(P).attr("transform","translate( "+(w.width>S.width?0:(S.width-w.width)/2)+", "+(S.height+W+5)+")"),(0,o.Ys)(x).attr("transform","translate( "+(w.width<S.width?0:-(S.width-w.width)/2)+", 0)"),w=y.node().getBBox(),y.attr("transform","translate("+-w.width/2+", "+(-w.height/2-W+3)+")");let v=w.width+(e.padding||0),D=w.height+(e.padding||0),R=-w.width/2-W,N=-w.height/2-W;if("handDrawn"===e.look){let t=h.Z.svg(d),a=k(e,{}),i=t.path(f(R,N,v,D,e.rx||0),a),n=t.line(-w.width/2-W,-w.height/2-W+S.height+W,w.width/2+W,-w.height/2-W+S.height+W,a);r=d.insert(()=>(s.cM.debug("Rough node insert CXC",i),n),":first-child"),l=d.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")}else l=c.insert("rect",":first-child"),r=c.insert("line"),l.attr("class","outer title-state").attr("style",n).attr("x",-w.width/2-W).attr("y",-w.height/2-W).attr("width",w.width+(e.padding||0)).attr("height",w.height+(e.padding||0)),r.attr("class","divider").attr("x1",-w.width/2-W).attr("x2",w.width/2+W).attr("y1",-w.height/2-W+S.height+W).attr("y2",-w.height/2-W+S.height+W);return g(e,l),e.intersect=function(t){return B.rect(e,t)},d}async function roundedRect(t,e){let a={rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return drawRect(t,e,a)}async function shadedProcess(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:s}=await d(t,e,y(e)),o=e?.padding??0,c=Math.max(i.width+(e.padding??0)*2,e?.width??0),p=Math.max(i.height+(e.padding??0)*2,e?.height??0),u=-i.width/2-o,f=-i.height/2-o,{cssStyles:m}=e,x=h.Z.svg(r),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:u,y:f},{x:u+c+8,y:f},{x:u+c+8,y:f+p},{x:u-8,y:f+p},{x:u-8,y:f},{x:u,y:f},{x:u,y:f+p}],S=x.polygon(b.map(t=>[t.x,t.y]),w),P=r.insert(()=>S,":first-child");return P.attr("class","basic label-container").attr("style",(0,n.R7)(m)),l&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",l),m&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",l),s.attr("transform",`translate(${-c/2+4+(e.padding??0)-(i.x-(i.left??0))},${-p/2+(e.padding??0)-(i.y-(i.top??0))})`),g(e,P),e.intersect=function(t){return B.rect(e,t)},r}async function slopedRect(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=-s/2,p=-o/2,{cssStyles:u}=e,f=h.Z.svg(r),m=k(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=[{x:c,y:p},{x:c,y:p+o},{x:c+s,y:p+o},{x:c+s,y:p-o/2}],w=createPathFromPoints(x),b=f.path(w,m),S=r.insert(()=>b,":first-child");return S.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",u),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(0, ${o/4})`),n.attr("transform",`translate(${-s/2+(e.padding??0)-(i.x-(i.left??0))}, ${-o/4+(e.padding??0)-(i.y-(i.top??0))})`),g(e,S),e.intersect=function(t){let a=B.polygon(e,x,t);return a},r}async function squareRect2(t,e){let a={rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return drawRect(t,e,a)}async function stadium(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:s}=await d(t,e,y(e)),o=s.height+e.padding,c=s.width+o/4+e.padding,{cssStyles:p}=e;
2if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=f(-c/2,-o/2,c,o,o/2),s=t.path(r,l);(a=i.insert(()=>s,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(p))}else(a=i.insert("rect",":first-child")).attr("class","basic label-container").attr("style",r).attr("rx",o/2).attr("ry",o/2).attr("x",-c/2).attr("y",-o/2).attr("width",c).attr("height",o);return g(e,a),e.intersect=function(t){return B.rect(e,t)},i}async function state(t,e){return drawRect(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function stateEnd(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{cssStyles:i}=e,{lineColor:n,stateBorder:s,nodeBorder:o}=a,d=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),c=h.Z.svg(d),y=k(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let p=c.circle(0,0,14,{...y,stroke:n,strokeWidth:2}),u=s??o,f=c.circle(0,0,5,{...y,fill:u,stroke:u,strokeWidth:2,fillStyle:"solid"}),m=d.insert(()=>p,":first-child");return m.insert(()=>f),i&&m.selectAll("path").attr("style",i),r&&m.selectAll("path").attr("style",r),g(e,m),e.intersect=function(t){return B.circle(e,7,t)},d}function stateStart(t,e,{config:{themeVariables:a}}){let l;let{lineColor:r}=a,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=h.Z.svg(i),e=t.circle(0,0,14,m(r));(l=i.insert(()=>e)).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else(l=i.insert("circle",":first-child")).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return g(e,l),e.intersect=function(t){return B.circle(e,7,t)},i}async function subroutine(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),s=(e?.padding||0)/2,o=i.width+e.padding,c=i.height+e.padding,p=-i.width/2-s,u=-i.height/2-s,f=[{x:0,y:0},{x:o,y:0},{x:o,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if("handDrawn"===e.look){let t=h.Z.svg(r),a=k(e,{}),l=t.rectangle(p-8,u,o+16,c,a),i=t.line(p,u,p,u+c,a),s=t.line(p+o,u,p+o,u+c,a);r.insert(()=>i,":first-child"),r.insert(()=>s,":first-child");let d=r.insert(()=>l,":first-child"),{cssStyles:y}=e;d.attr("class","basic label-container").attr("style",(0,n.R7)(y)),g(e,d)}else{let t=insertPolygonShape(r,o,c,f);l&&t.attr("style",l),g(e,t)}return e.intersect=function(t){return B.polygon(e,f,t)},r}async function taggedRect(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=Math.max(i.width+(e.padding??0)*2,e?.width??0),s=Math.max(i.height+(e.padding??0)*2,e?.height??0),o=-n/2,c=-s/2,p=.2*s,{cssStyles:u}=e,f=h.Z.svg(r),m=k(e,{}),x=[{x:o-p/2,y:c},{x:o+n+p/2,y:c},{x:o+n+p/2,y:c+s},{x:o-p/2,y:c+s}],w=[{x:o+n-p/2,y:c+s},{x:o+n+p/2,y:c+s},{x:o+n+p/2,y:c+s-.2*s}];"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let b=createPathFromPoints(x),S=f.path(b,m),P=createPathFromPoints(w),M=f.path(P,{...m,fillStyle:"solid"}),C=r.insert(()=>M,":first-child");return C.insert(()=>S,":first-child"),C.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),g(e,C),e.intersect=function(t){let a=B.polygon(e,x,t);return a},r}async function taggedWaveEdgedRectangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=o/4,p=.2*s,u=.2*o,f=o+c,{cssStyles:m}=e,x=h.Z.svg(r),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-s/2-s/2*.1,y:f/2},...generateFullSineWavePoints(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,c,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],S=-s/2+s/2*.1,P=-f/2-.4*u,M=[{x:S+s-p,y:(P+o)*1.4},{x:S+s,y:P+o-u},{x:S+s,y:(P+o)*.9},...generateFullSineWavePoints(S+s,(P+o)*1.3,S+s-p,(P+o)*1.5,-(.03*o),.5)],C=createPathFromPoints(b),W=x.path(C,w),v=createPathFromPoints(M),D=x.path(v,{...w,fillStyle:"solid"}),R=r.insert(()=>D,":first-child");return R.insert(()=>W,":first-child"),R.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&R.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&R.selectAll("path").attr("style",l),R.attr("transform",`translate(0,${-c/2})`),n.attr("transform",`translate(${-s/2+(e.padding??0)-(i.x-(i.left??0))},${-o/2+(e.padding??0)-c/2-(i.y-(i.top??0))})`),g(e,R),e.intersect=function(t){let a=B.polygon(e,b,t);return a},r}async function text(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=Math.max(i.width+e.padding,e?.width||0),s=Math.max(i.height+e.padding,e?.height||0),o=-n/2,h=-s/2,c=r.insert("rect",":first-child");return c.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",o).attr("y",h).attr("width",n).attr("height",s),g(e,c),e.intersect=function(t){return B.rect(e,t)},r}(0,s.eW)(question,"question"),(0,s.eW)(rect_left_inv_arrow,"rect_left_inv_arrow"),(0,s.eW)(rectWithTitle,"rectWithTitle"),
2(0,s.eW)(roundedRect,"roundedRect"),(0,s.eW)(shadedProcess,"shadedProcess"),(0,s.eW)(slopedRect,"slopedRect"),(0,s.eW)(squareRect2,"squareRect"),(0,s.eW)(stadium,"stadium"),(0,s.eW)(state,"state"),(0,s.eW)(stateEnd,"stateEnd"),(0,s.eW)(stateStart,"stateStart"),(0,s.eW)(subroutine,"subroutine"),(0,s.eW)(taggedRect,"taggedRect"),(0,s.eW)(taggedWaveEdgedRectangle,"taggedWaveEdgedRectangle"),(0,s.eW)(text,"text");var H=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e}
3    a${r},${i} 0,0,1 0,${-l}
4    l${a},0
5    a${r},${i} 0,0,1 0,${l}
6    M${a},${-l}
7    a${r},${i} 0,0,0 0,${l}
8    l${-a},0`,"createCylinderPathD"),q=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e} M${t+a},${e} a${r},${i} 0,0,0 0,${-l} l${-a},0 a${r},${i} 0,0,0 0,${l} l${a},0`,"createOuterCylinderPathD"),_=(0,s.eW)((t,e,a,l,r,i)=>`M${t+a/2},${-l/2} a${r},${i} 0,0,0 0,${l}`,"createInnerCylinderPathD");async function tiltedCylinder(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:s,label:o,halfPadding:c}=await d(t,e,y(e)),p="neo"===e.look?2*c:c,u=s.height+p,f=u/2,m=f/(2.5+u/50),x=s.width+m+p,{cssStyles:w}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=q(0,0,x,u,m,f),r=_(0,0,x,u,m,f),n=t.path(l,k(e,{})),s=t.path(r,k(e,{fill:"none"}));a=i.insert(()=>s,":first-child"),(a=i.insert(()=>n,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=H(0,0,x,u,m,f);(a=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(w)).attr("style",r)).attr("class","basic label-container"),w&&a.selectAll("path").attr("style",w),r&&a.selectAll("path").attr("style",r)}return a.attr("label-offset-x",m),a.attr("transform",`translate(${-x/2}, ${u/2} )`),o.attr("transform",`translate(${-(s.width/2)-m-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),g(e,a),e.intersect=function(t){let a=B.rect(e,t),l=a.y-(e.y??0);if(0!=f&&(Math.abs(l)<(e.height??0)/2||Math.abs(l)==(e.height??0)/2&&Math.abs(a.x-(e.x??0))>(e.width??0)/2-m)){let r=m*m*(1-l*l/(f*f));0!=r&&(r=Math.sqrt(Math.abs(r))),r=m-r,t.x-(e.x??0)>0&&(r=-r),a.x+=r}return a},i}async function trapezoid(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.width+e.padding,o=n.height+e.padding,c=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=k(e,{}),r=createPathFromPoints(c),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),p&&a.attr("style",p)}else a=insertPolygonShape(i,s,o,c);return r&&a.attr("style",r),e.width=s,e.height=o,g(e,a),e.intersect=function(t){return B.polygon(e,c,t)},i}async function trapezoidalPentagon(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=Math.max(60,i.width+(e.padding??0)*2,e?.width??0),s=Math.max(20,i.height+(e.padding??0)*2,e?.height??0),{cssStyles:o}=e,c=h.Z.svg(r),p=k(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let u=[{x:-n/2*.8,y:-s/2},{x:n/2*.8,y:-s/2},{x:n/2,y:-s/2*.6},{x:n/2,y:s/2},{x:-n/2,y:s/2},{x:-n/2,y:-s/2*.6}],f=createPathFromPoints(u),m=c.path(f,p),x=r.insert(()=>m,":first-child");return x.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",o),l&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",l),g(e,x),e.intersect=function(t){let a=B.polygon(e,u,t);return a},r}async function triangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),o=(0,s.ku)(s.nV().flowchart?.htmlLabels),c=i.width+(e.padding??0),p=c+i.height,u=c+i.height,f=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-p}],{cssStyles:m}=e,x=h.Z.svg(r),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=createPathFromPoints(f),S=x.path(b,w),P=r.insert(()=>S,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return m&&"handDrawn"!==e.look&&P.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&P.selectChildren("path").attr("style",l),e.width=c,e.height=p,g(e,P),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}
8, ${p/2-(i.height+(e.padding??0)/(o?2:1)-(i.y-(i.top??0)))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,f,t),B.polygon(e,f,t)},r}async function waveEdgedRectangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=o/8,p=o+c,{cssStyles:u}=e,f=70-s,m=f>0?f/2:0,x=h.Z.svg(r),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-s/2-m,y:p/2},...generateFullSineWavePoints(-s/2-m,p/2,s/2+m,p/2,c,.8),{x:s/2+m,y:-p/2},{x:-s/2-m,y:-p/2}],S=createPathFromPoints(b),P=x.path(S,w),M=r.insert(()=>P,":first-child");return M.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(0,${-c/2})`),n.attr("transform",`translate(${-s/2+(e.padding??0)-(i.x-(i.left??0))},${-o/2+(e.padding??0)-c-(i.y-(i.top??0))})`),g(e,M),e.intersect=function(t){let a=B.polygon(e,b,t);return a},r}async function waveRectangle(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await d(t,e,y(e)),n=Math.max(i.width+(e.padding??0)*2,e?.width??0),s=Math.max(i.height+(e.padding??0)*2,e?.height??0),o=n/s,c=n,p=s;c>p*o?p=c/o:c=p*o,c=Math.max(c,100),p=Math.max(p,50);let u=Math.min(.2*p,p/4),f=p+2*u,{cssStyles:m}=e,x=h.Z.svg(r),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-c/2,y:f/2},...generateFullSineWavePoints(-c/2,f/2,c/2,f/2,u,1),{x:c/2,y:-f/2},...generateFullSineWavePoints(c/2,-f/2,-c/2,-f/2,u,-1)],S=createPathFromPoints(b),P=x.path(S,w),M=r.insert(()=>P,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",l),g(e,M),e.intersect=function(t){let a=B.polygon(e,b,t);return a},r}async function windowPane(t,e){let{labelStyles:a,nodeStyles:l}=$(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await d(t,e,y(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),o=Math.max(i.height+(e.padding??0)*2,e?.height??0),c=-s/2,p=-o/2,{cssStyles:u}=e,f=h.Z.svg(r),m=k(e,{}),x=[{x:c-5,y:p-5},{x:c-5,y:p+o},{x:c+s,y:p+o},{x:c+s,y:p-5}],w=`M${c-5},${p-5} L${c+s},${p-5} L${c+s},${p+o} L${c-5},${p+o} L${c-5},${p-5}
9                M${c-5},${p} L${c+s},${p}
10                M${c},${p-5} L${c},${p+o}`;"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let b=f.path(w,m),S=r.insert(()=>b,":first-child");return S.attr("transform","translate(2.5, 2.5)"),S.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),n.attr("transform",`translate(${-(i.width/2)+2.5-(i.x-(i.left??0))}, ${-(i.height/2)+2.5-(i.y-(i.top??0))})`),g(e,S),e.intersect=function(t){let a=B.polygon(e,x,t);return a},r}async function erBox(t,e){if(e.alias&&(e.label=e.alias),"handDrawn"===e.look){let{themeVariables:a}=(0,s.iE)(),{background:l}=a,r={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${l}`]};await erBox(t,r)}let a=(0,s.iE)();e.useHtmlLabels=a.htmlLabels;let l=a.er?.diagramPadding??10,r=a.er?.entityPadding??6,{cssStyles:i}=e,{labelStyles:d}=$(e);if(0===e.attributes.length&&e.label){let r={rx:0,ry:0,labelPaddingX:l,labelPaddingY:1.5*l,classes:""};(0,n.Cq)(e.label,a)+2*r.labelPaddingX<a.er.minEntityWidth&&(e.width=a.er.minEntityWidth);let i=await drawRect(t,e,r);if(!(0,s.ku)(a.htmlLabels)){let t=i.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return i}a.htmlLabels||(l*=1.25,r*=1.25);let c=y(e);c||(c="node default");let p=t.insert("g").attr("class",c).attr("id",e.domId||e.id),u=await addText(p,e.label??"",a,0,0,["name"],d);u.height+=r;let f=0,m=[],x=0,w=0,b=0,S=0,P=!0,M=!0;for(let t of e.attributes){let e=await addText(p,t.type,a,0,f,["attribute-type"],d);x=Math.max(x,e.width+l);let i=await addText(p,t.name,a,0,f,["attribute-name"],d);w=Math.max(w,i.width+l);let n=await addText(p,t.keys.join(),a,0,f,["attribute-keys"],d);b=Math.max(b,n.width+l);let s=await addText(p,t.comment,a,0,f,["attribute-comment"],d);S=Math.max(S,s.width+l),f+=Math.max(e.height,i.height,n.height,s.height)+r,m.push(f)}m.pop();let C=4;b<=l&&(P=!1,b=0,C--),S<=l&&(M=!1,S=0,C--);let W=p.node().getBBox();if(u.width+2*l-(x+w+b+S)>0){let t=u.width+2*l-(x+w+b+S);x+=t/C,w+=t/C,b>0&&(b+=t/C),S>0&&(S+=t/C)}let v=x+w+b+S,D=h.Z.svg(p),R=k(e,{});"handDrawn"!==e.look&&(R.roughness=0,R.fillStyle="solid");let N=Math.max(W.width+2*l,e?.width||0,v),A=Math.max(W.height+(m[0]||f)+r,e?.height||0),L=-N/2,T=-A/2;p.selectAll("g:not(:first-child)").each((t,e,a)=>{let i=(0,o.Ys)(a[e]),n=i.attr("transform"),s=0,h=0;
10if(n){let t=RegExp(/translate\(([^,]+),([^)]+)\)/),e=t.exec(n);e&&(s=parseFloat(e[1]),h=parseFloat(e[2]),i.attr("class").includes("attribute-name")?s+=x:i.attr("class").includes("attribute-keys")?s+=x+w:i.attr("class").includes("attribute-comment")&&(s+=x+w+b))}i.attr("transform",`translate(${L+l/2+s}, ${h+T+u.height+r/2})`)}),p.select(".name").attr("transform","translate("+-u.width/2+", "+(T+r/2)+")");let Z=D.rectangle(L,T,N,A,R),I=p.insert(()=>Z,":first-child").attr("style",i.join("")),{themeVariables:F}=(0,s.iE)(),{rowEven:E,rowOdd:H,nodeBorder:q}=F;for(let[t,e]of(m.push(0),m.entries())){if(0===t&&m.length>1)continue;let a=t%2==0&&0!==e,l=D.rectangle(L,u.height+T+e,N,u.height,{...R,fill:a?E:H,stroke:q});p.insert(()=>l,"g.label").attr("style",i.join("")).attr("class",`row-rect-${t%2==0?"even":"odd"}`)}let _=D.line(L,u.height+T,N+L,u.height+T,R);for(let t of(p.insert(()=>_).attr("class","divider"),_=D.line(x+L,u.height+T,x+L,A+T,R),p.insert(()=>_).attr("class","divider"),P&&(_=D.line(x+w+L,u.height+T,x+w+L,A+T,R),p.insert(()=>_).attr("class","divider")),M&&(_=D.line(x+w+b+L,u.height+T,x+w+b+L,A+T,R),p.insert(()=>_).attr("class","divider")),m))_=D.line(L,u.height+T+t,N+L,u.height+T+t,R),p.insert(()=>_).attr("class","divider");return g(e,I),e.intersect=function(t){return B.rect(e,t)},p}async function addText(t,e,a,l=0,r=0,h=[],d=""){let c=t.insert("g").attr("class",`label ${h.join(" ")}`).attr("transform",`translate(${l}, ${r})`).attr("style",d);e!==(0,s.UO)(e)&&(e=(e=(0,s.UO)(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));let g=c.node().appendChild(await (0,i.rw)(c,e,{width:(0,n.Cq)(e,a)+100,style:d,useHtmlLabels:a.htmlLabels},a));if(e.includes("&lt;")||e.includes("&gt;")){let t=g.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)(t=t.childNodes[0]).textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let y=g.getBBox();if((0,s.ku)(a.htmlLabels)){let t=g.children[0];t.style.textAlign="start";let e=(0,o.Ys)(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return y}async function textHelper(t,e,a,l,r=a.class.padding??12){let i=l?0:3,n=t.insert("g").attr("class",y(e)).attr("id",e.domId||e.id),s=null,o=null,h=null,d=null,c=0,g=0,p=0;if(s=n.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let t=e.annotations[0];await addText2(s,{text:`\xab${t}\xbb`},0);let a=s.node().getBBox();c=a.height}o=n.insert("g").attr("class","label-group text"),await addText2(o,e,0,["font-weight: bolder"]);let u=o.node().getBBox();g=u.height,h=n.insert("g").attr("class","members-group text");let f=0;for(let t of e.members){let e=await addText2(h,t,f,[t.parseClassifier()]);f+=e+i}(p=h.node().getBBox().height)<=0&&(p=r/2),d=n.insert("g").attr("class","methods-group text");let m=0;for(let t of e.methods){let e=await addText2(d,t,m,[t.parseClassifier()]);m+=e+i}if(n.node().getBBox(),null!==s){let t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return o.attr("transform",`translate(${-u.width/2}, ${c})`),n.node().getBBox(),h.attr("transform",`translate(0, ${c+g+2*r})`),n.node().getBBox(),d.attr("transform",`translate(0, ${c+g+(p?p+4*r:2*r)})`),{shapeSvg:n,bbox:n.node().getBBox()}}async function addText2(t,e,a,l=[]){let r;let h=t.insert("g").attr("class","label").attr("style",l.join("; ")),d=(0,s.iE)(),c="useHtmlLabels"in e?e.useHtmlLabels:(0,s.ku)(d.htmlLabels)??!0,g="";g="text"in e?e.text:e.label,!c&&g.startsWith("\\")&&(g=g.substring(1)),(0,s.l0)(g)&&(c=!0);let y=await (0,i.rw)(h,(0,s.uX)((0,n.SH)(g)),{width:(0,n.Cq)(g,d)+50,classes:"markdown-node-label",useHtmlLabels:c},d),p=1;if(c){let t=y.children[0],e=(0,o.Ys)(y);p=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(p+=t.innerHTML.split("<mrow>").length-1);let a=t.getElementsByTagName("img");if(a){let t=""===g.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function setupImage(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=d.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,a=5*parseInt(t,10)+"px";e.style.minWidth=a,e.style.maxWidth=a}else e.style.width="100%";a(e)}(0,s.eW)(setupImage,"setupImage"),setTimeout(()=>{e.complete&&setupImage()}),e.addEventListener("error",setupImage),e.addEventListener("load",setupImage)})))}r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}
10else{l.includes("font-weight: bolder")&&(0,o.Ys)(y).selectAll("tspan").attr("font-weight",""),p=y.children.length;let t=y.children[0];if(""===y.textContent||y.textContent.includes("&gt")){t.textContent=g[0]+g.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim();let e=" "===g[1];e&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))}"undefined"===t.textContent&&(t.textContent=""),r=y.getBBox()}return h.attr("transform","translate(0,"+(-r.height/(2*p)+a)+")"),r.height}async function classBox(t,e){let a=(0,s.nV)(),l=a.class.padding??12,r=e.useHtmlLabels??(0,s.ku)(a.htmlLabels)??!0;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:i,bbox:n}=await textHelper(t,e,a,r,l),{labelStyles:d,nodeStyles:c}=$(e);e.labelStyle=d,e.cssStyles=e.styles||"";let y=e.styles?.join(";")||c||"";e.cssStyles||(e.cssStyles=y.replaceAll("!important","").split(";"));let p=0===e.members.length&&0===e.methods.length&&!a.class?.hideEmptyMembersBox,u=h.Z.svg(i),f=k(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let m=n.width,x=n.height;0===e.members.length&&0===e.methods.length?x+=l:e.members.length>0&&0===e.methods.length&&(x+=2*l);let w=-m/2,b=-x/2,S=u.rectangle(w-l,b-l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0),m+2*l,x+2*l+(p?2*l:0===e.members.length&&0===e.methods.length?-l:0),f),P=i.insert(()=>S,":first-child");P.attr("class","basic label-container");let M=P.node().getBBox();i.selectAll(".text").each((t,a,n)=>{let s=(0,o.Ys)(n[a]),h=s.attr("transform"),d=0;if(h){let t=RegExp(/translate\(([^,]+),([^)]+)\)/),e=t.exec(h);e&&(d=parseFloat(e[2]))}let c=d+b+l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0);r||(c-=4);let g=w;(s.attr("class").includes("label-group")||s.attr("class").includes("annotation-group"))&&(g=-s.node()?.getBBox().width/2||0,i.selectAll("text").each(function(t,e,a){"middle"===window.getComputedStyle(a[e]).textAnchor&&(g=0)})),s.attr("transform",`translate(${g}, ${c})`)});let C=i.select(".annotation-group").node().getBBox().height-(p?l/2:0)||0,W=i.select(".label-group").node().getBBox().height-(p?l/2:0)||0,v=i.select(".members-group").node().getBBox().height-(p?l/2:0)||0;if(e.members.length>0||e.methods.length>0||p){let t=u.line(M.x,C+W+b+l,M.x+M.width,C+W+b+l,f),e=i.insert(()=>t);e.attr("class","divider").attr("style",y)}if(p||e.members.length>0||e.methods.length>0){let t=u.line(M.x,C+W+v+b+2*l+l,M.x+M.width,C+W+v+b+l+2*l,f),e=i.insert(()=>t);e.attr("class","divider").attr("style",y)}if("handDrawn"!==e.look&&i.selectAll("path").attr("style",y),P.select(":nth-child(2)").attr("style",y),i.selectAll(".divider").select("path").attr("style",y),e.labelStyle?i.selectAll("span").attr("style",e.labelStyle):i.selectAll("span").attr("style",y),!r){let t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(y);if(e){let t=e[0].replace("color","fill");i.selectAll("tspan").attr("style",t)}else if(d){let e=t.exec(d);if(e){let t=e[0].replace("color","fill");i.selectAll("tspan").attr("style",t)}}}return g(e,P),e.intersect=function(t){return B.rect(e,t)},i}async function requirementBox(t,e){let a;let{labelStyles:l,nodeStyles:r}=$(e);e.labelStyle=l;let i="verifyMethod"in e,n=y(e),s=t.insert("g").attr("class",n).attr("id",e.domId??e.id),d=a=i?await addText3(s,`&lt;&lt;${e.type}&gt;&gt;`,0,e.labelStyle):await addText3(s,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle),c=await addText3(s,e.name,d,e.labelStyle+"; font-weight: bold;");if(d+=c+20,i){let t=await addText3(s,`${e.requirementId?`Id: ${e.requirementId}`:""}`,d,e.labelStyle);d+=t;let a=await addText3(s,`${e.text?`Text: ${e.text}`:""}`,d,e.labelStyle);d+=a;let l=await addText3(s,`${e.risk?`Risk: ${e.risk}`:""}`,d,e.labelStyle);d+=l,await addText3(s,`${e.verifyMethod?`Verification: ${e.verifyMethod}`:""}`,d,e.labelStyle)}else{let t=await addText3(s,`${e.type?`Type: ${e.type}`:""}`,d,e.labelStyle);d+=t,await addText3(s,`${e.docRef?`Doc Ref: ${e.docRef}`:""}`,d,e.labelStyle)}let p=(s.node()?.getBBox().width??200)+20,u=(s.node()?.getBBox().height??200)+20,f=-p/2,m=-u/2,x=h.Z.svg(s),w=k(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.rectangle(f,m,p,u,w),S=s.insert(()=>b,":first-child");if(S.attr("class","basic label-container").attr("style",r),s.selectAll(".label").each((t,e,a)=>{let l=(0,o.Ys)(a[e]),r=l.attr("transform"),i=0,n=0;
10if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/),e=t.exec(r);e&&(i=parseFloat(e[1]),n=parseFloat(e[2]))}let s=n-u/2,h=f+10;(0===e||1===e)&&(h=i),l.attr("transform",`translate(${h}, ${s+20})`)}),d>a+c+20){let t=x.line(f,m+a+c+20,f+p,m+a+c+20,w),e=s.insert(()=>t);e.attr("style",r)}return g(e,S),e.intersect=function(t){return B.rect(e,t)},s}async function addText3(t,e,a,l=""){let r;if(""===e)return 0;let h=t.insert("g").attr("class","label").attr("style",l),d=(0,s.nV)(),c=d.htmlLabels??!0,g=await (0,i.rw)(h,(0,s.uX)((0,n.SH)(e)),{width:(0,n.Cq)(e,d)+50,classes:"markdown-node-label",useHtmlLabels:c,style:l},d);if(c){let t=g.children[0],e=(0,o.Ys)(g);r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{let t=g.children[0];for(let e of t.children)e.textContent=e.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),l&&e.setAttribute("style",l);r=g.getBBox(),r.height+=6}return h.attr("transform",`translate(${-r.width/2},${-r.height/2+a})`),r.height}(0,s.eW)(tiltedCylinder,"tiltedCylinder"),(0,s.eW)(trapezoid,"trapezoid"),(0,s.eW)(trapezoidalPentagon,"trapezoidalPentagon"),(0,s.eW)(triangle,"triangle"),(0,s.eW)(waveEdgedRectangle,"waveEdgedRectangle"),(0,s.eW)(waveRectangle,"waveRectangle"),(0,s.eW)(windowPane,"windowPane"),(0,s.eW)(erBox,"erBox"),(0,s.eW)(addText,"addText"),(0,s.eW)(textHelper,"textHelper"),(0,s.eW)(addText2,"addText"),(0,s.eW)(classBox,"classBox"),(0,s.eW)(requirementBox,"requirementBox"),(0,s.eW)(addText3,"addText");var z=(0,s.eW)(t=>{switch(t){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 kanbanItem(t,e,{config:a}){let l,r,i,n;let{labelStyles:s,nodeStyles:o}=$(e);e.labelStyle=s||"";let p=e.width;e.width=(e.width??200)-10;let{shapeSvg:u,bbox:m,label:x}=await d(t,e,y(e)),w=e.padding||10,b="";"ticket"in e&&e.ticket&&a?.kanban?.ticketBaseUrl&&(b=a?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),l=u.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",b).attr("target","_blank"));let S={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};l?{label:r,bbox:i}=await c(l,"ticket"in e&&e.ticket||"",S):{label:r,bbox:i}=await c(u,"ticket"in e&&e.ticket||"",S);let{label:P,bbox:M}=await c(u,"assigned"in e&&e.assigned||"",S);e.width=p;let C=e?.width||0,W=Math.max(i.height,M.height)/2,v=Math.max(m.height+20,e?.height||0)+W,D=-C/2,R=-v/2;x.attr("transform","translate("+(w-C/2)+", "+(-W-m.height/2)+")"),r.attr("transform","translate("+(w-C/2)+", "+(-W+m.height/2)+")"),P.attr("transform","translate("+(w+C/2-M.width-20)+", "+(-W+m.height/2)+")");let{rx:N,ry:A}=e,{cssStyles:L}=e;if("handDrawn"===e.look){let t=h.Z.svg(u),a=k(e,{}),l=N||A?t.path(f(D,R,C,v,N||0),a):t.rectangle(D,R,C,v,a);(n=u.insert(()=>l,":first-child")).attr("class","basic label-container").attr("style",L||null)}else{(n=u.insert("rect",":first-child")).attr("class","basic label-container __APA__").attr("style",o).attr("rx",N??5).attr("ry",A??5).attr("x",D).attr("y",R).attr("width",C).attr("height",v);let t="priority"in e&&e.priority;if(t){let e=u.append("line"),a=D+2,l=R+Math.floor((N??0)/2),r=R+v-Math.floor((N??0)/2);e.attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",r).attr("stroke-width","4").attr("stroke",z(t))}}return g(e,n),e.height=v,e.intersect=function(t){return B.rect(e,t)},u}(0,s.eW)(kanbanItem,"kanbanItem");var V=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:squareRect2},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:roundedRect},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:stadium},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","
10subproc","framed-rectangle","subroutine"],handler:subroutine},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:cylinder},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:circle},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:question},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:hexagon},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:lean_right},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:lean_left},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:trapezoid},{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:inv_trapezoid},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:doublecircle},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:text}
10,{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:card},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:shadedProcess},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:stateStart},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:stateEnd},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:forkJoin},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:hourglass},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:curlyBraceLeft},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:curlyBraceRight},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:curlyBraces},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:lightningBolt}
10,{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:waveEdgedRectangle},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:halfRoundedRectangle},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:tiltedCylinder},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:linedCylinder},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:curvedTrapezoid},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:dividedRectangle},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:triangle},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:windowPane},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:filledCircle},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:trapezoidalPentagon},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:flippedTriangle},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:slopedRect},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:multiWaveEdgedRectangle},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:multiRect},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:bowTieRect},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:crossedCircle},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:taggedWaveEdgedRectangle},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:taggedRect},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:waveRectangle},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:rect_left_inv_arrow},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:linedWaveEdgedRect}],j=(0,s.eW)(()=>{let t=[...Object.entries({state,choice,note,rectWithTitle,labelRect,iconSquare,iconCircle,icon,iconRounded,imageSquare,anchor,kanbanItem,classBox,erBox,requirementBox}),...V.flatMap(t=>{let e=[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]];return e.map(e=>[e,t.handler])})];return Object.fromEntries(t)},"generateShapeMap")();function isValidShape(t){return t in j}(0,s.eW)(isValidShape,"isValidShape");var Y=new Map;async function insertNode(t,e,a){let l,r;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let i=e.shape?j[e.shape]:void 0;if(!i)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let n;"sandbox"===a.config.securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),l=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n??null),r=await i(l,e,a)}else l=r=await i(t,e,a);return e.tooltip&&r.attr("title",e.tooltip),Y.set(e.id,l),e.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}
10(0,s.eW)(insertNode,"insertNode");var O=(0,s.eW)((t,e)=>{Y.set(e.id,t)},"setNodeElem"),X=(0,s.eW)(()=>{Y.clear()},"clear"),J=(0,s.eW)(t=>{let e=Y.get(t.id);s.cM.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let a=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+a-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),a},"positionNode")}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.