import{W as s}from"./WidgetChart-CQnj_aQq.js";import{b as l,k as p,y as d}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:"WidgetCrmOpportunitesParPipeline",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 a=r,i=d(()=>{const e=Array.isArray(a.data)?a.data:[];return{labels:e.map(t=>t.pipeline||"Sans pipeline"),datasets:[{label:"Nombre",data:e.map(t=>t.nb||0),backgroundColor:"#6366f1",borderWidth:0,yAxisID:"y"},{label:"Montant",data:e.map(t=>t.montant||0),backgroundColor:"#10b981",borderWidth:0,yAxisID:"y1"}]}}),o={scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,position:"left",ticks:{font:{size:10},precision:0}},y1:{beginAtZero:!0,position:"right",grid:{drawOnChartArea:!1},ticks:{font:{size:10}}}}};return(e,t)=>(l(),p(s,{title:"Opportunités par pipeline",icon:"pi pi-chart-bar",type:"bar","chart-data":i.value,options:o,loading:r.loading,error:r.error,editing:r.editing,onRefresh:t[0]||(t[0]=n=>e.$emit("refresh")),onRemove:t[1]||(t[1]=n=>e.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{k as default};
