import{C as r}from"./chart.js-Ck9xQDHc-v4.7.2.js";import"./@kurkle-C_POY-EF-v4.7.2.js";async function l(){const t=await axios.get("/sales-analytics");let a={labels:t.data.labels,sales:[],formatted:[],totalOrders:[]};for(let s of t.data.data)a.sales.push(s.total.amount),a.formatted.push(s.total.formatted),a.totalOrders.push(s.total_orders);o(a)}l();function o(t){new r(document.querySelector(".sales-analytics .chart"),{type:"bar",data:{labels:t.labels,datasets:[{data:t.sales,borderRadius:6,backgroundColor:["rgba(76, 201, 254, .7)","rgba(71, 90, 255, .7)","rgba(255, 119, 183, .7)","rgba(250, 64, 50, .7)","rgba(136, 194, 115, .7)","rgba(139, 93, 255, .7)","rgba(255, 127, 62, .7)"]}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:!1,tooltip:{displayColors:!1,callbacks:{label(a){let s=`${trans("admin::dashboard.sales_analytics.orders")}: ${t.totalOrders[a.dataIndex]}`,e=`${trans("admin::dashboard.sales_analytics.sales")}: ${t.formatted[a.dataIndex]}`;return[s,e]}}}},scales:{y:{beginAtZero:!0,ticks:{callback:function(a){return t.formatted[0].charAt(0)+a}}}}}})}
