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