import{a as F}from"./chunk-6WVHDLRC.min.js";import{a as Q}from"./chunk-2JU6FAUR.min.js";import{D as q,Da as x,F as Z,Fa as V,Ga as N,Wa as Y,Za as w,h as S,nb as D}from"./chunk-PBNKOM7K.min.js";var nt=(r,t,e,n)=>{t.forEach(a=>{xt[a](r,e,n)})},lt=(r,t,e)=>{x.trace("Making markers for ",e),r.append("defs").append("marker").attr("id",t+"-extensionStart").attr("class","marker extension "+t).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),r.append("defs").append("marker").attr("id",t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},ct=(r,t)=>{r.append("defs").append("marker").attr("id",t+"-compositionStart").attr("class","marker composition "+t).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},ht=(r,t)=>{r.append("defs").append("marker").attr("id",t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},ot=(r,t)=>{r.append("defs").append("marker").attr("id",t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},ft=(r,t)=>{r.append("defs").append("marker").attr("id",t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","white").attr("cx",6).attr("cy",7).attr("r",6)},pt=(r,t)=>{r.append("marker").attr("id",t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},dt=(r,t)=>{r.append("marker").attr("id",t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},yt=(r,t)=>{r.append("marker").attr("id",t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},bt=(r,t)=>{r.append("defs").append("marker").attr("id",t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},xt={extension:lt,composition:ct,aggregation:ht,dependency:ot,lollipop:ft,point:pt,circle:dt,cross:yt,barb:bt},Pt=nt;function gt(r,t){t&&r.attr("style",t)}function ut(r){let t=S(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),e=t.append("xhtml:div"),n=r.label,a=r.isNode?"nodeLabel":"edgeLabel";return e.html('<span class="'+a+'" '+(r.labelStyle?'style="'+r.labelStyle+'"':"")+">"+n+"</span>"),gt(e,r.labelStyle),e.style("display","inline-block"),e.style("white-space","nowrap"),e.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}var wt=(r,t,e,n)=>{let a=r||"";if(typeof a=="object"&&(a=a[0]),N(w().flowchart.htmlLabels)){a=a.replace(/\\n|\n/g,"<br />"),x.info("vertexText"+a);let s={isNode:n,label:D(a).replace(/fa[blrs]?:fa-[\w-]+/g,l=>`<i class='${l.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return ut(s)}else{let s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",t.replace("color:","fill:"));let i=[];typeof a=="string"?i=a.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(a)?i=a:i=[];for(let l of i){let c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),e?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=l.trim(),s.appendChild(c)}return s}},I=wt,E=async(r,t,e,n)=>{let a,s=t.useHtmlLabels||N(w().flowchart.htmlLabels);e?a=e:a="node default";let i=r.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("g").attr("class","label").attr("style",t.labelStyle),c;t.labelText===void 0?c="":c=typeof t.labelText=="string"?t.labelText:t.labelText[0];let o=l.node(),h;t.labelType==="markdown"?h=F(l,V(D(c),w()),{useHtmlLabels:s,width:t.width||w().flowchart.wrappingWidth,classes:"markdown-node-label"}):h=o.appendChild(I(V(D(c),w()),t.labelStyle,!1,n));let f=h.getBBox(),b=t.padding/2;if(N(w().flowchart.htmlLabels)){let p=h.children[0],d=S(h),y=p.getElementsByTagName("img");if(y){let g=c.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...y].map(u=>new Promise(H=>{function R(){if(u.style.display="flex",u.style.flexDirection="column",g){let M=w().fontSize?w().fontSize:window.getComputedStyle(document.body).fontSize,W=5;u.style.width=parseInt(M,10)*W+"px"}else u.style.width="100%";H(u)}setTimeout(()=>{u.complete&&R()}),u.addEventListener("error",R),u.addEventListener("load",R)})))}f=p.getBoundingClientRect(),d.attr("width",f.width),d.attr("height",f.height)}return s?l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):l.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:i,bbox:f,halfPadding:b,label:l}},k=(r,t)=>{let e=t.node().getBBox();r.width=e.width,r.height=e.height};function _(r,t,e,n){return r.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+e/2+")")}function mt(r,t){return r.intersect(t)}function et(r,t,e,n){var a=r.x,s=r.y,i=a-n.x,l=s-n.y,c=Math.sqrt(t*t*l*l+e*e*i*i),o=Math.abs(t*e*i/c);n.x<a&&(o=-o);var h=Math.abs(t*e*l/c);return n.y<s&&(h=-h),{x:a+o,y:s+h}}function kt(r,t,e){return et(r,t,t,e)}function vt(r,t,e,n){var a,s,i,l,c,o,h,f,b,p,d,y,g,u,H;if(a=t.y-r.y,i=r.x-t.x,c=t.x*r.y-r.x*t.y,b=a*e.x+i*e.y+c,p=a*n.x+i*n.y+c,!(b!==0&&p!==0&&K(b,p))&&(s=n.y-e.y,l=e.x-n.x,o=n.x*e.y-e.x*n.y,h=s*r.x+l*r.y+o,f=s*t.x+l*t.y+o,!(h!==0&&f!==0&&K(h,f))&&(d=a*l-s*i,d!==0)))return y=Math.abs(d/2),g=i*o-l*c,u=g<0?(g-y)/d:(g+y)/d,g=s*c-a*o,H=g<0?(g-y)/d:(g+y)/d,{x:u,y:H}}function K(r,t){return r*t>0}function Lt(r,t,e){var n=r.x,a=r.y,s=[],i=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){i=Math.min(i,d.x),l=Math.min(l,d.y)}):(i=Math.min(i,t.x),l=Math.min(l,t.y));for(var c=n-r.width/2-i,o=a-r.height/2-l,h=0;h<t.length;h++){var f=t[h],b=t[h<t.length-1?h+1:0],p=vt(r,e,{x:c+f.x,y:o+f.y},{x:c+b.x,y:o+b.y});p&&s.push(p)}return s.length?(s.length>1&&s.sort(function(d,y){var g=d.x-e.x,u=d.y-e.y,H=Math.sqrt(g*g+u*u),R=y.x-e.x,M=y.y-e.y,W=Math.sqrt(R*R+M*M);return H<W?-1:H===W?0:1}),s[0]):r}var St=(r,t)=>{var e=r.x,n=r.y,a=t.x-e,s=t.y-n,i=r.width/2,l=r.height/2,c,o;return Math.abs(s)*i>Math.abs(a)*l?(s<0&&(l=-l),c=s===0?0:l*a/s,o=l):(a<0&&(i=-i),c=i,o=a===0?0:i*s/a),{x:e+c,y:n+o}},Bt=St,m={node:mt,circle:kt,ellipse:et,polygon:Lt,rect:Bt},Et=async(r,t)=>{t.useHtmlLabels||w().flowchart.htmlLabels||(t.centerLabel=!0);let{shapeSvg:n,bbox:a,halfPadding:s}=await E(r,t,"node "+t.classes,!0);x.info("Classes = ",t.classes);let i=n.insert("rect",":first-child");return i.attr("rx",t.rx).attr("ry",t.ry).attr("x",-a.width/2-s).attr("y",-a.height/2-s).attr("width",a.width+t.padding).attr("height",a.height+t.padding),k(t,i),t.intersect=function(l){return m.rect(t,l)},n},Mt=Et,G=r=>r?" "+r:"",T=(r,t)=>`${t||"node default"}${G(r.classes)} ${G(r.class)}`,P=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=a+s,l=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];x.info("Question main (Circle)");let c=_(e,i,i,l);return c.attr("style",t.style),k(t,c),t.intersect=function(o){return x.warn("Intersect called"),m.polygon(t,l,o)},e},Ct=(r,t)=>{let e=r.insert("g").attr("class","node default").attr("id",t.domId||t.id),n=28,a=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return e.insert("polygon",":first-child").attr("points",a.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(i){return m.circle(t,14,i)},e},Tt=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=4,s=n.height+t.padding,i=s/a,l=n.width+2*i+t.padding,c=[{x:i,y:0},{x:l-i,y:0},{x:l,y:-s/2},{x:l-i,y:-s},{x:i,y:-s},{x:0,y:-s/2}],o=_(e,l,s,c);return o.attr("style",t.style),k(t,o),t.intersect=function(h){return m.polygon(t,c,h)},e},Rt=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:-s/2,y:0},{x:a,y:0},{x:a,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return _(e,a,s,i).attr("style",t.style),t.width=a+s,t.height=s,t.intersect=function(c){return m.polygon(t,i,c)},e},It=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:-2*s/6,y:0},{x:a-s/6,y:0},{x:a+2*s/6,y:-s},{x:s/6,y:-s}],l=_(e,a,s,i);return l.attr("style",t.style),k(t,l),t.intersect=function(c){return m.polygon(t,i,c)},e},Ht=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:2*s/6,y:0},{x:a+s/6,y:0},{x:a-2*s/6,y:-s},{x:-s/6,y:-s}],l=_(e,a,s,i);return l.attr("style",t.style),k(t,l),t.intersect=function(c){return m.polygon(t,i,c)},e},Nt=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:-2*s/6,y:0},{x:a+2*s/6,y:0},{x:a-s/6,y:-s},{x:s/6,y:-s}],l=_(e,a,s,i);return l.attr("style",t.style),k(t,l),t.intersect=function(c){return m.polygon(t,i,c)},e},$t=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:s/6,y:0},{x:a-s/6,y:0},{x:a+2*s/6,y:-s},{x:-2*s/6,y:-s}],l=_(e,a,s,i);return l.attr("style",t.style),k(t,l),t.intersect=function(c){return m.polygon(t,i,c)},e},_t=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:0,y:0},{x:a+s/2,y:0},{x:a,y:-s/2},{x:a+s/2,y:-s},{x:0,y:-s}],l=_(e,a,s,i);return l.attr("style",t.style),k(t,l),t.intersect=function(c){return m.polygon(t,i,c)},e},Wt=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=a/2,i=s/(2.5+a/50),l=n.height+i+t.padding,c="M 0,"+i+" a "+s+","+i+" 0,0,0 "+a+" 0 a "+s+","+i+" 0,0,0 "+-a+" 0 l 0,"+l+" a "+s+","+i+" 0,0,0 "+a+" 0 l 0,"+-l,o=e.attr("label-offset-y",i).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-a/2+","+-(l/2+i)+")");return k(t,o),t.intersect=function(h){let f=m.rect(t,h),b=f.x-t.x;if(s!=0&&(Math.abs(b)<t.width/2||Math.abs(b)==t.width/2&&Math.abs(f.y-t.y)>t.height/2-i)){let p=i*i*(1-b*b/(s*s));p!=0&&(p=Math.sqrt(p)),p=i-p,h.y-t.y>0&&(p=-p),f.y+=p}return f},e},Xt=async(r,t)=>{let{shapeSvg:e,bbox:n,halfPadding:a}=await E(r,t,"node "+t.classes+" "+t.class,!0),s=e.insert("rect",":first-child"),i=n.width+t.padding,l=n.height+t.padding;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",-n.width/2-a).attr("y",-n.height/2-a).attr("width",i).attr("height",l),t.props){let c=new Set(Object.keys(t.props));t.props.borders&&(st(s,t.props.borders,i,l),c.delete("borders")),c.forEach(o=>{x.warn(`Unknown node property ${o}`)})}return k(t,s),t.intersect=function(c){return m.rect(t,c)},e},Yt=async(r,t)=>{let{shapeSvg:e}=await E(r,t,"label",!0);x.trace("Classes = ",t.class);let n=e.insert("rect",":first-child"),a=0,s=0;if(n.attr("width",a).attr("height",s),e.attr("class","label edgeLabel"),t.props){let i=new Set(Object.keys(t.props));t.props.borders&&(st(n,t.props.borders,a,s),i.delete("borders")),i.forEach(l=>{x.warn(`Unknown node property ${l}`)})}return k(t,n),t.intersect=function(i){return m.rect(t,i)},e};function st(r,t,e,n){let a=[],s=l=>{a.push(l,0)},i=l=>{a.push(0,l)};t.includes("t")?(x.debug("add top border"),s(e)):i(e),t.includes("r")?(x.debug("add right border"),s(n)):i(n),t.includes("b")?(x.debug("add bottom border"),s(e)):i(e),t.includes("l")?(x.debug("add left border"),s(n)):i(n),r.attr("stroke-dasharray",a.join(" "))}var Ut=(r,t)=>{let e;t.classes?e="node "+t.classes:e="node default";let n=r.insert("g").attr("class",e).attr("id",t.domId||t.id),a=n.insert("rect",":first-child"),s=n.insert("line"),i=n.insert("g").attr("class","label"),l=t.labelText.flat?t.labelText.flat():t.labelText,c="";typeof l=="object"?c=l[0]:c=l,x.info("Label text abc79",c,l,typeof l=="object");let o=i.node().appendChild(I(c,t.labelStyle,!0,!0)),h={width:0,height:0};if(N(w().flowchart.htmlLabels)){let y=o.children[0],g=S(o);h=y.getBoundingClientRect(),g.attr("width",h.width),g.attr("height",h.height)}x.info("Text 2",l);let f=l.slice(1,l.length),b=o.getBBox(),p=i.node().appendChild(I(f.join?f.join("<br/>"):f,t.labelStyle,!0,!0));if(N(w().flowchart.htmlLabels)){let y=p.children[0],g=S(p);h=y.getBoundingClientRect(),g.attr("width",h.width),g.attr("height",h.height)}let d=t.padding/2;return S(p).attr("transform","translate( "+(h.width>b.width?0:(b.width-h.width)/2)+", "+(b.height+d+5)+")"),S(o).attr("transform","translate( "+(h.width<b.width?0:-(b.width-h.width)/2)+", 0)"),h=i.node().getBBox(),i.attr("transform","translate("+-h.width/2+", "+(-h.height/2-d+3)+")"),a.attr("class","outer title-state").attr("x",-h.width/2-d).attr("y",-h.height/2-d).attr("width",h.width+t.padding).attr("height",h.height+t.padding),s.attr("class","divider").attr("x1",-h.width/2-d).attr("x2",h.width/2+d).attr("y1",-h.height/2-d+b.height+d).attr("y2",-h.height/2-d+b.height+d),k(t,a),t.intersect=function(y){return m.rect(t,y)},n},At=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.height+t.padding,s=n.width+a/4+t.padding,i=e.insert("rect",":first-child").attr("style",t.style).attr("rx",a/2).attr("ry",a/2).attr("x",-s/2).attr("y",-a/2).attr("width",s).attr("height",a);return k(t,i),t.intersect=function(l){return m.rect(t,l)},e},Dt=async(r,t)=>{let{shapeSvg:e,bbox:n,halfPadding:a}=await E(r,t,T(t,void 0),!0),s=e.insert("circle",":first-child");return s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+a).attr("width",n.width+t.padding).attr("height",n.height+t.padding),x.info("Circle main"),k(t,s),t.intersect=function(i){return x.info("Circle intersect",t,n.width/2+a,i),m.circle(t,n.width/2+a,i)},e},Ot=async(r,t)=>{let{shapeSvg:e,bbox:n,halfPadding:a}=await E(r,t,T(t,void 0),!0),s=5,i=e.insert("g",":first-child"),l=i.insert("circle"),c=i.insert("circle");return i.attr("class",t.class),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+a+s).attr("width",n.width+t.padding+s*2).attr("height",n.height+t.padding+s*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+a).attr("width",n.width+t.padding).attr("height",n.height+t.padding),x.info("DoubleCircle main"),k(t,l),t.intersect=function(o){return x.info("DoubleCircle intersect",t,n.width/2+a+s,o),m.circle(t,n.width/2+a+s,o)},e},jt=async(r,t)=>{let{shapeSvg:e,bbox:n}=await E(r,t,T(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:0,y:0},{x:a,y:0},{x:a,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],l=_(e,a,s,i);return l.attr("style",t.style),k(t,l),t.intersect=function(c){return m.polygon(t,i,c)},e},zt=(r,t)=>{let e=r.insert("g").attr("class","node default").attr("id",t.domId||t.id),n=e.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),k(t,n),t.intersect=function(a){return m.circle(t,7,a)},e},tt=(r,t,e)=>{let n=r.insert("g").attr("class","node default").attr("id",t.domId||t.id),a=70,s=10;e==="LR"&&(a=10,s=70);let i=n.append("rect").attr("x",-1*a/2).attr("y",-1*s/2).attr("width",a).attr("height",s).attr("class","fork-join");return k(t,i),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(l){return m.rect(t,l)},n},Zt=(r,t)=>{let e=r.insert("g").attr("class","node default").attr("id",t.domId||t.id),n=e.insert("circle",":first-child"),a=e.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),k(t,a),t.intersect=function(s){return m.circle(t,7,s)},e},Ft=(r,t)=>{let e=t.padding/2,n=4,a=8,s;t.classes?s="node "+t.classes:s="node default";let i=r.insert("g").attr("class",s).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),c=i.insert("line"),o=i.insert("line"),h=0,f=n,b=i.insert("g").attr("class","label"),p=0,d=t.classData.annotations&&t.classData.annotations[0],y=t.classData.annotations[0]?"\xAB"+t.classData.annotations[0]+"\xBB":"",g=b.node().appendChild(I(y,t.labelStyle,!0,!0)),u=g.getBBox();if(N(w().flowchart.htmlLabels)){let v=g.children[0],L=S(g);u=v.getBoundingClientRect(),L.attr("width",u.width),L.attr("height",u.height)}t.classData.annotations[0]&&(f+=u.height+n,h+=u.width);let H=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(w().flowchart.htmlLabels?H+="&lt;"+t.classData.type+"&gt;":H+="<"+t.classData.type+">");let R=b.node().appendChild(I(H,t.labelStyle,!0,!0));S(R).attr("class","classTitle");let M=R.getBBox();if(N(w().flowchart.htmlLabels)){let v=R.children[0],L=S(R);M=v.getBoundingClientRect(),L.attr("width",M.width),L.attr("height",M.height)}f+=M.height+n,M.width>h&&(h=M.width);let W=[];t.classData.members.forEach(v=>{let L=Q(v),X=L.displayText;w().flowchart.htmlLabels&&(X=X.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let $=b.node().appendChild(I(X,L.cssStyle?L.cssStyle:t.labelStyle,!0,!0)),C=$.getBBox();if(N(w().flowchart.htmlLabels)){let z=$.children[0],A=S($);C=z.getBoundingClientRect(),A.attr("width",C.width),A.attr("height",C.height)}C.width>h&&(h=C.width),f+=C.height+n,W.push($)}),f+=a;let J=[];if(t.classData.methods.forEach(v=>{let L=Q(v),X=L.displayText;w().flowchart.htmlLabels&&(X=X.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let $=b.node().appendChild(I(X,L.cssStyle?L.cssStyle:t.labelStyle,!0,!0)),C=$.getBBox();if(N(w().flowchart.htmlLabels)){let z=$.children[0],A=S($);C=z.getBoundingClientRect(),A.attr("width",C.width),A.attr("height",C.height)}C.width>h&&(h=C.width),f+=C.height+n,J.push($)}),f+=a,d){let v=(h-u.width)/2;S(g).attr("transform","translate( "+(-1*h/2+v)+", "+-1*f/2+")"),p=u.height+n}let it=(h-M.width)/2;return S(R).attr("transform","translate( "+(-1*h/2+it)+", "+(-1*f/2+p)+")"),p+=M.height+n,c.attr("class","divider").attr("x1",-h/2-e).attr("x2",h/2+e).attr("y1",-f/2-e+a+p).attr("y2",-f/2-e+a+p),p+=a,W.forEach(v=>{S(v).attr("transform","translate( "+-h/2+", "+(-1*f/2+p+a/2)+")");let L=v?.getBBox();p+=(L?.height??0)+n}),p+=a,o.attr("class","divider").attr("x1",-h/2-e).attr("x2",h/2+e).attr("y1",-f/2-e+a+p).attr("y2",-f/2-e+a+p),p+=a,J.forEach(v=>{S(v).attr("transform","translate( "+-h/2+", "+(-1*f/2+p)+")");let L=v?.getBBox();p+=(L?.height??0)+n}),l.attr("class","outer title-state").attr("x",-h/2-e).attr("y",-(f/2)-e).attr("width",h+t.padding).attr("height",f+t.padding),k(t,l),t.intersect=function(v){return m.rect(t,v)},i},rt={rhombus:P,question:P,rect:Xt,labelRect:Yt,rectWithTitle:Ut,choice:Ct,circle:Dt,doublecircle:Ot,stadium:At,hexagon:Tt,rect_left_inv_arrow:Rt,lean_right:It,lean_left:Ht,trapezoid:Nt,inv_trapezoid:$t,rect_right_inv_arrow:_t,cylinder:Wt,start:zt,end:Zt,note:Mt,subroutine:jt,fork:tt,join:tt,class_box:Ft},U={},tr=async(r,t,e)=>{let n,a;if(t.link){let s;w().securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),n=r.insert("svg:a").attr("xlink:href",t.link).attr("target",s),a=await rt[t.shape](n,t,e)}else a=await rt[t.shape](r,t,e),n=a;return t.tooltip&&a.attr("title",t.tooltip),t.class&&a.attr("class","node default "+t.class),U[t.id]=n,t.haveCallback&&U[t.id].attr("class",U[t.id].attr("class")+" clickable"),n},rr=(r,t)=>{U[t.id]=r},ar=()=>{U={}},er=r=>{let t=U[r.id];x.trace("Transforming node",r.diff,r,"translate("+(r.x-r.width/2-5)+", "+r.width/2+")");let e=8,n=r.diff||0;return r.clusterNode?t.attr("transform","translate("+(r.x+n-r.width/2)+", "+(r.y-r.height/2-e)+")"):t.attr("transform","translate("+r.x+", "+r.y+")"),n},j={},B={},sr=()=>{j={},B={}},ir=(r,t)=>{let e=N(w().flowchart.htmlLabels),n=t.labelType==="markdown"?F(r,t.label,{style:t.labelStyle,useHtmlLabels:e,addSvgBackground:!0}):I(t.label,t.labelStyle);x.info("abc82",t,t.labelType);let a=r.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(n);let i=n.getBBox();if(e){let c=n.children[0],o=S(n);i=c.getBoundingClientRect(),o.attr("width",i.width),o.attr("height",i.height)}s.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),j[t.id]=a,t.width=i.width,t.height=i.height;let l;if(t.startLabelLeft){let c=I(t.startLabelLeft,t.labelStyle),o=r.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");l=h.node().appendChild(c);let f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),B[t.id]||(B[t.id]={}),B[t.id].startLeft=o,O(l,t.startLabelLeft)}if(t.startLabelRight){let c=I(t.startLabelRight,t.labelStyle),o=r.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");l=o.node().appendChild(c),h.node().appendChild(c);let f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),B[t.id]||(B[t.id]={}),B[t.id].startRight=o,O(l,t.startLabelRight)}if(t.endLabelLeft){let c=I(t.endLabelLeft,t.labelStyle),o=r.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");l=h.node().appendChild(c);let f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),o.node().appendChild(c),B[t.id]||(B[t.id]={}),B[t.id].endLeft=o,O(l,t.endLabelLeft)}if(t.endLabelRight){let c=I(t.endLabelRight,t.labelStyle),o=r.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");l=h.node().appendChild(c);let f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),o.node().appendChild(c),B[t.id]||(B[t.id]={}),B[t.id].endRight=o,O(l,t.endLabelRight)}return n};function O(r,t){w().flowchart.htmlLabels&&r&&(r.style.width=t.length*9+"px",r.style.height="12px")}var nr=(r,t)=>{x.info("Moving label abc78 ",r.id,r.label,j[r.id]);let e=t.updatedPath?t.updatedPath:t.originalPath;if(r.label){let n=j[r.id],a=r.x,s=r.y;if(e){let i=Y.calcLabelPosition(e);x.info("Moving label "+r.label+" from (",a,",",s,") to (",i.x,",",i.y,") abc78"),t.updatedPath&&(a=i.x,s=i.y)}n.attr("transform","translate("+a+", "+s+")")}if(r.startLabelLeft){let n=B[r.id].startLeft,a=r.x,s=r.y;if(e){let i=Y.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",e);a=i.x,s=i.y}n.attr("transform","translate("+a+", "+s+")")}if(r.startLabelRight){let n=B[r.id].startRight,a=r.x,s=r.y;if(e){let i=Y.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",e);a=i.x,s=i.y}n.attr("transform","translate("+a+", "+s+")")}if(r.endLabelLeft){let n=B[r.id].endLeft,a=r.x,s=r.y;if(e){let i=Y.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",e);a=i.x,s=i.y}n.attr("transform","translate("+a+", "+s+")")}if(r.endLabelRight){let n=B[r.id].endRight,a=r.x,s=r.y;if(e){let i=Y.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",e);a=i.x,s=i.y}n.attr("transform","translate("+a+", "+s+")")}},Qt=(r,t)=>{let e=r.x,n=r.y,a=Math.abs(t.x-e),s=Math.abs(t.y-n),i=r.width/2,l=r.height/2;return a>=i||s>=l},Vt=(r,t,e)=>{x.warn(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(t)}
  insidePoint : ${JSON.stringify(e)}
  node        : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);let n=r.x,a=r.y,s=Math.abs(n-e.x),i=r.width/2,l=e.x<t.x?i-s:i+s,c=r.height/2,o=Math.abs(t.y-e.y),h=Math.abs(t.x-e.x);if(Math.abs(a-t.y)*i>Math.abs(n-t.x)*c){let f=e.y<t.y?t.y-c-a:a-c-t.y;l=h*f/o;let b={x:e.x<t.x?e.x+l:e.x-h+l,y:e.y<t.y?e.y+o-f:e.y-o+f};return l===0&&(b.x=t.x,b.y=t.y),h===0&&(b.x=t.x),o===0&&(b.y=t.y),x.warn(`abc89 topp/bott calc, Q ${o}, q ${f}, R ${h}, r ${l}`,b),b}else{e.x<t.x?l=t.x-i-n:l=n-i-t.x;let f=o*l/h,b=e.x<t.x?e.x+h-l:e.x-h+l,p=e.y<t.y?e.y+f:e.y-f;return x.warn(`sides calc abc89, Q ${o}, q ${f}, R ${h}, r ${l}`,{_x:b,_y:p}),l===0&&(b=t.x,p=t.y),h===0&&(b=t.x),o===0&&(p=t.y),{x:b,y:p}}},at=(r,t)=>{x.warn("abc88 cutPathAtIntersect",r,t);let e=[],n=r[0],a=!1;return r.forEach(s=>{if(x.info("abc88 checking point",s,t),!Qt(t,s)&&!a){let i=Vt(t,n,s);x.warn("abc88 inside",s,n,i),x.warn("abc88 intersection",i);let l=!1;e.forEach(c=>{l=l||c.x===i.x&&c.y===i.y}),e.some(c=>c.x===i.x&&c.y===i.y)?x.warn("abc88 no intersect",i,e):e.push(i),a=!0}else x.warn("abc88 outside",s,n),n=s,a||e.push(s)}),x.warn("abc88 returning points",e),e},lr=function(r,t,e,n,a,s){let i=e.points,l=!1,c=s.node(t.v);var o=s.node(t.w);x.info("abc88 InsertEdge: ",e),o.intersect&&c.intersect&&(i=i.slice(1,e.points.length-1),i.unshift(c.intersect(i[0])),x.info("Last point",i[i.length-1],o,o.intersect(i[i.length-1])),i.push(o.intersect(i[i.length-1]))),e.toCluster&&(x.info("to cluster abc88",n[e.toCluster]),i=at(e.points,n[e.toCluster].node),l=!0),e.fromCluster&&(x.info("from cluster abc88",n[e.fromCluster]),i=at(i.reverse(),n[e.fromCluster].node).reverse(),l=!0);let h=i.filter(u=>!Number.isNaN(u.y)),f;a==="graph"||a==="flowchart"?f=e.curve||Z:f=Z;let b=q().x(function(u){return u.x}).y(function(u){return u.y}).curve(f),p;switch(e.thickness){case"normal":p="edge-thickness-normal";break;case"thick":p="edge-thickness-thick";break;case"invisible":p="edge-thickness-thick";break;default:p=""}switch(e.pattern){case"solid":p+=" edge-pattern-solid";break;case"dotted":p+=" edge-pattern-dotted";break;case"dashed":p+=" edge-pattern-dashed";break}let d=r.append("path").attr("d",b(h)).attr("id",e.id).attr("class"," "+p+(e.classes?" "+e.classes:"")).attr("style",e.style),y="";switch((w().flowchart.arrowMarkerAbsolute||w().state.arrowMarkerAbsolute)&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),x.info("arrowTypeStart",e.arrowTypeStart),x.info("arrowTypeEnd",e.arrowTypeEnd),e.arrowTypeStart){case"arrow_cross":d.attr("marker-start","url("+y+"#"+a+"-crossStart)");break;case"arrow_point":d.attr("marker-start","url("+y+"#"+a+"-pointStart)");break;case"arrow_barb":d.attr("marker-start","url("+y+"#"+a+"-barbStart)");break;case"arrow_circle":d.attr("marker-start","url("+y+"#"+a+"-circleStart)");break;case"aggregation":d.attr("marker-start","url("+y+"#"+a+"-aggregationStart)");break;case"extension":d.attr("marker-start","url("+y+"#"+a+"-extensionStart)");break;case"composition":d.attr("marker-start","url("+y+"#"+a+"-compositionStart)");break;case"dependency":d.attr("marker-start","url("+y+"#"+a+"-dependencyStart)");break;case"lollipop":d.attr("marker-start","url("+y+"#"+a+"-lollipopStart)");break}switch(e.arrowTypeEnd){case"arrow_cross":d.attr("marker-end","url("+y+"#"+a+"-crossEnd)");break;case"arrow_point":d.attr("marker-end","url("+y+"#"+a+"-pointEnd)");break;case"arrow_barb":d.attr("marker-end","url("+y+"#"+a+"-barbEnd)");break;case"arrow_circle":d.attr("marker-end","url("+y+"#"+a+"-circleEnd)");break;case"aggregation":d.attr("marker-end","url("+y+"#"+a+"-aggregationEnd)");break;case"extension":d.attr("marker-end","url("+y+"#"+a+"-extensionEnd)");break;case"composition":d.attr("marker-end","url("+y+"#"+a+"-compositionEnd)");break;case"dependency":d.attr("marker-end","url("+y+"#"+a+"-dependencyEnd)");break;case"lollipop":d.attr("marker-end","url("+y+"#"+a+"-lollipopEnd)");break}let g={};return l&&(g.updatedPath=i),g.originalPath=e.points,g};export{Pt as a,I as b,E as c,k as d,Bt as e,tr as f,rr as g,ar as h,er as i,sr as j,ir as k,nr as l,lr as m};
//# sourceMappingURL=chunk-TCQ7DWI4.min.js.map
