import{C as y}from"./DonutChart.5e431aa7.js";import{U as k}from"./AnimatedNumber.d1ca0199.js";import{S as b}from"./Loading.f9d0ab03.js";import{_ as p}from"./_plugin-vue_export-helper.eefbdd86.js";import{aq as s,f as t,i as l,j as r,a0 as C,U as u,M as d,Q as i,O as v,ad as x,V as L,R as S,ae as T,P as N,S as q}from"./vendor-vue-ui.65fbb3e9.js";const V={emits:["onLabelClick"],components:{CoreDonutChart:y,UtilAnimatedNumber:k,SvgSeoSiteScoreLoading:b},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 n=this.parts.map(o=>o);return n.forEach(function(o,e){o.last&&(n.push(n[e]),n.splice(e,1))}),n}},methods:{handleLabelClick(n,o){o?.emitValue&&(n.preventDefault(),this.$emit("onLabelClick",o.emitValue))}}},B={class:"aioseo-donut-chart-with-legend"},A={class:"chart-left"},D={key:0,class:"aioseo-donut-chart-with-legend__loading"},M={key:0,class:"aioseo-donut-chart-with-legend__loading-text"},P={class:"chart-right"},w={class:"legend-amount"},H=["innerHTML"],U={key:0,class:"chart-more"},z=["innerHTML"];function E(n,o,e,I,R,c){const m=s("svg-seo-site-score-loading"),_=s("core-donut-chart"),h=s("util-animated-number");return t(),l("div",B,[r("div",A,[e.loading?(t(),l("div",D,[C(m),e.loadingText?(t(),l("div",M,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"]))]),r("div",P,[(t(!0),l(v,null,x(c.sortedParts,(a,g)=>(t(),l("div",{class:"legend",key:g},[r("div",{class:"legend-bullet",style:L(`background-color: ${a.color}`)},null,4),r("span",w,[e.animatedNumber?(t(),i(h,{key:0,number:parseInt(a.count)},null,8,["number"])):(t(),l("div",{key:1,innerHTML:parseInt(a.count)},null,8,H))]),(t(),i(q(a.link?"a":"span"),{href:a.link||null,class:N(["legend-label",{"is-link":a.link}]),onClick:f=>c.handleLabelClick(f,a)},{default:S(()=>[T(u(a.name),1)]),_:2},1032,["href","class","onClick"]))]))),128)),e.link&&e.total>0?(t(),l("div",U,[r("span",{innerHTML:e.link},null,8,z)])):d("",!0)])])}const G=p(V,[["render",E]]);export{G as C};
