export const __rspack_esm_id="1361";export const __rspack_esm_ids=["1361"];export const __webpack_modules__={26820(e,t,a){function i(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{S:()=>i}),(0,a(76338).K2)(i,"populateCommonDb")},16056(e,t,a){a.d(t,{diagram:()=>v});var i=a(51093),l=a(26820),r=a(72903),s=a(90047),o=a(76338),n=a(45617),c=a(79723),p=s.UI.pie,d={sections:new Map,showData:!1,config:p},g=d.sections,u=d.showData,m=structuredClone(p),h=(0,o.K2)(()=>structuredClone(m),"getConfig"),f=(0,o.K2)(()=>{g=new Map,u=d.showData,(0,s.IU)()},"clear"),x=(0,o.K2)(({label:e,value:t})=>{if(t<0)throw Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);g.has(e)||(g.set(e,t),o.Rm.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),w=(0,o.K2)(()=>g,"getSections"),S=(0,o.K2)(e=>{u=e},"setShowData"),$=(0,o.K2)(()=>u,"getShowData"),D={getConfig:h,clear:f,setDiagramTitle:s.ke,getDiagramTitle:s.ab,setAccTitle:s.SV,getAccTitle:s.iN,setAccDescription:s.EI,getAccDescription:s.m7,addSection:x,getSections:w,setShowData:S,getShowData:$},T=(0,o.K2)((e,t)=>{(0,l.S)(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),y={parse:(0,o.K2)(async e=>{let t=await (0,n.qg)("pie",e);o.Rm.debug(t),T(t,D)},"parse")},C=(0,o.K2)(e=>` .pieCircle{ stroke: ${e.pieStrokeColor}; stroke-width : ${e.pieStrokeWidth}; opacity : ${e.pieOpacity}; } .pieOuterCircle{ stroke: ${e.pieOuterStrokeColor}; stroke-width: ${e.pieOuterStrokeWidth}; fill: none; } .pieTitleText { text-anchor: middle; font-size: ${e.pieTitleTextSize}; fill: ${e.pieTitleTextColor}; font-family: ${e.fontFamily}; } .slice { font-family: ${e.fontFamily}; fill: ${e.pieSectionTextColor}; font-size:${e.pieSectionTextSize}; // fill: white; } .legend text { fill: ${e.pieLegendTextColor}; font-family: ${e.fontFamily}; font-size: ${e.pieLegendTextSize}; } `,"getStyles"),k=(0,o.K2)(e=>{let t=[...e.values()].reduce((e,t)=>e+t,0),a=[...e.entries()].map(([e,t])=>({label:e,value:t})).filter(e=>e.value/t*100>=1);return(0,c.rLf)().value(e=>e.value).sort(null)(a)},"createPieArcs"),v={parser:y,db:D,renderer:{draw:(0,o.K2)((e,t,a,l)=>{o.Rm.debug("rendering pie chart\n"+e);let n=l.db,p=(0,s.D7)(),d=(0,r.$t)(n.getConfig(),p.pie),g=(0,i.D)(t),u=g.append("g");u.attr("transform","translate(225,225)");let{themeVariables:m}=p,[h]=(0,r.I5)(m.pieOuterStrokeWidth);h??=2;let f=d.textPosition,x=(0,c.JLW)().innerRadius(0).outerRadius(185),w=(0,c.JLW)().innerRadius(185*f).outerRadius(185*f);u.append("circle").attr("cx",0).attr("cy",0).attr("r",185+h/2).attr("class","pieOuterCircle");let S=n.getSections(),$=k(S),D=[m.pie1,m.pie2,m.pie3,m.pie4,m.pie5,m.pie6,m.pie7,m.pie8,m.pie9,m.pie10,m.pie11,m.pie12],T=0;S.forEach(e=>{T+=e});let y=$.filter(e=>"0"!==(e.data.value/T*100).toFixed(0)),C=(0,c.UMr)(D).domain([...S.keys()]);u.selectAll("mySlices").data(y).enter().append("path").attr("d",x).attr("fill",e=>C(e.data.label)).attr("class","pieCircle"),u.selectAll("mySlices").data(y).enter().append("text").text(e=>(e.data.value/T*100).toFixed(0)+"%").attr("transform",e=>"translate("+w.centroid(e)+")").style("text-anchor","middle").attr("class","slice");let v=u.append("text").text(n.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText"),b=[...S.entries()].map(([e,t])=>({label:e,value:t})),_=u.selectAll(".legend").data(b).enter().append("g").attr("class","legend").attr("transform",(e,t)=>"translate(216,"+(22*t-22*b.length/2)+")");_.append("rect").attr("width",18).attr("height",18).style("fill",e=>C(e.label)).style("stroke",e=>C(e.label)),_.append("text").attr("x",22).attr("y",14).text(e=>n.getShowData()?`${e.label} [${e.value}]`:e.label);let A=Math.max(..._.selectAll("text").nodes().map(e=>e?.getBoundingClientRect().width??0)),K=v.node()?.getBoundingClientRect().width??0,R=Math.min(0,225-K/2),M=Math.max(512+A,225+K/2)-R;g.attr("viewBox",`${R} 0 ${M} 450`),(0,s.a$)(g,450,M,d.useMaxWidth)},"draw")},styles:C}}};