import{W as ln,X as an,Y as y,$ as tn,a0 as B,a1 as q,a2 as _,a3 as un,a4 as rn,a5 as G,a6 as o,a7 as Y,a8 as sn,a9 as on,aa as fn}from"./MermaidChart.svelte_svelte_type_style_lang.8184f5a3.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,$,a){var O=I-l,i=D-h,n=$-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function N(l,h,I,D,v,A,$){var a=l-I,O=h-D,i=($?A:-A)/G(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,j=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*G(fn(0,T*T*R-P*P)),W=(P*g-m*S)/R,X=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=W-j,e=X-t,r=w-j,z=p-t;return x*x+e*e>r*r+z*z&&(W=w,X=p),{cx:W,cy:X,x01:-n,y01:-d,x11:W*(v/T-1),y11:X*(v/T-1)}}function hn(){var l=cn,h=yn,I=Y(0),D=null,v=gn,A=dn,$=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,j=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(j>tn-y)a.moveTo(s*B(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*B(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=j,S=j,W=$.apply(this,arguments)/2,X=W>y&&(D?+D.apply(this,arguments):G(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(X>y){var z=sn(X/u*q(W)),H=sn(X/s*q(W));(P-=z*2)>y?(z*=t?1:-1,R+=z,T-=z):(P=0,R=T=(f+c)/2),(S-=H*2)>y?(H*=t?1:-1,m+=H,g-=H):(S=0,m=g=(f+c)/2)}var C=s*B(m),F=s*q(m),J=u*B(T),K=u*q(T);if(w>y){var L=s*B(g),M=s*q(g),Q=u*B(R),U=u*q(R),E;if(j<rn)if(E=pn(C,F,Q,U,L,M,J,K)){var V=C-E[0],Z=F-E[1],k=L-E[0],b=M-E[1],nn=1/q(on((V*k+Z*b)/(G(V*V+Z*Z)*G(k*k+b*b)))/2),en=G(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=N(Q,U,C,F,s,x,t),r=N(L,M,J,K,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(C,F),a.arc(0,0,s,m,g,!t)):a.moveTo(C,F),!(u>y)||!(P>y)?a.lineTo(J,K):p>y?(e=N(J,K,L,M,u,-p,t),r=N(C,F,Q,U,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[B(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:Y(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:Y(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:Y(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:Y(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:Y(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:Y(+n),i):A},i.padAngle=function(n){return arguments.length?($=typeof n=="function"?n:Y(+n),i):$},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
