1import{E as e,Ht as a,I as b,Lt as s,P as l,T as d,et as g,it as x,k as h}from"./forms-Dmk7DoPm.js";import{ft as w}from"./vue-runtime-qJxlhFPm.js";import{Z as r}from"./app-DYap17tX.js";import{u as P}from"./chartHelpers-W63giizi.js";import{n as k,t as C}from"./tt-D8F7RjfT.js";import{t as _}from"./CommissionCompareAmounts-BilMeBgf.js";var j={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-5 gap-4"},T={class:"relative overflow-hidden rounded-lg border bg-card p-6"},E={class:"flex items-start justify-between gap-3"},N={class:"min-w-0 flex-1"},B={class:"text-sm font-medium text-muted-foreground"},L={class:"text-2xl font-bold"},M={class:"h-12 w-12 rounded-full bg-green-100 dark:bg-green-900/20 flex items-center justify-center"},S={class:"relative overflow-hidden rounded-lg border bg-card p-6"},Y={class:"flex items-start justify-between gap-3"},A={class:"min-w-0 flex-1"},I={class:"text-sm font-medium text-muted-foreground"},V={class:"text-2xl font-bold"},$={class:"text-xs text-muted-foreground mt-1"},D={class:"h-12 w-12 rounded-full bg-green-100 dark:bg-green-900/20 flex items-center justify-center"},H={class:"relative overflow-hidden rounded-lg border bg-card p-6"},Z={class:"flex items-center justify-between"},q={class:"text-sm font-medium text-muted-foreground"},z={class:"text-2xl font-bold"},F={class:"text-xs text-muted-foreground mt-1"},G={class:"h-12 w-12 rounded-full bg-yellow-100 dark:bg-yellow-900/20 flex items-center justify-center"},J={class:"relative overflow-hidden rounded-lg border bg-card p-6"},K={class:"flex items-center justify-between"},O={class:"text-sm font-medium text-muted-foreground"},Q={class:"text-2xl font-bold"},R={class:"text-xs text-muted-foreground mt-1"},U={class:"h-12 w-12 rounded-full bg-blue-100 dark:bg-blue-900/20 flex items-center justify-center"},W={class:"relative overflow-hidden rounded-lg border bg-card p-6"},X={class:"flex items-center justify-between"},ee={class:"text-sm font-medium text-muted-foreground"},te={class:"text-lg font-bold"},oe={class:"text-xs text-muted-foreground mt-1"},ae={class:"h-12 w-12 rounded-full bg-purple-100 dark:bg-purple-900/20 flex items-center justify-center"},re=b({__name:"CommissionStats",props:{topSeller:{},locale:{},country_code:{},currency:{},compareEnabled:{type:Boolean,default:!0},lastYear:{type:Boolean,default:!1},currentPeriod:{default:"month"}},setup(y){const t=d(()=>w().props.detailed_stats),o=y,f=d(()=>P(o.currentPeriod)),c=d(()=>o.currentPeriod==="year"||o.currentPeriod==="this_year"?"ytd":o.currentPeriod==="previous_year"?"full":!1),u=d(()=>!!o.lastYear&&o.compareEnabled&&!c.value),v=d(()=>C(o.lastYear,u.value,f.value,c.value)),m=d(()=>k()),i=p=>r.formatMoney(p,2,!1,o.locale,o.country_code,o.currency);return(p,se)=>{const n=x("Icon");return g(),h("div",j,[e("div",T,[e("div",E,[e("div",N,[e("p",B,a(s(r).t(["Total Invoices","Total des factures","Total de facturas"])),1),e("p",L,a(i(t.value?.revenue?.total||0)),1),l(_,{enabled:o.compareEnabled,locale:o.locale,"country-code":o.country_code,currency:o.currency,current:Number(t.value?.revenue?.total||0),previous:Number(t.value?.revenue?.compare?.total??0),"previous-yoy":t.value?.revenue?.compare_yoy?.total??null,variation:t.value?.revenue?.variation,"variation-yoy":t.value?.revenue?.variation_yoy,"period-label":v.value,"yoy-period-label":m.value,"dual-compare":u.value},null,8,["enabled","locale","country-code","currency","current","previous","previous-yoy","variation","variation-yoy","period-label","yoy-period-label","dual-compare"])]),e("div",M,[l(n,{name:"file-text",class:"h-6 w-6 text-green-600 dark:text-green-400"})])])]),e("div",S,[e("div",Y,[e("div",A,[e("p",I,a(s(r).t(["Paid commissions","Commissions payées","Comisiones pagadas"])),1),e("p",V,a(i(t.value?.commissions?.paid||0)),1),e("p",$,a(s(r).t(["To pay","à payer","A pagar"]))+": "+a(i(t.value?.commissions?.to_pay??0)),1),l(_,{enabled:o.compareEnabled,locale:o.locale,"country-code":o.country_code,currency:o.currency,current:Number(t.value?.commissions?.paid||0),previous:Number(t.value?.commissions?.compare?.paid??0),"previous-yoy":t.value?.commissions?.compare_yoy?.paid??null,variation:t.value?.commissions?.variation,"variation-yoy":t.value?.commissions?.variation_yoy,"period-label":v.value,"yoy-period-label":m.value,"dual-compare":u.value},null,8,["enabled","locale","country-code","currency","current","previous","previous-yoy","variation","variation-yoy","period-label","y
1oy-period-label","dual-compare"])]),e("div",D,[l(n,{name:"dollar-sign",class:"h-6 w-6 text-green-600 dark:text-green-400"})])])]),e("div",H,[e("div",Z,[e("div",null,[e("p",q,a(s(r).t(["Pending","En attente","Pendiente"])),1),e("p",z,a(i(t.value?.commissions?.pending||0)),1),e("p",F,a(t.value?.counts?.pending||0)+" "+a(s(r).t(["lines","lignes","lÃneas"])),1)]),e("div",G,[l(n,{name:"clock",class:"h-6 w-6 text-yellow-600 dark:text-yellow-400"})])])]),e("div",J,[e("div",K,[e("div",null,[e("p",O,a(s(r).t(["All statuses total","Total tous statuts","Total todos estados"])),1),e("p",Q,a(i(t.value?.commissions?.total||0)),1),e("p",R,a(t.value?.counts?.lines??0)+" "+a(s(r).t(["lines","lignes","lÃneas"])),1)]),e("div",U,[l(n,{name:"bar-chart-3",class:"h-6 w-6 text-blue-600 dark:text-blue-400"})])])]),e("div",W,[e("div",X,[e("div",null,[e("p",ee,a(s(r).t(["Top seller","Top vendeur","Mejor vendedor"])),1),e("p",te,a(t.value?.sellers?.[0]?.name||"N/A"),1),e("p",oe,a(i(t.value?.sellers?.[0]?.revenue||0)),1)]),e("div",ae,[l(n,{name:"trophy",class:"h-6 w-6 text-purple-600 dark:text-purple-400"})])])])])}}}),ve=re;export{ve as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.