import{C as y}from"./DonutChart.36f89ed8.js";import{U as b}from"./AnimatedNumber.f40bef48.js";import{S as k}from"./Loading.62cbc7c3.js";import{_ as p}from"./_plugin-vue_export-helper.eefbdd86.js";import{x as r,o as t,c as l,a as s,H as C,t as u,b as d,l as i,G as v,N as x,j as L,m as N,y as T,K as S,v as q}from"./runtime-dom.esm-bundler.c4caba60.js";const B={emits:["onLabelClick"],components:{CoreDonutChart:y,UtilAnimatedNumber:b,SvgSeoSiteScoreLoading:k},props:{parts:{type:Array,required:!0},total:{type:Number,required:!0},label:{type:String,required:!0},link:{type:String,required:!1},animatedNumber:{type:Boolean,default(){return!0}},maxTotal:{type:String,required:!1},loading:{type:Boolean,required:!1},loadingText:{type:String,required:!1}},computed:{sortedParts(){const a=this.parts.map(n=>n);return a.forEach(function(n,e){n.last&&(a.push(a[e]),a.splice(e,1))}),a}},methods:{handleLabelClick(a,n){n!=null&&n.emitValue&&(a.preventDefault(),this.$emit("onLabelClick",n.emitValue))}}},V={class:"aioseo-donut-chart-with-legend"},A={class:"chart-left"},D={key:0,class:"aioseo-donut-chart-with-legend__loading"},H={key:0,class:"aioseo-donut-chart-with-legend__loading-text"},w={class:"chart-right"},M={class:"legend-amount"},P=["innerHTML"],U={key:0,class:"chart-more"},z=["innerHTML"];function E(a,n,e,I,j,c){const m=r("svg-seo-site-score-loading"),_=r("core-donut-chart"),h=r("util-animated-number");return t(),l("div",V,[s("div",A,[e.loading?(t(),l("div",D,[C(m),e.loadingText?(t(),l("div",H,u(e.loadingText),1)):d("",!0)])):(t(),i(_,{key:1,parts:e.parts,total:e.total,label:e.label,animatedNumber:e.animatedNumber,maxTotal:e.maxTotal,"is-label-colored":""},null,8,["parts","total","label","animatedNumber","maxTotal"]))]),s("div",w,[(t(!0),l(v,null,x(c.sortedParts,(o,g)=>(t(),l("div",{class:"legend",key:g},[s("div",{class:"legend-bullet",style:L(`background-color: ${o.color}`)},null,4),s("span",M,[e.animatedNumber?(t(),i(h,{key:0,number:parseInt(o.count)},null,8,["number"])):(t(),l("div",{key:1,innerHTML:parseInt(o.count)},null,8,P))]),(t(),i(q(o.link?"a":"span"),{href:o.link||null,class:S(["legend-label",{"is-link":o.link}]),onClick:f=>c.handleLabelClick(f,o)},{default:N(()=>[T(u(o.name),1)]),_:2},1032,["href","class","onClick"]))]))),128)),e.link&&e.total>0?(t(),l("div",U,[s("span",{innerHTML:e.link},null,8,z)])):d("",!0)])])}const J=p(B,[["render",E]]);export{J as C};
