import{QasS,TasR,b2asJ,_asd,gasK,sasY,aastt,baset,tasat,qasrt,lasW,casnt,Hasit,Lasst,a4asot,easlt,Aasct,Iasut}from"./mermaid.core.BrszyIat.js";import{pasdt}from"./chunk-4BX2VUAB.DCv7cNfo.js";import{paspt}from"./wardley-L42UT6IY.C8rjnVeB.js";import{dasP}from"./arc.CxsX2Wvr.js";import{oasgt}from"./ordinal.BYWQX77i.js";import"./framework.C2AwuPrQ.js";import"./init.Gi6I4Gst.js";functionft(t,a){returna<t?-1:a>t?1:a>=t?0:NaN}functionht(t){returnt}functionmt(){vart=ht,a=ft,f=null,y=S(0),s=S(R),p=S(0);functiono(e){varn,l=(e=J(e)).length,g,h,v=0,c=newArray(l),i=newArray(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,p.apply(this,arguments)),$=D*(w<0?-1:1),u;for(n=0;n<l;++n)(u=i[c[n]=n]=+t(e[n],n,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){returna(i[A],i[C])}):f!=null&&c.sort(function(A,C){returnf(e[A],e[C])}),n=0,h=v?(w-l*$)/v:0;n<l;++n,x=m)g=c[n],u=i[g],m=x+(u>0?u*h:0)+$,i[g]={data:e[g],index:n,value:u,startAngle:x,endAngle:m,padAngle:D};returni}returno.value=function(e){returnarguments.length?(t=typeofe=="function"?e:S(+e),o):t},o.sortValues=function(e){returnarguments.length?(a=e,f=null,o):a},o.sort=function(e){returnarguments.length?(f=e,a=null,o):f},o.startAngle=function(e){returnarguments.length?(y=typeofe=="function"?e:S(+e),o):y},o.endAngle=function(e){returnarguments.length?(s=typeofe=="function"?e:S(+e),o):s},o.padAngle=function(e){returnarguments.length?(p=typeofe=="function"?e:S(+e),o):p},o}varvt=ut.pie,z={sections:newMap,showData:!1},T=z.sections,F=z.showData,xt=structuredClone(vt),St=d(()=>structuredClone(xt),"getConfig"),yt=d(()=>{T=newMap,F=z.showData,ct()},"clear"),wt=d(({label:t,value:a})=>{if(a<0)thrownewError(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),W.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=d(()=>T,"getSections"),Ct=d(t=>{F=t},"setShowData"),Dt=d(()=>F,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:rt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Y,getAccDescription:K,addSection:wt,getSections:At,setShowData:Ct,getShowData:Dt},$t=d((t,a)=>{dt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:d(asynct=>{consta=awaitpt("pie",t);W.debug(a),$t(a,_)},"parse")},bt=d(t=>`