import{W as s}from"./WidgetChart-CQnj_aQq.js";import{b as l,k as m,y as p}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 k={__name:"WidgetVenteCAJourSemaine",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(r){const o=r,i=["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],n=p(()=>{const a=Array.isArray(o.data)?o.data:[],e={};for(const t of a)e[t.jour]=t.montant||0;return{labels:i,datasets:[{label:"CA",data:i.map(t=>e[t]||0),backgroundColor:"#6366f1",borderWidth:0}]}}),d={plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10}}}}};return(a,e)=>(l(),m(s,{title:"CA par jour de la semaine",icon:"pi pi-calendar",type:"bar","chart-data":n.value,options:d,loading:r.loading,error:r.error,editing:r.editing,onRefresh:e[0]||(e[0]=t=>a.$emit("refresh")),onRemove:e[1]||(e[1]=t=>a.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{k as default};
