Packages
livebook
0.14.7
0.19.8
0.19.7
0.19.6
0.19.5
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.3
0.17.2
0.17.1
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.5
0.15.4
0.15.3
0.15.2
0.15.1
0.15.0
0.14.7
0.14.6
0.14.5
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.14.0-rc.1
0.14.0-rc.0
0.13.3
0.13.2
0.13.1
0.13.0
0.12.1
0.12.0
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.0
0.9.3
0.9.2
0.9.1
0.9.0
0.8.2
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
Automate code & data workflows with interactive notebooks
Current section
Files
Jump to
Current section
Files
static/assets/chunk-I6TWXA3O.js
import{c as St}from"./chunk-SIKTVSAC.js";import{a as rs,b as Vs}from"./chunk-QMNP6MOC.js";import{d as Et}from"./chunk-QY4OGOKK.js";import{m as ft,o as es}from"./chunk-NQ4DUWMN.js";import{Ea as Qs,H as qs,I as et,Ia as Us,K as Gs,M as Zs,N as Fs,Z as V,h as S,ha as K,j as X}from"./chunk-ZOEWSKT6.js";import{a as tt,b as rt}from"./chunk-MGYUK2XN.js";function is(n,t,e){if(n&&n.length){let[r,a]=t,i=Math.PI/180*e,h=Math.cos(i),s=Math.sin(i);for(let c of n){let[l,o]=c;c[0]=(l-r)*h-(o-a)*s+r,c[1]=(l-r)*s+(o-a)*h+a}}}function Ta(n,t){return n[0]===t[0]&&n[1]===t[1]}function Oa(n,t,e,r=1){let a=e,i=Math.max(t,.1),h=n[0]&&n[0][0]&&typeof n[0][0]=="number"?[n]:n,s=[0,0];if(a)for(let l of h)is(l,s,a);let c=function(l,o,p){let g=[];for(let d of l){let w=[...d];Ta(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&g.push(w)}let f=[];o=Math.max(o,.1);let y=[];for(let d of g)for(let w=0;w<d.length-1;w++){let k=d[w],m=d[w+1];if(k[1]!==m[1]){let v=Math.min(k[1],m[1]);y.push({ymin:v,ymax:Math.max(k[1],m[1]),x:v===k[1]?k[0]:m[0],islope:(m[0]-k[0])/(m[1]-k[1])})}}if(y.sort((d,w)=>d.ymin<w.ymin?-1:d.ymin>w.ymin?1:d.x<w.x?-1:d.x>w.x?1:d.ymax===w.ymax?0:(d.ymax-w.ymax)/Math.abs(d.ymax-w.ymax)),!y.length)return f;let u=[],b=y[0].ymin,x=0;for(;u.length||y.length;){if(y.length){let d=-1;for(let w=0;w<y.length&&!(y[w].ymin>b);w++)d=w;y.splice(0,d+1).forEach(w=>{u.push({s:b,edge:w})})}if(u=u.filter(d=>!(d.edge.ymax<=b)),u.sort((d,w)=>d.edge.x===w.edge.x?0:(d.edge.x-w.edge.x)/Math.abs(d.edge.x-w.edge.x)),(p!==1||x%o==0)&&u.length>1)for(let d=0;d<u.length;d+=2){let w=d+1;if(w>=u.length)break;let k=u[d].edge,m=u[w].edge;f.push([[Math.round(k.x),b],[Math.round(m.x),b]])}b+=p,u.forEach(d=>{d.edge.x=d.edge.x+p*d.edge.islope}),x++}return f}(h,i,r);if(a){for(let l of h)is(l,s,-a);(function(l,o,p){let g=[];l.forEach(f=>g.push(...f)),is(g,o,p)})(c,s,-a)}return c}function Pt(n,t){var e;let r=t.hachureAngle+90,a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.round(Math.max(a,.1));let i=1;return t.roughness>=1&&(((e=t.randomizer)===null||e===void 0?void 0:e.next())||Math.random())>.7&&(i=a),Oa(n,a,r,i||1)}var $t=class{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){let r=Pt(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){let r=[];for(let a of t)r.push(...this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],e));return r}};function Xt(n){let t=n[0],e=n[1];return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}var hs=class extends $t{fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);let a=Pt(t,Object.assign({},e,{hachureGap:r})),i=Math.PI/180*e.hachureAngle,h=[],s=.5*r*Math.cos(i),c=.5*r*Math.sin(i);for(let[l,o]of a)Xt([l,o])&&h.push([[l[0]-s,l[1]+c],[...o]],[[l[0]+s,l[1]-c],[...o]]);return{type:"fillSketch",ops:this.renderLines(h,e)}}},ps=class extends $t{fillPolygons(t,e){let r=this._fillPolygons(t,e),a=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),i=this._fillPolygons(t,a);return r.ops=r.ops.concat(i.ops),r}},gs=class{constructor(t){this.helper=t}fillPolygons(t,e){let r=Pt(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){let r=[],a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.max(a,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);let h=a/4;for(let s of t){let c=Xt(s),l=c/a,o=Math.ceil(l)-1,p=c-o*a,g=(s[0][0]+s[1][0])/2-a/4,f=Math.min(s[0][1],s[1][1]);for(let y=0;y<o;y++){let u=f+p+y*a,b=g-h+2*Math.random()*h,x=u-h+2*Math.random()*h,d=this.helper.ellipse(b,x,i,i,e);r.push(...d.ops)}}return{type:"fillSketch",ops:r}}},fs=class{constructor(t){this.helper=t}fillPolygons(t,e){let r=Pt(t,e);return{type:"fillSketch",ops:this.dashedLine(r,e)}}dashedLine(t,e){let r=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,a=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,i=[];return t.forEach(h=>{let s=Xt(h),c=Math.floor(s/(r+a)),l=(s+a-c*(r+a))/2,o=h[0],p=h[1];o[0]>p[0]&&(o=h[1],p=h[0]);let g=Math.atan((p[1]-o[1])/(p[0]-o[0]));for(let f=0;f<c;f++){let y=f*(r+a),u=y+r,b=[o[0]+y*Math.cos(g)+l*Math.cos(g),o[1]+y*Math.sin(g)+l*Math.sin(g)],x=[o[0]+u*Math.cos(g)+l*Math.cos(g),o[1]+u*Math.sin(g)+l*Math.sin(g)];i.push(...this.helper.doubleLineOps(b[0],b[1],x[0],x[1],e))}}),i}},ys=class{constructor(t){this.helper=t}fillPolygons(t,e){let r=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,a=e.zigzagOffset<0?r:e.zigzagOffset,i=Pt(t,e=Object.assign({},e,{hachureGap:r+a}));return{type:"fillSketch",ops:this.zigzagLines(i,a,e)}}zigzagLines(t,e,r){let a=[];return t.forEach(i=>{let h=Xt(i),s=Math.round(h/(2*e)),c=i[0],l=i[1];c[0]>l[0]&&(c=i[1],l=i[0]);let o=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let p=0;p<s;p++){let g=2*p*e,f=2*(p+1)*e,y=Math.sqrt(2*Math.pow(e,2)),u=[c[0]+g*Math.cos(o),c[1]+g*Math.sin(o)],b=[c[0]+f*Math.cos(o),c[1]+f*Math.sin(o)],x=[u[0]+y*Math.cos(o+Math.PI/4),u[1]+y*Math.sin(o+Math.PI/4)];a.push(...this.helper.doubleLineOps(u[0],u[1],x[0],x[1],r),...this.helper.doubleLineOps(x[0],x[1],b[0],b[1],r))}}),a}},st={},us=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},_a=0,ls=1,Js=2,Wt={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function ns(n,t){return n.type===t}function ks(n){let t=[],e=function(h){let s=new Array;for(;h!=="";)if(h.match(/^([ \t\r\n,]+)/))h=h.substr(RegExp.$1.length);else if(h.match(/^([aAcChHlLmMqQsStTvVzZ])/))s[s.length]={type:_a,text:RegExp.$1},h=h.substr(RegExp.$1.length);else{if(!h.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];s[s.length]={type:ls,text:`${parseFloat(RegExp.$1)}`},h=h.substr(RegExp.$1.length)}return s[s.length]={type:Js,text:""},s}(n),r="BOD",a=0,i=e[a];for(;!ns(i,Js);){let h=0,s=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return ks("M0,0"+n);a++,h=Wt[i.text],r=i.text}else ns(i,ls)?h=Wt[r]:(a++,h=Wt[i.text],r=i.text);if(!(a+h<e.length))throw new Error("Path data ended short");for(let c=a;c<a+h;c++){let l=e[c];if(!ns(l,ls))throw new Error("Param not a number: "+r+","+l.text);s[s.length]=+l.text}if(typeof Wt[r]!="number")throw new Error("Bad segment: "+r);{let c={key:r,data:s};t.push(c),a+=h,i=e[a],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function la(n){let t=0,e=0,r=0,a=0,i=[];for(let{key:h,data:s}of n)switch(h){case"M":i.push({key:"M",data:[...s]}),[t,e]=s,[r,a]=s;break;case"m":t+=s[0],e+=s[1],i.push({key:"M",data:[t,e]}),r=t,a=e;break;case"L":i.push({key:"L",data:[...s]}),[t,e]=s;break;case"l":t+=s[0],e+=s[1],i.push({key:"L",data:[t,e]});break;case"C":i.push({key:"C",data:[...s]}),t=s[4],e=s[5];break;case"c":{let c=s.map((l,o)=>o%2?l+e:l+t);i.push({key:"C",data:c}),t=c[4],e=c[5];break}case"Q":i.push({key:"Q",data:[...s]}),t=s[2],e=s[3];break;case"q":{let c=s.map((l,o)=>o%2?l+e:l+t);i.push({key:"Q",data:c}),t=c[2],e=c[3];break}case"A":i.push({key:"A",data:[...s]}),t=s[5],e=s[6];break;case"a":t+=s[5],e+=s[6],i.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,e]});break;case"H":i.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...s]}),e=s[0];break;case"v":e+=s[0],i.push({key:"V",data:[e]});break;case"S":i.push({key:"S",data:[...s]}),t=s[2],e=s[3];break;case"s":{let c=s.map((l,o)=>o%2?l+e:l+t);i.push({key:"S",data:c}),t=c[2],e=c[3];break}case"T":i.push({key:"T",data:[...s]}),t=s[0],e=s[1];break;case"t":t+=s[0],e+=s[1],i.push({key:"T",data:[t,e]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,e=a}return i}function na(n){let t=[],e="",r=0,a=0,i=0,h=0,s=0,c=0;for(let{key:l,data:o}of n){switch(l){case"M":t.push({key:"M",data:[...o]}),[r,a]=o,[i,h]=o;break;case"C":t.push({key:"C",data:[...o]}),r=o[4],a=o[5],s=o[2],c=o[3];break;case"L":t.push({key:"L",data:[...o]}),[r,a]=o;break;case"H":r=o[0],t.push({key:"L",data:[r,a]});break;case"V":a=o[0],t.push({key:"L",data:[r,a]});break;case"S":{let p=0,g=0;e==="C"||e==="S"?(p=r+(r-s),g=a+(a-c)):(p=r,g=a),t.push({key:"C",data:[p,g,...o]}),s=o[0],c=o[1],r=o[2],a=o[3];break}case"T":{let[p,g]=o,f=0,y=0;e==="Q"||e==="T"?(f=r+(r-s),y=a+(a-c)):(f=r,y=a);let u=r+2*(f-r)/3,b=a+2*(y-a)/3,x=p+2*(f-p)/3,d=g+2*(y-g)/3;t.push({key:"C",data:[u,b,x,d,p,g]}),s=f,c=y,r=p,a=g;break}case"Q":{let[p,g,f,y]=o,u=r+2*(p-r)/3,b=a+2*(g-a)/3,x=f+2*(p-f)/3,d=y+2*(g-y)/3;t.push({key:"C",data:[u,b,x,d,f,y]}),s=p,c=g,r=f,a=y;break}case"A":{let p=Math.abs(o[0]),g=Math.abs(o[1]),f=o[2],y=o[3],u=o[4],b=o[5],x=o[6];p===0||g===0?(t.push({key:"C",data:[r,a,b,x,b,x]}),r=b,a=x):(r!==b||a!==x)&&(ca(r,a,b,x,p,g,f,y,u).forEach(function(d){t.push({key:"C",data:d})}),r=b,a=x);break}case"Z":t.push({key:"Z",data:[]}),r=i,a=h}e=l}return t}function vt(n,t,e){return[n*Math.cos(e)-t*Math.sin(e),n*Math.sin(e)+t*Math.cos(e)]}function ca(n,t,e,r,a,i,h,s,c,l){let o=(p=h,Math.PI*p/180);var p;let g=[],f=0,y=0,u=0,b=0;if(l)[f,y,u,b]=l;else{[n,t]=vt(n,t,-o),[e,r]=vt(e,r,-o);let H=(n-e)/2,z=(t-r)/2,O=H*H/(a*a)+z*z/(i*i);O>1&&(O=Math.sqrt(O),a*=O,i*=O);let R=a*a,E=i*i,j=R*E-R*z*z-E*H*H,B=R*z*z+E*H*H,I=(s===c?-1:1)*Math.sqrt(Math.abs(j/B));u=I*a*z/i+(n+e)/2,b=I*-i*H/a+(t+r)/2,f=Math.asin(parseFloat(((t-b)/i).toFixed(9))),y=Math.asin(parseFloat(((r-b)/i).toFixed(9))),n<u&&(f=Math.PI-f),e<u&&(y=Math.PI-y),f<0&&(f=2*Math.PI+f),y<0&&(y=2*Math.PI+y),c&&f>y&&(f-=2*Math.PI),!c&&y>f&&(y-=2*Math.PI)}let x=y-f;if(Math.abs(x)>120*Math.PI/180){let H=y,z=e,O=r;y=c&&y>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,g=ca(e=u+a*Math.cos(y),r=b+i*Math.sin(y),z,O,a,i,h,0,c,[y,H,u,b])}x=y-f;let d=Math.cos(f),w=Math.sin(f),k=Math.cos(y),m=Math.sin(y),v=Math.tan(x/4),M=4/3*a*v,$=4/3*i*v,D=[n,t],L=[n+M*w,t-$*d],C=[e+M*m,r-$*k],Z=[e,r];if(L[0]=2*D[0]-L[0],L[1]=2*D[1]-L[1],l)return[L,C,Z].concat(g);{g=[L,C,Z].concat(g);let H=[];for(let z=0;z<g.length;z+=3){let O=vt(g[z][0],g[z][1],o),R=vt(g[z+1][0],g[z+1][1],o),E=vt(g[z+2][0],g[z+2][1],o);H.push([O[0],O[1],R[0],R[1],E[0],E[1]])}return H}}var Ha={randOffset:function(n,t){return _(n,t)},randOffsetWithRange:function(n,t,e){return It(n,t,e)},ellipse:function(n,t,e,r,a){let i=ha(e,r,a);return xs(n,t,a,i).opset},doubleLineOps:function(n,t,e,r,a){return ot(n,t,e,r,a,!0)}};function oa(n,t,e,r,a){return{type:"path",ops:ot(n,t,e,r,a)}}function _t(n,t,e){let r=(n||[]).length;if(r>2){let a=[];for(let i=0;i<r-1;i++)a.push(...ot(n[i][0],n[i][1],n[i+1][0],n[i+1][1],e));return t&&a.push(...ot(n[r-1][0],n[r-1][1],n[0][0],n[0][1],e)),{type:"path",ops:a}}return r===2?oa(n[0][0],n[0][1],n[1][0],n[1][1],e):{type:"path",ops:[]}}function Ia(n,t,e,r,a){return function(i,h){return _t(i,!0,h)}([[n,t],[n+e,t],[n+e,t+r],[n,t+r]],a)}function Ks(n,t){if(n.length){let e=typeof n[0][0]=="number"?[n]:n,r=Tt(e[0],1*(1+.2*t.roughness),t),a=t.disableMultiStroke?[]:Tt(e[0],1.5*(1+.22*t.roughness),aa(t));for(let i=1;i<e.length;i++){let h=e[i];if(h.length){let s=Tt(h,1*(1+.2*t.roughness),t),c=t.disableMultiStroke?[]:Tt(h,1.5*(1+.22*t.roughness),aa(t));for(let l of s)l.op!=="move"&&r.push(l);for(let l of c)l.op!=="move"&&a.push(l)}}return{type:"path",ops:r.concat(a)}}return{type:"path",ops:[]}}function ha(n,t,e){let r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(n/2,2)+Math.pow(t/2,2))/2)),a=Math.ceil(Math.max(e.curveStepCount,e.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/a,h=Math.abs(n/2),s=Math.abs(t/2),c=1-e.curveFitting;return h+=_(h*c,e),s+=_(s*c,e),{increment:i,rx:h,ry:s}}function xs(n,t,e,r){let[a,i]=ra(r.increment,n,t,r.rx,r.ry,1,r.increment*It(.1,It(.4,1,e),e),e),h=zt(a,null,e);if(!e.disableMultiStroke&&e.roughness!==0){let[s]=ra(r.increment,n,t,r.rx,r.ry,1.5,0,e),c=zt(s,null,e);h=h.concat(c)}return{estimatedPoints:i,opset:{type:"path",ops:h}}}function ta(n,t,e,r,a,i,h,s,c){let l=n,o=t,p=Math.abs(e/2),g=Math.abs(r/2);p+=_(.01*p,c),g+=_(.01*g,c);let f=a,y=i;for(;f<0;)f+=2*Math.PI,y+=2*Math.PI;y-f>2*Math.PI&&(f=0,y=2*Math.PI);let u=2*Math.PI/c.curveStepCount,b=Math.min(u/2,(y-f)/2),x=ea(b,l,o,p,g,f,y,1,c);if(!c.disableMultiStroke){let d=ea(b,l,o,p,g,f,y,1.5,c);x.push(...d)}return h&&(s?x.push(...ot(l,o,l+p*Math.cos(f),o+g*Math.sin(f),c),...ot(l,o,l+p*Math.cos(y),o+g*Math.sin(y),c)):x.push({op:"lineTo",data:[l,o]},{op:"lineTo",data:[l+p*Math.cos(f),o+g*Math.sin(f)]})),{type:"path",ops:x}}function sa(n,t){let e=na(la(ks(n))),r=[],a=[0,0],i=[0,0];for(let{key:h,data:s}of e)switch(h){case"M":i=[s[0],s[1]],a=[s[0],s[1]];break;case"L":r.push(...ot(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]];break;case"C":{let[c,l,o,p,g,f]=s;r.push(...za(c,l,o,p,g,f,i,t)),i=[g,f];break}case"Z":r.push(...ot(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]]}return{type:"path",ops:r}}function cs(n,t){let e=[];for(let r of n)if(r.length){let a=t.maxRandomnessOffset||0,i=r.length;if(i>2){e.push({op:"move",data:[r[0][0]+_(a,t),r[0][1]+_(a,t)]});for(let h=1;h<i;h++)e.push({op:"lineTo",data:[r[h][0]+_(a,t),r[h][1]+_(a,t)]})}}return{type:"fillPath",ops:e}}function yt(n,t){return function(e,r){let a=e.fillStyle||"hachure";if(!st[a])switch(a){case"zigzag":st[a]||(st[a]=new hs(r));break;case"cross-hatch":st[a]||(st[a]=new ps(r));break;case"dots":st[a]||(st[a]=new gs(r));break;case"dashed":st[a]||(st[a]=new fs(r));break;case"zigzag-line":st[a]||(st[a]=new ys(r));break;default:a="hachure",st[a]||(st[a]=new $t(r))}return st[a]}(t,Ha).fillPolygons(n,t)}function aa(n){let t=Object.assign({},n);return t.randomizer=void 0,n.seed&&(t.seed=n.seed+1),t}function pa(n){return n.randomizer||(n.randomizer=new us(n.seed||0)),n.randomizer.next()}function It(n,t,e,r=1){return e.roughness*r*(pa(e)*(t-n)+n)}function _(n,t,e=1){return It(-n,n,t,e)}function ot(n,t,e,r,a,i=!1){let h=i?a.disableMultiStrokeFill:a.disableMultiStroke,s=bs(n,t,e,r,a,!0,!1);if(h)return s;let c=bs(n,t,e,r,a,!0,!0);return s.concat(c)}function bs(n,t,e,r,a,i,h){let s=Math.pow(n-e,2)+Math.pow(t-r,2),c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let o=a.maxRandomnessOffset||0;o*o*100>s&&(o=c/10);let p=o/2,g=.2+.2*pa(a),f=a.bowing*a.maxRandomnessOffset*(r-t)/200,y=a.bowing*a.maxRandomnessOffset*(n-e)/200;f=_(f,a,l),y=_(y,a,l);let u=[],b=()=>_(p,a,l),x=()=>_(o,a,l),d=a.preserveVertices;return i&&(h?u.push({op:"move",data:[n+(d?0:b()),t+(d?0:b())]}):u.push({op:"move",data:[n+(d?0:_(o,a,l)),t+(d?0:_(o,a,l))]})),h?u.push({op:"bcurveTo",data:[f+n+(e-n)*g+b(),y+t+(r-t)*g+b(),f+n+2*(e-n)*g+b(),y+t+2*(r-t)*g+b(),e+(d?0:b()),r+(d?0:b())]}):u.push({op:"bcurveTo",data:[f+n+(e-n)*g+x(),y+t+(r-t)*g+x(),f+n+2*(e-n)*g+x(),y+t+2*(r-t)*g+x(),e+(d?0:x()),r+(d?0:x())]}),u}function Tt(n,t,e){if(!n.length)return[];let r=[];r.push([n[0][0]+_(t,e),n[0][1]+_(t,e)]),r.push([n[0][0]+_(t,e),n[0][1]+_(t,e)]);for(let a=1;a<n.length;a++)r.push([n[a][0]+_(t,e),n[a][1]+_(t,e)]),a===n.length-1&&r.push([n[a][0]+_(t,e),n[a][1]+_(t,e)]);return zt(r,null,e)}function zt(n,t,e){let r=n.length,a=[];if(r>3){let i=[],h=1-e.curveTightness;a.push({op:"move",data:[n[1][0],n[1][1]]});for(let s=1;s+2<r;s++){let c=n[s];i[0]=[c[0],c[1]],i[1]=[c[0]+(h*n[s+1][0]-h*n[s-1][0])/6,c[1]+(h*n[s+1][1]-h*n[s-1][1])/6],i[2]=[n[s+1][0]+(h*n[s][0]-h*n[s+2][0])/6,n[s+1][1]+(h*n[s][1]-h*n[s+2][1])/6],i[3]=[n[s+1][0],n[s+1][1]],a.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&t.length===2){let s=e.maxRandomnessOffset;a.push({op:"lineTo",data:[t[0]+_(s,e),t[1]+_(s,e)]})}}else r===3?(a.push({op:"move",data:[n[1][0],n[1][1]]}),a.push({op:"bcurveTo",data:[n[1][0],n[1][1],n[2][0],n[2][1],n[2][0],n[2][1]]})):r===2&&a.push(...bs(n[0][0],n[0][1],n[1][0],n[1][1],e,!0,!0));return a}function ra(n,t,e,r,a,i,h,s){let c=[],l=[];if(s.roughness===0){n/=4,l.push([t+r*Math.cos(-n),e+a*Math.sin(-n)]);for(let o=0;o<=2*Math.PI;o+=n){let p=[t+r*Math.cos(o),e+a*Math.sin(o)];c.push(p),l.push(p)}l.push([t+r*Math.cos(0),e+a*Math.sin(0)]),l.push([t+r*Math.cos(n),e+a*Math.sin(n)])}else{let o=_(.5,s)-Math.PI/2;l.push([_(i,s)+t+.9*r*Math.cos(o-n),_(i,s)+e+.9*a*Math.sin(o-n)]);let p=2*Math.PI+o-.01;for(let g=o;g<p;g+=n){let f=[_(i,s)+t+r*Math.cos(g),_(i,s)+e+a*Math.sin(g)];c.push(f),l.push(f)}l.push([_(i,s)+t+r*Math.cos(o+2*Math.PI+.5*h),_(i,s)+e+a*Math.sin(o+2*Math.PI+.5*h)]),l.push([_(i,s)+t+.98*r*Math.cos(o+h),_(i,s)+e+.98*a*Math.sin(o+h)]),l.push([_(i,s)+t+.9*r*Math.cos(o+.5*h),_(i,s)+e+.9*a*Math.sin(o+.5*h)])}return[l,c]}function ea(n,t,e,r,a,i,h,s,c){let l=i+_(.1,c),o=[];o.push([_(s,c)+t+.9*r*Math.cos(l-n),_(s,c)+e+.9*a*Math.sin(l-n)]);for(let p=l;p<=h;p+=n)o.push([_(s,c)+t+r*Math.cos(p),_(s,c)+e+a*Math.sin(p)]);return o.push([t+r*Math.cos(h),e+a*Math.sin(h)]),o.push([t+r*Math.cos(h),e+a*Math.sin(h)]),zt(o,null,c)}function za(n,t,e,r,a,i,h,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],o=[0,0],p=s.disableMultiStroke?1:2,g=s.preserveVertices;for(let f=0;f<p;f++)f===0?c.push({op:"move",data:[h[0],h[1]]}):c.push({op:"move",data:[h[0]+(g?0:_(l[0],s)),h[1]+(g?0:_(l[0],s))]}),o=g?[a,i]:[a+_(l[f],s),i+_(l[f],s)],c.push({op:"bcurveTo",data:[n+_(l[f],s),t+_(l[f],s),e+_(l[f],s),r+_(l[f],s),o[0],o[1]]});return c}function Mt(n){return[...n]}function ia(n,t=0){let e=n.length;if(e<3)throw new Error("A curve must have at least three points.");let r=[];if(e===3)r.push(Mt(n[0]),Mt(n[1]),Mt(n[2]),Mt(n[2]));else{let a=[];a.push(n[0],n[0]);for(let s=1;s<n.length;s++)a.push(n[s]),s===n.length-1&&a.push(n[s]);let i=[],h=1-t;r.push(Mt(a[0]));for(let s=1;s+2<a.length;s++){let c=a[s];i[0]=[c[0],c[1]],i[1]=[c[0]+(h*a[s+1][0]-h*a[s-1][0])/6,c[1]+(h*a[s+1][1]-h*a[s-1][1])/6],i[2]=[a[s+1][0]+(h*a[s][0]-h*a[s+2][0])/6,a[s+1][1]+(h*a[s][1]-h*a[s+2][1])/6],i[3]=[a[s+1][0],a[s+1][1]],r.push(i[1],i[2],i[3])}}return r}function Ht(n,t){return Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)}function ja(n,t,e){let r=Ht(t,e);if(r===0)return Ht(n,t);let a=((n[0]-t[0])*(e[0]-t[0])+(n[1]-t[1])*(e[1]-t[1]))/r;return a=Math.max(0,Math.min(1,a)),Ht(n,pt(t,e,a))}function pt(n,t,e){return[n[0]+(t[0]-n[0])*e,n[1]+(t[1]-n[1])*e]}function ds(n,t,e,r){let a=r||[];if(function(s,c){let l=s[c+0],o=s[c+1],p=s[c+2],g=s[c+3],f=3*o[0]-2*l[0]-g[0];f*=f;let y=3*o[1]-2*l[1]-g[1];y*=y;let u=3*p[0]-2*g[0]-l[0];u*=u;let b=3*p[1]-2*g[1]-l[1];return b*=b,f<u&&(f=u),y<b&&(y=b),f+y}(n,t)<e){let s=n[t+0];a.length?(i=a[a.length-1],h=s,Math.sqrt(Ht(i,h))>1&&a.push(s)):a.push(s),a.push(n[t+3])}else{let c=n[t+0],l=n[t+1],o=n[t+2],p=n[t+3],g=pt(c,l,.5),f=pt(l,o,.5),y=pt(o,p,.5),u=pt(g,f,.5),b=pt(f,y,.5),x=pt(u,b,.5);ds([c,g,u,x],0,e,a),ds([x,b,y,p],0,e,a)}var i,h;return a}function Xa(n,t){return jt(n,0,n.length,t)}function jt(n,t,e,r,a){let i=a||[],h=n[t],s=n[e-1],c=0,l=1;for(let o=t+1;o<e-1;++o){let p=ja(n[o],h,s);p>c&&(c=p,l=o)}return Math.sqrt(c)>r?(jt(n,t,l+1,r,i),jt(n,l,e,r,i)):(i.length||i.push(h),i.push(s)),i}function os(n,t=.15,e){let r=[],a=(n.length-1)/3;for(let i=0;i<a;i++)ds(n,3*i,t,r);return e&&e>0?jt(r,0,r.length,e):r}var at="none",ut=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,a,i){let h=this._o(i);return this._d("line",[oa(t,e,r,a,h)],h)}rectangle(t,e,r,a,i){let h=this._o(i),s=[],c=Ia(t,e,r,a,h);if(h.fill){let l=[[t,e],[t+r,e],[t+r,e+a],[t,e+a]];h.fillStyle==="solid"?s.push(cs([l],h)):s.push(yt([l],h))}return h.stroke!==at&&s.push(c),this._d("rectangle",s,h)}ellipse(t,e,r,a,i){let h=this._o(i),s=[],c=ha(r,a,h),l=xs(t,e,h,c);if(h.fill)if(h.fillStyle==="solid"){let o=xs(t,e,h,c).opset;o.type="fillPath",s.push(o)}else s.push(yt([l.estimatedPoints],h));return h.stroke!==at&&s.push(l.opset),this._d("ellipse",s,h)}circle(t,e,r,a){let i=this.ellipse(t,e,r,r,a);return i.shape="circle",i}linearPath(t,e){let r=this._o(e);return this._d("linearPath",[_t(t,!1,r)],r)}arc(t,e,r,a,i,h,s=!1,c){let l=this._o(c),o=[],p=ta(t,e,r,a,i,h,s,!0,l);if(s&&l.fill)if(l.fillStyle==="solid"){let g=Object.assign({},l);g.disableMultiStroke=!0;let f=ta(t,e,r,a,i,h,!0,!1,g);f.type="fillPath",o.push(f)}else o.push(function(g,f,y,u,b,x,d){let w=g,k=f,m=Math.abs(y/2),v=Math.abs(u/2);m+=_(.01*m,d),v+=_(.01*v,d);let M=b,$=x;for(;M<0;)M+=2*Math.PI,$+=2*Math.PI;$-M>2*Math.PI&&(M=0,$=2*Math.PI);let D=($-M)/d.curveStepCount,L=[];for(let C=M;C<=$;C+=D)L.push([w+m*Math.cos(C),k+v*Math.sin(C)]);return L.push([w+m*Math.cos($),k+v*Math.sin($)]),L.push([w,k]),yt([L],d)}(t,e,r,a,i,h,l));return l.stroke!==at&&o.push(p),this._d("arc",o,l)}curve(t,e){let r=this._o(e),a=[],i=Ks(t,r);if(r.fill&&r.fill!==at)if(r.fillStyle==="solid"){let h=Ks(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else{let h=[],s=t;if(s.length){let c=typeof s[0][0]=="number"?[s]:s;for(let l of c)l.length<3?h.push(...l):l.length===3?h.push(...os(ia([l[0],l[0],l[1],l[2]]),10,(1+r.roughness)/2)):h.push(...os(ia(l),10,(1+r.roughness)/2))}h.length&&a.push(yt([h],r))}return r.stroke!==at&&a.push(i),this._d("curve",a,r)}polygon(t,e){let r=this._o(e),a=[],i=_t(t,!0,r);return r.fill&&(r.fillStyle==="solid"?a.push(cs([t],r)):a.push(yt([t],r))),r.stroke!==at&&a.push(i),this._d("polygon",a,r)}path(t,e){let r=this._o(e),a=[];if(!t)return this._d("path",a,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let i=r.fill&&r.fill!=="transparent"&&r.fill!==at,h=r.stroke!==at,s=!!(r.simplification&&r.simplification<1),c=function(o,p,g){let f=na(la(ks(o))),y=[],u=[],b=[0,0],x=[],d=()=>{x.length>=4&&u.push(...os(x,p)),x=[]},w=()=>{d(),u.length&&(y.push(u),u=[])};for(let{key:m,data:v}of f)switch(m){case"M":w(),b=[v[0],v[1]],u.push(b);break;case"L":d(),u.push([v[0],v[1]]);break;case"C":if(!x.length){let M=u.length?u[u.length-1]:b;x.push([M[0],M[1]])}x.push([v[0],v[1]]),x.push([v[2],v[3]]),x.push([v[4],v[5]]);break;case"Z":d(),u.push([b[0],b[1]])}if(w(),!g)return y;let k=[];for(let m of y){let v=Xa(m,g);v.length&&k.push(v)}return k}(t,1,s?4-4*(r.simplification||1):(1+r.roughness)/2),l=sa(t,r);if(i)if(r.fillStyle==="solid")if(c.length===1){let o=sa(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else a.push(cs(c,r));else a.push(yt(c,r));return h&&(s?c.forEach(o=>{a.push(_t(o,!1,r))}):a.push(l)),this._d("path",a,r)}opsToPath(t,e){let r="";for(let a of t.ops){let i=typeof e=="number"&&e>=0?a.data.map(h=>+h.toFixed(e)):a.data;switch(a.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){let e=t.sets||[],r=t.options||this.defaultOptions,a=[];for(let i of e){let h=null;switch(i.type){case"path":h={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:at};break;case"fillPath":h={d:this.opsToPath(i),stroke:at,strokeWidth:0,fill:r.fill||at};break;case"fillSketch":h=this.fillSketch(i,r)}h&&a.push(h)}return a}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||at,strokeWidth:r,fill:at}}_mergedShape(t){return t.filter((e,r)=>r===0||e.op!=="move")}},ws=class{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ut(e)}draw(t){let e=t.sets||[],r=t.options||this.getDefaultOptions(),a=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(let h of e)switch(h.type){case"path":a.save(),a.strokeStyle=r.stroke==="none"?"transparent":r.stroke,a.lineWidth=r.strokeWidth,r.strokeLineDash&&a.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(a.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(a,h,i),a.restore();break;case"fillPath":{a.save(),a.fillStyle=r.fill||"";let s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(a,h,i,s),a.restore();break}case"fillSketch":this.fillSketch(a,h,r)}}fillSketch(t,e,r){let a=r.fillWeight;a<0&&(a=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=a,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,a="nonzero"){t.beginPath();for(let i of e.ops){let h=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(h[0],h[1]);break;case"bcurveTo":t.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]);break;case"lineTo":t.lineTo(h[0],h[1])}}e.type==="fillPath"?t.fill(a):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,a,i){let h=this.gen.line(t,e,r,a,i);return this.draw(h),h}rectangle(t,e,r,a,i){let h=this.gen.rectangle(t,e,r,a,i);return this.draw(h),h}ellipse(t,e,r,a,i){let h=this.gen.ellipse(t,e,r,a,i);return this.draw(h),h}circle(t,e,r,a){let i=this.gen.circle(t,e,r,a);return this.draw(i),i}linearPath(t,e){let r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){let r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,a,i,h,s=!1,c){let l=this.gen.arc(t,e,r,a,i,h,s,c);return this.draw(l),l}curve(t,e){let r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){let r=this.gen.path(t,e);return this.draw(r),r}},Ot="http://www.w3.org/2000/svg",ms=class{constructor(t,e){this.svg=t,this.gen=new ut(e)}draw(t){let e=t.sets||[],r=t.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,i=a.createElementNS(Ot,"g"),h=t.options.fixedDecimalPlaceDigits;for(let s of e){let c=null;switch(s.type){case"path":c=a.createElementNS(Ot,"path"),c.setAttribute("d",this.opsToPath(s,h)),c.setAttribute("stroke",r.stroke),c.setAttribute("stroke-width",r.strokeWidth+""),c.setAttribute("fill","none"),r.strokeLineDash&&c.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":c=a.createElementNS(Ot,"path"),c.setAttribute("d",this.opsToPath(s,h)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||c.setAttribute("fill-rule","evenodd");break;case"fillSketch":c=this.fillSketch(a,s,r)}c&&i.appendChild(c)}return i}fillSketch(t,e,r){let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);let i=t.createElementNS(Ot,"path");return i.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",a+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,a,i){let h=this.gen.line(t,e,r,a,i);return this.draw(h)}rectangle(t,e,r,a,i){let h=this.gen.rectangle(t,e,r,a,i);return this.draw(h)}ellipse(t,e,r,a,i){let h=this.gen.ellipse(t,e,r,a,i);return this.draw(h)}circle(t,e,r,a){let i=this.gen.circle(t,e,r,a);return this.draw(i)}linearPath(t,e){let r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){let r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,a,i,h,s=!1,c){let l=this.gen.arc(t,e,r,a,i,h,s,c);return this.draw(l)}curve(t,e){let r=this.gen.curve(t,e);return this.draw(r)}path(t,e){let r=this.gen.path(t,e);return this.draw(r)}},P={canvas:(n,t)=>new ws(n,t),svg:(n,t)=>new ms(n,t),generator:n=>new ut(n),newSeed:()=>ut.newSeed()};var Ya=S((n,t)=>{var e=n.x,r=n.y,a=t.x-e,i=t.y-r,h=n.width/2,s=n.height/2,c,l;return Math.abs(i)*h>Math.abs(a)*s?(i<0&&(s=-s),c=i===0?0:s*a/i,l=s):(a<0&&(h=-h),c=h,l=a===0?0:h*i/a),{x:e+c,y:r+l}},"intersectRect"),Nt=Ya;function va(n,t){t&&n.attr("style",t)}S(va,"applyStyle");async function Ma(n){let t=K(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),e=t.append("xhtml:div"),r=n.label;n.label&&Gs(n.label)&&(r=await Zs(n.label.replace(Fs.lineBreakRegex,``),V()));let a=n.isNode?"nodeLabel":"edgeLabel";return e.html('<span class="'+a+'" '+(n.labelStyle?'style="'+n.labelStyle+'"':"")+">"+r+"</span>"),va(e,n.labelStyle),e.style("display","inline-block"),e.style("padding-right","1px"),e.style("white-space","nowrap"),e.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}S(Ma,"addHtmlLabel");var qa=S(async(n,t,e,r)=>{let a=n||"";if(typeof a=="object"&&(a=a[0]),et(V().flowchart.htmlLabels)){a=a.replace(/\\n|\n/g,"<br />"),X.info("vertexText"+a);let i={isNode:r,label:es(a).replace(/fa[blrs]?:fa-[\w-]+/g,s=>`<i class='${s.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await Ma(i)}else{let i=document.createElementNS("http://www.w3.org/2000/svg","text");i.setAttribute("style",t.replace("color:","fill:"));let h=[];typeof a=="string"?h=a.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(a)?h=a:h=[];for(let s of h){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=s.trim(),i.appendChild(c)}return i}},"createLabel"),gt=qa,bt=S((n,t,e,r,a)=>["M",n+a,t,"H",n+e-a,"A",a,a,0,0,1,n+e,t+a,"V",t+r-a,"A",a,a,0,0,1,n+e-a,t+r,"H",n+a,"A",a,a,0,0,1,n,t+r-a,"V",t+a,"A",a,a,0,0,1,n+a,t,"Z"].join(" "),"createRoundedRectPathD"),Ga=S(n=>{let{handDrawnSeed:t}=V();return{fill:n,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:n,seed:t}},"solidStateFill"),dt=S(n=>{let t=Za([...n.cssCompiledStyles||[],...n.cssStyles||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Za=S(n=>{let t=new Map;return n.forEach(e=>{let[r,a]=e.split(":");t.set(r.trim(),a==null?void 0:a.trim())}),t},"styles2Map"),T=S(n=>{let{stylesArray:t}=dt(n),e=[],r=[],a=[],i=[];return t.forEach(h=>{let s=h[0];s==="color"||s==="font-size"||s==="font-family"||s==="font-weight"||s==="font-style"||s==="text-decoration"||s==="text-align"||s==="text-transform"||s==="line-height"||s==="letter-spacing"||s==="word-spacing"||s==="text-shadow"||s==="text-overflow"||s==="white-space"||s==="word-wrap"||s==="word-break"||s==="overflow-wrap"||s==="hyphens"?e.push(h.join(":")+" !important"):(r.push(h.join(":")+" !important"),s.includes("stroke")&&a.push(h.join(":")+" !important"),s==="fill"&&i.push(h.join(":")+" !important"))}),{labelStyles:e.join(";"),nodeStyles:r.join(";"),stylesArray:t,borderStyles:a,backgroundStyles:i}},"styles2String"),N=S((n,t)=>{var c;let{themeVariables:e,handDrawnSeed:r}=V(),{nodeBorder:a,mainBkg:i}=e,{stylesMap:h}=dt(n);return Object.assign({roughness:.7,fill:h.get("fill")||i,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:h.get("stroke")||a,seed:r,strokeWidth:((c=h.get("stroke-width"))==null?void 0:c.replace("px",""))||1.3,fillLineDash:[0,0]},t)},"userNodeOverrides"),$a=S(async(n,t)=>{X.info("Creating subgraph rect for ",t.id,t);let e=V(),{themeVariables:r,handDrawnSeed:a}=e,{clusterBkg:i,clusterBorder:h}=r,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:o}=T(t),p=n.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),g=et(e.flowchart.htmlLabels),f=p.insert("g").attr("class","cluster-label "),y=await Et(f,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0}),u=y.getBBox();if(et(e.flowchart.htmlLabels)){let M=y.children[0],$=K(y);u=M.getBoundingClientRect(),$.attr("width",u.width),$.attr("height",u.height)}let b=t.width<=u.width+t.padding?u.width+t.padding:t.width;t.width<=u.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height,d=t.x-b/2,w=t.y-x/2;X.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){let M=P.svg(p),$=N(t,{roughness:.7,fill:i,stroke:h,fillWeight:3,seed:a}),D=M.path(bt(d,w,b,x,0),$);k=p.insert(()=>(X.debug("Rough node insert CXC",D),D),":first-child"),k.select("path:nth-child(2)").attr("style",l.join(";")),k.select("path").attr("style",o.join(";").replace("fill","stroke"))}else k=p.insert("rect",":first-child"),k.attr("style",c).attr("rx",t.rx).attr("ry",t.ry).attr("x",d).attr("y",w).attr("width",b).attr("height",x);let{subGraphTitleTopMargin:m}=rs(e);if(f.attr("transform",`translate(${t.x-u.width/2}, ${t.y-t.height/2+m})`),s){let M=f.select("span");M&&M.attr("style",s)}let v=k.node().getBBox();return t.offsetX=0,t.width=v.width,t.height=v.height,t.offsetY=u.height-t.padding/2,t.intersect=function(M){return Nt(t,M)},{cluster:p,labelBBox:u}},"rect"),Fa=S((n,t)=>{let e=n.insert("g").attr("class","note-cluster").attr("id",t.id),r=e.insert("rect",":first-child"),a=0*t.padding,i=a/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-i).attr("y",t.y-t.height/2-i).attr("width",t.width+a).attr("height",t.height+a).attr("fill","none");let h=r.node().getBBox();return t.width=h.width,t.height=h.height,t.intersect=function(s){return Nt(t,s)},{cluster:e,labelBBox:{width:0,height:0}}},"noteGroup"),Va=S(async(n,t)=>{let e=V(),{themeVariables:r,handDrawnSeed:a}=e,{altBackground:i,compositeBackground:h,compositeTitleBackground:s,nodeBorder:c}=r,l=n.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),o=l.insert("g",":first-child"),p=l.insert("g").attr("class","cluster-label"),g=l.append("rect"),f=p.node().appendChild(await gt(t.label,t.labelStyle,void 0,!0)),y=f.getBBox();if(et(e.flowchart.htmlLabels)){let D=f.children[0],L=K(f);y=D.getBoundingClientRect(),L.attr("width",y.width),L.attr("height",y.height)}let u=0*t.padding,b=u/2,x=(t.width<=y.width+t.padding?y.width+t.padding:t.width)+u;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;let d=t.height+u,w=t.height+u-y.height-6,k=t.x-x/2,m=t.y-d/2;t.width=x;let v=t.y-t.height/2-b+y.height+2,M;if(t.look==="handDrawn"){let D=t.cssClasses.includes("statediagram-cluster-alt"),L=P.svg(l),C=t.rx||t.ry?L.path(bt(k,m,x,d,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:c,seed:a}):L.rectangle(k,m,x,d,{seed:a});M=l.insert(()=>C,":first-child");let Z=L.rectangle(k,v,x,w,{fill:D?i:h,fillStyle:D?"hachure":"solid",stroke:c,seed:a});M=l.insert(()=>C,":first-child"),g=l.insert(()=>Z)}else M=o.insert("rect",":first-child"),M.attr("class","outer").attr("x",k).attr("y",m).attr("width",x).attr("height",d).attr("data-look",t.look),g.attr("class","inner").attr("x",k).attr("y",v).attr("width",x).attr("height",w);p.attr("transform",`translate(${t.x-y.width/2}, ${m+1-(et(e.flowchart.htmlLabels)?0:3)})`);let $=M.node().getBBox();return t.height=$.height,t.offsetX=0,t.offsetY=y.height-t.padding/2,t.labelBBox=y,t.intersect=function(D){return Nt(t,D)},{cluster:l,labelBBox:y}},"roundedWithTitle"),Qa=S((n,t)=>{let e=V(),{themeVariables:r,handDrawnSeed:a}=e,{nodeBorder:i}=r,h=n.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),s=h.insert("g",":first-child"),c=0*t.padding,l=t.width+c;t.diff=-t.padding;let o=t.height+c,p=t.x-l/2,g=t.y-o/2;t.width=l;let f;if(t.look==="handDrawn"){let b=P.svg(h).rectangle(p,g,l,o,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:a});f=h.insert(()=>b,":first-child")}else f=s.insert("rect",":first-child"),f.attr("class","divider").attr("x",p).attr("y",g).attr("width",l).attr("height",o).attr("data-look",t.look);let y=f.node().getBBox();return t.height=y.height,t.offsetX=0,t.offsetY=0,t.intersect=function(u){return Nt(t,u)},{cluster:h,labelBBox:{}}},"divider"),Ua=$a,Ja={rect:$a,squareRect:Ua,roundedWithTitle:Va,noteGroup:Fa,divider:Qa},Pa=new Map,Jr=S(async(n,t)=>{let e=t.shape||"rect",r=await Ja[e](n,t);return Pa.set(t.id,r),r},"insertCluster"),Kr=S(()=>{Pa=new Map},"clear"),Ka=S((n,t,e,r,a)=>{t.arrowTypeStart&&ga(n,"start",t.arrowTypeStart,e,r,a),t.arrowTypeEnd&&ga(n,"end",t.arrowTypeEnd,e,r,a)},"addEdgeMarkers"),tr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ga=S((n,t,e,r,a,i)=>{let h=tr[e];if(!h){X.warn(`Unknown arrow type: ${e}`);return}let s=t==="start"?"Start":"End";n.attr(`marker-${t}`,`url(${r}#${a}_${i}-${h}${s})`)},"addEdgeMarker"),as=new Map,J=new Map,ae=S(()=>{as.clear(),J.clear()},"clear"),Dt=S(n=>n?n.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),re=S(async(n,t)=>{let e=et(V().flowchart.htmlLabels),r=await Et(n,t.label,{style:Dt(t.labelStyle),useHtmlLabels:e,addSvgBackground:!0,isNode:!1});X.info("abc82",t,t.labelType);let a=n.insert("g").attr("class","edgeLabel"),i=a.insert("g").attr("class","label");i.node().appendChild(r);let h=r.getBBox();if(e){let c=r.children[0],l=K(r);h=c.getBoundingClientRect(),l.attr("width",h.width),l.attr("height",h.height)}i.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),as.set(t.id,a),t.width=h.width,t.height=h.height;let s;if(t.startLabelLeft){let c=await gt(t.startLabelLeft,Dt(t.labelStyle)),l=n.insert("g").attr("class","edgeTerminals"),o=l.insert("g").attr("class","inner");s=o.node().appendChild(c);let p=c.getBBox();o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),J.get(t.id)||J.set(t.id,{}),J.get(t.id).startLeft=l,Bt(s,t.startLabelLeft)}if(t.startLabelRight){let c=await gt(t.startLabelRight,Dt(t.labelStyle)),l=n.insert("g").attr("class","edgeTerminals"),o=l.insert("g").attr("class","inner");s=l.node().appendChild(c),o.node().appendChild(c);let p=c.getBBox();o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),J.get(t.id)||J.set(t.id,{}),J.get(t.id).startRight=l,Bt(s,t.startLabelRight)}if(t.endLabelLeft){let c=await gt(t.endLabelLeft,Dt(t.labelStyle)),l=n.insert("g").attr("class","edgeTerminals"),o=l.insert("g").attr("class","inner");s=o.node().appendChild(c);let p=c.getBBox();o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.node().appendChild(c),J.get(t.id)||J.set(t.id,{}),J.get(t.id).endLeft=l,Bt(s,t.endLabelLeft)}if(t.endLabelRight){let c=await gt(t.endLabelRight,Dt(t.labelStyle)),l=n.insert("g").attr("class","edgeTerminals"),o=l.insert("g").attr("class","inner");s=o.node().appendChild(c);let p=c.getBBox();o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.node().appendChild(c),J.get(t.id)||J.set(t.id,{}),J.get(t.id).endRight=l,Bt(s,t.endLabelRight)}return r},"insertEdgeLabel");function Bt(n,t){V().flowchart.htmlLabels&&n&&(n.style.width=t.length*9+"px",n.style.height="12px")}S(Bt,"setTerminalWidth");var ee=S((n,t)=>{X.debug("Moving label abc88 ",n.id,n.label,as.get(n.id),t);let e=t.updatedPath?t.updatedPath:t.originalPath,r=V(),{subGraphTitleTotalMargin:a}=rs(r);if(n.label){let i=as.get(n.id),h=n.x,s=n.y;if(e){let c=ft.calcLabelPosition(e);X.debug("Moving label "+n.label+" from (",h,",",s,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(h=c.x,s=c.y)}i.attr("transform",`translate(${h}, ${s+a/2})`)}if(n.startLabelLeft){let i=J.get(n.id).startLeft,h=n.x,s=n.y;if(e){let c=ft.calcTerminalLabelPosition(n.arrowTypeStart?10:0,"start_left",e);h=c.x,s=c.y}i.attr("transform",`translate(${h}, ${s})`)}if(n.startLabelRight){let i=J.get(n.id).startRight,h=n.x,s=n.y;if(e){let c=ft.calcTerminalLabelPosition(n.arrowTypeStart?10:0,"start_right",e);h=c.x,s=c.y}i.attr("transform",`translate(${h}, ${s})`)}if(n.endLabelLeft){let i=J.get(n.id).endLeft,h=n.x,s=n.y;if(e){let c=ft.calcTerminalLabelPosition(n.arrowTypeEnd?10:0,"end_left",e);h=c.x,s=c.y}i.attr("transform",`translate(${h}, ${s})`)}if(n.endLabelRight){let i=J.get(n.id).endRight,h=n.x,s=n.y;if(e){let c=ft.calcTerminalLabelPosition(n.arrowTypeEnd?10:0,"end_right",e);h=c.x,s=c.y}i.attr("transform",`translate(${h}, ${s})`)}},"positionEdgeLabel"),sr=S((n,t)=>{let e=n.x,r=n.y,a=Math.abs(t.x-e),i=Math.abs(t.y-r),h=n.width/2,s=n.height/2;return a>=h||i>=s},"outsideNode"),ar=S((n,t,e)=>{X.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(t)} insidePoint : ${JSON.stringify(e)} node : x:${n.x} y:${n.y} w:${n.width} h:${n.height}`);let r=n.x,a=n.y,i=Math.abs(r-e.x),h=n.width/2,s=e.x<t.x?h-i:h+i,c=n.height/2,l=Math.abs(t.y-e.y),o=Math.abs(t.x-e.x);if(Math.abs(a-t.y)*h>Math.abs(r-t.x)*c){let p=e.y<t.y?t.y-c-a:a-c-t.y;s=o*p/l;let g={x:e.x<t.x?e.x+s:e.x-o+s,y:e.y<t.y?e.y+l-p:e.y-l+p};return s===0&&(g.x=t.x,g.y=t.y),o===0&&(g.x=t.x),l===0&&(g.y=t.y),X.debug(`abc89 top/bottom calc, Q ${l}, q ${p}, R ${o}, r ${s}`,g),g}else{e.x<t.x?s=t.x-h-r:s=r-h-t.x;let p=l*s/o,g=e.x<t.x?e.x+o-s:e.x-o+s,f=e.y<t.y?e.y+p:e.y-p;return X.debug(`sides calc abc89, Q ${l}, q ${p}, R ${o}, r ${s}`,{_x:g,_y:f}),s===0&&(g=t.x,f=t.y),o===0&&(g=t.x),l===0&&(f=t.y),{x:g,y:f}}},"intersection"),fa=S((n,t)=>{X.warn("abc88 cutPathAtIntersect",n,t);let e=[],r=n[0],a=!1;return n.forEach(i=>{if(X.info("abc88 checking point",i,t),!sr(t,i)&&!a){let h=ar(t,r,i);X.debug("abc88 inside",i,r,h),X.debug("abc88 intersection",h,t);let s=!1;e.forEach(c=>{s=s||c.x===h.x&&c.y===h.y}),e.some(c=>c.x===h.x&&c.y===h.y)?X.warn("abc88 no intersect",h,e):e.push(h),a=!0}else X.warn("abc88 outside",i,r),r=i,a||e.push(i)}),X.debug("returning points",e),e},"cutPathAtIntersect");function Da(n){let t=[],e=[];for(let r=1;r<n.length-1;r++){let a=n[r-1],i=n[r],h=n[r+1];(a.x===i.x&&i.y===h.y&&Math.abs(i.x-h.x)>5&&Math.abs(i.y-a.y)>5||a.y===i.y&&i.x===h.x&&Math.abs(i.x-a.x)>5&&Math.abs(i.y-h.y)>5)&&(t.push(i),e.push(r))}return{cornerPoints:t,cornerPointPositions:e}}S(Da,"extractCornerPoints");var ya=S(function(n,t,e){let r=t.x-n.x,a=t.y-n.y,i=Math.sqrt(r*r+a*a),h=e/i;return{x:t.x-h*r,y:t.y-h*a}},"findAdjacentPoint"),rr=S(function(n){let{cornerPointPositions:t}=Da(n),e=[];for(let r=0;r<n.length;r++)if(t.includes(r)){let a=n[r-1],i=n[r+1],h=n[r],s=ya(a,h,5),c=ya(i,h,5),l=c.x-s.x,o=c.y-s.y;e.push(s);let p=Math.sqrt(2)*2,g={x:h.x,y:h.y};if(Math.abs(i.x-a.x)>10&&Math.abs(i.y-a.y)>=10){X.debug("Corner point fixing",Math.abs(i.x-a.x),Math.abs(i.y-a.y));let f=5;h.x===s.x?g={x:l<0?s.x-f+p:s.x+f-p,y:o<0?s.y-p:s.y+p}:g={x:l<0?s.x-p:s.x+p,y:o<0?s.y-f+p:s.y+f-p}}else X.debug("Corner point skipping fixing",Math.abs(i.x-a.x),Math.abs(i.y-a.y));e.push(g,c)}else e.push(n[r]);return e},"fixCorners"),ie=S(function(n,t,e,r,a,i,h){let{handDrawnSeed:s}=V(),c=t.points,l=!1,o=a;var p=i;p.intersect&&o.intersect&&(c=c.slice(1,t.points.length-1),c.unshift(o.intersect(c[0])),X.debug("Last point APA12",t.start,"-->",t.end,c[c.length-1],p,p.intersect(c[c.length-1])),c.push(p.intersect(c[c.length-1]))),t.toCluster&&(X.info("to cluster abc88",e.get(t.toCluster)),c=fa(t.points,e.get(t.toCluster).node),l=!0),t.fromCluster&&(X.debug("from cluster abc88",e.get(t.fromCluster),JSON.stringify(c,null,2)),c=fa(c.reverse(),e.get(t.fromCluster).node).reverse(),l=!0);let g=c.filter($=>!Number.isNaN($.y));g=rr(g);let f=g[g.length-1];if(g.length>1){f=g[g.length-1];let $=g[g.length-2],D=(f.x-$.x)/2,L=(f.y-$.y)/2,C={x:$.x+D,y:$.y+L};g.splice(-1,0,C)}let y=Us;t.curve&&(y=t.curve);let{x:u,y:b}=Vs(t),x=Qs().x(u).y(b).curve(y),d;switch(t.thickness){case"normal":d="edge-thickness-normal";break;case"thick":d="edge-thickness-thick";break;case"invisible":d="edge-thickness-invisible";break;default:d="edge-thickness-normal"}switch(t.pattern){case"solid":d+=" edge-pattern-solid";break;case"dotted":d+=" edge-pattern-dotted";break;case"dashed":d+=" edge-pattern-dashed";break;default:d+=" edge-pattern-solid"}let w,k=x(g),m=Array.isArray(t.style)?t.style:[t.style];if(t.look==="handDrawn"){let $=P.svg(n);Object.assign([],g);let D=$.path(k,{roughness:.3,seed:s});d+=" transition",w=K(D).select("path").attr("id",t.id).attr("class"," "+d+(t.classes?" "+t.classes:"")).attr("style",m?m.reduce((C,Z)=>C+";"+Z,""):"");let L=w.attr("d");w.attr("d",L),n.node().appendChild(w.node())}else w=n.append("path").attr("d",k).attr("id",t.id).attr("class"," "+d+(t.classes?" "+t.classes:"")).attr("style",m?m.reduce(($,D)=>$+";"+D,""):"");let v="";(V().flowchart.arrowMarkerAbsolute||V().state.arrowMarkerAbsolute)&&(v=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,v=v.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),X.info("arrowTypeStart",t.arrowTypeStart),X.info("arrowTypeEnd",t.arrowTypeEnd),Ka(w,t,v,h,r);let M={};return l&&(M.updatedPath=c),M.originalPath=t.points,M},"insertEdge"),er=S((n,t,e,r)=>{t.forEach(a=>{yr[a](n,e,r)})},"insertMarkers"),ir=S((n,t,e)=>{X.trace("Making markers for ",e),n.append("defs").append("marker").attr("id",e+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),n.append("defs").append("marker").attr("id",e+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),lr=S((n,t,e)=>{n.append("defs").append("marker").attr("id",e+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).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"),n.append("defs").append("marker").attr("id",e+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).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")},"composition"),nr=S((n,t,e)=>{n.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).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"),n.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).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")},"aggregation"),cr=S((n,t,e)=>{n.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).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"),n.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).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")},"dependency"),or=S((n,t,e)=>{n.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),n.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),hr=S((n,t,e)=>{n.append("marker").attr("id",e+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).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"),n.append("marker").attr("id",e+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).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")},"point"),pr=S((n,t,e)=>{n.append("marker").attr("id",e+"_"+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"),n.append("marker").attr("id",e+"_"+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")},"circle"),gr=S((n,t,e)=>{n.append("marker").attr("id",e+"_"+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"),n.append("marker").attr("id",e+"_"+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")},"cross"),fr=S((n,t,e)=>{n.append("defs").append("marker").attr("id",e+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),yr={extension:ir,composition:lr,aggregation:nr,dependency:cr,lollipop:or,point:hr,circle:pr,cross:gr,barb:fr},le=er,q=S(async(n,t,e)=>{let r,a=t.useHtmlLabels||et(V().flowchart.htmlLabels);e?r=e:r="node default";let i=n.insert("g").attr("class",r).attr("id",t.domId||t.id),h=i.insert("g").attr("class","label").attr("style",t.labelStyle),s;t.label===void 0?s="":s=typeof t.label=="string"?t.label:t.label[0];let c;c=await Et(h,qs(es(s),V()),{useHtmlLabels:a,width:t.width||V().flowchart.wrappingWidth,cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let l=c.getBBox(),o=t.padding/2;if(et(V().flowchart.htmlLabels)){let p=c.children[0],g=K(c),f=p.getElementsByTagName("img");if(f){let y=s.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].map(u=>new Promise(b=>{function x(){if(u.style.display="flex",u.style.flexDirection="column",y){let d=V().fontSize?V().fontSize:window.getComputedStyle(document.body).fontSize,k=parseInt(d,10)*5+"px";u.style.minWidth=k,u.style.maxWidth=k}else u.style.width="100%";b(u)}S(x,"setupImage"),setTimeout(()=>{u.complete&&x()}),u.addEventListener("error",x),u.addEventListener("load",x)})))}l=p.getBoundingClientRect(),g.attr("width",l.width),g.attr("height",l.height)}return a?h.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"):h.attr("transform","translate(0, "+-l.height/2+")"),t.centerLabel&&h.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),h.insert("rect",":first-child"),{shapeSvg:i,bbox:l,halfPadding:o,label:h}},"labelHelper"),W=S((n,t)=>{let e=t.node().getBBox();n.width=e.width,n.height=e.height},"updateNodeBounds"),G=S((n,t)=>(n.look==="handDrawn"?"rough-node":"node")+" "+n.cssClasses+" "+(t||""),"getNodeClasses");function F(n){let t=n.map((e,r)=>`${r===0?"M":"L"}${e.x},${e.y}`);return t.push("Z"),t.join(" ")}S(F,"createPathFromPoints");function ht(n,t,e,r,a,i){let h=[],c=e-n,l=r-t,o=c/i,p=2*Math.PI/o,g=t+l/2;for(let f=0;f<=50;f++){let y=f/50,u=n+y*c,b=g+a*Math.sin(p*(u-n));h.push({x:u,y:b})}return h}S(ht,"generateFullSineWavePoints");function Xs(n,t,e,r,a,i){let h=[],s=a*Math.PI/180,o=(i*Math.PI/180-s)/(r-1);for(let p=0;p<r;p++){let g=s+p*o,f=n+e*Math.cos(g),y=t+e*Math.sin(g);h.push({x:-f,y:-y})}return h}S(Xs,"generateCirclePoints");function La(n,t){return n.intersect(t)}S(La,"intersectNode");var ur=La;function Ca(n,t,e,r){var a=n.x,i=n.y,h=a-r.x,s=i-r.y,c=Math.sqrt(t*t*s*s+e*e*h*h),l=Math.abs(t*e*h/c);r.x<a&&(l=-l);var o=Math.abs(t*e*s/c);return r.y<i&&(o=-o),{x:a+l,y:i+o}}S(Ca,"intersectEllipse");var Ra=Ca;function Aa(n,t,e){return Ra(n,t,t,e)}S(Aa,"intersectCircle");var xr=Aa;function Ba(n,t,e,r){var a,i,h,s,c,l,o,p,g,f,y,u,b,x,d;if(a=t.y-n.y,h=n.x-t.x,c=t.x*n.y-n.x*t.y,g=a*e.x+h*e.y+c,f=a*r.x+h*r.y+c,!(g!==0&&f!==0&&zs(g,f))&&(i=r.y-e.y,s=e.x-r.x,l=r.x*e.y-e.x*r.y,o=i*n.x+s*n.y+l,p=i*t.x+s*t.y+l,!(o!==0&&p!==0&&zs(o,p))&&(y=a*s-i*h,y!==0)))return u=Math.abs(y/2),b=h*l-s*c,x=b<0?(b-u)/y:(b+u)/y,b=i*c-a*l,d=b<0?(b-u)/y:(b+u)/y,{x,y:d}}S(Ba,"intersectLine");function zs(n,t){return n*t>0}S(zs,"sameSign");var br=Ba;function Na(n,t,e){let r=n.x,a=n.y,i=[],h=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(o){h=Math.min(h,o.x),s=Math.min(s,o.y)}):(h=Math.min(h,t.x),s=Math.min(s,t.y));let c=r-n.width/2-h,l=a-n.height/2-s;for(let o=0;o<t.length;o++){let p=t[o],g=t[o<t.length-1?o+1:0],f=br(n,e,{x:c+p.x,y:l+p.y},{x:c+g.x,y:l+g.y});f&&i.push(f)}return i.length?(i.length>1&&i.sort(function(o,p){let g=o.x-e.x,f=o.y-e.y,y=Math.sqrt(g*g+f*f),u=p.x-e.x,b=p.y-e.y,x=Math.sqrt(u*u+b*b);return y<x?-1:y===x?0:1}),i[0]):n}S(Na,"intersectPolygon");var dr=Na,A={node:ur,circle:xr,ellipse:Ra,polygon:dr,rect:Nt},Ys=S(async(n,t,e)=>{let{labelStyles:r,nodeStyles:a}=T(t);t.labelStyle=r;let{shapeSvg:i,bbox:h}=await q(n,t,G(t)),s=Math.max(h.width+e.labelPaddingX*2,(t==null?void 0:t.width)||0),c=Math.max(h.height+e.labelPaddingY*2,(t==null?void 0:t.height)||0),l=-s/2,o=-c/2,p,{rx:g,ry:f}=t,{cssStyles:y}=t;if(e!=null&&e.rx&&e.ry&&(g=e.rx,f=e.ry),t.look==="handDrawn"){let u=P.svg(i),b=N(t,{}),x=g||f?u.path(bt(l,o,s,c,g||0),b):u.rectangle(l,o,s,c,b);p=i.insert(()=>x,":first-child"),p.attr("class","basic label-container").attr("style",y)}else p=i.insert("rect",":first-child"),p.attr("class","basic label-container").attr("style",a).attr("rx",g).attr("ry",f).attr("x",l).attr("y",o).attr("width",s).attr("height",c);return W(t,p),t.intersect=function(u){return A.rect(t,u)},i},"drawRect"),wr=S(async(n,t)=>Ys(n,t,{rx:5,ry:5,classes:"flowchart-node"}),"state"),Ss=S(async(n,t)=>{let e={rx:5,ry:5,classes:"",labelPaddingX:((t==null?void 0:t.padding)||0)*1,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Ys(n,t,e)},"roundedRect"),Lt=S(async(n,t)=>{let e={rx:0,ry:0,classes:"",labelPaddingX:((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Ys(n,t,e)},"squareRect"),Yt=S((n,t,{config:{themeVariables:e}})=>{let{lineColor:r}=e,a=n.insert("g").attr("class","node default").attr("id",t.domId||t.id),i;if(t.look==="handDrawn"){let s=P.svg(a).circle(0,0,14,Ga(r));i=a.insert(()=>s)}else i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),W(t,i),t.intersect=function(h){return A.circle(t,7,h)},a},"stateStart"),qt=S((n,t,{config:{themeVariables:e}})=>{let{labelStyles:r,nodeStyles:a}=T(t);t.labelStyle=r;let{cssStyles:i}=t,{lineColor:h,stateBorder:s,nodeBorder:c}=e,l=n.insert("g").attr("class","node default").attr("id",t.domId||t.id),o=P.svg(l),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let g=o.circle(0,0,14,rt(tt({},p),{stroke:h,strokeWidth:2})),f=s!=null?s:c,y=o.circle(0,0,5,rt(tt({},p),{fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"})),u=l.insert(()=>g,":first-child");return u.insert(()=>y),i&&u.selectAll("path").attr("style",i),a&&u.selectAll("path").attr("style",a),W(t,u),t.intersect=function(b){return A.circle(t,7,b)},l},"stateEnd"),vs=S((n,t,{dir:e,config:{state:r,themeVariables:a}})=>{var x,d,w,k,m,v;let{nodeStyles:i}=T(t);t.label="";let h=n.insert("g").attr("class",G(t)).attr("id",(x=t.domId)!=null?x:t.id),{cssStyles:s}=t,c=Math.max(70,(d=t==null?void 0:t.width)!=null?d:0),l=Math.max(10,(w=t==null?void 0:t.height)!=null?w:0);e==="LR"&&(c=Math.max(10,(k=t==null?void 0:t.width)!=null?k:0),l=Math.max(70,(m=t==null?void 0:t.height)!=null?m:0));let o=-1*c/2,p=-1*l/2,g=P.svg(h),f=N(t,{stroke:a.lineColor,fill:a.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=g.rectangle(o,p,c,l,f),u=h.insert(()=>y,":first-child");s&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),W(t,u);let b=(v=r==null?void 0:r.padding)!=null?v:0;return t.width&&t.height&&(t.width+=b/2||0,t.height+=b/2||0),t.intersect=function(M){return A.rect(t,M)},h},"forkJoin"),mr=S((n,t)=>{var g,f;let{nodeStyles:e}=T(t);t.label="";let r=n.insert("g").attr("class",G(t)).attr("id",(g=t.domId)!=null?g:t.id),{cssStyles:a}=t,i=Math.max(28,(f=t.width)!=null?f:0),h=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}],s=P.svg(r),c=N(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let l=F(h),o=s.path(l,c),p=r.insert(()=>o,":first-child");return a&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",a),e&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",e),t.width=28,t.height=28,t.intersect=function(y){return A.polygon(t,h,y)},r},"choice"),kr=S(async(n,t,{config:{themeVariables:e}})=>{var x,d,w,k;let{labelStyles:r,nodeStyles:a}=T(t);t.labelStyle=r;let{shapeSvg:i,bbox:h}=await q(n,t,G(t)),s=Math.max(h.width+((x=t.padding)!=null?x:0)*2,(d=t==null?void 0:t.width)!=null?d:0),c=Math.max(h.height+((w=t.padding)!=null?w:0)*2,(k=t==null?void 0:t.height)!=null?k:0),l=-s/2,o=-c/2,{cssStyles:p}=t;t.useHtmlLabels||(t.centerLabel=!0);let f=P.svg(i),y=N(t,{fill:e.noteBkgColor,stroke:e.noteBorderColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let u=f.rectangle(l,o,s,c,y),b=i.insert(()=>u,":first-child");return b.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",p),a&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",a),W(t,b),t.intersect=function(m){return A.rect(t,m)},i},"note"),Ms=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=i.height+t.padding,s=i.width+h/4+t.padding,c,{cssStyles:l}=t;if(t.look==="handDrawn"){let o=P.svg(a),p=N(t,{}),g=bt(-s/2,-h/2,s,h,h/2),f=o.path(g,p);c=a.insert(()=>f,":first-child"),c.attr("class","basic label-container").attr("style",l)}else c=a.insert("rect",":first-child"),c.attr("class","basic label-container").attr("style",r).attr("rx",h/2).attr("ry",h/2).attr("x",-s/2).attr("y",-h/2).attr("width",s).attr("height",h);return W(t,c),t.intersect=function(o){return A.rect(t,o)},a},"stadium"),Sr=S(async(n,t)=>{var $,D;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let a;t.cssClasses?a="node "+t.cssClasses:a="node default";let i=n.insert("g").attr("class",a).attr("id",t.domId||t.id),h=i.insert("g"),s=i.insert("g").attr("class","label").attr("style",r),c=t.description,l=t.label,o=s.node().appendChild(await gt(l,t.labelStyle,!0,!0)),p={width:0,height:0};if(et((D=($=V())==null?void 0:$.flowchart)==null?void 0:D.htmlLabels)){let L=o.children[0],C=K(o);p=L.getBoundingClientRect(),C.attr("width",p.width),C.attr("height",p.height)}X.info("Text 2",c);let g=c||[],f=o.getBBox(),y=s.node().appendChild(await gt(g.join?g.join("<br/>"):g,t.labelStyle,!0,!0)),u=y.children[0],b=K(y);p=u.getBoundingClientRect(),b.attr("width",p.width),b.attr("height",p.height);let x=(t.padding||0)/2;K(y).attr("transform","translate( "+(p.width>f.width?0:(f.width-p.width)/2)+", "+(f.height+x+5)+")"),K(o).attr("transform","translate( "+(p.width<f.width?0:-(f.width-p.width)/2)+", 0)"),p=s.node().getBBox(),s.attr("transform","translate("+-p.width/2+", "+(-p.height/2-x+3)+")");let d=p.width+(t.padding||0),w=p.height+(t.padding||0),k=-p.width/2-x,m=-p.height/2-x,v,M;if(t.look==="handDrawn"){let L=P.svg(i),C=N(t,{}),Z=L.path(bt(k,m,d,w,t.rx||0),C),H=L.line(-p.width/2-x,-p.height/2-x+f.height+x,p.width/2+x,-p.height/2-x+f.height+x,C);M=i.insert(()=>(X.debug("Rough node insert CXC",Z),H),":first-child"),v=i.insert(()=>(X.debug("Rough node insert CXC",Z),Z),":first-child")}else v=h.insert("rect",":first-child"),M=h.insert("line"),v.attr("class","outer title-state").attr("style",r).attr("x",-p.width/2-x).attr("y",-p.height/2-x).attr("width",p.width+(t.padding||0)).attr("height",p.height+(t.padding||0)),M.attr("class","divider").attr("x1",-p.width/2-x).attr("x2",p.width/2+x).attr("y1",-p.height/2-x+f.height+x).attr("y2",-p.height/2-x+f.height+x);return W(t,v),t.intersect=function(L){return A.rect(t,L)},i},"rectWithTitle");function ct(n,t,e,r){return n.insert("polygon",":first-child").attr("points",r.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+e/2+")")}S(ct,"insertPolygonShape");var Ct=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=((t==null?void 0:t.padding)||0)/2,s=i.width+t.padding,c=i.height+t.padding,l=-i.width/2-h,o=-i.height/2-h,p=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look==="handDrawn"){let g=P.svg(a),f=N(t,{}),y=g.rectangle(l-8,o,s+16,c,f),u=g.line(l,o,l,o+c,f),b=g.line(l+s,o,l+s,o+c,f);a.insert(()=>u,":first-child"),a.insert(()=>b,":first-child");let x=a.insert(()=>y,":first-child"),{cssStyles:d}=t;x.attr("class","basic label-container").attr("style",d),W(t,x)}else{let g=ct(a,s,c,p);r&&g.attr("style",r),W(t,g)}return t.intersect=function(g){return A.polygon(t,p,g)},a},"subroutine"),vr=S((n,t,e,r,a,i)=>[`M${n},${t+i}`,`a${a},${i} 0,0,0 ${e},0`,`a${a},${i} 0,0,0 ${-e},0`,`l0,${r}`,`a${a},${i} 0,0,0 ${e},0`,`l0,${-r}`].join(" "),"createCylinderPathD"),Mr=S((n,t,e,r,a,i)=>[`M${n},${t+i}`,`M${n+e},${t+i}`,`a${a},${i} 0,0,0 ${-e},0`,`l0,${r}`,`a${a},${i} 0,0,0 ${e},0`,`l0,${-r}`].join(" "),"createOuterCylinderPathD"),$r=S((n,t,e,r,a,i)=>[`M${n-e/2},${-r/2}`,`a${a},${i} 0,0,0 ${e},0`].join(" "),"createInnerCylinderPathD"),Gt=S(async(n,t)=>{var f,y,u,b,x;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+t.padding,(f=t.width)!=null?f:0),c=s/2,l=c/(2.5+s/50),o=Math.max(i.height+l+t.padding,(y=t.height)!=null?y:0),p,{cssStyles:g}=t;if(t.look==="handDrawn"){let d=P.svg(a),w=Mr(0,0,s,o,c,l),k=$r(0,l,s,o,c,l),m=d.path(w,N(t,{})),v=d.path(k,N(t,{fill:"none"}));p=a.insert(()=>v,":first-child"),p=a.insert(()=>m,":first-child"),p.attr("class","basic label-container"),g&&p.attr("style",g)}else{let d=vr(0,0,s,o,c,l);p=a.insert("path",":first-child").attr("d",d).attr("class","basic label-container").attr("style",g).attr("style",r)}return p.attr("label-offset-y",l),p.attr("transform",`translate(${-s/2}, ${-(o/2+l)})`),W(t,p),h.attr("transform",`translate(${-(i.width/2)-(i.x-((u=i.left)!=null?u:0))}, ${-(i.height/2)+((b=t.padding)!=null?b:0)/1.5-(i.y-((x=i.top)!=null?x:0))})`),t.intersect=function(d){var m,v,M,$,D,L;let w=A.rect(t,d),k=w.x-((m=t.x)!=null?m:0);if(c!=0&&(Math.abs(k)<((v=t.width)!=null?v:0)/2||Math.abs(k)==((M=t.width)!=null?M:0)/2&&Math.abs(w.y-(($=t.y)!=null?$:0))>((D=t.height)!=null?D:0)/2-l)){let C=l*l*(1-k*k/(c*c));C>0&&(C=Math.sqrt(C)),C=l-C,d.y-((L=t.y)!=null?L:0)>0&&(C=-C),w.y+=C}return w},a},"cylinder"),ua=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,halfPadding:h}=await q(n,t,G(t)),s=i.width/2+h,c,{cssStyles:l}=t;if(t.look==="handDrawn"){let o=P.svg(a),p=N(t,{}),g=o.circle(0,0,s*2,p);c=a.insert(()=>g,":first-child"),c.attr("class","basic label-container").attr("style",l)}else c=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",s).attr("cx",0).attr("cy",0);return W(t,c),t.intersect=function(o){return X.info("Circle intersect",t,s,o),A.circle(t,s,o)},a},"circle"),$s=S(async(n,t)=>{var g,f;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,halfPadding:h}=await q(n,t,G(t)),c=i.width/2+h+5,l=i.width/2+h,o,{cssStyles:p}=t;if(t.look==="handDrawn"){let y=P.svg(a),u=N(t,{roughness:.2,strokeWidth:2.5}),b=N(t,{roughness:.2,strokeWidth:1.5}),x=y.circle(0,0,c*2,u),d=y.circle(0,0,l*2,b);o=a.insert("g",":first-child"),o.attr("class",t.cssClasses).attr("style",p),(g=o.node())==null||g.appendChild(x),(f=o.node())==null||f.appendChild(d)}else{o=a.insert("g",":first-child");let y=o.insert("circle",":first-child"),u=o.insert("circle");o.attr("class","basic label-container").attr("style",r),y.attr("class","outer-circle").attr("style",r).attr("r",c).attr("cx",0).attr("cy",0),u.attr("class","inner-circle").attr("style",r).attr("r",l).attr("cx",0).attr("cy",0)}return W(t,o),t.intersect=function(y){return X.info("DoubleCircle intersect",t,c,y),A.circle(t,c,y)},a},"doublecircle"),xa=S(async(n,t)=>{var w,k,m,v,M,$;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((w=t.padding)!=null?w:0),(k=t==null?void 0:t.width)!=null?k:0),c=Math.max(i.height+((m=t.padding)!=null?m:0),(v=t==null?void 0:t.height)!=null?v:0),l=-s/2,o=-c/2,p=o/2,g=[{x:l+p,y:o},{x:l,y:0},{x:l+p,y:-o},{x:-l,y:-o},{x:-l,y:o}],{cssStyles:f}=t,y=P.svg(a),u=N(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=F(g),x=y.path(b,u),d=a.insert(()=>x,":first-child");return d.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",f),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),d.attr("transform",`translate(${-p/2},0)`),h.attr("transform",`translate(${-p/2-i.width/2-(i.x-((M=i.left)!=null?M:0))}, ${-(i.height/2)-(i.y-(($=i.top)!=null?$:0))})`),W(t,d),t.intersect=function(D){return A.polygon(t,g,D)},a},"rect_left_inv_arrow"),Pr=S((n,t,e)=>[`M${n+e/2},${t}`,`L${n+e},${t-e/2}`,`L${n+e/2},${t-e}`,`L${n},${t-e/2}`,"Z"].join(" "),"createDecisionBoxPathD"),Zt=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=i.width+t.padding,s=i.height+t.padding,c=h+s,l=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}],o,{cssStyles:p}=t;if(t.look==="handDrawn"){let g=P.svg(a),f=N(t,{}),y=Pr(0,0,c),u=g.path(y,f);o=a.insert(()=>u,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`),p&&o.attr("style",p)}else o=ct(a,c,c,l);return r&&o.attr("style",r),W(t,o),t.intersect=function(g){return X.debug(`APA12 Intersect called SPLITpoint:`,g,`node:`,t,`res:`,A.polygon(t,l,g)),A.polygon(t,l,g)},a},"question"),Dr=S((n,t,e,r,a)=>[`M${n+a},${t}`,`L${n+e-a},${t}`,`L${n+e},${t-r/2}`,`L${n+e-a},${t-r}`,`L${n+a},${t-r}`,`L${n},${t-r/2}`,"Z"].join(" "),"createHexagonPathD"),Ps=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=4,s=i.height+t.padding,c=s/h,l=i.width+2*c+t.padding,o=[{x:c,y:0},{x:l-c,y:0},{x:l,y:-s/2},{x:l-c,y:-s},{x:c,y:-s},{x:0,y:-s/2}],p,{cssStyles:g}=t;if(t.look==="handDrawn"){let f=P.svg(a),y=N(t,{}),u=Dr(0,0,l,s,c),b=f.path(u,y);p=a.insert(()=>b,":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),g&&p.attr("style",g)}else p=ct(a,l,s,o);return r&&p.attr("style",r),t.width=l,t.height=s,W(t,p),t.intersect=function(f){return A.polygon(t,o,f)},a},"hexagon");async function Ea(n,t){let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=Math.max(i.width+t.padding,(t==null?void 0:t.width)||0),s=Math.max(i.height+t.padding,(t==null?void 0:t.height)||0),c=-h/2,l=-s/2,o=a.insert("rect",":first-child");return o.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",c).attr("y",l).attr("width",h).attr("height",s),W(t,o),t.intersect=function(p){return A.rect(t,p)},a}S(Ea,"text");async function ss(n,t){let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=i.height+t.padding,s=12,c=i.width+t.padding+s,l=0,o=c,p=-h,g=0,f=[{x:l+s,y:p},{x:o,y:p},{x:o,y:g},{x:l,y:g},{x:l,y:p+s},{x:l+s,y:p}],y,{cssStyles:u}=t;if(t.look==="handDrawn"){let b=P.svg(a),x=N(t,{}),d=F(f),w=b.path(d,x);y=a.insert(()=>w,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&y.attr("style",u)}else y=ct(a,c,h,f);return r&&y.attr("style",r),W(t,y),t.intersect=function(b){return A.polygon(t,f,b)},a}S(ss,"card");var Rt=S(async(n,t)=>{var d,w,k,m,v,M,$,D,L;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=(d=t==null?void 0:t.padding)!=null?d:0,c=Math.max(i.width+((w=t.padding)!=null?w:0)*2,(k=t==null?void 0:t.width)!=null?k:0),l=Math.max(i.height+((m=t.padding)!=null?m:0)*2,(v=t==null?void 0:t.height)!=null?v:0),o=-i.width/2-s,p=-i.height/2-s,{cssStyles:g}=t,f=P.svg(a),y=N(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let u=[{x:o,y:p},{x:o+c+8,y:p},{x:o+c+8,y:p+l},{x:o-8,y:p+l},{x:o-8,y:p},{x:o,y:p},{x:o,y:p+l}],b=f.polygon(u.map(C=>[C.x,C.y]),y),x=a.insert(()=>b,":first-child");return x.attr("class","basic label-container").attr("style",g),r&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",r),g&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",r),h.attr("transform",`translate(${-c/2+4+((M=t.padding)!=null?M:0)-(i.x-(($=i.left)!=null?$:0))},${-l/2+((D=t.padding)!=null?D:0)-(i.y-((L=i.top)!=null?L:0))})`),W(t,x),t.intersect=function(C){return A.rect(t,C)},a},"shadedProcess"),Lr=S((n,t)=>{let{labelStyles:e}=T(t);t.labelStyle=e;let r=G(t),a=r;r||(a="anchor");let i=n.insert("g").attr("class",a).attr("id",t.domId||t.id),h=1,{cssStyles:s}=t,c=P.svg(i),l=N(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(l.roughness=0);let o=c.circle(0,0,h*2,l),p=i.insert(()=>o,":first-child");return p.attr("class","anchor").attr("style",s),W(t,p),t.intersect=function(g){return X.info("Circle intersect",t,h,g),A.circle(t,h,g)},i},"anchor"),Ft=S(async(n,t)=>{var p,g,f,y;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=Math.max(i.width+((p=t.padding)!=null?p:0),(g=t==null?void 0:t.width)!=null?g:0),s=Math.max(i.height+((f=t.padding)!=null?f:0),(y=t==null?void 0:t.height)!=null?y:0),c=[{x:-3*s/6,y:0},{x:h,y:0},{x:h+3*s/6,y:-s},{x:0,y:-s}],l,{cssStyles:o}=t;if(t.look==="handDrawn"){let u=P.svg(a),b=N(t,{}),x=F(c),d=u.path(x,b);l=a.insert(()=>d,":first-child").attr("transform",`translate(${-h/2}, ${s/2})`),o&&l.attr("style",o)}else l=ct(a,h,s,c);return r&&l.attr("style",r),t.width=h,t.height=s,W(t,l),t.intersect=function(u){return A.polygon(t,c,u)},a},"lean_right"),Vt=S(async(n,t)=>{var p,g,f,y;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=Math.max(i.width+((p=t.padding)!=null?p:0),(g=t==null?void 0:t.width)!=null?g:0),s=Math.max(i.height+((f=t.padding)!=null?f:0),(y=t==null?void 0:t.height)!=null?y:0),c=[{x:0,y:0},{x:h+3*s/6,y:0},{x:h,y:-s},{x:-(3*s)/6,y:-s}],l,{cssStyles:o}=t;if(t.look==="handDrawn"){let u=P.svg(a),b=N(t,{}),x=F(c),d=u.path(x,b);l=a.insert(()=>d,":first-child").attr("transform",`translate(${-h/2}, ${s/2})`),o&&l.attr("style",o)}else l=ct(a,h,s,c);return r&&l.attr("style",r),t.width=h,t.height=s,W(t,l),t.intersect=function(u){return A.polygon(t,c,u)},a},"lean_left"),Qt=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=i.width+t.padding,s=i.height+t.padding,c=[{x:-3*s/6,y:0},{x:h+3*s/6,y:0},{x:h,y:-s},{x:0,y:-s}],l,{cssStyles:o}=t;if(t.look==="handDrawn"){let p=P.svg(a),g=N(t,{}),f=F(c),y=p.path(f,g);l=a.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${s/2})`),o&&l.attr("style",o)}else l=ct(a,h,s,c);return r&&l.attr("style",r),t.width=h,t.height=s,W(t,l),t.intersect=function(p){return A.polygon(t,c,p)},a},"trapezoid"),At=S(async(n,t)=>{var p,g,f,y;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=Math.max(i.width+((p=t.padding)!=null?p:0)*2,(g=t==null?void 0:t.width)!=null?g:0),s=Math.max(i.height+((f=t.padding)!=null?f:0)*2,(y=t==null?void 0:t.height)!=null?y:0),c=[{x:0,y:0},{x:h,y:0},{x:h+3*s/6,y:-s},{x:-3*s/6,y:-s}],l,{cssStyles:o}=t;if(t.look==="handDrawn"){let u=P.svg(a),b=N(t,{}),x=F(c),d=u.path(x,b);l=a.insert(()=>d,":first-child").attr("transform",`translate(${-h/2}, ${s/2})`),o&&l.attr("style",o)}else l=ct(a,h,s,c);return r&&l.attr("style",r),t.width=h,t.height=s,W(t,l),t.intersect=function(u){return A.polygon(t,c,u)},a},"inv_trapezoid"),Cr=S(async(n,t)=>{var c,l;let{shapeSvg:e,bbox:r,label:a}=await q(n,t,"label"),i=e.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),e.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(r.width/2)-(r.x-((c=r.left)!=null?c:0))}, ${-(r.height/2)-(r.y-((l=r.top)!=null?l:0))})`),W(t,i),t.intersect=function(o){return A.rect(t,o)},e},"labelRect"),Ds=S(async(n,t)=>{var d,w,k,m,v;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=et((d=V().flowchart)==null?void 0:d.htmlLabels),c=i.width+((w=t.padding)!=null?w:0),l=c+i.height,o=c+i.height,p=[{x:0,y:0},{x:o,y:0},{x:o/2,y:-l}],{cssStyles:g}=t,f=P.svg(a),y=N(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let u=F(p),b=f.path(u,y),x=a.insert(()=>b,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return g&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",g),r&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",r),t.width=c,t.height=l,W(t,x),h.attr("transform",`translate(${-i.width/2-(i.x-((k=i.left)!=null?k:0))}, ${l/2-(i.height+((m=t.padding)!=null?m:0)/(s?2:1)-(i.y-((v=i.top)!=null?v:0)))})`),t.intersect=function(M){return X.info("Triangle intersect",t,p,M),A.polygon(t,p,M)},a},"triangle"),ba=S(async(n,t)=>{var d,w,k,m;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let a=80,i=50,{shapeSvg:h,bbox:s}=await q(n,t,G(t)),c=Math.max(a,s.width+((d=t.padding)!=null?d:0)*2,(w=t==null?void 0:t.width)!=null?w:0),l=Math.max(i,s.height+((k=t.padding)!=null?k:0)*2,(m=t==null?void 0:t.height)!=null?m:0),o=l/2,{cssStyles:p}=t,g=P.svg(h),f=N(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=[{x:-c/2,y:-l/2},{x:c/2-o,y:-l/2},...Xs(-c/2+o,0,o,50,90,270),{x:c/2-o,y:l/2},{x:-c/2,y:l/2}],u=F(y),b=g.path(u,f),x=h.insert(()=>b,":first-child");return x.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),r&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",r),W(t,x),t.intersect=function(v){return X.info("Pill intersect",t,{radius:o,point:v}),A.polygon(t,y,v)},h},"halfRoundedRectangle"),Ls=S(async(n,t)=>{var v,M,$,D;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=80,s=20,c=Math.max(h,(i.width+((v=t.padding)!=null?v:0)*2)*1.25,(M=t==null?void 0:t.width)!=null?M:0),l=Math.max(s,i.height+(($=t.padding)!=null?$:0)*2,(D=t==null?void 0:t.height)!=null?D:0),o=l/2,{cssStyles:p}=t,g=P.svg(a),f=N(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=c,u=l,b=y-o,x=u/4,d=[{x:b,y:0},{x,y:0},{x:0,y:u/2},{x,y:u},{x:b,y:u},...Xs(-b,-u/2,o,50,270,90)],w=F(d),k=g.path(w,f),m=a.insert(()=>k,":first-child");return m.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",p),r&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",r),m.attr("transform",`translate(${-c/2}, ${-l/2})`),W(t,m),t.intersect=function(L){return A.polygon(t,d,L)},a},"curvedTrapezoid"),Cs=S(async(n,t)=>{var d,w,k,m,v,M,$,D;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((d=t.padding)!=null?d:0)*2,(w=t==null?void 0:t.width)!=null?w:0),c=Math.max(i.height+((k=t.padding)!=null?k:0)*2,(m=t==null?void 0:t.height)!=null?m:0),l=-s/2,o=-c/2,{cssStyles:p}=t,g=P.svg(a),f=N(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=[{x:l,y:o},{x:l,y:o+c},{x:l+s,y:o+c},{x:l+s,y:o-c/2}],u=F(y),b=g.path(u,f),x=a.insert(()=>b,":first-child");return x.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),r&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",r),x.attr("transform",`translate(0, ${c/4})`),h.attr("transform",`translate(${-s/2+((v=t.padding)!=null?v:0)-(i.x-((M=i.left)!=null?M:0))}, ${-c/4+(($=t.padding)!=null?$:0)-(i.y-((D=i.top)!=null?D:0))})`),W(t,x),t.intersect=function(L){return A.polygon(t,y,L)},a},"slopedRect");function js(n,t,e,r,a,i,h){let c=(n+e)/2,l=(t+r)/2,o=Math.atan2(r-t,e-n),p=(e-n)/2,g=(r-t)/2,f=p/a,y=g/i,u=Math.sqrt(f**2+y**2);if(u>1)throw new Error("The given radii are too small to create an arc between the points.");let b=Math.sqrt(1-u**2),x=c+b*i*Math.sin(o)*(h?-1:1),d=l-b*a*Math.cos(o)*(h?-1:1),w=Math.atan2((t-d)/i,(n-x)/a),m=Math.atan2((r-d)/i,(e-x)/a)-w;h&&m<0&&(m+=2*Math.PI),!h&&m>0&&(m-=2*Math.PI);let v=[];for(let M=0;M<20;M++){let $=M/19,D=w+$*m,L=x+a*Math.cos(D),C=d+i*Math.sin(D);v.push({x:L,y:C})}return v}S(js,"generateArcPoints");var Rs=S(async(n,t)=>{let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=i.width+t.padding+20,s=i.height+t.padding,c=s/2,l=c/(2.5+s/50),{cssStyles:o}=t,p=[{x:h/2,y:-s/2},{x:-h/2,y:-s/2},...js(-h/2,-s/2,-h/2,s/2,l,c,!1),{x:h/2,y:s/2},...js(h/2,s/2,h/2,-s/2,l,c,!0)],g=P.svg(a),f=N(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=F(p),u=g.path(y,f),b=a.insert(()=>u,":first-child");return b.attr("class","basic label-container"),o&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${l/2}, 0)`),W(t,b),t.intersect=function(x){return A.polygon(t,p,x)},a},"bowTieRect"),Ut=S(async(n,t)=>{var d,w,k,m;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=i.width+t.padding,c=i.height+t.padding,l=c*.2,o=-s/2,p=-c/2-l/2,{cssStyles:g}=t,f=P.svg(a),y=N(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let u=[{x:o,y:p+l},{x:-o,y:p+l},{x:-o,y:-p},{x:o,y:-p},{x:o,y:p},{x:-o,y:p},{x:-o,y:p+l}],b=f.polygon(u.map(v=>[v.x,v.y]),y),x=a.insert(()=>b,":first-child");return x.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",g),r&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",r),h.attr("transform",`translate(${o+((d=t.padding)!=null?d:0)/2-(i.x-((w=i.left)!=null?w:0))}, ${p+l+((k=t.padding)!=null?k:0)/2-(i.y-((m=i.top)!=null?m:0))})`),W(t,x),t.intersect=function(v){return A.rect(t,v)},a},"dividedRectangle");function Wa(n){let t=Math.cos(Math.PI/4),e=Math.sin(Math.PI/4),r=n*2,a={x:r/2*t,y:r/2*e},i={x:-(r/2)*t,y:r/2*e},h={x:-(r/2)*t,y:-(r/2)*e},s={x:r/2*t,y:-(r/2)*e};return`M ${i.x},${i.y} L ${s.x},${s.y} M ${a.x},${a.y} L ${h.x},${h.y}`}S(Wa,"createLine");var As=S((n,t)=>{var f,y;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e,t.label="";let a=n.insert("g").attr("class",G(t)).attr("id",(f=t.domId)!=null?f:t.id),i=Math.max(30,(y=t==null?void 0:t.width)!=null?y:0),{cssStyles:h}=t,s=P.svg(a),c=N(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let l=s.circle(0,0,i*2,c),o=Wa(i),p=s.path(o,c),g=a.insert(()=>l,":first-child");return g.insert(()=>p),h&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",h),r&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",r),W(t,g),t.intersect=function(u){return X.info("crossedCircle intersect",t,{radius:i,point:u}),A.circle(t,i,u)},a},"crossedCircle"),da=S(async(n,t)=>{var v,M,$,D;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=100,s=50,c=Math.max(i.width+((v=t.padding)!=null?v:0)*2,(M=t==null?void 0:t.width)!=null?M:0),l=Math.max(i.height+(($=t.padding)!=null?$:0)*2,(D=t==null?void 0:t.height)!=null?D:0),o=c/l,p=c,g=l;p>g*o?g=p/o:p=g*o,p=Math.max(p,h),g=Math.max(g,s);let f=Math.min(g*.2,g/4),y=g+f*2,{cssStyles:u}=t,b=P.svg(a),x=N(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let d=[{x:-p/2,y:y/2},...ht(-p/2,y/2,p/2,y/2,f,1),{x:p/2,y:-y/2},...ht(p/2,-y/2,-p/2,-y/2,f,-1)],w=F(d),k=b.path(w,x),m=a.insert(()=>k,":first-child");return m.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",u),r&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",r),W(t,m),t.intersect=function(L){return A.polygon(t,d,L)},a},"waveRectangle"),Rr=S((n,t,e,r,a,i)=>`M${n},${t} a${a},${i} 0,0,1 0,${-r} l${e},0 a${a},${i} 0,0,1 0,${r} M${e},${-r} a${a},${i} 0,0,0 0,${r} l${-e},0`,"createCylinderPathD"),Ar=S((n,t,e,r,a,i)=>[`M${n},${t}`,`M${n+e},${t}`,`a${a},${i} 0,0,0 0,${-r}`,`l${-e},0`,`a${a},${i} 0,0,0 0,${r}`,`l${e},0`].join(" "),"createOuterCylinderPathD"),Br=S((n,t,e,r,a,i)=>[`M${n+e/2},${-r/2}`,`a${a},${i} 0,0,0 0,${r}`].join(" "),"createInnerCylinderPathD"),Bs=S(async(n,t)=>{var u,b;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h,halfPadding:s}=await q(n,t,G(t)),c=t.look==="neo"?s*2:s,l=i.height+c,o=l/2,p=o/(2.5+l/50),g=i.width+p+c,{cssStyles:f}=t,y;if(t.look==="handDrawn"){let x=P.svg(a),d=Ar(0,0,g,l,p,o),w=Br(0,0,g,l,p,o),k=x.path(d,N(t,{})),m=x.path(w,N(t,{fill:"none"}));y=a.insert(()=>m,":first-child"),y=a.insert(()=>k,":first-child"),y.attr("class","basic label-container"),f&&y.attr("style",f)}else{let x=Rr(0,0,g,l,p,o);y=a.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",f).attr("style",r)}return y.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),r&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",r),y.attr("label-offset-x",p),y.attr("transform",`translate(${-g/2}, ${l/2} )`),h.attr("transform",`translate(${-(i.width/2)-p-(i.x-((u=i.left)!=null?u:0))}, ${-(i.height/2)-(i.y-((b=i.top)!=null?b:0))})`),W(t,y),t.intersect=function(x){var k,m,v,M,$,D;let d=A.rect(t,x),w=d.y-((k=t.y)!=null?k:0);if(o!=0&&(Math.abs(w)<((m=t.height)!=null?m:0)/2||Math.abs(w)==((v=t.height)!=null?v:0)/2&&Math.abs(d.x-((M=t.x)!=null?M:0))>(($=t.width)!=null?$:0)/2-p)){let L=p*p*(1-w*w/(o*o));L!=0&&(L=Math.sqrt(L)),L=p-L,x.x-((D=t.x)!=null?D:0)>0&&(L=-L),d.x+=L}return d},a},"tiltedCylinder"),Ns=S(async(n,t)=>{var x,d,w,k;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=60,s=20,c=Math.max(h,i.width+((x=t.padding)!=null?x:0)*2,(d=t==null?void 0:t.width)!=null?d:0),l=Math.max(s,i.height+((w=t.padding)!=null?w:0)*2,(k=t==null?void 0:t.height)!=null?k:0),{cssStyles:o}=t,p=P.svg(a),g=N(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let f=[{x:-c/2*.8,y:-l/2},{x:c/2*.8,y:-l/2},{x:c/2,y:-l/2*.6},{x:c/2,y:l/2},{x:-c/2,y:l/2},{x:-c/2,y:-l/2*.6}],y=F(f),u=p.path(y,g),b=a.insert(()=>u,":first-child");return b.attr("class","basic label-container"),o&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",o),r&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",r),W(t,b),t.intersect=function(m){return A.polygon(t,f,m)},a},"trapezoidalPentagon"),Es=S(async(n,t)=>{var x,d,w,k;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=i.width+((x=t.padding)!=null?x:0),c=s+i.height,l=s+i.height,o=[{x:0,y:-c},{x:l,y:-c},{x:l/2,y:0}],{cssStyles:p}=t,g=P.svg(a),f=N(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=F(o),u=g.path(y,f),b=a.insert(()=>u,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return p&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),r&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",r),t.width=s,t.height=c,W(t,b),h.attr("transform",`translate(${-i.width/2-(i.x-((d=i.left)!=null?d:0))}, ${-c/2+((w=t.padding)!=null?w:0)/2+(i.y-((k=i.top)!=null?k:0))})`),t.intersect=function(m){return X.info("Triangle intersect",t,o,m),A.polygon(t,o,m)},a},"flippedTriangle"),wa=S(async(n,t)=>{var y,u;let{labelStyles:e,nodeStyles:r}=T(t);t.label="",t.labelStyle=e;let{shapeSvg:a}=await q(n,t,G(t)),i=Math.max(30,(y=t==null?void 0:t.width)!=null?y:0),h=Math.max(30,(u=t==null?void 0:t.height)!=null?u:0),{cssStyles:s}=t,c=P.svg(a),l=N(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");let o=[{x:0,y:0},{x:i,y:0},{x:0,y:h},{x:i,y:h}],p=F(o),g=c.path(p,l),f=a.insert(()=>g,":first-child");return f.attr("class","basic label-container"),s&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",s),r&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",r),f.attr("transform",`translate(${-i/2}, ${-h/2})`),W(t,f),t.intersect=function(b){return X.info("Pill intersect",t,{points:o}),A.polygon(t,o,b)},a},"hourglass"),Jt=S(async(n,t)=>{var v,M,$,D;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i}=await q(n,t,G(t)),h=Math.max(i.width+((v=t.padding)!=null?v:0)*2,(M=t==null?void 0:t.width)!=null?M:0),s=Math.max(i.height+(($=t.padding)!=null?$:0)*2,(D=t==null?void 0:t.height)!=null?D:0),c=-h/2,l=-s/2,o=.2*s,p=.2*s,{cssStyles:g}=t,f=P.svg(a),y=N(t,{}),u=[{x:c-o/2,y:l},{x:c+h+o/2,y:l},{x:c+h+o/2,y:l+s},{x:c-o/2,y:l+s}],b=[{x:c+h-o/2,y:l+s},{x:c+h+o/2,y:l+s},{x:c+h+o/2,y:l+s-p}];t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=F(u),d=f.path(x,y),w=F(b),k=f.path(w,rt(tt({},y),{fillStyle:"solid"})),m=a.insert(()=>k,":first-child");return m.insert(()=>d,":first-child"),m.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",g),r&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",r),W(t,m),t.intersect=function(L){return A.polygon(t,u,L)},a},"taggedRect"),Kt=S(async(n,t)=>{var v,M,$,D,L,C;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((v=t.padding)!=null?v:0)*2,(M=t==null?void 0:t.width)!=null?M:0),c=Math.max(i.height+(($=t.padding)!=null?$:0)*2,(D=t==null?void 0:t.height)!=null?D:0),l=5,o=-s/2,p=-c/2,{cssStyles:g}=t,f=P.svg(a),y=N(t,{}),u=[{x:o-l,y:p+l},{x:o-l,y:p+c+l},{x:o+s-l,y:p+c+l},{x:o+s-l,y:p+c},{x:o+s,y:p+c},{x:o+s,y:p+c-l},{x:o+s+l,y:p+c-l},{x:o+s+l,y:p-l},{x:o+l,y:p-l},{x:o+l,y:p},{x:o,y:p},{x:o,y:p+l}],b=[{x:o,y:p+l},{x:o+s-l,y:p+l},{x:o+s-l,y:p+c},{x:o+s,y:p+c},{x:o+s,y:p},{x:o,y:p}];t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=F(u),d=f.path(x,y),w=F(b),k=f.path(w,rt(tt({},y),{fill:"none"})),m=a.insert(()=>k,":first-child");return m.insert(()=>d,":first-child"),m.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",g),r&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",r),h.attr("transform",`translate(${-(i.width/2)-l-(i.x-((L=i.left)!=null?L:0))}, ${-(i.height/2)+l-(i.y-((C=i.top)!=null?C:0))})`),W(t,m),t.intersect=function(Z){return A.polygon(t,u,Z)},a},"multiRect"),Nr=S((n,t,e,r,a,i,h)=>[`M${n},${t+i}`,`a${a},${i} 0,0,0 ${e},0`,`a${a},${i} 0,0,0 ${-e},0`,`l0,${r}`,`a${a},${i} 0,0,0 ${e},0`,`l0,${-r}`,`M${n},${t+i+h}`,`a${a},${i} 0,0,0 ${e},0`].join(" "),"createCylinderPathD"),Er=S((n,t,e,r,a,i,h)=>[`M${n},${t+i}`,`M${n+e},${t+i}`,`a${a},${i} 0,0,0 ${-e},0`,`l0,${r}`,`a${a},${i} 0,0,0 ${e},0`,`l0,${-r}`,`M${n},${t+i+h}`,`a${a},${i} 0,0,0 ${e},0`].join(" "),"createOuterCylinderPathD"),Wr=S((n,t,e,r,a,i)=>[`M${n-e/2},${-r/2}`,`a${a},${i} 0,0,0 ${e},0`].join(" "),"createInnerCylinderPathD"),Ws=S(async(n,t)=>{var y,u,b,x,d,w;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((y=t.padding)!=null?y:0),(u=t.width)!=null?u:0),c=s/2,l=c/(2.5+s/50),o=Math.max(i.height+l+((b=t.padding)!=null?b:0),(x=t.height)!=null?x:0),p=o*.1,g,{cssStyles:f}=t;if(t.look==="handDrawn"){let k=P.svg(a),m=Er(0,0,s,o,c,l,p),v=Wr(0,l,s,o,c,l),M=N(t,{}),$=k.path(m,M),D=k.path(v,M);a.insert(()=>D,":first-child").attr("class","line"),g=a.insert(()=>$,":first-child"),g.attr("class","basic label-container"),f&&g.attr("style",f)}else{let k=Nr(0,0,s,o,c,l,p);g=a.insert("path",":first-child").attr("d",k).attr("class","basic label-container").attr("style",f).attr("style",r)}return g.attr("label-offset-y",l),g.attr("transform",`translate(${-s/2}, ${-(o/2+l)})`),W(t,g),h.attr("transform",`translate(${-(i.width/2)-(i.x-((d=i.left)!=null?d:0))}, ${-(i.height/2)+l-(i.y-((w=i.top)!=null?w:0))})`),t.intersect=function(k){var M,$,D,L,C,Z;let m=A.rect(t,k),v=m.x-((M=t.x)!=null?M:0);if(c!=0&&(Math.abs(v)<(($=t.width)!=null?$:0)/2||Math.abs(v)==((D=t.width)!=null?D:0)/2&&Math.abs(m.y-((L=t.y)!=null?L:0))>((C=t.height)!=null?C:0)/2-l)){let H=l*l*(1-v*v/(c*c));H>0&&(H=Math.sqrt(H)),H=l-H,k.y-((Z=t.y)!=null?Z:0)>0&&(H=-H),m.y+=H}return m},a},"linedCylinder"),ma=S(async(n,t)=>{var m,v,M,$,D,L,C,Z;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((m=t.padding)!=null?m:0)*2,(v=t==null?void 0:t.width)!=null?v:0),c=Math.max(i.height+((M=t.padding)!=null?M:0)*2,($=t==null?void 0:t.height)!=null?$:0),l=c/8,o=c+l,{cssStyles:p}=t,f=70-s,y=f>0?f/2:0,u=P.svg(a),b=N(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let x=[{x:-s/2-y,y:o/2},...ht(-s/2-y,o/2,s/2+y,o/2,l,.8),{x:s/2+y,y:-o/2},{x:-s/2-y,y:-o/2}],d=F(x),w=u.path(d,b),k=a.insert(()=>w,":first-child");return k.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),r&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",r),k.attr("transform",`translate(0,${-l/2})`),h.attr("transform",`translate(${-s/2+((D=t.padding)!=null?D:0)-(i.x-((L=i.left)!=null?L:0))},${-c/2+((C=t.padding)!=null?C:0)-l-(i.y-((Z=i.top)!=null?Z:0))})`),W(t,k),t.intersect=function(H){return A.polygon(t,x,H)},a},"waveEdgedRectangle"),Ts=S((n,t)=>{var u,b,x;let{labelStyles:e,nodeStyles:r}=T(t);t.label="",t.labelStyle=e;let a=n.insert("g").attr("class",G(t)).attr("id",(u=t.domId)!=null?u:t.id),{cssStyles:i}=t,h=Math.max(35,(b=t==null?void 0:t.width)!=null?b:0),s=Math.max(35,(x=t==null?void 0:t.height)!=null?x:0),c=7,l=[{x:h,y:0},{x:0,y:s+c/2},{x:h-2*c,y:s+c/2},{x:0,y:2*s},{x:h,y:s-c/2},{x:2*c,y:s-c/2}],o=P.svg(a),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let g=F(l),f=o.path(g,p),y=a.insert(()=>f,":first-child");return i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",r),y.attr("transform",`translate(-${h/2},${-s})`),W(t,y),t.intersect=function(d){return X.info("lightningBolt intersect",t,d),A.polygon(t,l,d)},a},"lightningBolt"),Os=S((n,t,{config:{themeVariables:e}})=>{var f;let{labelStyles:r,nodeStyles:a}=T(t);t.label="",t.labelStyle=r;let i=n.insert("g").attr("class",G(t)).attr("id",(f=t.domId)!=null?f:t.id),h=7,{cssStyles:s}=t,c=P.svg(i),{nodeBorder:l}=e,o=N(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(o.roughness=0);let p=c.circle(0,0,h*2,o),g=i.insert(()=>p,":first-child");return g.selectAll("path").attr("style",`fill: ${l} !important;`),s&&s.length>0&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),W(t,g),t.intersect=function(y){return X.info("filledCircle intersect",t,{radius:h,point:y}),A.circle(t,h,y)},i},"filledCircle"),ts=S(async(n,t)=>{var L,C,Z,H,z,O;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((L=t.padding)!=null?L:0)*2,(C=t==null?void 0:t.width)!=null?C:0),c=Math.max(i.height+((Z=t.padding)!=null?Z:0)*2,(H=t==null?void 0:t.height)!=null?H:0),l=c/4,o=c+l,p=-s/2,g=-o/2,f=5,{cssStyles:y}=t,u=ht(p-f,g+o+f,p+s-f,g+o+f,l,.8),b=u==null?void 0:u[u.length-1],x=[{x:p-f,y:g+f},{x:p-f,y:g+o+f},...u,{x:p+s-f,y:b.y-f},{x:p+s,y:b.y-f},{x:p+s,y:b.y-2*f},{x:p+s+f,y:b.y-2*f},{x:p+s+f,y:g-f},{x:p+f,y:g-f},{x:p+f,y:g},{x:p,y:g},{x:p,y:g+f}],d=[{x:p,y:g+f},{x:p+s-f,y:g+f},{x:p+s-f,y:b.y-f},{x:p+s,y:b.y-f},{x:p+s,y:g},{x:p,y:g}],w=P.svg(a),k=N(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let m=F(x),v=w.path(m,k),M=F(d),$=w.path(M,k),D=a.insert(()=>v,":first-child");return D.insert(()=>$),D.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",y),r&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",r),D.attr("transform",`translate(0,${-l/2})`),h.attr("transform",`translate(${-(i.width/2)-f-(i.x-((z=i.left)!=null?z:0))}, ${-(i.height/2)+f-l/2-(i.y-((O=i.top)!=null?O:0))})`),W(t,D),t.intersect=function(R){return A.polygon(t,x,R)},a},"multiWaveEdgedRectangle"),_s=S(async(n,t)=>{var w,k,m,v,M,$;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((w=t.padding)!=null?w:0)*2,(k=t==null?void 0:t.width)!=null?k:0),c=Math.max(i.height+((m=t.padding)!=null?m:0)*2,(v=t==null?void 0:t.height)!=null?v:0),l=5,o=-s/2,p=-c/2,{cssStyles:g}=t,f=P.svg(a),y=N(t,{}),u=[{x:o-l,y:p-l},{x:o-l,y:p+c},{x:o+s,y:p+c},{x:o+s,y:p-l}],b=`M${o-l},${p-l} L${o+s},${p-l} L${o+s},${p+c} L${o-l},${p+c} L${o-l},${p-l} M${o-l},${p} L${o+s},${p} M${o},${p-l} L${o},${p+c}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=f.path(b,y),d=a.insert(()=>x,":first-child");return d.attr("transform",`translate(${l/2}, ${l/2})`),d.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",g),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),h.attr("transform",`translate(${-(i.width/2)+l/2-(i.x-((M=i.left)!=null?M:0))}, ${-(i.height/2)+l/2-(i.y-(($=i.top)!=null?$:0))})`),W(t,d),t.intersect=function(D){return A.polygon(t,u,D)},a},"windowPane"),ka=S(async(n,t)=>{var x,d,w,k,m,v,M,$;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((x=t.padding)!=null?x:0)*2,(d=t==null?void 0:t.width)!=null?d:0),c=Math.max(i.height+((w=t.padding)!=null?w:0)*2,(k=t==null?void 0:t.height)!=null?k:0),l=c/4,o=c+l,{cssStyles:p}=t,g=P.svg(a),f=N(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=[{x:-s/2-s/2*.1,y:-o/2},{x:-s/2-s/2*.1,y:o/2},...ht(-s/2-s/2*.1,o/2,s/2+s/2*.1,o/2,l,.8),{x:s/2+s/2*.1,y:-o/2},{x:-s/2-s/2*.1,y:-o/2},{x:-s/2,y:-o/2},{x:-s/2,y:o/2*1.1},{x:-s/2,y:-o/2}],u=g.polygon(y.map(D=>[D.x,D.y]),f),b=a.insert(()=>u,":first-child");return b.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",p),r&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(0,${-l/2})`),h.attr("transform",`translate(${-s/2+((m=t.padding)!=null?m:0)+s/2*.1/2-(i.x-((v=i.left)!=null?v:0))},${-c/2+((M=t.padding)!=null?M:0)-l/2-(i.y-(($=i.top)!=null?$:0))})`),W(t,b),t.intersect=function(D){return A.polygon(t,y,D)},a},"linedWaveEdgedRect"),Sa=S(async(n,t)=>{var D,L,C,Z,H,z,O,R;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=Math.max(i.width+((D=t.padding)!=null?D:0)*2,(L=t==null?void 0:t.width)!=null?L:0),c=Math.max(i.height+((C=t.padding)!=null?C:0)*2,(Z=t==null?void 0:t.height)!=null?Z:0),l=c/4,o=.2*s,p=.2*c,g=c+l,{cssStyles:f}=t,y=P.svg(a),u=N(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=[{x:-s/2-s/2*.1,y:g/2},...ht(-s/2-s/2*.1,g/2,s/2+s/2*.1,g/2,l,.8),{x:s/2+s/2*.1,y:-g/2},{x:-s/2-s/2*.1,y:-g/2}],x=-s/2+s/2*.1,d=-g/2-p*.4,w=[{x:x+s-o,y:(d+c)*1.4},{x:x+s,y:d+c-p},{x:x+s,y:(d+c)*.9},...ht(x+s,(d+c)*1.3,x+s-o,(d+c)*1.5,-c*.03,.5)],k=F(b),m=y.path(k,u),v=F(w),M=y.path(v,rt(tt({},u),{fillStyle:"solid"})),$=a.insert(()=>M,":first-child");return $.insert(()=>m,":first-child"),$.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",f),r&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",r),$.attr("transform",`translate(0,${-l/2})`),h.attr("transform",`translate(${-s/2+((H=t.padding)!=null?H:0)-(i.x-((z=i.left)!=null?z:0))},${-c/2+((O=t.padding)!=null?O:0)-l/2-(i.y-((R=i.top)!=null?R:0))})`),W(t,$),t.intersect=function(E){return A.polygon(t,b,E)},a},"taggedWaveEdgedRectangle");function lt(n,t,e,r=100,a=0,i=180){let h=[],s=a*Math.PI/180,o=(i*Math.PI/180-s)/(r-1);for(let p=0;p<r;p++){let g=s+p*o,f=n+e*Math.cos(g),y=t+e*Math.sin(g);h.push({x:-f,y:-y})}return h}S(lt,"generateCirclePoints");var Hs=S(async(n,t)=>{var m,v,M,$,D;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=i.width+((m=t.padding)!=null?m:0),c=i.height+((v=t.padding)!=null?v:0),l=Math.max(5,c*.1),{cssStyles:o}=t,p=[...lt(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...lt(s/2+l*2,-l,l,20,-180,-270),...lt(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...lt(s/2,c/2,l,20,0,90)],g=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...lt(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...lt(s/2+s*.1,-l,l,20,-180,-270),...lt(s/2+s*.1,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...lt(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2,y:c/2+l}],f=P.svg(a),y=N(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let b=F(p).replace("Z",""),x=f.path(b,y),d=F(g),w=f.path(d,tt({},y)),k=a.insert("g",":first-child");return k.insert(()=>w,":first-child").attr("stroke-opacity",0),k.insert(()=>x,":first-child"),k.attr("class","text"),o&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",r),k.attr("transform",`translate(${l}, 0)`),h.attr("transform",`translate(${-s/2+l-(i.x-((M=i.left)!=null?M:0))},${-c/2+(($=t.padding)!=null?$:0)/2-(i.y-((D=i.top)!=null?D:0))})`),W(t,k),t.intersect=function(L){return A.polygon(t,g,L)},a},"curlyBraceLeft");function nt(n,t,e,r=100,a=0,i=180){let h=[],s=a*Math.PI/180,o=(i*Math.PI/180-s)/(r-1);for(let p=0;p<r;p++){let g=s+p*o,f=n+e*Math.cos(g),y=t+e*Math.sin(g);h.push({x:f,y})}return h}S(nt,"generateCirclePoints");var Tr=S(async(n,t)=>{var m,v,M,$,D,L;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=i.width+((m=t.padding)!=null?m:0),c=i.height+((v=t.padding)!=null?v:0),l=Math.max(5,c*.1),{cssStyles:o}=t,p=[...nt(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...nt(s/2+l*2,-l,l,20,-180,-270),...nt(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...nt(s/2,c/2,l,20,0,90)],g=[{x:-s/2,y:-c/2-l},{x:s/2,y:-c/2-l},...nt(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...nt(s/2+l*2,-l,l,20,-180,-270),...nt(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...nt(s/2,c/2,l,20,0,90),{x:s/2,y:c/2+l},{x:-s/2,y:c/2+l}],f=P.svg(a),y=N(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let b=F(p).replace("Z",""),x=f.path(b,y),d=F(g),w=f.path(d,tt({},y)),k=a.insert("g",":first-child");return k.insert(()=>w,":first-child").attr("stroke-opacity",0),k.insert(()=>x,":first-child"),k.attr("class","text"),o&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",r),k.attr("transform",`translate(${-l}, 0)`),h.attr("transform",`translate(${-s/2+((M=t.padding)!=null?M:0)/2-(i.x-(($=i.left)!=null?$:0))},${-c/2+((D=t.padding)!=null?D:0)/2-(i.y-((L=i.top)!=null?L:0))})`),W(t,k),t.intersect=function(C){return A.polygon(t,g,C)},a},"curlyBraceRight");function U(n,t,e,r=100,a=0,i=180){let h=[],s=a*Math.PI/180,o=(i*Math.PI/180-s)/(r-1);for(let p=0;p<r;p++){let g=s+p*o,f=n+e*Math.cos(g),y=t+e*Math.sin(g);h.push({x:-f,y:-y})}return h}S(U,"generateCirclePoints");var Or=S(async(n,t)=>{var D,L,C,Z,H,z;let{labelStyles:e,nodeStyles:r}=T(t);t.labelStyle=e;let{shapeSvg:a,bbox:i,label:h}=await q(n,t,G(t)),s=i.width+((D=t.padding)!=null?D:0),c=i.height+((L=t.padding)!=null?L:0),l=Math.max(5,c*.1),{cssStyles:o}=t,p=[...U(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...U(s/2+l*2,-l,l,20,-180,-270),...U(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...U(s/2,c/2,l,20,0,90)],g=[...U(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...U(-s/2-l/2,-l,l,20,0,90),...U(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...U(-s/2+l+l/2,c/2,l,30,-180,-270)],f=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...U(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...U(s/2+l*2,-l,l,20,-180,-270),...U(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...U(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2-l-l/2,y:c/2+l},...U(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...U(-s/2-l/2,-l,l,20,0,90),...U(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...U(-s/2+l+l/2,c/2,l,30,-180,-270)],y=P.svg(a),u=N(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let x=F(p).replace("Z",""),d=y.path(x,u),k=F(g).replace("Z",""),m=y.path(k,u),v=F(f),M=y.path(v,tt({},u)),$=a.insert("g",":first-child");return $.insert(()=>M,":first-child").attr("stroke-opacity",0),$.insert(()=>d,":first-child"),$.insert(()=>m,":first-child"),$.attr("class","text"),o&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",r),$.attr("transform",`translate(${l-l/4}, 0)`),h.attr("transform",`translate(${-s/2+((C=t.padding)!=null?C:0)/2-(i.x-((Z=i.left)!=null?Z:0))},${-c/2+((H=t.padding)!=null?H:0)/2-(i.y-((z=i.top)!=null?z:0))})`),W(t,$),t.intersect=function(O){return A.polygon(t,f,O)},a},"curlyBraces"),_r=S(async(n,t,{config:{themeVariables:e,flowchart:r}})=>{var z,O,R,E;let{labelStyles:a}=T(t);t.labelStyle=a;let i=(z=t.assetHeight)!=null?z:48,h=(O=t.assetWidth)!=null?O:48,s=Math.max(i,h),c=r==null?void 0:r.wrappingWidth;t.width=Math.max(s,c!=null?c:0);let{shapeSvg:l,bbox:o,halfPadding:p,label:g}=await q(n,t,"icon-shape default"),f=t.pos==="t",y=s+p*2,u=s+p*2,{nodeBorder:b,mainBkg:x}=e,{stylesMap:d}=dt(t),w=-u/2,k=-y/2,m=t.label?8:0,v=P.svg(l),M=N(t,{stroke:d.get("fill")||x});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let $=v.rectangle(w,k,u,y,M),D=Math.max(u,o.width),L=y+o.height+m,C=v.rectangle(-D/2,-L/2,D,L,rt(tt({},M),{fill:"transparent",stroke:"none"})),Z=l.insert(()=>$,":first-child"),H=l.insert(()=>C);if(t.icon){let j=l.append("g");j.html(`<g>${await St(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let B=j.node().getBBox(),I=B.width,Y=B.height,Q=B.x,it=B.y;j.attr("transform",`translate(${-I/2-Q},${f?o.height/2+m/2-Y/2-it:-o.height/2-m/2-Y/2-it})`),j.selectAll("path").attr("fill",(R=d.get("stroke"))!=null?R:b)}return g.attr("transform",`translate(${-o.width/2-(o.x-((E=o.left)!=null?E:0))},${f?-L/2:L/2-o.height})`),Z.attr("transform",`translate(0,${f?o.height/2+m/2:-o.height/2-m/2})`),W(t,H),t.intersect=function(j){var wt,mt,kt;if(X.info("iconSquare intersect",t,j),!t.label)return A.rect(t,j);let B=(wt=t.x)!=null?wt:0,I=(mt=t.y)!=null?mt:0,Y=(kt=t.height)!=null?kt:0,Q=[];return f?Q=[{x:B-o.width/2,y:I-Y/2},{x:B+o.width/2,y:I-Y/2},{x:B+o.width/2,y:I-Y/2+o.height+m},{x:B+u/2,y:I-Y/2+o.height+m},{x:B+u/2,y:I+Y/2},{x:B-u/2,y:I+Y/2},{x:B-u/2,y:I-Y/2+o.height+m},{x:B-o.width/2,y:I-Y/2+o.height+m}]:Q=[{x:B-u/2,y:I-Y/2},{x:B+u/2,y:I-Y/2},{x:B+u/2,y:I-Y/2+y},{x:B+o.width/2,y:I-Y/2+y},{x:B+o.width/2/2,y:I+Y/2},{x:B-o.width/2,y:I+Y/2},{x:B-o.width/2,y:I-Y/2+y},{x:B-u/2,y:I-Y/2+y}],A.polygon(t,Q,j)},l},"iconSquare"),Hr=S(async(n,t,{config:{themeVariables:e,flowchart:r}})=>{var E,j,B;let{labelStyles:a}=T(t);t.labelStyle=a;let i=(E=t.assetHeight)!=null?E:48,h=(j=t.assetWidth)!=null?j:48,s=Math.max(i,h),c=r==null?void 0:r.wrappingWidth;t.width=Math.max(s,c!=null?c:0);let{shapeSvg:l,bbox:o,label:p}=await q(n,t,"icon-shape default"),g=20,f=t.label?8:0,y=t.pos==="t",{nodeBorder:u,mainBkg:b}=e,{stylesMap:x}=dt(t),d=P.svg(l),w=N(t,{stroke:x.get("fill")||b});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let k=l.append("g");t.icon&&k.html(`<g>${await St(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let m=k.node().getBBox(),v=m.width,M=m.height,$=m.x,D=m.y,L=Math.max(v,M)*Math.SQRT2+g*2,C=d.circle(0,0,L,w),Z=Math.max(L,o.width),H=L+o.height+f,z=d.rectangle(-Z/2,-H/2,Z,H,rt(tt({},w),{fill:"transparent",stroke:"none"})),O=l.insert(()=>C,":first-child"),R=l.insert(()=>z);return k.attr("transform",`translate(${-v/2-$},${y?o.height/2+f/2-M/2-D:-o.height/2-f/2-M/2-D})`),k.selectAll("path").attr("fill",x.get("stroke")||u),p.attr("transform",`translate(${-o.width/2-(o.x-((B=o.left)!=null?B:0))},${y?-H/2:H/2-o.height})`),O.attr("transform",`translate(0,${y?o.height/2+f/2:-o.height/2-f/2})`),W(t,R),t.intersect=function(I){return X.info("iconSquare intersect",t,I),A.rect(t,I)},l},"iconCircle"),Ir=S(async(n,t,{config:{themeVariables:e,flowchart:r}})=>{var Z,H,z;let{labelStyles:a}=T(t);t.labelStyle=a;let i=(Z=t.assetHeight)!=null?Z:48,h=(H=t.assetWidth)!=null?H:48,s=Math.max(i,h),c=r==null?void 0:r.wrappingWidth;t.width=Math.max(s,c!=null?c:0);let{shapeSvg:l,bbox:o,label:p}=await q(n,t,"icon-shape default"),g=t.pos==="t",f=s,y=s,{nodeBorder:u}=e,{stylesMap:b}=dt(t),x=-y/2,d=-f/2,w=t.label?8:0,k=P.svg(l),m=N(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let v=k.rectangle(x,d,y,f,m),M=Math.max(y,o.width),$=f+o.height+w,D=k.rectangle(-M/2,-$/2,M,$,rt(tt({},m),{fill:"transparent",stroke:"none"})),L=l.insert(()=>v,":first-child"),C=l.insert(()=>D);if(t.icon){let O=l.append("g");O.html(`<g>${await St(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let R=O.node().getBBox(),E=R.width,j=R.height,B=R.x,I=R.y;O.attr("transform",`translate(${-E/2-B},${g?o.height/2+w/2-j/2-I:-o.height/2-w/2-j/2-I})`),O.selectAll("path").attr("fill",b.get("stroke")||u)}return p.attr("transform",`translate(${-o.width/2-(o.x-((z=o.left)!=null?z:0))},${g?-$/2:$/2-o.height})`),L.attr("transform",`translate(0,${g?o.height/2+w/2:-o.height/2-w/2})`),W(t,C),t.intersect=function(O){var Y,Q,it;if(X.info("iconSquare intersect",t,O),!t.label)return A.rect(t,O);let R=(Y=t.x)!=null?Y:0,E=(Q=t.y)!=null?Q:0,j=(it=t.height)!=null?it:0,B=[];return g?B=[{x:R-o.width/2,y:E-j/2},{x:R+o.width/2,y:E-j/2},{x:R+o.width/2,y:E-j/2+o.height+w},{x:R+y/2,y:E-j/2+o.height+w},{x:R+y/2,y:E+j/2},{x:R-y/2,y:E+j/2},{x:R-y/2,y:E-j/2+o.height+w},{x:R-o.width/2,y:E-j/2+o.height+w}]:B=[{x:R-y/2,y:E-j/2},{x:R+y/2,y:E-j/2},{x:R+y/2,y:E-j/2+f},{x:R+o.width/2,y:E-j/2+f},{x:R+o.width/2/2,y:E+j/2},{x:R-o.width/2,y:E+j/2},{x:R-o.width/2,y:E-j/2+f},{x:R-y/2,y:E-j/2+f}],A.polygon(t,B,O)},l},"icon"),zr=S(async(n,t,{config:{flowchart:e}})=>{var L,C,Z,H;let r=new Image;r.src=(L=t==null?void 0:t.img)!=null?L:"",await r.decode();let a=Number(r.naturalWidth.toString().replace("px","")),i=Number(r.naturalHeight.toString().replace("px",""));t.imageAspectRatio=a/i;let{labelStyles:h}=T(t);t.labelStyle=h;let s=e==null?void 0:e.wrappingWidth;t.defaultWidth=e==null?void 0:e.wrappingWidth;let c=Math.max(t.label&&s!=null?s:0,(C=t==null?void 0:t.assetWidth)!=null?C:a),l=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:c,o=t.constraint==="on"?l/t.imageAspectRatio:(Z=t==null?void 0:t.assetHeight)!=null?Z:i;t.width=Math.max(l,s!=null?s:0);let{shapeSvg:p,bbox:g,label:f}=await q(n,t,"image-shape default"),y=t.pos==="t",u=-l/2,b=-o/2,x=t.label?8:0,d=P.svg(p),w=N(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let k=d.rectangle(u,b,l,o,w),m=Math.max(l,g.width),v=o+g.height+x,M=d.rectangle(-m/2,-v/2,m,v,rt(tt({},w),{fill:"none",stroke:"none"})),$=p.insert(()=>k,":first-child"),D=p.insert(()=>M);if(t.img){let z=p.append("image");z.attr("href",t.img),z.attr("width",l),z.attr("height",o),z.attr("preserveAspectRatio","none"),z.attr("transform",`translate(${-l/2},${y?v/2-o:-v/2})`)}return f.attr("transform",`translate(${-g.width/2-(g.x-((H=g.left)!=null?H:0))},${y?-o/2-g.height/2-x/2:o/2-g.height/2+x/2})`),$.attr("transform",`translate(0,${y?g.height/2+x/2:-g.height/2-x/2})`),W(t,D),t.intersect=function(z){var I,Y,Q;if(X.info("iconSquare intersect",t,z),!t.label)return A.rect(t,z);let O=(I=t.x)!=null?I:0,R=(Y=t.y)!=null?Y:0,E=(Q=t.height)!=null?Q:0,j=[];return y?j=[{x:O-g.width/2,y:R-E/2},{x:O+g.width/2,y:R-E/2},{x:O+g.width/2,y:R-E/2+g.height+x},{x:O+l/2,y:R-E/2+g.height+x},{x:O+l/2,y:R+E/2},{x:O-l/2,y:R+E/2},{x:O-l/2,y:R-E/2+g.height+x},{x:O-g.width/2,y:R-E/2+g.height+x}]:j=[{x:O-l/2,y:R-E/2},{x:O+l/2,y:R-E/2},{x:O+l/2,y:R-E/2+o},{x:O+g.width/2,y:R-E/2+o},{x:O+g.width/2/2,y:R+E/2},{x:O-g.width/2,y:R+E/2},{x:O-g.width/2,y:R-E/2+o},{x:O-l/2,y:R-E/2+o}],A.polygon(t,j,z)},p},"imageSquare"),jr=S(async(n,t,{config:{themeVariables:e,flowchart:r}})=>{var z,O,R,E;let{labelStyles:a}=T(t);t.labelStyle=a;let i=(z=t.assetHeight)!=null?z:48,h=(O=t.assetWidth)!=null?O:48,s=Math.max(i,h),c=r==null?void 0:r.wrappingWidth;t.width=Math.max(s,c!=null?c:0);let{shapeSvg:l,bbox:o,halfPadding:p,label:g}=await q(n,t,"icon-shape default"),f=t.pos==="t",y=s+p*2,u=s+p*2,{nodeBorder:b,mainBkg:x}=e,{stylesMap:d}=dt(t),w=-u/2,k=-y/2,m=t.label?8:0,v=P.svg(l),M=N(t,{stroke:d.get("fill")||x});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let $=v.path(bt(w,k,u,y,5),M),D=Math.max(u,o.width),L=y+o.height+m,C=v.rectangle(-D/2,-L/2,D,L,rt(tt({},M),{fill:"transparent",stroke:"none"})),Z=l.insert(()=>$,":first-child"),H=l.insert(()=>C);if(t.icon){let j=l.append("g");j.html(`<g>${await St(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let B=j.node().getBBox(),I=B.width,Y=B.height,Q=B.x,it=B.y;j.attr("transform",`translate(${-I/2-Q},${f?o.height/2+m/2-Y/2-it:-o.height/2-m/2-Y/2-it})`),j.selectAll("path").attr("fill",(R=d.get("stroke"))!=null?R:b)}return g.attr("transform",`translate(${-o.width/2-(o.x-((E=o.left)!=null?E:0))},${f?-L/2:L/2-o.height})`),Z.attr("transform",`translate(0,${f?o.height/2+m/2:-o.height/2-m/2})`),W(t,H),t.intersect=function(j){var wt,mt,kt;if(X.info("iconSquare intersect",t,j),!t.label)return A.rect(t,j);let B=(wt=t.x)!=null?wt:0,I=(mt=t.y)!=null?mt:0,Y=(kt=t.height)!=null?kt:0,Q=[];return f?Q=[{x:B-o.width/2,y:I-Y/2},{x:B+o.width/2,y:I-Y/2},{x:B+o.width/2,y:I-Y/2+o.height+m},{x:B+u/2,y:I-Y/2+o.height+m},{x:B+u/2,y:I+Y/2},{x:B-u/2,y:I+Y/2},{x:B-u/2,y:I-Y/2+o.height+m},{x:B-o.width/2,y:I-Y/2+o.height+m}]:Q=[{x:B-u/2,y:I-Y/2},{x:B+u/2,y:I-Y/2},{x:B+u/2,y:I-Y/2+y},{x:B+o.width/2,y:I-Y/2+y},{x:B+o.width/2/2,y:I+Y/2},{x:B-o.width/2,y:I+Y/2},{x:B-o.width/2,y:I-Y/2+y},{x:B-u/2,y:I-Y/2+y}],A.polygon(t,Q,j)},l},"iconRounded"),Is={state:wr,stateStart:Yt,stateEnd:qt,forkJoin:vs,choice:mr,note:kr,rectWithTitle:Sr,roundedRect:Ss,squareRect:Lt,rectangle:Lt,rect:Lt,process:Lt,proc:Lt,rounded:Ss,event:Ss,stadium:Ms,pill:Ms,terminal:Ms,subroutine:Ct,"framed-rectangle":Ct,"fr-rect":Ct,subprocess:Ct,subproc:Ct,cylinder:Gt,db:Gt,cyl:Gt,database:Gt,question:Zt,diam:Zt,diamond:Zt,decision:Zt,hexagon:Ps,hex:Ps,prepare:Ps,lean_right:Ft,"lean-r":Ft,"lean-right":Ft,"in-out":Ft,lean_left:Vt,"lean-l":Vt,"lean-left":Vt,"out-in":Vt,trapezoid:Qt,"trap-b":Qt,"trapezoid-bottom":Qt,priority:Qt,inv_trapezoid:At,"inv-trapezoid":At,"trapezoid-top":At,"trap-t":At,manual:At,doublecircle:$s,"dbl-circ":$s,"double-circle":$s,circle:ua,circ:ua,rect_left_inv_arrow:xa,odd:xa,card:ss,"notched-rectangle":ss,"notch-rect":ss,"lined-rectangle":Rt,"lin-rect":Rt,"lin-proc":Rt,"lined-process":Rt,"shaded-process":Rt,"small-circle":Yt,"sm-circ":Yt,start:Yt,stop:qt,"framed-circle":qt,"fr-circ":qt,join:vs,fork:vs,comment:Hs,"brace-l":Hs,bolt:Ts,"com-link":Ts,"lightning-bolt":Ts,doc:ma,document:ma,delay:ba,"half-rounded-rectangle":ba,"horizontal-cylinder":Bs,"h-cyl":Bs,das:Bs,"lined-cylinder":Ws,"lin-cyl":Ws,disk:Ws,"curved-trapezoid":Ls,"curv-trap":Ls,display:Ls,"divided-rectangle":Ut,"div-rect":Ut,"div-proc":Ut,"divided-process":Ut,triangle:Ds,tri:Ds,extract:Ds,"window-pane":_s,"win-pane":_s,"internal-storage":_s,"f-circ":Os,junction:Os,"filled-circle":Os,"lin-doc":ka,"lined-document":ka,"notched-pentagon":Ns,"notch-pent":Ns,"loop-limit":Ns,"flipped-triangle":Es,"flip-tri":Es,"manual-file":Es,"sloped-rectangle":Cs,"sl-rect":Cs,"manual-input":Cs,docs:ts,documents:ts,"st-doc":ts,"stacked-document":ts,processes:Kt,procs:Kt,"stacked-rectangle":Kt,"st-rect":Kt,flag:da,"paper-tape":da,"bow-tie-rectangle":Rs,"bow-rect":Rs,"stored-data":Rs,"crossed-circle":As,"cross-circ":As,summary:As,"tag-doc":Sa,"tagged-document":Sa,"tag-rect":Jt,"tagged-rectangle":Jt,"tag-proc":Jt,"tagged-process":Jt,hourglass:wa,collate:wa,text:Ea,anchor:Lr,brace:Hs,labelRect:Cr,"brace-r":Tr,braces:Or,iconSquare:_r,iconCircle:Hr,icon:Ir,iconRounded:jr,imageSquare:zr},xt=new Map,ni=S(async(n,t,e)=>{let r,a;if(t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect"),!Is[t.shape])throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let i;e.config.securityLevel==="sandbox"?i="_top":t.linkTarget&&(i=t.linkTarget||"_blank"),r=n.insert("svg:a").attr("xlink:href",t.link).attr("target",i),a=await Is[t.shape](r,t,e)}else a=await Is[t.shape](n,t,e),r=a;return t.tooltip&&a.attr("title",t.tooltip),xt.set(t.id,r),t.haveCallback&&xt.get(t.id).attr("class",xt.get(t.id).attr("class")+" clickable"),r},"insertNode"),ci=S((n,t)=>{xt.set(t.id,n)},"setNodeElem"),oi=S(()=>{xt.clear()},"clear"),hi=S(n=>{let t=xt.get(n.id);X.trace("Transforming node",n.diff,n,"translate("+(n.x-n.width/2-5)+", "+n.width/2+")");let e=8,r=n.diff||0;return n.clusterNode?t.attr("transform","translate("+(n.x+r-n.width/2)+", "+(n.y-n.height/2-e)+")"):t.attr("transform","translate("+n.x+", "+n.y+")"),r},"positionNode");export{Jr as a,Kr as b,ae as c,re as d,ee as e,ie as f,le as g,q as h,W as i,ni as j,ci as k,oi as l,hi as m};