import{W as s}from"./WidgetChart-CQnj_aQq.js";import{b as d,k as p,y as m}from"./vue-core-Di3IuVqe.js";import"./WidgetCard-CLnTgmXL.js";import"./primevue-CfIk0_DY.js";import"./index-BxIwIJfy.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const A={__name:"WidgetCommandesAnnulees",props:{data:{type:[Array,Object,null],default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},editing:{type:Boolean,default:!1}},emits:["refresh","remove"],setup(a){const o=a,r={Finalise:"#10b981",Annule:"#ef4444"},n=m(()=>{const t=Array.isArray(o.data)?o.data:[];return{labels:t.map(e=>e.situation||""),datasets:[{data:t.map(e=>e.pourcentage||0),backgroundColor:t.map(e=>r[e.situation]||"#9ca3af"),borderWidth:0}]}}),i={plugins:{legend:{position:"right",labels:{font:{size:10},boxWidth:12,padding:6}},tooltip:{callbacks:{label:t=>`${t.label}: ${t.parsed.toFixed(2)} %`}}}};return(t,e)=>(d(),p(s,{title:"Commandes annulées",icon:"pi pi-chart-pie",type:"doughnut","chart-data":n.value,options:i,loading:a.loading,error:a.error,editing:a.editing,onRefresh:e[0]||(e[0]=l=>t.$emit("refresh")),onRemove:e[1]||(e[1]=l=>t.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{A as default};
