import{L as C}from"./bootstrap-vue-next-C0pyDr3k.js";import{_ as M}from"./InfoCard.vue_vue_type_script_setup_true_lang-CWF_aA31.js";import{_ as N}from"./LineChart.vue_vue_type_script_setup_true_lang-r8tM6cyh.js";import{_ as A}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as E}from"./TabsComponent.vue_vue_type_script_setup_true_lang-DHn9gLzv.js";import{_ as R}from"./BlockBalanceAgreement-396E9Da8.js";import{u as F,r as y,g as v,x as P,o as i,c as u,b as c,a as s,B as m,ax as $,F as I,h as O,m as b,w as o,t as r,P as w}from"./index-Bb2UEb_P.js";import{f as T}from"./common-U_VzDrmL.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./HtmlContent-DrkJBX3e.js";import"./IconCloseCircle-ctElXVvc.js";import"./clauses-Bhz_DuFa.js";import"./index-Dax_IkAt.js";import"./ButtonDefault-CzWpVlv6.js";const j={class:"tw-w-full"},H={class:"container"},K={class:"tw-grid tw-grid-cols-1 xl:tw-grid-cols-2 tw-gap-4 tw-mt-4"},q={class:"tw-text-lg lg:tw-text-xl tw-text-gray-400"},z={key:1,class:"tw-mt-4"},G={__name:"DependUsersStatistic",async setup(J){let d,_;const g=[{key:"Year",label:"Год",variant:"td-gray",sortable:!0},{key:"Month",label:"Месяц",variant:"td-blue",sortable:!0},{key:"NumUsers",label:"Пользователей",variant:"td-gray"},{key:"NumPayments",label:"Платежей",variant:"td-gray"},{key:"MonthSum",label:"Сумма",variant:"td-gray"}],n=F(),f=y("Year"),p=y(!0),l=v(()=>Object.keys(n.dependStats).map(a=>n.dependStats?.[a])),x=v(()=>!l.value||l.value.length===0?[]:l.value.slice().sort((a,t)=>a.Year!==t.Year?p.value?t.Year-a.Year:a.Year-t.Year:p.value?t.Month-a.Month:a.Month-t.Month));return[d,_]=P(()=>Promise.all([n.fetchUserData(),n.fetchDependUsersStatistic(),n.fetchDependUsersStatisticCharts()])),await d,_(),(a,t)=>{const S=R,h=E,k=A,B=N,D=M,U=C;return i(),u("div",j,[c(S),s("div",H,[c(h,{tabs:m($)},null,8,["tabs"]),t[7]||(t[7]=s("h1",{class:"tw-text-xl sm:tw-text-4xl tw-mb-4"},"Статистика начислений",-1)),c(k,{partition:"Header:/DependUsersStatistic"}),s("div",K,[(i(!0),u(I,null,O(m(n).dependStats2,(e,L,Y)=>(i(),b(D,{key:L,title:e.Name},{action:o(()=>[s("div",q,r(e.Limit)+" "+r(e.Units),1)]),body:o(()=>[c(B,{data:e.Data,color:m(w)[Y%m(w).length],class:"tw-mt-4"},null,8,["data","color"])]),_:2},1032,["title"]))),128))]),l.value&&l.value.length>0?(i(),b(U,{key:0,"sort-by":f.value,"onUpdate:sortBy":t[0]||(t[0]=e=>f.value=e),"sort-desc":p.value,"onUpdate:sortDesc":t[1]||(t[1]=e=>p.value=e),class:"basic-table tw-mt-4",fields:g,items:x.value,"show-empty":!0,"empty-text":"Ваши рефералы не оплачивали никаких услуг.","empty-filtered-text":"Ваши рефералы не оплачивали никаких услуг."},{"cell(Year)":o(e=>[t[2]||(t[2]=s("span",{class:"td-mobile"},"Год",-1)),s("span",null,r(e.value),1)]),"cell(Month)":o(e=>[t[3]||(t[3]=s("span",{class:"td-mobile"},"Месяц",-1)),s("span",null,r(e.value),1)]),"cell(NumUsers)":o(e=>[t[4]||(t[4]=s("span",{class:"td-mobile"},"Пользователей",-1)),s("span",null,r(e.value),1)]),"cell(NumPayments)":o(e=>[t[5]||(t[5]=s("span",{class:"td-mobile"},"Платежей",-1)),s("span",null,r(e.value),1)]),"cell(MonthSum)":o(e=>[t[6]||(t[6]=s("span",{class:"td-mobile"},"Сумма",-1)),s("span",null,r(m(T)(e.value)),1)]),_:1},8,["sort-by","sort-desc","items"])):(i(),u("div",z," Нет данных для отображения. "))])])}}},pt=V(G,[["__scopeId","data-v-6050e959"]]);export{pt as default};
