import{_ as f,n as h,a as x}from"./currency-Dtag6qPd.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as d,o,c as n,a as s,t as r,f as u,n as p,e as a,F as y,b as v}from"./runtime-core.esm-bundler-VrNrzzXC.js";const C={mounted(){this.hasLoaded=!1,this.subscription=Dashboard.bestCustomers.subscribe(i=>{this.hasLoaded=!0,this.customers=i})},methods:{__:f,nsCurrency:h,nsRawCurrency:x},data(){return{customers:[],subscription:null,hasLoaded:!1}},unmounted(){this.subscription.unsubscribe()}},w={id:"ns-best-customers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},g={class:"flex-auto"},j={class:"head text-center flex justify-between items-center border-b w-full p-2"},k={key:0,class:"w-full flex items-center justify-center"},L={key:1,class:"flex items-center justify-center flex-col"},B={class:"text-sm"},N={key:2,class:"table w-full"},V={class:"p-2"},z={class:"-mx-1 flex justify-start items-center"},D={class:"px-1 justify-center"},F={class:"font-semibold items-center"},R={class:"flex justify-end amount p-2"};function E(i,e,S,W,t,c){const m=d("ns-close-button"),_=d("ns-spinner");return o(),n("div",w,[s("div",g,[s("div",j,[s("h5",null,r(c.__("Best Customers")),1),s("div",null,[u(m,{onClick:e[0]||(e[0]=l=>i.$emit("onRemove"))})])]),s("div",{class:p(["body flex flex-col h-64",t.customers.length===0?"body flex items-center justify-center flex-col h-64":""])},[t.hasLoaded?a("",!0):(o(),n("div",k,[u(_,{size:"12",border:"4"})])),t.hasLoaded&&t.customers.length===0?(o(),n("div",L,[e[1]||(e[1]=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1)),s("p",B,r(c.__("Well.. nothing to show for the meantime")),1)])):a("",!0),t.customers.length>0?(o(),n("table",N,[s("thead",null,[(o(!0),n(y,null,v(t.customers,l=>(o(),n("tr",{key:l.id,class:"entry border-b text-sm"},[s("th",V,[s("div",z,[e[2]||(e[2]=s("div",{class:"px-1"},[s("div",{class:"rounded-full"},[s("i",{class:"las la-user-circle text-xl"})])],-1)),s("div",D,[s("h3",F,r(l.first_name)+" "+r(l.last_name),1)])])]),s("th",R,r(c.nsCurrency(l.purchases_amount)),1)]))),128))])])):a("",!0)],2)])])}const H=b(C,[["render",E]]);export{H as default};
