2 lines
183 KiB
JavaScript
2 lines
183 KiB
JavaScript
var Ue=Object.defineProperty,Je=Object.defineProperties;var Ye=Object.getOwnPropertyDescriptors;var Ae=Object.getOwnPropertySymbols;var Xe=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var De=(M,n,t)=>n in M?Ue(M,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):M[n]=t,$e=(M,n)=>{for(var t in n||(n={}))Xe.call(n,t)&&De(M,t,n[t]);if(Ae)for(var t of Ae(n))qe.call(n,t)&&De(M,t,n[t]);return M},Ee=(M,n)=>Je(M,Ye(n));var R=(M,n,t)=>new Promise((i,s)=>{var f=w=>{try{_(t.next(w))}catch(g){s(g)}},c=w=>{try{_(t.throw(w))}catch(g){s(g)}},_=w=>w.done?i(w.value):Promise.resolve(w.value).then(f,c);_((t=t.apply(M,n)).next())});import{r as I,w as se,b as E,q as V,h as a,x as J,f as u,g as A,H as Ge,i as e,t as o,k as l,F as ne,m as fe,j as ge,l as X,T as be,s as Se,o as ae,Z as Fe,V as je,v as Q,A as W,Y as we,W as Oe,J as he,Q as We,U as Ke,a2 as Qe,a3 as e1,B as _e,X as He}from"./vendor-vue.CmaRnji1.js";import{C as Pe}from"./CrossFade.B9Ap6pL9.js";import{_ as pe,dH as ee,u as me,a as ce,f as j,i as K,dF as ze,A as Te,T as Ne,S as t1}from"./index.CjrDwa0W.js";import{B as Ve}from"./BananaPay.C5pAUf3c.js";import{i as l1}from"./swiper.tg5sgs8j.js";/* empty css */import{_ as s1}from"./NoInternet.dMK-ez9k.js";import"./vendor.DSdF8huI.js";function Ce(M){return M==null||isNaN(M)?"0":Math.floor(Number(M)).toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")}const i1={class:"w-full h-full rounded-[40em] overflow-hidden bg-black relative"},n1={class:"w-full h-[25em] flex items-center justify-center"},a1={class:"w-full h-[21em] flex items-center justify-center"},o1={class:"font-['SFPRO'] text-[14em] text-white font-[400] leading-[100%] truncate"},r1={class:"w-full h-[347em] px-[15em]"},c1={key:0,class:"w-full h-full flex items-center justify-center"},u1={class:"font-['SFPRO'] text-[12em] text-white/50 font-[400]"},d1={key:1,class:"w-full h-full flex items-center justify-center"},f1={class:"font-['SFPRO'] text-[12em] text-white/50 font-[400]"},g1={key:2,class:"w-full h-full overflow-auto no-scrollbar pt-[9em] flex flex-wrap gap-y-[5em]",style:{"align-content":"flex-start"}},m1={class:"w-[60%] h-full flex items-center pl-[15em]"},v1={class:"font-['SFPRO'] text-[11em] text-white font-[400] leading-[100%] truncate"},p1={class:"w-[40%] h-full flex items-center justify-end pr-[15em]"},h1={class:"font-['SFPRO'] text-[14em] text-white font-[400] leading-[100%] truncate"},C1={class:"flex flex-col justify-end px-[15em] z-[101] relative gap-y-[5em] pb-[15em]"},b1={class:"w-full flex items-center justify-between px-[18em]"},x1={class:"text-white/50 text-[12em] font-['SFPRO'] font-[400]"},y1={class:"text-white/50 text-[12em] font-['SFPRO'] font-[400]"},_1={key:0,class:"w-full flex items-center justify-between px-[18em]"},w1={class:"text-white/50 text-[12em] font-['SFPRO'] font-[400]"},k1={class:"text-white/50 text-[12em] font-['SFPRO'] font-[400]"},I1={class:"w-full flex items-center justify-between px-[18em]"},$1={class:"text-white text-[14em] font-['SFPRO'] font-[400]"},S1={class:"text-white text-[14em] font-['SFPRO'] font-[400]"},F1={class:"font-['SFPRO'] text-[14em] text-black font-[400] leading-[100%] truncate"},P1={inheritAttrs:!1},T1=Object.assign(P1,{__name:"Payallinvoices",props:{show:{type:Boolean,default:!1}},emits:["close"],setup(M,{emit:n}){const t=M,i=n,s=ee(),f=me(),{t:c}=ce(),_=I([]),w=I(!1),g=I(!1);se(()=>t.show,d=>R(this,null,function*(){d&&(yield b())}));const b=()=>R(this,null,function*(){w.value=!0;try{const d=yield j("BILLING_GET_INVOICES",{type:"received",status:"unpaid",page:1,limit:999});d&&d.success&&d.data&&Array.isArray(d.data)?_.value=d.data.filter(v=>v.status==="unpaid"||v.status==="overdue"):_.value=[]}catch(d){console.error("[PayAllInvoices] Failed to fetch invoices:",d),_.value=[]}finally{w.value=!1}}),T=E(()=>{var d,v;return((v=(d=f.appConfig)==null?void 0:d.BillingConfig)==null?void 0:v.TaxRate)||0}),x=E(()=>_.value.reduce((d,v)=>d+(v.subtotal||v.total),0)),N=E(()=>x.value*T.value),m=E(()=>x.value+N.value),r=d=>Ce(d),C=()=>R(this,null,function*(){if(!(_.value.length===0||g.value)){g.value=!0;try{const d=_.value.map(O=>O.id),v=yield j("BILLING_PAY_ALL_INVOICES",{invoice_ids:d,payment_method:"bank"});if(v.success){const O=v.count||_.value.length,k=v.total||m.value;f.TriggerNotification({appname:"billing",header:c("billing.paymentSuccessful"),message:c(v.message,{count:O,total:r(k)})||c("billing.successfullyPaidInvoices",{count:O,plural:O>1?"s":"",total:r(k)})}),s.clearCache(),i("close")}else f.TriggerNotification({appname:"billing",header:c("billing.paymentFailed"),message:c(v.message,{balance:v==null?void 0:v.balance})||c("billing.couldNotProcessPayment")})}catch(d){console.error("[PayAllInvoices] Payment failed:",d),f.TriggerNotification({appname:"billing",header:c("billing.title"),message:c("billing.errorOccurredWhileProcessing")})}finally{g.value=!1}}});return(d,v)=>(a(),V(be,{name:"slide-up"},{default:J(()=>[t.show?(a(),u("div",Ge({key:0},d.$attrs,{class:"w-full h-[480em] absolute bottom-0 px-[7em] py-[4em] z-[2000]"}),[e("div",i1,[e("div",n1,[e("div",{onClick:v[0]||(v[0]=O=>i("close")),class:"w-[45em] h-[15%] rounded-full bg-white cursor-pointer anim-hover-1"})]),e("div",a1,[e("p",o1,o(l(c)("billing.payAllInvoicesTitle")),1)]),e("div",r1,[w.value?(a(),u("div",c1,[e("p",u1,o(l(c)("billing.loadingInvoices")),1)])):_.value.length===0?(a(),u("div",d1,[e("p",f1,o(l(c)("billing.noUnpaidInvoices")),1)])):(a(),u("div",g1,[(a(!0),u(ne,null,fe(_.value,O=>(a(),u("div",{key:O.id,class:"w-full h-[40em] flex bg-white/5 rounded-[10em]"},[e("div",m1,[e("p",v1,o(O.sender_display_name||O.sender_name),1)]),e("div",p1,[e("p",h1," $"+o(r(O.total)),1)])]))),128)),v[1]||(v[1]=e("div",{class:"w-full h-[25em]"},null,-1))]))]),e("div",{class:"absolute w-full h-[240em] left-0 bottom-0 pointer-events-none z-[100]",style:ge([{transform:"rotate(180deg)"},{background:"linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 53.38%, rgba(0, 0, 0, 0.00) 65.27%)"}])}),e("div",C1,[e("div",b1,[e("p",x1,o(l(c)("billing.subtotal")),1),e("p",y1,"$"+o(r(x.value)),1)]),T.value>0?(a(),u("div",_1,[e("p",w1,o(l(c)("billing.tax").toUpperCase())+" ("+o((T.value*100).toFixed(0))+"%)",1),e("p",k1,"$"+o(r(N.value)),1)])):A("",!0),e("div",I1,[e("p",$1,o(l(c)("billing.total").toUpperCase()),1),e("p",S1,"$"+o(r(m.value)),1)]),e("div",{onClick:C,class:X([_.value.length===0||g.value?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer anim-hover-1","w-full h-[33em] rounded-[15em] bg-white flex items-center justify-center mt-[5em]"])},[e("p",F1,o(g.value?l(c)("billing.processing"):l(c)("billing.payAll")),1)],2)])])],16)):A("",!0)]),_:1}))}}),B1=pe(T1,[["__scopeId","data-v-b7714e82"]]),L1={class:"w-full h-full rounded-[40em] overflow-hidden bg-black relative"},E1={class:"w-full h-[25em] flex items-center justify-center"},O1={class:"w-full h-[21em] flex items-center justify-center"},N1={class:"font-['SFPRO'] text-[14em] text-white font-[400] leading-[100%] truncate"},j1={class:"w-full h-[347em] px-[15em]"},z1={key:0,class:"w-full h-full flex items-center justify-center"},R1={class:"font-['SFPRO'] text-[12em] text-white/50 font-[400]"},M1={key:1,class:"w-full h-full flex items-center justify-center"},A1={class:"font-['SFPRO'] text-[12em] text-white/50 font-[400]"},D1={key:2,class:"w-full h-full overflow-auto no-scrollbar pt-[9em] flex flex-wrap gap-y-[5em]"},H1={class:"w-[60%] h-full flex items-center pl-[15em]"},G1={class:"font-['SFPRO'] text-[11em] text-white font-[400] leading-[100%] truncate"},V1={class:"w-[40%] h-full flex items-center justify-end pr-[15em]"},Z1={class:"font-['SFPRO'] text-[14em] text-white font-[400] leading-[100%] truncate"},U1={class:"flex flex-col justify-end px-[15em] z-[101] relative gap-y-[10em]"},J1={class:"w-full flex items-center justify-between px-[18em]"},Y1={class:"text-white text-[14em] font-['SFPRO'] font-[400]"},X1={class:"text-white text-[14em] font-['SFPRO'] font-[400]"},q1={class:"font-['SFPRO'] text-[14em] text-black font-[400] leading-[100%] truncate"},W1={inheritAttrs:!1},K1=Object.assign(W1,{__name:"Payalltaxes",props:{show:{type:Boolean,default:!1}},emits:["close"],setup(M,{emit:n}){const t=M,i=n,s=ee(),f=me(),{t:c}=ce(),_=I([]),w=I(!1),g=I(!1);se(()=>t.show,m=>R(this,null,function*(){m&&(yield b())}));const b=()=>R(this,null,function*(){w.value=!0;try{const m=yield j("BILLING_GET_CITIZEN_TAX_INVOICES",{status:"unpaid",page:1,limit:999});m&&m.success&&m.taxInvoices&&Array.isArray(m.taxInvoices)?_.value=m.taxInvoices.filter(r=>r.status==="unpaid"||r.status==="overdue"):_.value=[]}catch(m){console.error("[PayAllTaxes] Failed to fetch taxes:",m),_.value=[]}finally{w.value=!1}}),T=E(()=>_.value.reduce((m,r)=>m+(parseFloat(r.amount)||0),0)),x=m=>Ce(m),N=()=>R(this,null,function*(){if(!(_.value.length===0||g.value)){g.value=!0;try{const m=_.value.map(C=>C.id),r=yield j("BILLING_PAY_ALL_CITIZEN_TAXES",{tax_invoice_ids:m,payment_method:"bank"});if(r.success){const C=r.count||_.value.length,d=r.total||T.value;f.TriggerNotification({appname:"billing",header:c("billing.paymentSuccessful"),message:c("billing.successfullyPaidTaxes",{count:C,plural:C>1?"es":"",total:x(d)})}),s.clearCache(),i("close")}else f.TriggerNotification({appname:"billing",header:c("billing.paymentFailed"),message:c(r.message,{balance:r==null?void 0:r.balance})||c("billing.couldNotProcessPayment")})}catch(m){console.error("[PayAllTaxes] Payment failed:",m),f.TriggerNotification({appname:"billing",header:c("billing.title"),message:c("billing.errorOccurredWhileProcessing")})}finally{g.value=!1}}});return(m,r)=>(a(),V(be,{name:"slide-up"},{default:J(()=>[t.show?(a(),u("div",Ge({key:0},m.$attrs,{class:"w-full h-[480em] absolute bottom-0 px-[7em] py-[4em] z-[2000]"}),[e("div",L1,[e("div",E1,[e("div",{onClick:r[0]||(r[0]=C=>i("close")),class:"w-[45em] h-[15%] rounded-full bg-white cursor-pointer anim-hover-1"})]),e("div",O1,[e("p",N1,o(l(c)("billing.payAllTaxes")),1)]),e("div",j1,[w.value?(a(),u("div",z1,[e("p",R1,o(l(c)("billing.loadingTaxes")),1)])):_.value.length===0?(a(),u("div",M1,[e("p",A1,o(l(c)("billing.noUnpaidTaxes")),1)])):(a(),u("div",D1,[(a(!0),u(ne,null,fe(_.value,C=>(a(),u("div",{key:C.id,class:"w-full h-[40em] flex bg-white/5 rounded-[10em]"},[e("div",H1,[e("p",G1,o(C.reason||l(c)("billing.governmentTax")),1)]),e("div",V1,[e("p",Z1," $"+o(x(C.amount)),1)])]))),128)),r[1]||(r[1]=e("div",{class:"w-full h-[25em]"},null,-1))]))]),e("div",{class:"absolute w-full h-[240em] left-0 bottom-0 pointer-events-none z-[100]",style:ge([{transform:"rotate(180deg)"},{background:"linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 53.38%, rgba(0, 0, 0, 0.00) 65.27%)"}])}),e("div",U1,[e("div",J1,[e("p",Y1,o(l(c)("billing.total").toUpperCase()),1),e("p",X1,"$"+o(x(T.value)),1)]),e("div",{onClick:N,class:X([_.value.length===0||g.value?"opacity-50 cursor-not-allowed":"cursor-pointer anim-hover-1","w-full h-[33em] rounded-[15em] bg-white flex items-center justify-center"])},[e("p",q1,o(g.value?l(c)("billing.processing"):l(c)("billing.payAll")),1)],2)])])],16)):A("",!0)]),_:1}))}}),Q1=pe(K1,[["__scopeId","data-v-babe55b9"]]),et={class:"w-full h-full"},tt={class:"w-full h-[71%] flex"},lt={class:"w-[60%] h-full"},st={class:"w-full h-[37%] flex items-end"},it={class:"font-['SFPRO'] text-[11.2em] text-black font-[400] leading-[100%] truncate"},nt={class:"w-full h-[31%] flex items-center"},at={key:0,class:"font-['SFPRO'] text-[11.2em] text-black/50 font-[400] leading-[100%] truncate"},ot={key:1,class:"font-['SFPRO'] text-[11.2em] text-black font-[500] leading-[100%] truncate"},rt={class:"w-full h-[22%]"},ct={key:0,class:"h-full inline-flex items-center justify-center px-[10em] bg-[#1CB90366] rounded-[5em]"},ut={class:"font-['SFPRO'] text-[11.2em] text-[#1CB903] font-[400] leading-[100%] truncate"},dt={key:1,class:"h-full inline-flex items-center justify-center px-[10em] bg-[#FF883E66] rounded-[5em]"},ft={class:"font-['SFPRO'] text-[11.2em] text-[#FF883E] font-[400] leading-[100%] truncate"},gt={key:2,class:"h-full inline-flex items-center justify-center px-[10em] bg-[#FFC10766] rounded-[5em]"},mt={class:"font-['SFPRO'] text-[11.2em] text-[#FFC107] font-[400] leading-[100%] truncate"},vt={class:"w-[40%] h-full flex items-center justify-end"},xe={__name:"Invoice",props:{id:{type:[Number,String],default:null},backgroundImage:{type:String,default:K["billing/billingsmall.png"]},title:{type:String,default:"LS Police Department"},subtitle:{type:String,default:null},amount:{type:Number,default:300},dueDate:{type:String,default:null},isPaid:{type:Boolean,default:!1},isOverdue:{type:Boolean,default:!1},variant:{type:String,default:"citizen"},buttonText:{type:String,default:null},buttonColor:{type:String,default:null},showDetailsButton:{type:Boolean,default:!0},showBadge:{type:Boolean,default:!0},canCancel:{type:Boolean,default:!0},canPayTax:{type:Boolean,default:!0}},emits:["clicked"],setup(M,{emit:n}){const{t}=ce(),i=M,s=E(()=>Ce(i.amount));E(()=>{if(!i.dueDate)return null;const r=new Date(i.dueDate),C=String(r.getDate()).padStart(2,"0"),d=String(r.getMonth()+1).padStart(2,"0"),v=r.getFullYear();return`${C}.${d}.${v}`});const f=E(()=>{if(i.buttonText)return i.buttonText;switch(i.variant){case"employee":case"sent":return i.isPaid?t("billing.paid"):t("general.cancel");case"tax":case"businessTax":case"citizenTax":return`$${s.value}`;default:return i.isPaid?t("billing.paid"):t("billing.pay")}}),c=E(()=>{if(i.buttonColor)return i.buttonColor;const r="inline-flex h-[40%] rounded-[11em] mb-[10em] px-[16em] items-center justify-center";switch(i.variant){case"employee":case"sent":return i.isPaid?`${r} bg-transparent border-[1.75em] border-[#000] opacity-[.3]`:i.canCancel?`${r} cursor-pointer anim-hover-1 bg-[#FF4E3E]`:`${r} bg-[#FF4E3E] opacity-[.3]`;case"tax":case"businessTax":case"citizenTax":return`${r} ${i.isPaid?"":"cursor-pointer anim-hover-1"} border-[1.75em] border-[#000] ${i.isPaid?"opacity-[.3]":""}`;default:if(i.isPaid)return`${r} bg-transparent border-[1.75em] border-[#000] opacity-[.3]`;const C=i.isOverdue?"bg-[#FF883E]":"bg-[#3E5FFF]";return`${r} cursor-pointer anim-hover-1 ${C} border-[#00000000]`}}),_=E(()=>i.variant==="employee"||i.variant==="sent"?i.isPaid?"text-black":"text-white":i.variant==="tax"||i.variant==="businessTax"||i.variant==="citizenTax"||i.isPaid?"text-black":"text-white"),w=E(()=>i.variant==="tax"?t("billing.editTaxDetails"):i.variant==="businessTax"||i.variant==="citizenTax"?i.isPaid?t("billing.paid"):t("billing.payTax"):t("billing.invoiceDetails")),g=E(()=>i.variant==="businessTax"||i.variant==="citizenTax"?i.isPaid?"text-black":"text-white":i.variant==="tax"?"text-white":"text-black"),b=E(()=>{const r="w-full h-[29%] flex items-center justify-center";return i.variant==="businessTax"?i.isPaid?`${r}`:i.canPayTax?`${r} cursor-pointer anim-hover-1`:`${r} opacity-[.3]`:`${r} cursor-pointer anim-hover-1`}),T=E(()=>{if(!i.dueDate||i.isPaid||i.isOverdue)return!1;const r=new Date;r.setHours(0,0,0,0);const C=new Date(i.dueDate);C.setHours(0,0,0,0);const d=C.getTime()-r.getTime(),v=Math.ceil(d/(1e3*60*60*24));return v>=0&&v<=2}),x=n,N=()=>{if(i.isPaid)return;let r="pay";if(i.variant==="employee"||i.variant==="sent"){if(!i.canCancel)return;r="cancel"}x("clicked",{type:r,id:i.id})},m=()=>{i.variant==="tax"?x("clicked",{type:"pay-tax",id:i.id}):i.variant==="businessTax"?!i.isPaid&&i.canPayTax&&x("clicked",{type:"pay",id:i.id}):i.variant==="citizenTax"?i.isPaid||x("clicked",{type:"pay",id:i.id}):x("clicked",{type:"details",id:i.id})};return(r,C)=>(a(),u("div",{class:"w-full h-[117em] px-[20em]",style:ge({backgroundImage:`url(${M.backgroundImage})`,backgroundSize:"100% 100%"})},[e("div",et,[e("div",tt,[e("div",lt,[e("div",st,[e("p",it,o(M.title),1)]),e("div",nt,[(M.variant==="tax"||M.variant==="businessTax"||M.variant==="citizenTax")&&M.subtitle?(a(),u("p",at,o(M.subtitle),1)):(a(),u("p",ot,"$"+o(s.value),1))]),e("div",rt,[M.variant==="tax"&&M.dueDate&&M.showBadge?(a(),u("div",ct,[e("p",ut,o(M.dueDate),1)])):M.isOverdue&&M.showBadge?(a(),u("div",dt,[e("p",ft,o(l(t)("billing.overdue")),1)])):T.value&&M.showBadge?(a(),u("div",gt,[e("p",mt,o(l(t)("billing.dueSoon")),1)])):A("",!0)])]),e("div",vt,[e("div",{class:X(c.value),onClick:N},[e("p",{class:X([_.value,"font-['SFPRO'] text-[15em] font-[400] leading-[100%] truncate"])},o(f.value),3)],2)])]),M.showDetailsButton?(a(),u("div",{key:0,onClick:m,class:X(b.value)},[e("p",{class:X([g.value,"font-['SFPRO'] text-[12em] font-[400] leading-[100%] truncate"])},o(w.value),3)],2)):A("",!0)])],4))}},pt={class:"w-full h-full"},ht={class:"w-full h-[15%] flex items-end justify-center"},Ct={class:"w-[89%] h-[38%] flex items-center justify-between",initial:{opacity:0},enter:{opacity:1,transition:{delay:100,duration:400}}},bt={class:"flex flex-col justify-between h-[90%] flex-shrink min-w-0"},xt={class:"font-['SFPRO'] text-[13em] text-black/50 font-[400] leading-[100%] overflow-hidden text-ellipsis whitespace-nowrap"},yt={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] overflow-hidden text-ellipsis whitespace-nowrap"},_t={class:"h-full flex items-center justify-end gap-x-[7em] flex-shrink-0"},wt=["title"],kt={class:"w-full h-[72em] flex items-end justify-center"},It={key:0,class:"w-[90%] h-[82%] rounded-[20em] flex items-center bg-white pl-[12em] pr-[15em]",initial:{opacity:0},enter:{opacity:1,transition:{delay:200,duration:400}}},$t={class:"flex-1 pl-[10em]"},St={class:"font-['SFPRO'] text-[12.5em] text-black font-[400] leading-[1.2] overflow-hidden text-ellipsis line-clamp-2"},Ft={key:1,class:"w-[90%] h-[82%] rounded-[20em] flex items-center bg-white pl-[12em] pr-[15em]",initial:{opacity:0},enter:{opacity:1,transition:{delay:200,duration:400}}},Pt={class:"flex-1 pl-[10em]"},Tt={class:"font-['SFPRO'] text-[12.5em] text-black font-[400] leading-[1.2] overflow-hidden text-ellipsis line-clamp-2"},Bt={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] truncate max-w-[100%]"},Lt={class:"font-['SFPRO'] text-[11em] text-white font-[400] leading-[100%] truncate whitespace-nowrap"},Et={class:"font-['SFPRO'] text-[11em] text-white font-[400] leading-[100%] truncate whitespace-nowrap"},Ot={key:0,class:"w-full h-[60em] flex items-center justify-center"},Nt={class:"text-black/50 text-[12em] font-['SFPRO']"},jt={key:1,class:"w-full h-[60em] flex items-center justify-center"},zt={class:"text-black/50 text-[12em] font-['SFPRO']"},Rt={__name:"Billings",emits:["scroll"],setup(M,{emit:n}){const t=ee(),i=ze(),s=me(),{appConfig:f}=Se(s),{t:c}=ce(),_=I(!1),w=I(!1),g=h=>{h.style.opacity=0,h.style.transform="translateY(15px)"},b=(h,z)=>{const q=(parseInt(h.dataset.index)||0)*50;setTimeout(()=>{h.style.transition="opacity 0.3s ease, transform 0.3s ease",h.style.opacity=1,h.style.transform="translateY(0)",setTimeout(z,300)},q)},T=h=>{h.style.transition=null,h.style.opacity=null,h.style.transform=null},x=I(!1),N=I(!1),m=I(1),r=I(0),C=I(!1),d=I(null),v=I("User"),O=h=>new Date(h).toLocaleDateString(),k=I(!1),S=I({unpaid_count:0,unpaid_total:0,overdue_count:0,overdue_total:0,paid_count:0,paid_total:0}),B=E(()=>t.general.isAdmin),te=E(()=>t.general.isAuthorizedCitizen),ie=E(()=>t.general.isAuthorizedJob),oe=E(()=>{if(!t.general.isAuthorizedJob)return!1;if(t.general.isBoss)return!0;const h=t.general.employeePermissions;return h&&h.can_access_business}),D=n,y=h=>{const{scrollTop:z,scrollHeight:Z,clientHeight:q}=h.target;if(D("scroll",{scrollTop:z,scrollHeight:Z,clientHeight:q}),z+q>=Z-50&&!N.value)if(t.general.category==="taxes"){const ye=t.getCachedTaxes("citizen");ye.pagination&&m.value<ye.pagination.totalPages&&H(m.value+1,!0)}else{const Ie=t.getCachedInvoices("received",t.general.category).pagination;Ie&&m.value<Ie.totalPages&&p(m.value+1,!0)}},L=E(()=>t.general.category=="taxes"?c("billing.taxes"):t.general.category=="unpaid"?c("billing.unpaidInvoices"):c("billing.paidInvoices")),F=E(()=>t.general.category=="taxes"?K["billing/billingsmall-tax.png"]:K["billing/billingsmall.png"]),G=E(()=>S.value.overdue_count||0),ue=E(()=>t.general.category==="taxes"?G.value:t.general.category==="unpaid"?r.value:0),le=E(()=>t.getFilteredInvoices("received",t.general.category).data||[]),re=E(()=>{const h=t.getFilteredTaxes("citizen");return h.data?t.general.category==="taxes"?h.data.filter(z=>z.status!=="paid"):t.general.category==="paid"?h.data.filter(z=>z.status==="paid"):[]:[]}),P=()=>R(this,null,function*(){try{const h=yield j("BILLING_GET_CITIZEN_TAX_STATS",{});h.success&&(S.value=h.stats)}catch(h){console.error("Error fetching citizen tax stats:",h)}}),H=(h=1,z=!1)=>R(this,null,function*(){if(!k.value){if(h===1&&!z){const Z=t.getCachedTaxes("citizen");if(Z.isInitialized&&t.isCacheValid(Z))return}k.value=!0,t.general.category==="taxes"&&(h===1?x.value=!0:N.value=!0);try{const Z=yield j("BILLING_GET_CITIZEN_TAX_INVOICES",{status:"all",page:h,limit:20});if(Z.success){const q=Z.taxInvoices.map(ve=>Ee($e({},ve),{isTax:!0}));z?t.appendTaxes("citizen",q,Z.pagination):t.cacheTaxes("citizen",q,Z.pagination),m.value=h}}catch(Z){console.error("Error fetching citizen tax invoices:",Z)}finally{x.value=!1,N.value=!1,k.value=!1}}}),p=(h=1,z=!1,Z=!1)=>R(this,null,function*(){if(!(x.value||N.value)&&t.general.category!=="taxes"){if(h===1&&!z&&!Z){const q=t.getCachedInvoices("received",t.general.category);if(q.isInitialized&&t.isCacheValid(q))return}h===1?x.value=!0:N.value=!0;try{const q=t.general.category==="taxes"?"all":t.general.category,ve=yield j("BILLING_GET_INVOICES",{type:"received",status:q,page:h,limit:20});ve.success?(z?t.appendInvoices("received",t.general.category,ve.invoices,ve.pagination):t.cacheInvoices("received",t.general.category,ve.invoices,ve.pagination),m.value=h):console.error("Failed to fetch invoices:",ve.message)}catch(q){console.error("Error fetching invoices:",q)}finally{x.value=!1,N.value=!1}}}),$=()=>R(this,null,function*(){try{const h=yield j("BILLING_GET_INVOICES",{type:"received",status:"overdue",page:1,limit:1});h.success&&h.pagination&&(r.value=h.pagination.total)}catch(h){console.error("Error fetching overdue count:",h)}}),U=h=>R(this,null,function*(){if(h.type=="details"||h.type=="invoice-details")t.setInvoiceId(h.id),t.general.category==="taxes"&&t.setIsTaxInvoice(!0),t.setCitizenPage("invoicedetails");else if(h.type==="pay")if(t.general.category==="taxes"){const Z=t.getCachedTaxes("citizen").data.find(q=>q.id===h.id);Z&&(d.value={id:Z.id,total:Z.amount,isTax:!0},C.value=!0)}else{const Z=t.getCachedInvoices("received",t.general.category).data.find(q=>q.id===h.id);Z&&(d.value=Z,C.value=!0)}}),de=()=>R(this,null,function*(){if(C.value=!1,!!d.value)try{let h;d.value.isTax?(h=yield j("BILLING_PAY_CITIZEN_TAX",{tax_invoice_id:d.value.id}),h.success?(t.updateCitizenTaxInCache(d.value.id,{status:"paid",paid_at:new Date().toISOString()}),P()):s.TriggerNotification({appname:"billing",header:c("billing.paymentFailed"),message:c(h.message,{balance:h==null?void 0:h.balance})||c("billing.couldNotProcessPayment")})):(h=yield j("BILLING_PAY_INVOICE",{invoice_id:d.value.id,skipDeduction:!0}),h.success?(t.updateInvoiceInCache(d.value.id,{status:"paid",paid_at:new Date().toISOString()}),$()):s.TriggerNotification({appname:"billing",header:c("billing.paymentFailed"),message:c(h.message,{balance:h==null?void 0:h.balance})||c("billing.couldNotProcessPayment")})),d.value=null}catch(h){console.error("Error paying invoice:",h),s.TriggerNotification({appname:"billing",header:c("billing.paymentFailed"),message:c("billing.errorOccurredWhileProcessing")}),d.value=null}}),ke=se(()=>t.general.category,(h,z)=>{h!==z&&(m.value=1,h==="taxes"?H(1,!1):h==="paid"?(p(1,!1,!0),H(1,!1)):p(1,!1,!0))});ae(()=>R(this,null,function*(){try{const h=yield j("BILLING_GET_PLAYER_INFO",{});h.success&&(v.value=h.playerName)}catch(h){console.error("Error fetching player info:",h)}try{const h=yield j("BILLING_CHECK_ADMIN",{});h.success&&t.setIsAdmin(h.isAdmin)}catch(h){console.error("Error checking admin status:",h)}try{const h=yield j("BILLING_CHECK_CITIZEN_AUTH",{});h.success&&t.setIsAuthorizedCitizen(h.authorized)}catch(h){console.error("Error checking citizen authorization:",h)}try{const h=yield j("BILLING_CHECK_JOB_AUTH",{});if(h.success&&(t.setIsAuthorizedJob(h.authorized),t.setIsBoss(h.is_boss||!1),h.authorized&&h.job_name&&h.job_label&&(t.setJobInfo(h.job_name,h.job_label),!h.is_boss)))try{const z=yield j("BILLING_GET_MY_PERMISSIONS",{});z.success&&z.permissions&&t.setEmployeePermissions(z.permissions)}catch(z){console.error("Error fetching employee permissions:",z)}}catch(h){console.error("Error checking job authorization:",h)}t.general.category==="taxes"?H(1,!1):t.general.category==="paid"?(p(1,!1,!0),H(1,!1)):p(1,!1,!0),$(),P(),H(1,!1)}));const Ze=se(()=>{var h;return(h=i.JobData)==null?void 0:h.name},(h,z)=>R(this,null,function*(){if(h!==z)try{const Z=yield j("BILLING_CHECK_JOB_AUTH",{});if(Z.success)if(t.setIsAuthorizedJob(Z.authorized),t.setIsBoss(Z.is_boss||!1),Z.authorized&&Z.job_name&&Z.job_label){if(t.setJobInfo(Z.job_name,Z.job_label),!Z.is_boss)try{const q=yield j("BILLING_GET_MY_PERMISSIONS",{});q.success&&q.permissions&&t.setEmployeePermissions(q.permissions)}catch(q){console.error("Error fetching employee permissions:",q)}}else t.setIsBoss(!1)}catch(Z){console.error("Error re-checking job authorization:",Z)}}));return Fe(()=>{ke(),Ze()}),(h,z)=>{var q,ve,ye,Ie,Me;const Z=je("motion");return a(),u("div",pt,[Q(B1,{class:"z-[2000] absolute",show:_.value,onClose:z[0]||(z[0]=Y=>_.value=!1)},null,8,["show"]),Q(Q1,{class:"z-[2000] absolute",show:w.value,onClose:z[1]||(z[1]=Y=>w.value=!1)},null,8,["show"]),Q(Ve,{show:C.value,amount:parseFloat(((q=d.value)==null?void 0:q.subtotal)||((ve=d.value)==null?void 0:ve.total)||((ye=d.value)==null?void 0:ye.amount)||0),taxRate:(Ie=d.value)!=null&&Ie.isTax?0:((Me=l(f).BillingConfig)==null?void 0:Me.TaxRate)||0,reference:d.value?l(c)("billing.invoiceNumber",{id:d.value.id}):l(c)("billing.invoice"),onClose:z[2]||(z[2]=Y=>{C.value=!1,d.value=null}),onPaided:de},null,8,["show","amount","taxRate","reference"]),e("div",ht,[W((a(),u("div",Ct,[e("div",bt,[e("p",xt,o(l(c)("billing.hello")),1),e("p",yt,o(v.value),1)]),e("div",_t,[te.value?(a(),u("div",{key:0,onClick:z[3]||(z[3]=Y=>l(t).setGeneralPage("authorizedcitizen")),class:"inline-flex h-full aspect-square cursor-pointer anim-hover-1 items-center justify-center bg-black rounded-[8em]"},z[8]||(z[8]=[e("svg",{class:"w-[50%] h-[50%]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M7.948 12.25H8C8.29639 12.25 8.56499 12.4246 8.68536 12.6954L12 20.1533L15.3146 12.6954C15.435 12.4246 15.7036 12.25 16 12.25H16.052C16.9505 12.25 17.6997 12.2499 18.2945 12.3299C18.9223 12.4143 19.4891 12.6 19.9445 13.0555C20.4 13.5109 20.5857 14.0777 20.6701 14.7055C20.7501 15.3003 20.75 16.0495 20.75 16.948V18.7505C20.75 20.6361 20.75 21.5789 20.1642 22.1647C19.5784 22.7505 18.6356 22.7505 16.75 22.7505H7.25C5.36438 22.7505 4.42158 22.7505 3.83579 22.1647C3.25 21.5789 3.25 20.6361 3.25 18.7505V16.948C3.24997 16.0495 3.24995 15.3003 3.32991 14.7055C3.41432 14.0777 3.59999 13.5109 4.05546 13.0555C4.51093 12.6 5.07773 12.4143 5.70552 12.3299C6.3003 12.2499 7.04954 12.25 7.948 12.25Z",fill:"white"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.362 12.6057C10.4987 12.3846 10.7401 12.25 11 12.25H13C13.2599 12.25 13.5013 12.3846 13.638 12.6057C13.7746 12.8268 13.7871 13.1029 13.6708 13.3354L12.7724 15.1323L13.2442 18.907C13.2581 19.0181 13.2469 19.1309 13.2115 19.2372L12.7115 20.7372C12.6094 21.0434 12.3228 21.25 12 21.25C11.6772 21.25 11.3906 21.0434 11.2885 20.7372L10.7885 19.2372C10.7531 19.1309 10.7419 19.0181 10.7558 18.907L11.2276 15.1323L10.3292 13.3354C10.2129 13.1029 10.2254 12.8268 10.362 12.6057Z",fill:"white"}),e("path",{d:"M7.75 5.5C7.75 3.15279 9.65279 1.25 12 1.25C14.3472 1.25 16.25 3.15279 16.25 5.5V6.5C16.25 8.84721 14.3472 10.75 12 10.75C9.65279 10.75 7.75 8.84721 7.75 6.5V5.5Z",fill:"white"})],-1)]))):A("",!0),ie.value?(a(),u("div",{key:1,onClick:z[4]||(z[4]=Y=>oe.value&&l(t).setGeneralPage("employee")),class:X(["inline-flex h-full aspect-square cursor-pointer anim-hover-1 items-center justify-center bg-black rounded-[8em]",{"opacity-50":!oe.value}]),title:oe.value?"":l(c)("billing.noAccessPermission")},z[9]||(z[9]=[e("svg",{class:"w-[50%] h-[50%]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M22.7501 13.9219C22.7498 15.527 22.7495 16.8083 22.6143 17.8125C22.4748 18.8483 22.1799 19.7021 21.5049 20.3769C20.8299 21.0517 19.9754 21.347 18.9395 21.4863C17.936 21.6211 16.6562 21.6211 15.0528 21.6211H8.97177C7.3559 21.621 6.06678 21.621 5.0577 21.4853C4.02144 21.3459 3.16732 21.0503 2.49227 20.375C1.81735 19.6996 1.52186 18.8459 1.3829 17.8095C1.24795 16.8029 1.24847 15.5185 1.24911 13.9082V12.0351C2.34636 13.4557 4.06563 14.3717 5.99911 14.372H9.24911V14.625C9.24911 15.0416 9.24321 15.3969 9.32626 15.707C9.5343 16.4834 10.1407 17.0897 10.917 17.2978C11.2271 17.3808 11.5826 17.375 11.9991 17.375C12.4156 17.375 12.771 17.3808 13.0811 17.2978C13.8575 17.0898 14.4639 16.4834 14.6719 15.707C14.755 15.3969 14.7491 15.0416 14.7491 14.625V14.372H17.9981C19.9331 14.3718 21.6529 13.4537 22.7501 12.0312V13.9219ZM13.2491 14.625C13.2491 15.1382 13.2428 15.248 13.2237 15.3193C13.1543 15.5779 12.952 15.7802 12.6934 15.8496C12.6221 15.8687 12.5119 15.875 11.9991 15.875C11.4862 15.875 11.3761 15.8687 11.3047 15.8496C11.0461 15.7802 10.8438 15.5779 10.7745 15.3193C10.7554 15.248 10.7491 15.1382 10.7491 14.625V14.372H13.2491V14.625ZM11.9991 2.125C12.6856 2.125 13.2569 2.12403 13.7178 2.1709C14.1912 2.21905 14.6305 2.32434 15.0264 2.58886C15.3267 2.7895 15.5846 3.04738 15.7852 3.34765C16.0497 3.74361 16.155 4.18283 16.2032 4.65625C16.2318 4.93763 16.2401 5.26021 16.2442 5.625H19.9981C21.5167 5.62509 22.7479 6.85646 22.7481 8.375C22.748 10.9981 20.6213 13.1258 17.9981 13.126H5.99911C3.37611 13.1256 1.24923 10.998 1.24911 8.375C1.24928 6.85645 2.48058 5.62517 3.99911 5.625H7.75399C7.75805 5.26021 7.7664 4.93763 7.79501 4.65625C7.84317 4.18283 7.94845 3.74361 8.21298 3.34765C8.41361 3.04738 8.67149 2.7895 8.97177 2.58886C9.36773 2.32434 9.80694 2.21905 10.2803 2.1709C10.7412 2.12403 11.3126 2.125 11.9991 2.125ZM11.9991 3.625C11.2812 3.625 10.7991 3.62571 10.4317 3.66308C10.077 3.69919 9.91321 3.76348 9.80477 3.83593C9.66832 3.92712 9.55123 4.0442 9.46005 4.18066C9.3876 4.28909 9.3233 4.45288 9.2872 4.80761C9.26463 5.02939 9.25677 5.293 9.25302 5.625H14.7452C14.7414 5.293 14.7336 5.02939 14.711 4.80761C14.6749 4.45288 14.6106 4.28909 14.5381 4.18066C14.447 4.0442 14.3299 3.92712 14.1934 3.83593C14.085 3.76348 13.9212 3.69919 13.5665 3.66308C13.1991 3.62571 12.7169 3.625 11.9991 3.625Z",fill:"white"})],-1)]),10,wt)):A("",!0),B.value?(a(),u("div",{key:2,onClick:z[5]||(z[5]=Y=>l(t).setGeneralPage("admin")),class:"inline-flex h-full aspect-square cursor-pointer anim-hover-1 items-center justify-center bg-black rounded-[8em]"},z[10]||(z[10]=[e("svg",{class:"w-[50%] h-[50%]",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"22",viewBox:"0 0 20 22",fill:"none"},[e("path",{d:"M9.75 0C13.5343 0 16.9612 1.21567 19.2402 3.18164C19.4054 3.32411 19.5 3.53188 19.5 3.75V9.74998L19.4932 10.1504C19.3481 14.251 16.9876 17.0703 14.71 18.8418C13.5324 19.7577 12.359 20.4095 11.4814 20.832C11.0446 21.0424 10.2578 21.3546 9.9922 21.46L9.9873 21.4619C9.8334 21.5132 9.6666 21.5132 9.5127 21.4619L9.5078 21.46C9.2421 21.3545 8.4553 21.0424 8.0186 20.832C7.14093 20.4095 5.9667 19.7578 4.78906 18.8418C2.43814 17.0132 0 14.068 0 9.74998V3.75C0 3.53188 0.0946099 3.32411 0.25977 3.18164C2.5388 1.21567 5.96568 0 9.75 0ZM9.75 5C8.5074 5 7.5 6.00736 7.5 7.25C7.5 8.06117 7.9305 8.77008 8.5742 9.16598C6.79909 9.67618 5.5 11.3108 5.5 13.25C5.5 13.6642 5.83579 14 6.25 14H13.25C13.6642 14 14 13.6642 14 13.25C14 11.3105 12.7004 9.67588 10.9248 9.16598C11.569 8.77018 12 8.06147 12 7.25C12 6.00736 10.9926 5 9.75 5Z",fill:"white"})],-1)]))):A("",!0)])])),[[Z]])]),e("div",kt,[ue.value>0?W((a(),u("div",It,[z[11]||(z[11]=e("div",{class:"w-[36em] h-[36em] flex items-center justify-center flex-shrink-0"},[e("svg",{class:"w-full h-full",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("circle",{cx:"20",cy:"20",r:"20",fill:"#FF883E","fill-opacity":"0.25"}),e("path",{d:"M21.9981 28.75C24.2531 28.75 26.0332 28.75 27.3516 28.5537C28.6904 28.3543 29.7764 27.9217 30.376 26.8633L30.4796 26.6641C30.9509 25.6611 30.758 24.5714 30.2764 23.3945C29.8928 22.4569 29.2771 21.3483 28.4991 20.0195L27.669 18.6162L25.7442 15.3711L25.6983 15.293C24.5956 13.4338 23.723 11.9633 22.9112 10.9648C22.0829 9.94615 21.1845 9.25 20.0001 9.25C18.8156 9.25004 17.9172 9.94615 17.089 10.9648C16.4717 11.7241 15.8188 12.7561 15.0567 14.0244L14.2559 15.3711L12.3311 18.6162L12.2833 18.6963C11.1346 20.6328 10.2283 22.1614 9.72372 23.3945C9.21012 24.6498 9.02516 25.8058 9.62411 26.8633L9.74227 27.0547C10.3606 27.9749 11.3935 28.3668 12.6485 28.5537C13.967 28.75 15.7471 28.75 18.002 28.75H21.9981ZM20.0001 21.5C19.4478 21.4999 19.0001 21.0522 19.0001 20.5V16C19.0001 15.4478 19.4478 15.0001 20.0001 15C20.5523 15 21.0001 15.4477 21.0001 16V20.5C21.0001 21.0523 20.5523 21.5 20.0001 21.5ZM20.0001 25.002C19.4478 25.0019 19.0001 24.5542 19.0001 24.002V23.9922C19.0001 23.4399 19.4478 22.9923 20.0001 22.9922C20.5523 22.9922 21.0001 23.4399 21.0001 23.9922V24.002C21.0001 24.5542 20.5523 25.002 20.0001 25.002Z",fill:"#FF883E"})])],-1)),e("div",$t,[e("p",St,o(l(c)("billing.overduePayments",{count:ue.value,plural:ue.value>1?"s":""})),1)])])),[[Z]]):W((a(),u("div",Ft,[z[12]||(z[12]=e("div",{class:"w-[36em] h-[36em] flex items-center justify-center flex-shrink-0"},[e("svg",{class:"w-full h-full",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("circle",{cx:"20",cy:"20",r:"20",fill:"#3F60FF","fill-opacity":"0.25"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.75 30.5C13.8129 30.5 9 25.6871 9 19.75C9 13.8129 13.8129 9 19.75 9C25.6871 9 30.5 13.8129 30.5 19.75C30.5 25.6871 25.6871 30.5 19.75 30.5ZM24.5182 17.3902C24.8718 16.9659 24.8145 16.3353 24.3902 15.9818C23.9659 15.6282 23.3353 15.6855 22.9818 16.1098L18.6828 21.2686L16.4571 19.0429C16.0666 18.6524 15.4334 18.6524 15.0429 19.0429C14.6524 19.4334 14.6524 20.0666 15.0429 20.4571L18.0429 23.4571C18.2416 23.6558 18.5146 23.7617 18.7953 23.749C19.076 23.7362 19.3384 23.606 19.5182 23.3902L24.5182 17.3902Z",fill:"#3F60FF"})])],-1)),e("div",Pt,[e("p",Tt,o(l(c)("billing.noOverdueInvoices")),1)])])),[[Z]])]),e("div",{onScroll:y,class:"w-full h-[490em] px-[15em] pb-[50em] overflow-auto no-scrollbar flex flex-wrap content-start gap-y-[15em]"},[e("div",{class:X(["w-full h-[60em] flex items-center flex-shrink-0",{"justify-between":l(t).general.category=="unpaid"&&le.value.length>0||l(t).general.category=="taxes"&&re.value.length>0,"justify-center":!(l(t).general.category=="unpaid"&&le.value.length>0||l(t).general.category=="taxes"&&re.value.length>0)}])},[e("p",Bt,o(L.value),1),l(t).general.category=="unpaid"&&le.value.length>0?(a(),u("div",{key:0,class:"px-[6.5em] py-[7.5em] bg-[#3E5FFF] rounded-[10em] cursor-pointer anim-hover-1 max-w-[45%]",onClick:z[6]||(z[6]=Y=>_.value=!0)},[e("p",Lt,o(l(c)("billing.payAllInvoices")),1)])):A("",!0),l(t).general.category=="taxes"&&re.value.length>0?(a(),u("div",{key:1,class:"px-[6.5em] py-[7.5em] bg-[#3E5FFF] rounded-[10em] cursor-pointer anim-hover-1 max-w-[45%]",onClick:z[7]||(z[7]=Y=>w.value=!0)},[e("p",Et,o(l(c)("billing.payAllTaxes")),1)])):A("",!0)],2),Q(we,{appear:"",onBeforeEnter:g,onEnter:b,onAfterEnter:T,css:!1,class:"contents"},{default:J(()=>[(a(!0),u(ne,null,fe(le.value,(Y,Le)=>(a(),V(xe,{onClicked:U,key:"inv-"+Y.id,"data-index":Le,id:Y.id,backgroundImage:F.value,variant:"citizen",isPaid:Y.status==="paid",isOverdue:Y.status==="overdue",title:Y.sender_display_name||Y.sender_job_label||Y.sender_name,amount:Y.total,dueDate:Y.due_date},null,8,["data-index","id","backgroundImage","isPaid","isOverdue","title","amount","dueDate"]))),128))]),_:1}),Q(we,{appear:"",onBeforeEnter:g,onEnter:b,onAfterEnter:T,css:!1,class:"contents"},{default:J(()=>[(a(!0),u(ne,null,fe(re.value,(Y,Le)=>(a(),V(xe,{onClicked:U,key:"tax-"+Y.id,"data-index":Le,id:Y.id,backgroundImage:Y.status==="paid"?l(K)["billing/billingsmall.png"]:l(K)["billing/billingsmall-tax.png"],variant:"citizenTax",isPaid:Y.status==="paid",isOverdue:Y.status!=="paid"&&new Date(Y.due_date)<new Date,title:Y.reason,subtitle:`${l(c)("billing.due")}: ${O(Y.due_date)}`,amount:Y.amount,dueDate:Y.due_date},null,8,["data-index","id","backgroundImage","isPaid","isOverdue","title","subtitle","amount","dueDate"]))),128))]),_:1}),N.value?(a(),u("div",Ot,[e("p",Nt,o(l(c)("billing.loadingMore")),1)])):le.value.length===0&&re.value.length===0&&!x.value?(a(),u("div",jt,[e("p",zt,o(l(t).general.category==="taxes"?l(c)("billing.noTaxInvoicesFound"):l(c)("billing.noInvoicesFound")),1)])):A("",!0),z[13]||(z[13]=e("div",{class:"w-full h-[60em]"},null,-1))],32)])}}},Mt={class:"w-full h-[12.6%] flex items-end"},At={class:"w-full h-[37%] relative flex items-center justify-center"},Dt={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%]"},Ht={key:0,class:"w-full h-[81.2%] flex items-center justify-center"},Gt={class:"font-['SFPRO'] text-[14em] text-black/50 font-[400]"},Vt={key:1,class:"w-full h-[81.2%] flex items-end justify-center"},Zt={class:"w-full h-full relative"},Ut={class:"w-full h-[30em] flex items-end justify-between"},Jt={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] w-[75%] truncate"},Yt={class:"font-['SFPRO'] text-[10em] text-black/40 font-[400] leading-[100%] w-[25%] truncate text-end mb-[.2em]"},Xt={class:"w-full h-[25em] flex items-end justify-between"},qt={class:"font-['SFPRO'] text-[11em] text-black font-[400] leading-[100%] w-[95%] truncate"},Wt={class:"ml-[0.5em] text-black/50"},Kt={class:"w-full h-[25em] flex items-end justify-between"},Qt={class:"font-['SFPRO'] text-[11em] text-black font-[400] leading-[100%] w-[95%] truncate"},el={class:"ml-[0.5em] text-black/50"},tl={class:"w-full h-[49em] flex items-end"},ll={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] w-[75%] truncate"},sl={class:"w-full h-[227em] overflow-auto no-scrollbar"},il={class:"w-[75%] h-full flex items-center gap-x-[9em]"},nl={class:"font-['SFPRO'] text-[11.2em] text-black/50 font-[400] leading-[100%] truncate"},al={class:"px-[.65em] py-[.25em] bg-[#0000001A] rounded-[.7em] text-[8.5em] font-['SFPRO']"},ol={class:"w-[25%] h-full flex items-center justify-end"},rl={class:"font-['SFPRO'] text-[11.2em] text-black font-[400] leading-[100%] truncate"},cl={class:"w-full h-[19em] flex items-center justify-between"},ul={class:"w-[60%] h-full flex items-center"},dl={class:"font-['SFPRO'] text-[11.2em] text-black/50 font-[400] leading-[100%] truncate"},fl={class:"w-[40%] h-full flex items-center justify-end"},gl={class:"font-['SFPRO'] text-[11.2em] text-black font-[400] leading-[100%] truncate"},ml={class:"w-full h-[19em] flex items-center justify-between"},vl={class:"w-[60%] h-full flex items-center"},pl={class:"font-['SFPRO'] text-[11.2em] text-black/50 font-[400] leading-[100%] truncate"},hl={class:"w-[40%] h-full flex items-center justify-end"},Cl={class:"font-['SFPRO'] text-[11.2em] text-black font-[400] leading-[100%] truncate"},bl={class:"w-full h-[29em] flex items-center justify-between"},xl={class:"w-[60%] h-full flex items-center"},yl={class:"font-['SFPRO'] text-[11.2em] text-black font-[400] leading-[100%] truncate"},_l={class:"w-[40%] h-full flex items-center justify-end"},wl={class:"font-['SFPRO'] text-[11.2em] text-black font-[400] leading-[100%] truncate"},kl={class:"font-['SFPRO'] text-[16em] text-white font-[400] truncate"},Il={class:"font-['SFPRO'] text-[16em] text-white font-[400] truncate"},$l={class:"font-['SFPRO'] text-[16em] text-white font-[400] truncate"},Sl={key:3,class:"w-full h-[44em] flex items-center justify-center"},Fl={class:"font-['SFPRO'] text-[16em] text-black font-[600] truncate"},Pl={key:4,class:"w-full h-[81.2%] flex items-center justify-center"},Tl={class:"font-['SFPRO'] text-[14em] text-black/50 font-[400]"},Be={__name:"InvoiceDetails",setup(M){const n=ee(),{t}=ce(),i=me(),{appConfig:s}=Se(i),f=I(null),c=I(!0),_=I(!1),w=I(!1),g=I(!1),b=E(()=>n.general.page==="admin"),T=E(()=>n.general.page==="employee"),x=E(()=>n.general.page==="citizen"),N=E(()=>n.general.page==="authorizedcitizen"),m=E(()=>n.general.isTaxInvoice),r=E(()=>b.value?"#FDD7D7":T.value?"#D8D7FD":"#F2F2F7"),C=E(()=>f.value?f.value.status==="paid"?K["billing/billinglarge3.png"]:m.value&&(T.value||x.value)?K["billing/billinglarge4.png"]:b.value||T.value||N.value?K["billing/billinglarge2.png"]:K["billing/billinglarge.png"]:K["billing/billinglarge.png"]),d=E(()=>f.value&&f.value.status!=="paid"),v=D=>{if(!D)return"";const y=new Date(D),L=String(y.getDate()).padStart(2,"0"),F=String(y.getMonth()+1).padStart(2,"0"),G=y.getFullYear();return`${L}.${F}.${G}`},O=D=>D?Ce(D):"0.00",k=()=>R(this,null,function*(){try{if(c.value=!0,m.value){if(x.value){const F=n.getCachedTaxes("citizen");if(F.isInitialized){const G=F.data.find(ue=>ue.id===n.general.invoiceId);if(G){const ue=parseFloat(G.amount)||0;f.value={id:G.id,sender_display_name:t("billing.governmentTax"),sender_name:t("billing.taxAuthority"),sender_job_label:t("billing.taxAuthority"),receiver_name:"You",created_at:G.created_at,due_date:G.due_date,status:G.status,paid_at:G.paid_at,subtotal:ue,tax_percent:0,tax_amount:0,total:ue,items:[{reason:G.reason||t("billing.citizenTaxLabel"),amount:1,price:ue}]},c.value=!1;return}}console.error("Citizen tax invoice not found in cache"),c.value=!1;return}const L=n.getCachedBusinessTaxInvoices;if(L.isInitialized){const F=L.data.find(G=>G.id===n.general.invoiceId);if(F){const G=parseFloat(F.amount)||0;f.value={id:F.id,sender_display_name:t("billing.governmentTax"),sender_name:t("billing.taxAuthority"),sender_job_label:t("billing.taxAuthority"),receiver_name:n.general.jobLabel||n.general.jobName,created_at:F.created_at,due_date:F.due_date,status:F.status,paid_at:F.paid_at,subtotal:G,tax_percent:0,tax_amount:0,total:G,items:[{reason:F.reason||t("billing.businessTaxLabel"),amount:1,price:G}]},c.value=!1;return}}console.error("Tax invoice not found in cache"),c.value=!1;return}const D=n.findInvoiceById(n.general.invoiceId);if(D&&D.items&&D.items.length>0){f.value=D,c.value=!1;return}const y=yield j("BILLING_GET_INVOICE_DETAILS",{invoice_id:n.general.invoiceId});y.success?f.value=y.invoice:console.error("Error fetching invoice details:",y.message)}catch(D){console.error("Error fetching invoice details:",D)}finally{c.value=!1}}),S=()=>{n.setIsTaxInvoice(!1),b.value?n.setAdminPage("main"):T.value?n.setEmployeePage("main"):n.general.lastPage==="authorizedcitizen"?n.setCitizenPage("main"):n.setCitizenPage("billings")},B=()=>{_.value=!0},te=()=>R(this,null,function*(){if(f.value){_.value=!1;try{const D=yield j("BILLING_CANCEL_INVOICE",{invoice_id:f.value.id});D.success?(n.removeInvoiceFromCache(f.value.id),T.value?n.setEmployeePage("main"):n.setAdminPage("main")):i.TriggerNotification({appname:"billing",header:t("apps.billing"),message:t(D.message)})}catch(D){console.error("Error cancelling invoice:",D)}}}),ie=()=>{g.value||(w.value=!0)},oe=()=>R(this,null,function*(){if(f.value&&!g.value){g.value=!0,w.value=!1;try{let D;if(m.value)if(x.value)D=yield j("BILLING_PAY_CITIZEN_TAX",{tax_invoice_id:f.value.id}),D.success?(n.setIsTaxInvoice(!1),n.setCitizenPage("billings")):i.TriggerNotification({appname:"billing",header:t("billing.paymentFailed"),message:t(D.message,{balance:D==null?void 0:D.balance})||t("billing.couldNotProcessPayment")});else if(D=yield j("BILLING_PAY_BUSINESS_TAX",{invoice_id:f.value.id}),D.success){const y=n.getCachedBusinessTaxInvoices;if(y.isInitialized){const L=y.data.find(F=>F.id===f.value.id);L&&(L.status="paid",L.paid_at=new Date().toISOString())}n.setIsTaxInvoice(!1),n.setEmployeePage("main")}else i.TriggerNotification({appname:"billing",header:t("billing.paymentFailed"),message:t(D.message,{balance:D==null?void 0:D.balance})||t("billing.couldNotProcessPayment")});else D=yield j("BILLING_PAY_INVOICE",{invoice_id:f.value.id,skipDeduction:!0}),D.success?(n.updateInvoiceInCache(f.value.id,{status:"paid",paid_at:new Date().toISOString()}),n.setCitizenPage("billings")):i.TriggerNotification({appname:"billing",header:t("billing.paymentFailed"),message:t(D.message,{balance:D==null?void 0:D.balance})||t("billing.couldNotProcessPayment")})}catch(D){console.error("Error paying invoice:",D),i.TriggerNotification({appname:"billing",header:t("billing.paymentFailed"),message:t("billing.errorOccurredWhileProcessing")})}finally{g.value=!1}}});return ae(()=>{n.general.invoiceId&&k()}),(D,y)=>{var L;return a(),u("div",{class:"w-full h-full",style:ge({backgroundColor:r.value})},[e("div",Mt,[e("div",At,[e("div",{onClick:S,class:"h-full aspect-square rounded-full absolute left-[15em] bg-white flex items-center justify-center cursor-pointer anim-hover-1"},y[2]||(y[2]=[e("svg",{class:"h-[40%]",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M6.41402 1L1.41406 6L6.41406 11",stroke:"black","stroke-width":"2","stroke-miterlimit":"16","stroke-linecap":"round"})],-1)])),e("p",Dt,o(l(t)("billing.invoiceDetails")),1)])]),c.value?(a(),u("div",Ht,[e("p",Gt,o(l(t)("general.loading")),1)])):f.value?(a(),u("div",Vt,[e("div",{class:"w-[90%] h-[95%] px-[20em]",style:ge({backgroundImage:`url(${C.value})`,backgroundSize:"100% 100%"})},[e("div",Zt,[e("div",Ut,[e("p",Jt,o(f.value.sender_display_name||f.value.sender_job_label||f.value.sender_name),1),e("p",Yt,o(v(f.value.created_at)),1)]),e("div",Xt,[e("p",qt,[Oe(o(l(t)("billing.from"))+": ",1),e("span",Wt,o(f.value.sender_name),1)])]),e("div",Kt,[e("p",Qt,[Oe(o(l(t)("billing.due"))+": ",1),e("span",el,o(v(f.value.due_date)),1)])]),e("div",tl,[e("p",ll,o(l(t)("billing.charges")),1)]),e("div",sl,[(a(!0),u(ne,null,fe(f.value.items,(F,G)=>(a(),u("div",{key:G,class:"w-full h-[34em] flex justify-between"},[e("div",il,[e("p",nl,o(F.reason),1),e("div",al,o(F.amount)+"x",1)]),e("div",ol,[e("p",rl,"$"+o(O(F.price)),1)])]))),128))]),y[3]||(y[3]=e("div",{class:"w-full h-[10em]"},null,-1)),e("div",cl,[e("div",ul,[e("p",dl,o(l(t)("billing.subtotal")),1)]),e("div",fl,[e("p",gl,"$"+o(O(f.value.subtotal)),1)])]),e("div",ml,[e("div",vl,[e("p",pl,o(l(t)("billing.tax").toUpperCase())+" ("+o(f.value.tax_percent)+"%)",1)]),e("div",hl,[e("p",Cl,"$"+o(O(f.value.tax_amount)),1)])]),e("div",bl,[e("div",xl,[e("p",yl,o(l(t)("billing.total").toUpperCase()),1)]),e("div",_l,[e("p",wl,"$"+o(O(f.value.total)),1)])]),y[4]||(y[4]=e("div",{class:"w-full h-[20em]"},null,-1)),d.value&&m.value&&(T.value||x.value)?(a(),u("div",{key:0,onClick:ie,class:X(["w-full h-[44em] flex items-center justify-center cursor-pointer anim-hover-1 rounded-[8em]",{"opacity-50 pointer-events-none":g.value}])},[e("p",kl,o(g.value?l(t)("general.loading"):l(t)("billing.payTax")),1)],2)):d.value&&(b.value||T.value||N.value)&&!m.value?(a(),u("div",{key:1,onClick:B,class:"w-full h-[44em] flex items-center justify-center cursor-pointer anim-hover-1 bg-[#FF4E3E] rounded-[8em]"},[e("p",Il,o(l(t)("general.cancel")),1)])):d.value&&x.value&&!m.value?(a(),u("div",{key:2,onClick:ie,class:X(["w-full h-[44em] flex items-center justify-center cursor-pointer anim-hover-1 rounded-[8em]",{"opacity-50 pointer-events-none":g.value}])},[e("p",$l,o(g.value?l(t)("general.loading"):l(t)("billing.pay")),1)],2)):d.value?A("",!0):(a(),u("div",Sl,[e("p",Fl,o(l(t)("billing.paid")),1)]))])],4)])):A("",!0),_.value?(a(),V(Te,{key:2,header:l(t)("billing.cancelInvoice"),label:l(t)("billing.cancelInvoiceConfirmation"),buttons:{cancel:l(t)("billing.no"),submit:l(t)("billing.yes")},onCancel:y[0]||(y[0]=F=>_.value=!1),onSubmit:te},null,8,["header","label","buttons"])):A("",!0),f.value?(a(),V(Ve,{key:3,show:w.value,amount:f.value.subtotal,taxRate:((L=l(s).BillingConfig)==null?void 0:L.TaxRate)||0,reference:l(t)("billing.invoiceNumber",{id:f.value.id}),onClose:y[1]||(y[1]=F=>w.value=!1),onPaided:oe},null,8,["show","amount","taxRate","reference"])):(a(),u("div",Pl,[e("p",Tl,o(l(t)("billing.invoiceNotFound")),1)]))],4)}}},Bl={class:"w-full h-full relative"},Ll={__name:"BillingCitizenRouter",setup(M){const n=I([{key:"billings"},{key:"invoicedetails"}]),t=ee();ae(()=>{t.setGeneralGradientOpacity(1),t.setCitizenPage("billings")});const i=({scrollTop:s,scrollHeight:f,clientHeight:c})=>{const _=f-c,w=s/_*100,g=70,b=95;w<=g?t.setGeneralGradientOpacity(1):w>=b?t.setGeneralGradientOpacity(0):t.setGeneralGradientOpacity(1-(w-g)/(b-g))};return(s,f)=>(a(),u("div",Bl,[Q(Pe,{"current-key":l(t).citizen.page,items:n.value,duration:300,easing:"ease-in-out"},{billings:J(()=>[l(t).citizen.page=="billings"?(a(),V(Rt,{key:0,onScroll:i})):A("",!0)]),invoicedetails:J(()=>[l(t).citizen.page=="invoicedetails"?(a(),V(Be,{key:0})):A("",!0)]),_:1},8,["current-key","items"])]))}},El={key:"search",class:"w-full h-[15%] flex items-end justify-center"},Ol={class:"w-[89%] h-[38%] flex items-center gap-x-[8em] search-container-enter"},Nl={class:"flex-[10] h-full relative bg-white rounded-[12em] pl-[28em] pr-[10em]"},jl=["placeholder"],zl={key:"normal",class:"w-full h-[15%] flex items-end justify-center"},Rl={class:"w-[89%] h-[38%] flex items-center justify-between"},Ml={class:"flex flex-col justify-between h-[90%] flex-shrink min-w-0"},Al={class:"font-['SFPRO'] text-[13em] text-black/50 font-[400] leading-[100%] overflow-hidden text-ellipsis whitespace-nowrap"},Dl={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] overflow-hidden text-ellipsis whitespace-nowrap"},Hl={class:"h-full flex items-center justify-end gap-x-[7em] flex-shrink-0"},Gl={__name:"TopBar",props:{title:{type:String,required:!0},subtitle:{type:String,default:""}},setup(M){const n=ee(),t=ze(),{t:i}=ce(),s=I(!1),f=I("User"),c=I(""),_=I(null),w=()=>{s.value=!s.value,s.value?setTimeout(()=>{var m;(m=_.value)==null||m.focus()},300):(c.value="",n.setSearchQuery(""))},g=()=>{s.value=!1,c.value="",n.setSearchQuery("")};se(c,m=>{n.setSearchQuery(m)}),se(()=>n.general.page,()=>{g()}),se(()=>n.general.category,()=>{g()});const b=M,T=E(()=>{var m;return n.general.page==="employee"&&((m=t.JobData)==null?void 0:m.label)||b.title}),x=E(()=>b.subtitle?b.subtitle:f.value);E(()=>{var d,v;const m=n.general.isBoss,r=((v=(d=t.JobData)==null?void 0:d.grade)==null?void 0:v.isboss)||!1;return m||r});const N=E(()=>n.general.page==="employee");return se(()=>{var m,r,C;return{jobName:(m=t.JobData)==null?void 0:m.name,isBossJobby:(C=(r=t.JobData)==null?void 0:r.grade)==null?void 0:C.isboss,isBossBilling:n.general.isBoss}},(m,r)=>{if(r){const C=m.jobName!==r.jobName,d=m.isBossBilling||m.isBossJobby,v=r.isBossBilling||r.isBossJobby,O=d!==v;n.general.page==="employee"&&(C&&r.jobName?(n.setGeneralPage("citizen"),n.setEmployeePage("main"),n.cache.employees={data:[],lastFetch:null,isInitialized:!1,jobName:null}):!C&&O&&!d&&n.employee.page==="business_settings"&&n.setEmployeePage("main"))}},{deep:!0}),ae(()=>R(this,null,function*(){const m=yield j("BILLING_GET_PLAYER_INFO",{});m.success&&(f.value=m.playerName)})),(m,r)=>(a(),V(be,{name:"fade",mode:"out-in"},{default:J(()=>[s.value?(a(),u("div",El,[e("div",Ol,[e("div",Nl,[r[6]||(r[6]=e("svg",{class:"absolute left-[5em] top-[50%] transform -translate-y-[50%] w-[16em] h-[16em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M3 10.2803C3 11.2838 3.19038 12.225 3.57114 13.1039C3.9519 13.9828 4.48005 14.7567 5.15559 15.4258C5.83112 16.0948 6.6126 16.6178 7.50001 16.9949C8.38742 17.372 9.33778 17.5605 10.3511 17.5605C11.1495 17.5605 11.911 17.4389 12.6356 17.1956C13.3603 16.9523 14.0236 16.6178 14.6254 16.1921L19.1576 20.6897C19.2682 20.7932 19.3895 20.8708 19.5215 20.9225C19.6535 20.9742 19.7933 21 19.9407 21C20.1495 21 20.3337 20.9529 20.4934 20.8586C20.653 20.7643 20.7774 20.635 20.8664 20.4709C20.9555 20.3066 21 20.1241 21 19.9234C21 19.7775 20.9739 19.6407 20.9217 19.5129C20.8695 19.3852 20.7943 19.2727 20.6961 19.1754L16.1914 14.6868C16.6643 14.0786 17.0343 13.4004 17.3014 12.6523C17.5686 11.9042 17.7021 11.1135 17.7021 10.2803C17.7021 9.27673 17.5118 8.33552 17.1311 7.45666C16.7503 6.5778 16.2221 5.80385 15.5466 5.13482C14.8711 4.46579 14.0896 3.94273 13.2021 3.56564C12.3147 3.18855 11.3644 3 10.3511 3C9.33778 3 8.38742 3.18855 7.50001 3.56564C6.6126 3.94273 5.83112 4.46579 5.15559 5.13482C4.48005 5.80385 3.9519 6.5778 3.57114 7.45666C3.19038 8.33552 3 9.27673 3 10.2803ZM4.57523 10.2803C4.57523 9.4896 4.72416 8.74911 5.022 8.05879C5.31986 7.36847 5.7344 6.76026 6.26561 6.23415C6.79683 5.70806 7.41096 5.29751 8.10799 5.00253C8.80503 4.70755 9.55273 4.56006 10.3511 4.56006C11.1495 4.56006 11.8971 4.70755 12.5942 5.00253C13.2912 5.29751 13.9038 5.70806 14.4319 6.23415C14.9601 6.76026 15.3746 7.36847 15.6756 8.05879C15.9765 8.74911 16.1269 9.4896 16.1269 10.2803C16.1269 11.0709 15.9765 11.8114 15.6756 12.5018C15.3746 13.1921 14.9601 13.7988 14.4319 14.3218C13.9038 14.8449 13.2912 15.2554 12.5942 15.5535C11.8971 15.8515 11.1495 16.0005 10.3511 16.0005C9.55273 16.0005 8.80503 15.8515 8.10799 15.5535C7.41096 15.2554 6.79683 14.8449 6.26561 14.3218C5.7344 13.7988 5.31986 13.1921 5.022 12.5018C4.72416 11.8114 4.57523 11.0709 4.57523 10.2803Z",fill:"black","fill-opacity":"0.7"})],-1)),W(e("input",{ref_key:"searchInput",ref:_,"onUpdate:modelValue":r[0]||(r[0]=C=>c.value=C),type:"text",placeholder:l(i)("billing.searchAnyInvoices"),class:"w-full h-full border-none outline-none bg-transparent font-['SFPRO'] text-[11.5em] font-[400] text-black placeholder:text-black/50"},null,8,jl),[[he,c.value]])]),e("div",{class:"flex-[2] h-full",onClick:w},r[7]||(r[7]=[e("div",{class:"w-full h-full bg-white rounded-[12em] flex items-center justify-center cursor-pointer anim-hover-1"},[e("svg",{class:"w-[16em] h-[16em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M17.2928 5.29289C17.6833 4.90237 18.3163 4.90237 18.7068 5.29289C19.0974 5.68342 19.0974 6.31643 18.7068 6.70696L13.4129 11.9999L18.7059 17.2929L18.7752 17.369C19.0952 17.7618 19.0719 18.3409 18.7059 18.7069C18.3397 19.073 17.7607 19.0957 17.368 18.7753L17.2918 18.7069L11.9988 13.4139L6.70777 18.7059C6.31725 19.0965 5.68424 19.0964 5.29371 18.7059C4.90319 18.3154 4.90319 17.6824 5.29371 17.2919L10.5848 11.9999L5.29273 6.70793L5.22437 6.63176C4.90398 6.23901 4.92666 5.66001 5.29273 5.29387C5.65872 4.92788 6.23786 4.90454 6.63062 5.22453L6.7068 5.29387L11.9988 10.5858L17.2928 5.29289Z",fill:"black"})])],-1)]))])])):(a(),u("div",zl,[e("div",Rl,[e("div",Ml,[e("p",Al,o(T.value),1),e("p",Dl,o(x.value),1)]),e("div",Hl,[l(n).general.page=="citizen"?(a(),u("div",{key:0,onClick:r[1]||(r[1]=C=>l(n).setGeneralPage("admin")),class:"inline-flex h-[100%] cursor-pointer anim-hover-1 px-[10em] items-center justify-center bg-white rounded-[8em]"},r[8]||(r[8]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M12 1.25C15.7843 1.25 19.2112 2.46567 21.4902 4.43164C21.6554 4.57411 21.75 4.78188 21.75 5V11L21.7432 11.4004C21.5981 15.501 19.2376 18.3203 16.96 20.0918C15.7824 21.0077 14.609 21.6595 13.7314 22.082C13.2946 22.2924 12.5078 22.6046 12.2422 22.71L12.2373 22.7119C12.0834 22.7632 11.9166 22.7632 11.7627 22.7119L11.7578 22.71C11.4921 22.6045 10.7053 22.2924 10.2686 22.082C9.39093 21.6595 8.2167 21.0078 7.03906 20.0918C4.68814 18.2632 2.25 15.318 2.25 11V5C2.25 4.78188 2.34461 4.57411 2.50977 4.43164C4.7888 2.46567 8.21568 1.25 12 1.25ZM12 6.25C10.7574 6.25 9.75 7.25736 9.75 8.5C9.75 9.31117 10.1805 10.0201 10.8242 10.416C9.04909 10.9262 7.75 12.5608 7.75 14.5C7.75 14.9142 8.08579 15.25 8.5 15.25H15.5C15.9142 15.25 16.25 14.9142 16.25 14.5C16.25 12.5605 14.9504 10.9259 13.1748 10.416C13.819 10.0202 14.25 9.31147 14.25 8.5C14.25 7.25736 13.2426 6.25 12 6.25Z",fill:"black"})],-1)]))):A("",!0),l(n).general.page=="citizen"?(a(),u("div",{key:1,onClick:r[2]||(r[2]=C=>l(n).setGeneralPage("employee")),class:"inline-flex h-[100%] cursor-pointer anim-hover-1 px-[10em] items-center justify-center bg-white rounded-[8em]"},r[9]||(r[9]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M7.948 12.25H8C8.29639 12.25 8.56499 12.4246 8.68536 12.6954L12 20.1533L15.3146 12.6954C15.435 12.4246 15.7036 12.25 16 12.25H16.052C16.9505 12.25 17.6997 12.2499 18.2945 12.3299C18.9223 12.4143 19.4891 12.6 19.9445 13.0555C20.4 13.5109 20.5857 14.0777 20.6701 14.7055C20.7501 15.3003 20.75 16.0495 20.75 16.948V18.7505C20.75 20.6361 20.75 21.5789 20.1642 22.1647C19.5784 22.7505 18.6356 22.7505 16.75 22.7505H7.25C5.36438 22.7505 4.42158 22.7505 3.83579 22.1647C3.25 21.5789 3.25 20.6361 3.25 18.7505V16.948C3.24997 16.0495 3.24995 15.3003 3.32991 14.7055C3.41432 14.0777 3.59999 13.5109 4.05546 13.0555C4.51093 12.6 5.07773 12.4143 5.70552 12.3299C6.3003 12.2499 7.04954 12.25 7.948 12.25Z",fill:"black"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.362 12.6057C10.4987 12.3846 10.7401 12.25 11 12.25H13C13.2599 12.25 13.5013 12.3846 13.638 12.6057C13.7746 12.8268 13.7871 13.1029 13.6708 13.3354L12.7724 15.1323L13.2442 18.907C13.2581 19.0181 13.2469 19.1309 13.2115 19.2372L12.7115 20.7372C12.6094 21.0434 12.3228 21.25 12 21.25C11.6772 21.25 11.3906 21.0434 11.2885 20.7372L10.7885 19.2372C10.7531 19.1309 10.7419 19.0181 10.7558 18.907L11.2276 15.1323L10.3292 13.3354C10.2129 13.1029 10.2254 12.8268 10.362 12.6057Z",fill:"black"}),e("path",{d:"M7.75 5.5C7.75 3.15279 9.65279 1.25 12 1.25C14.3472 1.25 16.25 3.15279 16.25 5.5V6.5C16.25 8.84721 14.3472 10.75 12 10.75C9.65279 10.75 7.75 8.84721 7.75 6.5V5.5Z",fill:"black"})],-1)]))):A("",!0),N.value?(a(),u("div",{key:2,onClick:r[3]||(r[3]=C=>l(n).setEmployeePage("business_settings")),class:"inline-flex h-[100%] cursor-pointer anim-hover-1 px-[10em] items-center justify-center bg-white rounded-[8em]"},r[10]||(r[10]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"22",viewBox:"0 0 21 22",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.24975 21.1969C8.5241 21.3944 8.8181 21.4681 9.0977 21.5H11.9023C12.1819 21.4681 12.4759 21.3944 12.7503 21.1969C13.0245 20.9995 13.1873 20.7446 13.3058 20.4902C13.4122 20.2617 13.9485 18.6612 13.9485 18.6612C13.9485 18.6612 14.2104 18.2178 14.4256 18.0766C14.8481 17.7995 15.2744 17.7394 15.5521 17.7995C15.5521 17.7995 17.4336 18.3292 17.6993 18.3713C17.9948 18.4181 18.3181 18.424 18.6524 18.2885C18.9866 18.1531 19.214 17.9239 19.393 17.685L20.8316 15.2026C20.9442 14.9434 21.0272 14.6508 20.9917 14.3133C20.9561 13.9758 20.8138 13.7068 20.6496 13.4766C20.5021 13.2699 19.2592 11.8863 19.0441 11.648C19.0441 11.648 18.7841 11.2493 18.7841 10.7498C18.7841 10.1651 19.0441 9.8519 19.0441 9.8519C19.0441 9.8519 20.5021 8.22998 20.6496 8.0233C20.8138 7.79311 20.9561 7.5241 20.9917 7.1866C21.0272 6.84914 20.9442 6.55652 20.8316 6.29733C20.7304 6.06456 19.393 3.81487 19.393 3.81487C19.214 3.57595 18.9866 3.34685 18.6524 3.21138C18.3181 3.07586 17.9948 3.08183 17.6993 3.1286C17.4336 3.17064 15.882 3.60698 15.5521 3.70035C15.5521 3.70035 15.0227 3.81487 14.4256 3.42329C14.2104 3.28218 14.0437 3.07813 13.9484 2.83872C13.9484 2.83872 13.4122 1.23829 13.3058 1.00981C13.1873 0.75543 13.0245 0.50047 12.7503 0.30308C12.4759 0.1056 12.1819 0.03188 11.9023 0H9.0977C8.8181 0.03188 8.5241 0.1056 8.24975 0.30308C7.97551 0.50047 7.81274 0.75543 7.69424 1.00981C7.5878 1.23829 7.05157 2.83872 7.05157 2.83872C6.95627 3.07813 6.78956 3.28218 6.57438 3.42329C5.97727 3.81487 5.44794 3.70035 5.44794 3.70035C5.11796 3.60698 3.56641 3.17064 3.30069 3.1286C3.00518 3.08183 2.68189 3.07586 2.34759 3.21138C2.01342 3.34685 1.78602 3.57595 1.60699 3.81487C1.60699 3.81487 0.269567 6.06456 0.168427 6.29733C0.0558271 6.55652 -0.0272429 6.84914 0.00832714 7.1866C0.0438971 7.5241 0.186187 7.79311 0.350427 8.0233C0.497907 8.22998 1.95586 9.8519 1.95586 9.8519C1.95586 9.8519 2.21591 10.1651 2.21591 10.7498C2.21591 11.2493 1.95588 11.648 1.95588 11.648C1.74083 11.8863 0.497907 13.2699 0.350437 13.4766C0.186187 13.7068 0.0438971 13.9758 0.00832714 14.3133C-0.0272429 14.6508 0.0558271 14.9434 0.168437 15.2026L1.60697 17.685C1.78601 17.9239 2.01341 18.1531 2.34761 18.2885C2.68191 18.424 3.00519 18.4181 3.30071 18.3713C3.56643 18.3292 5.44789 17.7995 5.44789 17.7995C5.72563 17.7394 6.15193 17.7995 6.57443 18.0766C6.78957 18.2178 7.05153 18.6612 7.05153 18.6612C7.05153 18.6612 7.5878 20.2617 7.69424 20.4902C7.81274 20.7446 7.97551 20.9995 8.24975 21.1969ZM10.5195 14.25C12.4525 14.25 14.0195 12.683 14.0195 10.75C14.0195 8.817 12.4525 7.25 10.5195 7.25C8.5865 7.25 7.01953 8.817 7.01953 10.75C7.01953 12.683 8.5865 14.25 10.5195 14.25Z",fill:"black"})],-1)]))):A("",!0),l(n).general.page=="admin"?(a(),u("div",{key:3,onClick:r[4]||(r[4]=C=>l(n).setAdminPage("settings")),class:"inline-flex h-[100%] cursor-pointer anim-hover-1 px-[10em] items-center justify-center bg-white rounded-[8em]"},r[11]||(r[11]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"22",viewBox:"0 0 21 22",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.24975 21.1969C8.5241 21.3944 8.8181 21.4681 9.0977 21.5H11.9023C12.1819 21.4681 12.4759 21.3944 12.7503 21.1969C13.0245 20.9995 13.1873 20.7446 13.3058 20.4902C13.4122 20.2617 13.9485 18.6612 13.9485 18.6612C13.9485 18.6612 14.2104 18.2178 14.4256 18.0766C14.8481 17.7995 15.2744 17.7394 15.5521 17.7995C15.5521 17.7995 17.4336 18.3292 17.6993 18.3713C17.9948 18.4181 18.3181 18.424 18.6524 18.2885C18.9866 18.1531 19.214 17.9239 19.393 17.685L20.8316 15.2026C20.9442 14.9434 21.0272 14.6508 20.9917 14.3133C20.9561 13.9758 20.8138 13.7068 20.6496 13.4766C20.5021 13.2699 19.2592 11.8863 19.0441 11.648C19.0441 11.648 18.7841 11.2493 18.7841 10.7498C18.7841 10.1651 19.0441 9.8519 19.0441 9.8519C19.0441 9.8519 20.5021 8.22998 20.6496 8.0233C20.8138 7.79311 20.9561 7.5241 20.9917 7.1866C21.0272 6.84914 20.9442 6.55652 20.8316 6.29733C20.7304 6.06456 19.393 3.81487 19.393 3.81487C19.214 3.57595 18.9866 3.34685 18.6524 3.21138C18.3181 3.07586 17.9948 3.08183 17.6993 3.1286C17.4336 3.17064 15.882 3.60698 15.5521 3.70035C15.5521 3.70035 15.0227 3.81487 14.4256 3.42329C14.2104 3.28218 14.0437 3.07813 13.9484 2.83872C13.9484 2.83872 13.4122 1.23829 13.3058 1.00981C13.1873 0.75543 13.0245 0.50047 12.7503 0.30308C12.4759 0.1056 12.1819 0.03188 11.9023 0H9.0977C8.8181 0.03188 8.5241 0.1056 8.24975 0.30308C7.97551 0.50047 7.81274 0.75543 7.69424 1.00981C7.5878 1.23829 7.05157 2.83872 7.05157 2.83872C6.95627 3.07813 6.78956 3.28218 6.57438 3.42329C5.97727 3.81487 5.44794 3.70035 5.44794 3.70035C5.11796 3.60698 3.56641 3.17064 3.30069 3.1286C3.00518 3.08183 2.68189 3.07586 2.34759 3.21138C2.01342 3.34685 1.78602 3.57595 1.60699 3.81487C1.60699 3.81487 0.269567 6.06456 0.168427 6.29733C0.0558271 6.55652 -0.0272429 6.84914 0.00832714 7.1866C0.0438971 7.5241 0.186187 7.79311 0.350427 8.0233C0.497907 8.22998 1.95586 9.8519 1.95586 9.8519C1.95586 9.8519 2.21591 10.1651 2.21591 10.7498C2.21591 11.2493 1.95588 11.648 1.95588 11.648C1.74083 11.8863 0.497907 13.2699 0.350437 13.4766C0.186187 13.7068 0.0438971 13.9758 0.00832714 14.3133C-0.0272429 14.6508 0.0558271 14.9434 0.168437 15.2026L1.60697 17.685C1.78601 17.9239 2.01341 18.1531 2.34761 18.2885C2.68191 18.424 3.00519 18.4181 3.30071 18.3713C3.56643 18.3292 5.44789 17.7995 5.44789 17.7995C5.72563 17.7394 6.15193 17.7995 6.57443 18.0766C6.78957 18.2178 7.05153 18.6612 7.05153 18.6612C7.05153 18.6612 7.5878 20.2617 7.69424 20.4902C7.81274 20.7446 7.97551 20.9995 8.24975 21.1969ZM10.5195 14.25C12.4525 14.25 14.0195 12.683 14.0195 10.75C14.0195 8.817 12.4525 7.25 10.5195 7.25C8.5865 7.25 7.01953 8.817 7.01953 10.75C7.01953 12.683 8.5865 14.25 10.5195 14.25Z",fill:"black"})],-1)]))):A("",!0),e("div",{onClick:r[5]||(r[5]=C=>l(n).setGeneralPage("citizen")),class:"inline-flex h-[100%] cursor-pointer anim-hover-1 px-[10em] items-center justify-center bg-white rounded-[8em]"},r[12]||(r[12]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M6.75 8C6.75 5.1005 9.1005 2.75 12 2.75C14.8995 2.75 17.25 5.1005 17.25 8C17.25 10.8995 14.8995 13.25 12 13.25C9.1005 13.25 6.75 10.8995 6.75 8Z",fill:"black"}),e("path",{d:"M4.25 20.5C4.25 16.2198 7.71979 12.75 12 12.75C16.2802 12.75 19.75 16.2198 19.75 20.5C19.75 20.9142 19.4142 21.25 19 21.25H5C4.58579 21.25 4.25 20.9142 4.25 20.5Z",fill:"black"})],-1)])),e("div",{onClick:w,class:"inline-flex h-[100%] cursor-pointer anim-hover-1 px-[10em] items-center justify-center bg-white rounded-[8em]"},r[13]||(r[13]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M3 10.2803C3 11.2838 3.19038 12.225 3.57114 13.1039C3.9519 13.9828 4.48005 14.7567 5.15559 15.4258C5.83112 16.0948 6.6126 16.6178 7.50001 16.9949C8.38742 17.372 9.33778 17.5605 10.3511 17.5605C11.1495 17.5605 11.911 17.4389 12.6356 17.1956C13.3603 16.9523 14.0236 16.6178 14.6254 16.1921L19.1576 20.6897C19.2682 20.7932 19.3895 20.8708 19.5215 20.9225C19.6535 20.9742 19.7933 21 19.9407 21C20.1495 21 20.3337 20.9529 20.4934 20.8586C20.653 20.7643 20.7774 20.635 20.8664 20.4709C20.9555 20.3066 21 20.1241 21 19.9234C21 19.7775 20.9739 19.6407 20.9217 19.5129C20.8695 19.3852 20.7943 19.2727 20.6961 19.1754L16.1914 14.6868C16.6643 14.0786 17.0343 13.4004 17.3014 12.6523C17.5686 11.9042 17.7021 11.1135 17.7021 10.2803C17.7021 9.27673 17.5118 8.33552 17.1311 7.45666C16.7503 6.5778 16.2221 5.80385 15.5466 5.13482C14.8711 4.46579 14.0896 3.94273 13.2021 3.56564C12.3147 3.18855 11.3644 3 10.3511 3C9.33778 3 8.38742 3.18855 7.50001 3.56564C6.6126 3.94273 5.83112 4.46579 5.15559 5.13482C4.48005 5.80385 3.9519 6.5778 3.57114 7.45666C3.19038 8.33552 3 9.27673 3 10.2803ZM4.57523 10.2803C4.57523 9.4896 4.72416 8.74911 5.022 8.05879C5.31986 7.36847 5.7344 6.76026 6.26561 6.23415C6.79683 5.70806 7.41096 5.29751 8.10799 5.00253C8.80503 4.70755 9.55273 4.56006 10.3511 4.56006C11.1495 4.56006 11.8971 4.70755 12.5942 5.00253C13.2912 5.29751 13.9038 5.70806 14.4319 6.23415C14.9601 6.76026 15.3746 7.36847 15.6756 8.05879C15.9765 8.74911 16.1269 9.4896 16.1269 10.2803C16.1269 11.0709 15.9765 11.8114 15.6756 12.5018C15.3746 13.1921 14.9601 13.7988 14.4319 14.3218C13.9038 14.8449 13.2912 15.2554 12.5942 15.5535C11.8971 15.8515 11.1495 16.0005 10.3511 16.0005C9.55273 16.0005 8.80503 15.8515 8.10799 15.5535C7.41096 15.2554 6.79683 14.8449 6.26561 14.3218C5.7344 13.7988 5.31986 13.1921 5.022 12.5018C4.72416 11.8114 4.57523 11.0709 4.57523 10.2803Z",fill:"black","fill-opacity":"0.7"})],-1)]))])])]))]),_:1}))}},Re=pe(Gl,[["__scopeId","data-v-769c7cef"]]),Vl={class:"w-full h-full relative flex flex-col gap-y-[10em] items-center",style:{"background-color":"#D8D7FD"}},Zl={class:"w-[90%] h-[120em] flex items-center gap-x-[5em] justify-center mx-auto",initial:{opacity:0,y:-10},enter:{opacity:1,y:0,transition:{delay:100,duration:400}}},Ul={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},Jl={class:"flex flex-col items-center"},Yl={class:"text-[10.5em] font-['SFPRO'] text-black"},Xl={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},ql={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},Wl={class:"flex flex-col items-center"},Kl={class:"text-[10.5em] font-['SFPRO'] text-black"},Ql={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},es={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},ts={class:"flex flex-col items-center"},ls={class:"text-[10.5em] font-['SFPRO'] text-black"},ss={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},is={class:"w-full h-[60em] flex items-center justify-center flex-shrink-0",initial:{opacity:0},enter:{opacity:1,transition:{delay:200,duration:400}}},ns={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%]"},as={key:2,class:"w-full h-[60em] flex items-center justify-center"},os={class:"text-black/50 text-[12em] font-['SFPRO']"},rs={key:3,class:"w-full h-[60em] flex items-center justify-center"},cs={class:"text-black/50 text-[12em] font-['SFPRO']"},us={__name:"Main",emits:["scroll"],setup(M,{emit:n}){const t=ee(),i=me(),{t:s}=ce(),f=P=>{P.style.opacity=0,P.style.transform="translateY(15px)"},c=(P,H)=>{const $=(parseInt(P.dataset.index)||0)*50;setTimeout(()=>{P.style.transition="opacity 0.3s ease, transform 0.3s ease",P.style.opacity=1,P.style.transform="translateY(0)",setTimeout(H,300)},$)},_=P=>{P.style.transition=null,P.style.opacity=null,P.style.transform=null};E(()=>{var P,H;return t.general.isBoss?!0:(H=(P=t.general.employeePermissions)==null?void 0:P.can_create_invoices)!=null?H:!1});const w=E(()=>{var P,H;return t.general.isBoss?!0:(H=(P=t.general.employeePermissions)==null?void 0:P.can_cancel_invoices)!=null?H:!1}),g=E(()=>{var P,H;return t.general.isBoss?!0:(H=(P=t.general.employeePermissions)==null?void 0:P.can_pay_taxes)!=null?H:!1}),b=I(!1),T=I(!1),x=I(1),N=I(!1),m=I(null),r=E(()=>t.general.category=="taxes"?s("billing.businessTaxes"):t.general.category=="unpaid"?s("billing.createdUnpaidInvoices"):s("billing.createdPaidInvoices")),C=E(()=>t.general.category=="taxes"?K["billing/billingsmall-tax.png"]:K["billing/billingsmall.png"]),d=P=>new Date(P).toLocaleDateString(),v=E(()=>t.general.category==="taxes"?O.value:t.getFilteredInvoices("sent",t.general.category).data||[]),O=I([]),k=I(null),S=I({unpaid_count:32,paid_count:98,self_profit:19e3}),B=I({unpaid_count:0,unpaid_total:0,paid_count:0,paid_total:0}),te=I({jobName:"Law Enforcement",jobType:"police",settings:{commission_per_employee:0,can_bill_players:!0}}),ie=()=>R(this,null,function*(){try{const P=yield j("BILLING_GET_BUSINESS_INFO",{});P&&P.success?te.value=P:console.error("Failed to fetch business info:",P)}catch(P){console.error("Error fetching business info:",P)}}),oe=()=>R(this,null,function*(){try{const P=yield j("BILLING_GET_BUSINESS_STATS",{});P.success&&(S.value=P.stats,t.cacheBusinessStats(P.stats))}catch(P){console.error("Error fetching business stats:",P)}}),D=()=>R(this,null,function*(){try{const P=yield j("BILLING_GET_BUSINESS_TAX_STATS",{});P.success&&(B.value=P.stats)}catch(P){console.error("Error fetching business tax stats:",P)}}),y=I(!1),L=(P=1,H=!1)=>R(this,null,function*(){if(!(b.value||T.value||y.value)){if(P===1&&!H){const p=t.getCachedBusinessTaxInvoices;if(p.isInitialized&&t.isCacheValid(p)){O.value=p.data,k.value=p.pagination;return}}y.value=!0,P===1?b.value=!0:T.value=!0;try{const p=yield j("BILLING_GET_BUSINESS_TAX_INVOICES",{status:"all",page:P,limit:20});p.success&&(H?(t.appendBusinessTaxInvoices(p.taxInvoices,p.pagination),O.value=t.getCachedBusinessTaxInvoices.data):(t.cacheBusinessTaxInvoices(p.taxInvoices,p.pagination),O.value=p.taxInvoices),k.value=p.pagination,x.value=P)}catch(p){console.error("Error fetching business tax invoices:",p)}finally{b.value=!1,T.value=!1,y.value=!1}}}),F=(P=1,H=!1)=>R(this,null,function*(){if(!(b.value||T.value)&&t.general.category!=="taxes"){if(P===1&&!H){const p=t.getCachedInvoices("sent",t.general.category);if(p.isInitialized&&t.isCacheValid(p))return}P===1?b.value=!0:T.value=!0;try{const p=yield j("BILLING_GET_INVOICES",{type:"sent",status:t.general.category==="taxes"?"all":t.general.category,page:P,limit:20,panel_type:"employee"});p.success&&(H?t.appendInvoices("sent",t.general.category,p.invoices,p.pagination):t.cacheInvoices("sent",t.general.category,p.invoices,p.pagination),x.value=P)}catch(p){console.error("Error fetching invoices:",p)}finally{b.value=!1,T.value=!1}}}),G=n,ue=P=>{const{scrollTop:H,scrollHeight:p,clientHeight:$}=P.target;if(G("scroll",{scrollTop:H,scrollHeight:p,clientHeight:$}),H+$>=p-50&&!T.value)if(t.general.category==="taxes")k.value&&x.value<k.value.totalPages&&L(x.value+1,!0);else{const ke=t.getCachedInvoices("sent",t.general.category).pagination;ke&&x.value<ke.totalPages&&F(x.value+1,!0)}},le=P=>R(this,null,function*(){if(t.general.category==="taxes"){if(P.type==="pay")try{const H=yield j("BILLING_PAY_BUSINESS_TAX",{tax_invoice_id:P.id});if(H.success){i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(H.message)||s("billing.taxPaidSuccessfully")});const p=t.getCachedBusinessTaxInvoices;if(p.isInitialized){const $=p.data.find(U=>U.id===P.id);$&&($.status="paid",$.paid_at=new Date().toISOString()),O.value=[...p.data]}D()}else i.TriggerNotification({appname:"billing",header:s("billing.paymentFailed"),message:s(H.message,{balance:H==null?void 0:H.balance})||s("billing.failedToPayTax")})}catch(H){console.error("Error paying business tax:",H)}else P.type==="details"&&(t.setInvoiceId(P.id),t.setIsTaxInvoice(!0),t.setEmployeePage("invoicedetails"));return}P.type==="cancel"?(m.value=P.id,N.value=!0):P.type==="details"&&(t.setInvoiceId(P.id),t.setEmployeePage("invoicedetails"))}),re=()=>R(this,null,function*(){if(m.value)try{(yield j("BILLING_CANCEL_INVOICE",{invoice_id:m.value})).success&&(t.removeInvoiceFromCache(m.value),F(1,!1),oe())}catch(P){console.error("Error cancelling invoice:",P)}finally{N.value=!1,m.value=null}});return se(()=>t.general.category,P=>{x.value=1,P==="taxes"?L(1,!1):F(1,!1)},{immediate:!0}),ae(()=>{t.clearSentInvoicesCache(),ie(),oe(),D(),t.general.category==="taxes"?L(1,!1):F(1,!1)}),(P,H)=>{const p=je("motion");return a(),u("div",Vl,[Q(Re,{title:te.value.jobName},null,8,["title"]),W((a(),u("div",Zl,[e("div",Ul,[H[1]||(H[1]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.9998 1.66797C8.08376 1.66797 1.6665 8.08522 1.6665 16.0013C1.6665 23.9174 8.08376 30.3346 15.9998 30.3346C23.916 30.3346 30.3332 23.9174 30.3332 16.0013C30.3332 8.08522 23.916 1.66797 15.9998 1.66797ZM17.3332 10.668C17.3332 9.93159 16.7362 9.33463 15.9998 9.33463C15.2634 9.33463 14.6665 9.93159 14.6665 10.668V16.0013C14.6665 16.3549 14.807 16.6941 15.057 16.9441L17.7237 19.6108C18.2444 20.1314 19.0886 20.1314 19.6093 19.6108C20.13 19.0901 20.13 18.2458 19.6093 17.7252L17.3332 15.449V10.668Z",fill:"#FF883E"})],-1)),e("div",Jl,[e("p",Yl,o(S.value.unpaid_count),1),e("p",Xl,o(l(s)("billing.unpaid")),1)])]),e("div",ql,[H[2]||(H[2]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M22.4468 10.817C25.6672 13.9341 27.8401 18.1088 28.578 22.5272C28.9557 24.7891 28.0828 26.7739 26.5825 28.16C25.0972 29.5324 22.9914 30.3333 20.7952 30.3333H11.2033C9.007 30.3333 6.90117 29.5324 5.4159 28.16C3.91562 26.7739 3.04262 24.7891 3.42036 22.5272C4.31384 17.1773 7.09265 13.1965 9.51684 10.8506C9.64012 10.7313 9.76346 10.6144 9.90233 10.513C10.2024 10.2939 10.7388 10.0768 11.1068 10.0255C11.2899 10 11.4216 10 11.685 10H20.3134C20.5768 10 20.7085 10 20.8916 10.0255C21.2596 10.0768 21.796 10.2939 22.096 10.513C22.2453 10.622 22.3125 10.687 22.4468 10.817Z",fill:"#1CB903"}),e("path",{d:"M14.1875 2.54322C14.5158 2.21378 15.1358 1.66797 15.9988 1.66797C16.8619 1.66797 17.4819 2.21378 17.8102 2.54322C18.2082 2.94261 18.5254 3.53958 19.0304 3.80678C19.448 4.02769 19.9867 3.8131 20.4035 3.70456C20.8007 3.60116 21.4062 3.44456 22.0478 3.52996C22.3266 3.56706 22.6924 3.65574 22.9758 3.9081C23.3115 4.20697 23.3656 4.57884 23.3166 4.85989C23.2568 5.20182 23.0451 5.48245 22.8371 5.74933L21.6474 7.28117C21.3407 7.67705 21.0372 8.08389 20.6298 8.38312C20.3279 8.60477 19.9459 8.66797 19.5715 8.66797H12.4262C12.0517 8.66797 11.6698 8.60477 11.368 8.38312C10.9605 8.08389 10.657 7.67705 10.3503 7.28117L9.16055 5.74933C8.95265 5.48245 8.74087 5.20184 8.68116 4.85989C8.63208 4.57884 8.68625 4.20697 9.02192 3.9081C9.30535 3.65574 9.67117 3.56706 9.94997 3.52996C10.5916 3.44456 11.197 3.60116 11.5943 3.70456C12.0111 3.8131 12.5496 4.02769 12.9673 3.80678C13.4724 3.53958 13.7895 2.94261 14.1875 2.54322Z",fill:"#1CB903"})],-1)),e("div",Wl,[e("p",Kl,"$"+o(l(Ce)(S.value.self_profit)),1),e("p",Ql,o(l(s)("billing.selfProfit")),1)])]),e("div",es,[H[3]||(H[3]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("g",{opacity:"0.7"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6668 29.9987C7.75075 29.9987 1.3335 23.5815 1.3335 15.6654C1.3335 7.74928 7.75075 1.33203 15.6668 1.33203C23.583 1.33203 30.0002 7.74928 30.0002 15.6654C30.0002 23.5815 23.583 29.9987 15.6668 29.9987ZM22.0244 12.5189C22.4959 11.9532 22.4195 11.1125 21.8538 10.6411C21.288 10.1696 20.4472 10.2461 19.9759 10.8118L14.2439 17.6902L11.2763 14.7226C10.7556 14.2019 9.91139 14.2019 9.39068 14.7226C8.86999 15.2432 8.86999 16.0875 9.39068 16.6082L13.3907 20.6082C13.6556 20.8731 14.0196 21.0143 14.3939 20.9974C14.7682 20.9803 15.118 20.8067 15.3578 20.519L22.0244 12.5189Z",fill:"#0D71F0"})])],-1)),e("div",ts,[e("p",ls,o(S.value.paid_count),1),e("p",ss,o(l(s)("billing.paid")),1)])])])),[[p]]),e("div",{onScroll:ue,class:"w-full h-[490em] px-[15em] pb-[50em] overflow-auto no-scrollbar flex flex-wrap content-start gap-y-[15em]"},[W((a(),u("div",is,[e("p",ns,o(r.value),1)])),[[p]]),l(t).general.category==="taxes"?(a(),V(we,{key:0,appear:"",onBeforeEnter:f,onEnter:c,onAfterEnter:_,css:!1,class:"contents"},{default:J(()=>[(a(!0),u(ne,null,fe(v.value,($,U)=>(a(),V(xe,{onClicked:le,key:$.id,"data-index":U,id:$.id,backgroundImage:C.value,variant:"businessTax",isPaid:$.status==="paid",isOverdue:!1,title:$.reason,subtitle:`${l(s)("billing.due")}: ${d($.due_date)}`,amount:$.amount,dueDate:$.due_date,canPayTax:g.value},null,8,["data-index","id","backgroundImage","isPaid","title","subtitle","amount","dueDate","canPayTax"]))),128))]),_:1})):(a(),V(we,{key:1,appear:"",onBeforeEnter:f,onEnter:c,onAfterEnter:_,css:!1,class:"contents"},{default:J(()=>[(a(!0),u(ne,null,fe(v.value,($,U)=>(a(),V(xe,{onClicked:le,key:$.id,"data-index":U,id:$.id,backgroundImage:C.value,variant:"employee",isPaid:$.status==="paid",isOverdue:$.status==="overdue",title:$.receiver_name,amount:$.total,dueDate:$.due_date,canCancel:w.value},null,8,["data-index","id","backgroundImage","isPaid","isOverdue","title","amount","dueDate","canCancel"]))),128))]),_:1})),T.value?(a(),u("div",as,[e("p",os,o(l(s)("billing.loadingMore")),1)])):v.value.length===0&&!b.value?(a(),u("div",rs,[e("p",cs,o(l(t).general.category==="taxes"?l(s)("billing.noTaxInvoicesFound"):l(s)("billing.noInvoicesFound")),1)])):A("",!0),H[4]||(H[4]=e("div",{class:"w-full h-[60em]"},null,-1))],32),N.value?(a(),V(Te,{key:0,header:l(s)("billing.cancelInvoice"),label:l(s)("billing.cancelInvoiceConfirmation"),buttons:{cancel:l(s)("billing.no"),submit:l(s)("billing.yes")},onCancel:H[0]||(H[0]=$=>N.value=!1),onSubmit:re},null,8,["header","label","buttons"])):A("",!0)])}}},ds=pe(us,[["__scopeId","data-v-dbf20326"]]),fs={class:"w-full h-full relative flex flex-col gap-y-[15em] items-center",style:{"background-color":"#D8D7FD"}},gs={class:"w-full h-[15%] flex items-end justify-center"},ms={class:"w-[89%] h-[38%] flex items-center relative justify-center"},vs={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] truncate"},ps={key:0,class:"w-full mx-auto py-[3em]"},hs=["onClick"],Cs={class:"w-[40em] h-[40em] rounded-full flex items-center justify-center transition-all duration-300 avatar-wrapper"},bs=["src"],xs={class:"font-['SFPRO'] text-[10em] font-[400] leading-[100%] truncate transition-colors duration-300 max-w-[60em] text-center"},ys={key:1,class:"w-full text-center py-[15em]"},_s={class:"font-['SFPRO'] text-[12em] text-black/60 font-[400]"},ws={key:2,class:"w-[89%] flex-1 bg-white rounded-[15em] flex items-center justify-center"},ks={class:"text-center px-[20em]"},Is={class:"font-['SFPRO'] text-[14em] text-black/60 font-[500] mb-[8em]"},$s={class:"font-['SFPRO'] text-[11em] text-black/40 font-[400]"},Ss={key:3,class:"w-[89%] flex-1 bg-white rounded-[15em] flex items-center flex-col relative pl-[20em] pr-[10em] overflow-hidden"},Fs={class:"w-full flex-1 overflow-y-auto"},Ps={class:"flex items-center gap-x-[8em]"},Ts=["innerHTML"],Bs={class:"text-[10.5em] font-['SFPRO'] text-black font-[400] leading-[100%]"},Ls=["checked","onChange","disabled","id"],Es=["for"],Os={key:0,class:"w-full py-[12em] border-t-[1.75em] border-[#0000000D]"},Ns=["disabled"],js={class:"text-white font-['SFPRO'] text-[12em] font-[500]"},zs={__name:"BusinessSettings",setup(M){const n=ee(),t=me(),{t:i}=ce(),s=[l1],f=I(null),c=I(!1),_=E(()=>(n.cache.employees.data||[]).filter(O=>!O.grade.isboss)),w=()=>R(this,null,function*(){c.value=!0;try{const v=yield j("BILLING_GET_EMPLOYEES",{});if(!v){console.error("[BusinessSettings] fetchNui returned null - callback may not be registered");return}v.success&&v.employees?n.cacheEmployees(v.employees,v.jobName):console.error("[BusinessSettings] Failed to get employees:",v)}catch(v){console.error("[BusinessSettings] Failed to fetch employees:",v)}finally{c.value=!1}});ae(()=>{w()});const g=E(()=>[{key:"can_access_business",title:i("billing.accessToBusiness"),iconBG:"#FF883E",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M1.04508 9.97268C1.36921 10.3034 1.8123 10.7046 2.39192 11.1095C3.67137 12.0033 5.5771 12.9041 8.21712 13.1863C8.46246 13.9361 9.16762 14.4778 9.99937 14.4778C10.8309 14.4778 11.5345 13.9358 11.78 13.1863C14.4208 12.9043 16.3271 12.0035 17.6068 11.1095C18.1856 10.7051 18.628 10.304 18.952 9.97352C18.955 10.3252 18.9577 10.7002 18.9577 11.0989V11.6117C18.9577 12.9463 18.9577 14.0118 18.8454 14.8473C18.7293 15.7108 18.4826 16.4218 17.9201 16.9843C17.3575 17.5469 16.6465 17.7935 15.783 17.9097C14.9475 18.022 13.882 18.022 12.5474 18.022H7.45052C6.11615 18.022 5.05108 18.0219 4.21566 17.9097C3.35219 17.7936 2.6412 17.5468 2.07861 16.9843C1.51601 16.4218 1.26942 15.7108 1.15332 14.8473C1.04098 14.0118 1.041 12.9463 1.04102 11.6117V11.0989C1.04101 10.6998 1.04208 10.3247 1.04508 9.97268ZM10.6244 12.6028C10.6244 12.9479 10.3444 13.2277 9.99937 13.2278C9.65421 13.2278 9.37437 12.948 9.37437 12.6028V11.9778H10.6244V12.6028ZM9.99937 1.76953C10.5713 1.76953 11.0476 1.76874 11.4316 1.80778C11.826 1.84793 12.1923 1.93571 12.5221 2.15609C12.7723 2.32327 12.9873 2.53826 13.1545 2.78842C13.3748 3.11835 13.4626 3.48445 13.5028 3.87891C13.5266 4.11381 13.5335 4.38318 13.537 4.68783C14.4215 4.69347 15.1647 4.71552 15.7822 4.79851C16.6456 4.91459 17.3567 5.16136 17.9193 5.7238C18.547 6.35152 18.7809 7.16407 18.8795 8.16683C18.8936 8.31037 18.8578 8.45452 18.7778 8.57452L18.7697 8.5851C18.6882 8.68935 18.4699 8.96852 18.331 9.11735C18.043 9.42602 17.609 9.83452 17.0095 10.2534C15.895 11.0319 14.2192 11.839 11.8735 12.1243V11.7695C11.8735 11.1943 11.4071 10.7278 10.8319 10.7278H9.16521C8.59012 10.7281 8.12353 11.1944 8.12353 11.7695V12.1243C5.77799 11.8389 4.10199 11.0319 2.98763 10.2534C2.3881 9.83452 1.95393 9.42602 1.66602 9.11735C1.52197 8.96285 1.29277 8.6686 1.21923 8.57452C1.13938 8.4546 1.10344 8.31027 1.11751 8.16683C1.21613 7.16417 1.45027 6.35149 2.0778 5.7238C2.6403 5.1613 3.35152 4.91464 4.21484 4.79851C4.83232 4.71549 5.57563 4.69347 6.46012 4.68783C6.46349 4.38317 6.47204 4.11382 6.49593 3.87891C6.53607 3.48441 6.6238 3.11837 6.84423 2.78842C7.01142 2.53825 7.22638 2.32326 7.47656 2.15609C7.80647 1.93576 8.17263 1.84791 8.56704 1.80778C8.95113 1.76876 9.42737 1.76953 9.99937 1.76953ZM9.99937 3.01953C9.40137 3.01953 8.99929 3.02016 8.69321 3.05127C8.39779 3.08134 8.2611 3.135 8.17073 3.19532C8.05707 3.27127 7.95943 3.36893 7.88347 3.48259C7.82309 3.57295 7.76951 3.70946 7.73942 4.00505C7.72062 4.18987 7.71406 4.40954 7.71093 4.6862H12.287C12.2838 4.40956 12.278 4.18986 12.2593 4.00505C12.2292 3.70959 12.1755 3.57295 12.1152 3.48259C12.0393 3.36894 11.9416 3.27128 11.828 3.19532C11.7376 3.13497 11.6009 3.08137 11.3055 3.05127C10.9994 3.02013 10.5974 3.01954 9.99937 3.01953Z" fill="white"/></svg>'},{key:"can_create_invoices",title:i("billing.createInvoices"),iconBG:"#3E5FFF",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.9582 10.625C14.4184 10.625 14.7915 10.9981 14.7915 11.4583V13.9583H17.2915C17.7518 13.9583 18.1248 14.3314 18.1248 14.7917C18.1248 15.2519 17.7518 15.625 17.2915 15.625H14.7915V18.125C14.7915 18.5852 14.4184 18.9583 13.9582 18.9583C13.4979 18.9583 13.1248 18.5852 13.1248 18.125V15.625H10.6248C10.1646 15.625 9.7915 15.2519 9.7915 14.7917C9.7915 14.3314 10.1646 13.9583 10.6248 13.9583H13.1248V11.4583C13.1248 10.9981 13.4979 10.625 13.9582 10.625Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.1753 1.04297C12.2438 1.04295 13.1127 1.04294 13.7977 1.14079C14.5149 1.24324 15.1211 1.46377 15.5993 1.97185C16.0724 2.47459 16.2732 3.10288 16.3673 3.84634C16.4583 4.5664 16.4583 5.48295 16.4583 6.6246V11.4596H15.8333C15.8333 10.4241 14.9938 9.58464 13.9583 9.58464C12.9228 9.58464 12.0833 10.4241 12.0833 11.4596V12.918H10.625C9.5895 12.918 8.75 13.7575 8.75 14.793C8.75 15.8285 9.5895 16.668 10.625 16.668H12.0833V17.3752C12.0393 17.4005 12.003 17.4276 11.9758 17.4527L10.361 18.4711C10.1655 18.5944 9.98042 18.7111 9.81342 18.7936C9.627 18.8856 9.41608 18.9596 9.16667 18.9596C8.91725 18.9596 8.70633 18.8856 8.51992 18.7936C8.35292 18.7111 8.16775 18.5943 7.97221 18.471L6.35754 17.4527C5.86489 17.142 5.45334 17.3232 5.30913 17.4527L4.88521 17.7439C4.70958 17.8646 4.49787 18.0041 4.27258 18.1219C3.87918 18.3277 3.17863 18.6096 2.54653 18.2025C2.11873 17.9269 1.9846 17.4728 1.92908 17.0737C1.87493 16.6845 1.87497 16.1759 1.875 15.5853V6.62459C1.87499 5.48293 1.87498 4.56641 1.96609 3.84634C2.06017 3.10288 2.26088 2.47459 2.73404 1.97185C3.21223 1.46377 3.81846 1.24324 4.53568 1.14079C5.22067 1.04294 6.08955 1.04295 7.15807 1.04297H11.1753ZM5.83333 4.16797C5.3731 4.16797 5 4.54107 5 5.0013C5 5.46154 5.3731 5.83464 5.83333 5.83464H12.5C12.9603 5.83464 13.3333 5.46154 13.3333 5.0013C13.3333 4.54107 12.9603 4.16797 12.5 4.16797H5.83333ZM5.83333 7.5013C5.3731 7.5013 5 7.8744 5 8.33464C5 8.79489 5.3731 9.16797 5.83333 9.16797H9.16667C9.62692 9.16797 10 8.79489 10 8.33464C10 7.8744 9.62692 7.5013 9.16667 7.5013H5.83333Z" fill="white"/></svg>'},{key:"can_cancel_invoices",title:i("billing.cancelInvoices"),iconBG:"#FF4E3E",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><g clip-path="url(#clip0_2774_3353)"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.9048 11.8447C17.2302 12.1702 17.2302 12.6978 16.9048 13.0232L15.137 14.791L16.9048 16.5588C17.2302 16.8842 17.2302 17.4118 16.9048 17.7373C16.5793 18.0627 16.0517 18.0627 15.7263 17.7373L13.9585 15.9695L12.1907 17.7373C11.8653 18.0627 11.3377 18.0627 11.0122 17.7373C10.6868 17.4118 10.6868 16.8842 11.0122 16.5588L12.78 14.791L11.0122 13.0232C10.6868 12.6978 10.6868 12.1702 11.0122 11.8447C11.3377 11.5193 11.8653 11.5193 12.1907 11.8447L13.9585 13.6125L15.7263 11.8447C16.0517 11.5193 16.5793 11.5193 16.9048 11.8447Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.0049 1C12.1438 0.999984 13.0625 0.999657 13.7852 1.09766C14.5363 1.19955 15.1686 1.41799 15.6699 1.92383C16.1704 2.42888 16.3856 3.06426 16.4863 3.81934C16.5833 4.5476 16.583 5.4744 16.583 6.625V10.6211C16.0293 10.54 15.4457 10.7126 15.0195 11.1387L13.959 12.1992L12.8984 11.1387L12.7588 11.0127C12.0387 10.4255 10.9769 10.4676 10.3057 11.1387C9.5897 11.8546 9.5897 13.0155 10.3057 13.7314L11.3662 14.792L10.3057 15.8525C9.5897 16.5685 9.5897 17.7293 10.3057 18.4453C10.3253 18.465 10.3469 18.4824 10.3672 18.501C10.2151 18.5961 10.0714 18.6853 9.93848 18.751C9.75217 18.8429 9.54122 18.9169 9.29199 18.917C9.04258 18.917 8.83095 18.843 8.64453 18.751C8.47762 18.6686 8.29304 18.551 8.09766 18.4277L6.48242 17.4102C6.27023 17.2763 6.14884 17.2 6.05371 17.1523C5.96008 17.1008 5.90019 17.1261 5.88184 17.1455C5.7876 17.1897 5.66183 17.2668 5.43457 17.4102C5.25893 17.5308 4.62276 17.9613 4.39746 18.0791C4.00405 18.2849 3.30385 18.5661 2.67188 18.1592C2.24406 17.8836 2.10923 17.4294 2.05371 17.0303C1.99964 16.6411 1.99997 16.1323 2 15.542V6.625C1.99999 5.47443 1.99965 4.5476 2.09668 3.81934C2.19732 3.06428 2.41261 2.42888 2.91309 1.92383C3.41445 1.41793 4.04674 1.19956 4.79785 1.09766C5.52068 0.999603 6.43981 0.999984 7.5791 1H11.0049ZM5.95801 8.29199C5.49793 8.29217 5.125 8.66486 5.125 9.125C5.125 9.58514 5.49793 9.95783 5.95801 9.95801H8.45801C8.91826 9.95801 9.29199 9.58525 9.29199 9.125C9.29199 8.66475 8.91826 8.29199 8.45801 8.29199H5.95801ZM5.95801 4.95801C5.49793 4.95819 5.125 5.33187 5.125 5.79199C5.12518 6.25198 5.49804 6.62482 5.95801 6.625H10.958C11.4182 6.625 11.7918 6.25209 11.792 5.79199C11.792 5.33176 11.4183 4.95801 10.958 4.95801H5.95801Z" fill="white"/><path d="M16.583 14.8232L16.5518 14.792L16.583 14.7607V14.8232Z" fill="white"/></g><defs><clipPath id="clip0_2774_3353"><rect width="20" height="20" fill="white"/></clipPath></defs></svg>'},{key:"can_pay_taxes",title:i("billing.payBusinessTaxes"),iconBG:"#1CB903",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.7129 1.04297H8.28741C7.14807 1.04295 6.22914 1.04294 5.5063 1.141C4.75518 1.2429 4.12317 1.46098 3.62181 1.96688C3.12121 2.472 2.90613 3.10743 2.80551 3.86265C2.70847 4.59091 2.70848 5.51717 2.7085 6.66774V15.5853C2.70846 16.1759 2.70843 16.6845 2.76258 17.0737C2.8181 17.4728 2.95222 17.9269 3.38004 18.2025C4.01212 18.6096 4.71267 18.3277 5.10607 18.1219C5.33136 18.0041 5.96699 17.5734 6.14263 17.4527C6.36997 17.3093 6.49583 17.233 6.59009 17.1887C6.60816 17.1693 6.66783 17.1435 6.76187 17.1952C6.85704 17.2429 6.97863 17.3187 7.19105 17.4527L8.80575 18.471C9.00125 18.5943 9.18641 18.7111 9.35341 18.7936C9.53983 18.8856 9.75075 18.9596 10.0002 18.9596C10.2496 18.9596 10.4605 18.8856 10.6469 18.7936C10.8138 18.7111 10.999 18.5944 11.1944 18.4711L12.8093 17.4527C13.0367 17.3093 13.1625 17.233 13.2567 17.1887C13.2777 17.171 13.3412 17.1474 13.4285 17.1952C13.4877 17.2249 13.7213 17.3782 13.9406 17.5221C14.0737 17.6094 14.2014 17.6932 14.2817 17.7439C14.4572 17.8646 14.669 18.0041 14.8942 18.1219C15.2877 18.3277 15.9882 18.6096 16.6203 18.2025C17.0481 17.9269 17.1822 17.4728 17.2377 17.0737C17.2919 16.6845 17.2918 16.1759 17.2918 15.5853V6.66779C17.2918 5.51719 17.2918 4.59092 17.1948 3.86265C17.0942 3.10743 16.8791 2.472 16.3785 1.96688C15.8772 1.46098 15.2452 1.2429 14.494 1.141C13.7712 1.04294 12.8522 1.04295 11.7129 1.04297ZM10.0002 9.16797C10.0002 9.62822 9.62708 10.0013 9.16683 10.0013H6.66683C6.2066 10.0013 5.8335 9.62822 5.8335 9.16797C5.8335 8.70772 6.2066 8.33464 6.66683 8.33464H9.16683C9.62708 8.33464 10.0002 8.70772 10.0002 9.16797ZM11.6668 6.66797C12.1271 6.66797 12.5002 6.29488 12.5002 5.83464C12.5002 5.3744 12.1271 5.0013 11.6668 5.0013H6.66683C6.2066 5.0013 5.8335 5.3744 5.8335 5.83464C5.8335 6.29488 6.2066 6.66797 6.66683 6.66797H11.6668Z" fill="white"/></svg>'}]),b=E(()=>n.general.isBoss),T=I({}),x=I(!1),N=I(!1),m=E(()=>{if(b.value&&f.value){const v=_.value.find(O=>O.identifier===f.value);return(v==null?void 0:v.permissions)||{}}else return n.general.employeePermissions||{}});se([f,m],()=>{T.value=$e({},m.value),x.value=!1},{immediate:!0,deep:!0});const r=(v,O)=>{b.value&&(T.value[v]=O,x.value=!0)},C=()=>R(this,null,function*(){if(!(!b.value||!f.value||!x.value)){N.value=!0;try{const v=yield j("BILLING_UPDATE_EMPLOYEE_PERMISSIONS",{employee_identifier:f.value,permissions:T.value});if(v.success){const O=n.cache.employees.data.findIndex(k=>k.identifier===f.value);if(O!==-1){const k=Ee($e({},n.cache.employees.data[O]),{permissions:$e({},T.value)});n.cache.employees.data.splice(O,1,k)}x.value=!1,t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(v.message)||i("billing.permissionsSaved")})}else t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(v.message)||i("billing.failedToSavePermissions")})}catch(v){console.error("[BusinessSettings] Error updating permissions:",v),t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i("billing.errorOccurredWhileProcessing")})}finally{N.value=!1}}}),d=v=>{f.value=v};return se(_,v=>{b.value&&v.length>0&&!f.value&&(f.value=v[0].identifier)}),(v,O)=>(a(),u("div",fs,[e("div",gs,[e("div",ms,[e("p",vs,o(l(i)("billing.businessSettings")),1),e("div",{onClick:O[0]||(O[0]=k=>l(n).setEmployeePage("main")),class:"absolute left-0 bottom-[10%] inline-flex h-[30em] aspect-square cursor-pointer anim-hover-1 items-center justify-center bg-white rounded-full"},O[1]||(O[1]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[e("path",{d:"M12.5 5L7.5 10L12.5 15",stroke:"black","stroke-width":"2","stroke-miterlimit":"16","stroke-linecap":"round"})],-1)]))])]),b.value?(a(),u("div",ps,[Q(l(Ke),{"slides-per-view":"auto","space-between":7,"free-mode":!0,modules:s,class:"employee-swiper"},{default:J(()=>[(a(!0),u(ne,null,fe(_.value,k=>(a(),V(l(We),{key:k.identifier,class:"!w-auto"},{default:J(()=>[e("div",{onClick:S=>d(k.identifier),class:X(["flex flex-col gap-y-[5em] items-center cursor-pointer transition-all duration-300 employee-card px-[8em]",{selected:k.identifier==f.value}])},[e("div",Cs,[e("img",{src:k.photo,class:"w-full h-full rounded-full object-cover"},null,8,bs)]),e("p",xs,o(k.name),1)],10,hs)]),_:2},1024))),128))]),_:1})])):(a(),u("div",ys,[e("p",_s,o(l(i)("billing.yourPermissions")),1)])),b.value&&!f.value?(a(),u("div",ws,[e("div",ks,[O[2]||(O[2]=e("svg",{class:"w-[50em] h-[50em] mx-auto mb-[15em] opacity-30",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e("path",{d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"})],-1)),e("p",Is,o(l(i)("billing.noEmployeeSelected")),1),e("p",$s,o(l(i)("billing.selectEmployeeToManage")),1)])])):!b.value||b.value&&f.value?(a(),u("div",Ss,[e("div",Fs,[(a(!0),u(ne,null,fe(g.value,(k,S)=>(a(),u("div",{key:k.key,class:"w-full py-[15em] border-b-[1.75em] border-[#0000000D] flex items-center justify-between"},[e("div",Ps,[e("div",{class:"p-[3.5em] rounded-[4em] flex items-center justify-center",style:ge({backgroundColor:k.iconBG}),innerHTML:k.icon},null,12,Ts),e("p",Bs,o(k.title),1)]),e("input",{checked:T.value[k.key]===!0,onChange:B=>r(k.key,B.target.checked),disabled:!b.value,type:"checkbox",id:"toggle-"+S},null,40,Ls),e("label",{for:"toggle-"+S,class:X({"opacity-50 cursor-not-allowed":!b.value})},null,10,Es)]))),128))]),b.value&&x.value?(a(),u("div",Os,[e("button",{onClick:C,disabled:N.value,class:"w-full h-[40em] rounded-[10em] bg-[#3E5FFF] flex items-center justify-center transition-all duration-300 hover:bg-[#3550DD] active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed"},[e("p",js,o(N.value?l(i)("billing.saving"):l(i)("billing.saveChanges")),1)],8,Ns)])):A("",!0)])):A("",!0)]))}},Rs=pe(zs,[["__scopeId","data-v-f61a07dd"]]),Ms={class:"w-full h-full"},As={__name:"BillingEmployeeRouter",setup(M){const n=ee(),t=I([{key:"main"},{key:"business_settings"},{key:"invoicedetails"}]),i=()=>R(this,null,function*(){try{const f=yield j("BILLING_GET_MY_PERMISSIONS",{});f.success&&n.setEmployeePermissions(f.permissions)}catch(f){console.error("[BillingEmployeeRouter] Failed to load employee permissions:",f)}});ae(()=>{n.setGeneralGradientOpacity(1),i()});const s=({scrollTop:f,scrollHeight:c,clientHeight:_})=>{const w=c-_,g=f/w*100,b=70,T=95;g<=b?n.setGeneralGradientOpacity(1):g>=T?n.setGeneralGradientOpacity(0):n.setGeneralGradientOpacity(1-(g-b)/(T-b))};return(f,c)=>(a(),u("div",Ms,[Q(Pe,{"current-key":l(n).employee.page,items:t.value,duration:300,easing:"ease-in-out"},{main:J(()=>[l(n).employee.page=="main"?(a(),V(ds,{key:0,onScroll:s})):A("",!0)]),business_settings:J(()=>[l(n).employee.page=="business_settings"?(a(),V(Rs,{key:0})):A("",!0)]),invoicedetails:J(()=>[l(n).employee.page=="invoicedetails"?(a(),V(Be,{key:0})):A("",!0)]),_:1},8,["current-key","items"])]))}},Ds={class:"w-full h-full relative flex flex-col gap-y-[15em] items-center",style:{"background-color":"#FDD7D7"}},Hs={key:"taxes",class:"w-[90%] h-[120em] flex items-center gap-x-[5em] justify-center mx-auto"},Gs={class:"flex flex-col items-center"},Vs={class:"text-[10.5em] font-['SFPRO'] text-white"},Zs={class:"text-[10.5em] font-['SFPRO'] text-[#FFFFFF80]"},Us={class:"flex flex-col items-center"},Js={class:"text-[10.5em] font-['SFPRO'] text-white"},Ys={class:"text-[10.5em] font-['SFPRO'] text-[#FFFFFF80]"},Xs={key:"invoices",class:"w-[90%] h-[140em] flex items-center gap-x-[5em] justify-center mx-auto"},qs={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},Ws={class:"flex flex-col items-center"},Ks={class:"text-[10.5em] font-['SFPRO'] text-black"},Qs={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},ei={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},ti={class:"flex flex-col items-center"},li={class:"text-[10.5em] font-['SFPRO'] text-black"},si={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},ii={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},ni={class:"flex flex-col items-center"},ai={class:"text-[10.5em] font-['SFPRO'] text-black"},oi={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},ri={class:"w-full h-[60em] flex items-center justify-center flex-shrink-0"},ci={key:2,class:"w-full h-[60em] flex items-center justify-center"},ui={class:"text-black/50 text-[12em] font-['SFPRO']"},di={key:3,class:"w-full h-[60em] flex items-center justify-center"},fi={class:"text-black/50 text-[12em] font-['SFPRO']"},gi={__name:"Main",emits:["scroll"],setup(M,{emit:n}){const t=ee(),i=me(),{t:s}=ce(),f=y=>{y.style.opacity=0,y.style.transform="translateY(15px)"},c=(y,L)=>{const G=(parseInt(y.dataset.index)||0)*50;setTimeout(()=>{y.style.transition="opacity 0.3s ease, transform 0.3s ease",y.style.opacity=1,y.style.transform="translateY(0)",setTimeout(L,300)},G)},_=y=>{y.style.transition=null,y.style.opacity=null,y.style.transform=null},w=I(null),g=I(!1),b=I(!1),T=I(1),x=I(!1),N=I(null),m=I(null),r=E(()=>t.cache.adminStats||{unpaid_count:0,paid_count:0,tax_revenue:0}),C=n,d=y=>{const{scrollTop:L,scrollHeight:F,clientHeight:G}=y.target;if(C("scroll",{scrollTop:L,scrollHeight:F,clientHeight:G}),L+G>=F-50&&!b.value){let le=null;if(t.general.category==="taxes")le=t.getCachedTaxes("all").pagination;else{const re=t.general.category;le=t.getCachedInvoices("sent",re).pagination}le&&T.value<le.totalPages&&(t.general.category==="taxes"?B(T.value+1,!0):S(T.value+1,!0))}},v=I({citizen:{back:()=>{w.value=null},add:y=>R(this,null,function*(){try{const L=yield j("BILLING_CREATE_TAX",{tax_type:"citizen",reason:y.reason,amount:parseFloat(y.amount),interval_hours:parseInt(y.hour),job:null});L.success?(i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(L.message)||s("billing.cityTaxCreated")}),w.value=null,B(1,!1)):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(L.message)||s("billing.failedToCreateTax")})}catch(L){console.error("Error creating tax:",L),i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s("billing.errorOccurredWhileProcessing")})}}),header:s("billing.newCitizenTax"),label:s("billing.fillDetailsToAddCitizenTax"),fields:{reason:{placeholder:s("billing.reason")},amount:{placeholder:s("billing.amount"),type:"number"},hour:{placeholder:s("billing.hour"),type:"number"}},buttons:{cancel:s("general.cancel"),submit:s("general.add")}},business:{back:()=>{w.value=null},add:y=>R(this,null,function*(){try{const L=yield j("BILLING_CREATE_TAX",{tax_type:"business",reason:y.reason,amount:parseFloat(y.amount),interval_hours:parseInt(y.hour),job:y.job||null});L.success?(i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(L.message)||s("billing.businessTaxCreated")}),w.value=null,B(1,!1)):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(L.message)||s("billing.failedToCreateTax")})}catch(L){console.error("Error creating tax:",L),i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s("billing.errorOccurredWhileProcessing")})}}),header:s("billing.newBusinessTax"),label:s("billing.fillDetailsToAddBusinessTax"),fields:{reason:{placeholder:s("billing.reason")},amount:{placeholder:s("billing.amount"),type:"number"},hour:{placeholder:s("billing.hour"),type:"number"},job:{placeholder:s("billing.jobOptional"),type:"text",optional:!0}},buttons:{cancel:s("general.cancel"),submit:s("general.add")}}}),O=E(()=>t.general.category=="taxes"?s("billing.cityTaxes"):t.general.category=="unpaid"?s("billing.createdUnpaidInvoices"):s("billing.createdPaidInvoices")),k=E(()=>{if(t.general.category==="taxes")return t.getFilteredTaxes("all").data||[];{const y=t.general.category;return t.getFilteredInvoices("sent",y).data||[]}}),S=(y=1,L=!1)=>R(this,null,function*(){if(g.value||b.value)return;const F=t.general.category;y===1?g.value=!0:b.value=!0;try{const G=yield j("BILLING_GET_INVOICES",{type:"sent",status:F,page:y,limit:20,panel_type:"admin"});G&&G.success&&(L?t.appendInvoices("sent",F,G.invoices,G.pagination):t.cacheInvoices("sent",F,G.invoices,G.pagination),T.value=y)}catch(G){console.error("[Admin Main] Error fetching invoices:",G)}finally{g.value=!1,b.value=!1}}),B=(y=1,L=!1)=>R(this,null,function*(){if(!(g.value||b.value)){y===1?g.value=!0:b.value=!0;try{const F=yield j("BILLING_GET_TAXES",{tax_type:"all",page:y,limit:20});F&&F.success&&(L?t.appendTaxes("all",F.taxes,F.pagination):t.cacheTaxes("all",F.taxes,F.pagination),T.value=y)}catch(F){console.error("Error fetching taxes:",F)}finally{g.value=!1,b.value=!1}}}),te=y=>R(this,null,function*(){t.general.category==="taxes"?y.type==="details"||y.type==="pay-tax"?(t.setInvoiceId(y.id),t.setIsTaxInvoice(!0),t.setAdminPage("taxdetails")):y.type==="cancel"&&(N.value=y.id,m.value="tax",x.value=!0):y.type==="details"?(t.setInvoiceId(y.id),t.setAdminPage("invoicedetails")):y.type==="cancel"&&(N.value=y.id,m.value="invoice",x.value=!0)}),ie=()=>R(this,null,function*(){if(N.value)try{if(m.value==="tax"){const y=yield j("BILLING_DELETE_TAX",{tax_id:N.value});y.success?(i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(y.message)||s("billing.taxDeleted")}),B(1,!1)):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(y.message)||s("billing.failedToDeleteTax")})}else{const y=yield j("BILLING_CANCEL_INVOICE",{invoice_id:N.value});y.success?(i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(y.message)||s("billing.invoiceCancelled")}),S(1,!1),oe()):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(y.message)||s("billing.failedToCancelInvoice")})}}catch(y){console.error("Error cancelling:",y),i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s("billing.errorOccurredWhileProcessing")})}finally{x.value=!1,N.value=null,m.value=null}}),oe=()=>R(this,null,function*(){try{const y=yield j("BILLING_GET_ADMIN_STATS",{});y&&y.success&&t.cacheAdminStats(y.stats)}catch(y){console.error("Error fetching admin stats:",y)}}),D=se(()=>t.general.category,(y,L)=>{if(T.value=1,y==="taxes"){const F=t.getCachedTaxes("all");if(F.isInitialized&&t.isCacheValid(F))return;B(1,!1)}else{const F=t.getCachedInvoices("sent",y);if(F.isInitialized&&t.isCacheValid(F))return;S(1,!1)}});return ae(()=>{t.clearSentInvoicesCache(),oe(),t.general.category==="taxes"?B(1,!1):S(1,!1)}),Fe(()=>{D()}),(y,L)=>(a(),u("div",Ds,[w.value&&v.value[w.value]?(a(),V(Ne,{key:0,onBack:v.value[w.value].back,onAdd:v.value[w.value].add,header:v.value[w.value].header,label:v.value[w.value].label,fields:v.value[w.value].fields,buttons:v.value[w.value].buttons},null,8,["onBack","onAdd","header","label","fields","buttons"])):A("",!0),Q(Re,{title:"Admin,"}),Q(be,{name:"fade-stats",mode:"out-in"},{default:J(()=>[l(t).general.category=="taxes"?(a(),u("div",Hs,[e("div",{onClick:L[0]||(L[0]=F=>w.value="citizen"),class:"flex-1 h-full rounded-[8em] bg-[#3E5FFF] flex flex-col gap-y-[5em] items-center justify-center cursor-pointer anim-hover-1"},[L[3]||(L[3]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M9 10.668C9 6.80197 12.134 3.66797 16 3.66797C19.866 3.66797 23 6.80197 23 10.668C23 14.534 19.866 17.668 16 17.668C12.134 17.668 9 14.534 9 10.668Z",fill:"white"}),e("path",{d:"M5.6665 27.3333C5.6665 21.6264 10.2929 17 15.9998 17C21.7068 17 26.3332 21.6264 26.3332 27.3333C26.3332 27.8856 25.8854 28.3333 25.3332 28.3333H6.6665C6.11422 28.3333 5.6665 27.8856 5.6665 27.3333Z",fill:"white"})],-1)),e("div",Gs,[e("p",Vs,o(l(s)("billing.new")),1),e("p",Zs,o(l(s)("billing.citizenTax")),1)])]),e("div",{onClick:L[1]||(L[1]=F=>w.value="business"),class:"flex-1 h-full rounded-[8em] bg-[#1CB903] flex flex-col gap-y-[5em] items-center justify-center cursor-pointer anim-hover-1"},[L[4]||(L[4]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M1.67203 15.9571C2.19063 16.4863 2.89958 17.1281 3.82698 17.776C5.8741 19.2061 8.92326 20.6473 13.1473 21.0989C13.5398 22.2985 14.6681 23.1653 15.9989 23.1653C17.3293 23.1652 18.4552 22.2981 18.8478 21.0989C23.0732 20.6476 26.1233 19.2064 28.1708 17.776C29.0969 17.1289 29.8046 16.4872 30.323 15.9584C30.3278 16.5211 30.3322 17.1211 30.3322 17.7591V18.5795C30.3322 20.7148 30.3322 22.4197 30.1525 23.7565C29.9668 25.138 29.5721 26.2756 28.6721 27.1757C27.772 28.0759 26.6342 28.4704 25.2528 28.6563C23.916 28.836 22.211 28.836 20.0757 28.836H11.9207C9.78574 28.836 8.08163 28.8359 6.74495 28.6563C5.36341 28.4705 4.22582 28.0757 3.32567 27.1757C2.42551 26.2756 2.03098 25.1381 1.84521 23.7565C1.66547 22.4196 1.6655 20.7149 1.66553 18.5795V17.7591C1.66551 17.1205 1.66723 16.5203 1.67203 15.9571ZM16.9989 20.1653C16.9989 20.7175 16.5509 21.1651 15.9989 21.1653C15.4466 21.1653 14.9989 20.7176 14.9989 20.1653V19.1653H16.9989V20.1653ZM15.9989 2.83203C16.914 2.83203 17.6761 2.83077 18.2905 2.89323C18.9216 2.95747 19.5076 3.09791 20.0353 3.45053C20.4356 3.71801 20.7796 4.06199 21.047 4.46225C21.3996 4.99014 21.5401 5.5759 21.6044 6.20703C21.6425 6.58287 21.6536 7.01387 21.659 7.50131C23.0744 7.51034 24.2634 7.54562 25.2514 7.67839C26.6329 7.86413 27.7706 8.25895 28.6708 9.15886C29.675 10.1632 30.0493 11.4633 30.2072 13.0677C30.2297 13.2974 30.1724 13.528 30.0444 13.72L30.0314 13.7369C29.901 13.9037 29.5517 14.3504 29.3296 14.5885C28.8688 15.0824 28.1742 15.736 27.215 16.4063C25.4318 17.6519 22.7506 18.9432 18.9976 19.3997V18.832C18.9976 17.9116 18.2513 17.1653 17.3309 17.1653H14.6642C13.7441 17.1657 12.9976 17.9119 12.9976 18.832V19.3997C9.24469 18.9431 6.56309 17.6519 4.78011 16.4063C3.82086 15.736 3.12619 15.0824 2.66553 14.5885C2.43505 14.3413 2.06833 13.8705 1.95067 13.72C1.82291 13.5281 1.76541 13.2972 1.78791 13.0677C1.94571 11.4635 2.32033 10.1632 3.32438 9.15886C4.22438 8.25886 5.36233 7.86421 6.74365 7.67839C7.73161 7.54557 8.92092 7.51034 10.3361 7.50131C10.3415 7.01385 10.3552 6.58289 10.3934 6.20703C10.4576 5.57583 10.598 4.99018 10.9507 4.46225C11.2182 4.06198 11.5621 3.71799 11.9624 3.45053C12.4903 3.09799 13.0761 2.95743 13.7072 2.89323C14.3217 2.83079 15.0837 2.83203 15.9989 2.83203ZM15.9989 4.83203C15.0421 4.83203 14.3988 4.83303 13.909 4.88282C13.4364 4.93093 13.2177 5.01678 13.0731 5.11329C12.8912 5.23482 12.735 5.39107 12.6134 5.57293C12.5168 5.7175 12.4311 5.93591 12.383 6.40886C12.3529 6.70457 12.3424 7.05605 12.3374 7.4987H19.659C19.654 7.05607 19.6448 6.70455 19.6148 6.40886C19.5666 5.93613 19.4808 5.7175 19.3842 5.57293C19.2628 5.39109 19.1065 5.23483 18.9246 5.11329C18.7801 5.01673 18.5613 4.93097 18.0888 4.88282C17.5989 4.83299 16.9557 4.83205 15.9989 4.83203Z",fill:"white"})],-1)),e("div",Us,[e("p",Js,o(l(s)("billing.new")),1),e("p",Ys,o(l(s)("billing.businessTax")),1)])])])):(a(),u("div",Xs,[e("div",qs,[L[5]||(L[5]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.9998 1.66797C8.08376 1.66797 1.6665 8.08522 1.6665 16.0013C1.6665 23.9174 8.08376 30.3346 15.9998 30.3346C23.916 30.3346 30.3332 23.9174 30.3332 16.0013C30.3332 8.08522 23.916 1.66797 15.9998 1.66797ZM17.3332 10.668C17.3332 9.93159 16.7362 9.33463 15.9998 9.33463C15.2634 9.33463 14.6665 9.93159 14.6665 10.668V16.0013C14.6665 16.3549 14.807 16.6941 15.057 16.9441L17.7237 19.6108C18.2444 20.1314 19.0886 20.1314 19.6093 19.6108C20.13 19.0901 20.13 18.2458 19.6093 17.7252L17.3332 15.449V10.668Z",fill:"#FF883E"})],-1)),e("div",Ws,[e("p",Ks,o(r.value.unpaid_count),1),e("p",Qs,o(l(s)("billing.unpaid")),1)])]),e("div",ei,[L[6]||(L[6]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M22.4468 10.817C25.6672 13.9341 27.8401 18.1088 28.578 22.5272C28.9557 24.7891 28.0828 26.7739 26.5825 28.16C25.0972 29.5324 22.9914 30.3333 20.7952 30.3333H11.2033C9.007 30.3333 6.90117 29.5324 5.4159 28.16C3.91562 26.7739 3.04262 24.7891 3.42036 22.5272C4.31384 17.1773 7.09265 13.1965 9.51684 10.8506C9.64012 10.7313 9.76346 10.6144 9.90233 10.513C10.2024 10.2939 10.7388 10.0768 11.1068 10.0255C11.2899 10 11.4216 10 11.685 10H20.3134C20.5768 10 20.7085 10 20.8916 10.0255C21.2596 10.0768 21.796 10.2939 22.096 10.513C22.2453 10.622 22.3125 10.687 22.4468 10.817Z",fill:"#1CB903"}),e("path",{d:"M14.1875 2.54322C14.5158 2.21378 15.1358 1.66797 15.9988 1.66797C16.8619 1.66797 17.4819 2.21378 17.8102 2.54322C18.2082 2.94261 18.5254 3.53958 19.0304 3.80678C19.448 4.02769 19.9867 3.8131 20.4035 3.70456C20.8007 3.60116 21.4062 3.44456 22.0478 3.52996C22.3266 3.56706 22.6924 3.65574 22.9758 3.9081C23.3115 4.20697 23.3656 4.57884 23.3166 4.85989C23.2568 5.20182 23.0451 5.48245 22.8371 5.74933L21.6474 7.28117C21.3407 7.67705 21.0372 8.08389 20.6298 8.38312C20.3279 8.60477 19.9459 8.66797 19.5715 8.66797H12.4262C12.0517 8.66797 11.6698 8.60477 11.368 8.38312C10.9605 8.08389 10.657 7.67705 10.3503 7.28117L9.16055 5.74933C8.95265 5.48245 8.74087 5.20184 8.68116 4.85989C8.63208 4.57884 8.68625 4.20697 9.02192 3.9081C9.30535 3.65574 9.67117 3.56706 9.94997 3.52996C10.5916 3.44456 11.197 3.60116 11.5943 3.70456C12.0111 3.8131 12.5496 4.02769 12.9673 3.80678C13.4724 3.53958 13.7895 2.94261 14.1875 2.54322Z",fill:"#1CB903"})],-1)),e("div",ti,[e("p",li,"$"+o(l(Ce)(r.value.tax_revenue)),1),e("p",si,o(l(s)("billing.taxRevenue")),1)])]),e("div",ii,[L[7]||(L[7]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("g",{opacity:"0.7"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6668 29.9987C7.75075 29.9987 1.3335 23.5815 1.3335 15.6654C1.3335 7.74928 7.75075 1.33203 15.6668 1.33203C23.583 1.33203 30.0002 7.74928 30.0002 15.6654C30.0002 23.5815 23.583 29.9987 15.6668 29.9987ZM22.0244 12.5189C22.4959 11.9532 22.4195 11.1125 21.8538 10.6411C21.288 10.1696 20.4472 10.2461 19.9759 10.8118L14.2439 17.6902L11.2763 14.7226C10.7556 14.2019 9.91139 14.2019 9.39068 14.7226C8.86999 15.2432 8.86999 16.0875 9.39068 16.6082L13.3907 20.6082C13.6556 20.8731 14.0196 21.0143 14.3939 20.9974C14.7682 20.9803 15.118 20.8067 15.3578 20.519L22.0244 12.5189Z",fill:"#0D71F0"})])],-1)),e("div",ni,[e("p",ai,o(r.value.paid_count),1),e("p",oi,o(l(s)("billing.paid")),1)])])]))]),_:1}),e("div",{onScroll:d,class:"w-full h-[490em] px-[15em] pb-[50em] overflow-auto no-scrollbar flex flex-wrap content-start gap-y-[15em]"},[e("div",ri,[Q(be,{name:"fade-text",mode:"out-in"},{default:J(()=>[(a(),u("p",{key:O.value,class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%]"},o(O.value),1))]),_:1})]),l(t).general.category==="taxes"?(a(),V(we,{key:0,appear:"",onBeforeEnter:f,onEnter:c,onAfterEnter:_,css:!1,class:"contents"},{default:J(()=>[(a(!0),u(ne,null,fe(k.value,(F,G)=>(a(),V(xe,{onClicked:te,key:F.id,"data-index":G,backgroundImage:l(K)["billing/edittax.png"],variant:"tax",isPaid:!1,isOverdue:!1,title:F.reason,subtitle:F.tax_type==="business"?F.job?`${l(s)("billing.to")} ${F.job}`:l(s)("billing.toBusinesses"):l(s)("billing.toCitizens"),amount:F.amount,dueDate:l(s)("billing.inEveryHours",{hours:F.interval_hours,plural:F.interval_hours>1?"s":""}),id:F.id},null,8,["data-index","backgroundImage","title","subtitle","amount","dueDate","id"]))),128))]),_:1})):(a(),V(we,{key:1,appear:"",onBeforeEnter:f,onEnter:c,onAfterEnter:_,css:!1,class:"contents"},{default:J(()=>[(a(!0),u(ne,null,fe(k.value,(F,G)=>(a(),V(xe,{onClicked:te,key:F.id,"data-index":G,backgroundImage:l(K)["billing/invoice.png"],variant:"sent",isPaid:F.status==="paid",isOverdue:F.status==="overdue",title:F.receiver_name,subtitle:`$${F.total}`,amount:F.total,dueDate:F.due_date,id:F.id},null,8,["data-index","backgroundImage","isPaid","isOverdue","title","subtitle","amount","dueDate","id"]))),128))]),_:1})),b.value?(a(),u("div",ci,[e("p",ui,o(l(s)("billing.loadingMore")),1)])):k.value.length===0&&!g.value?(a(),u("div",di,[e("p",fi,o(l(t).general.category==="taxes"?l(s)("billing.noTaxesFound"):l(s)("billing.noInvoicesFound")),1)])):A("",!0),L[8]||(L[8]=e("div",{class:"w-full h-[60em]"},null,-1))],32),x.value?(a(),V(Te,{key:1,header:m.value==="tax"?l(s)("billing.deleteTax"):l(s)("billing.cancelInvoice"),label:m.value==="tax"?l(s)("billing.deleteTaxConfirmation"):l(s)("billing.cancelInvoiceConfirmation"),buttons:{cancel:l(s)("billing.no"),submit:l(s)("billing.yes")},onCancel:L[2]||(L[2]=F=>x.value=!1),onSubmit:ie},null,8,["header","label","buttons"])):A("",!0)]))}},mi=pe(gi,[["__scopeId","data-v-f79b088a"]]),vi={class:"w-full h-full relative flex flex-col gap-y-[15em] items-center",style:{"background-color":"#FDD7D7"}},pi={class:"w-full h-[12.6%] flex items-end px-[20em]"},hi={class:"w-full h-[37%] relative flex items-center justify-between"},Ci={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%]"},bi={class:"w-full h-[470em] px-[20em]"},xi={key:0,class:"w-full h-full flex items-center justify-center"},yi={class:"text-black/50 text-[12em] font-['SFPRO']"},_i={key:1,class:"w-full h-full flex items-center justify-center"},wi={class:"text-black/50 text-[12em] font-['SFPRO']"},ki={class:"w-full flex-1 flex items-center justify-between"},Ii={class:"flex items-center gap-x-[8em]"},$i={class:"font-['SFPRO'] text-[12em] text-black font-[400] leading-[100%]"},Si={key:0,class:"text-[8em] font-['SFPRO'] text-[#3E5FFF] bg-[#3E5FFF]/10 px-[6em] py-[2em] rounded-[4em]"},Fi={key:0,class:"flex items-center gap-x-[10em]"},Pi=["onClick"],Ti=["onClick"],Bi=["onClick"],Li={key:1,class:"text-[10em] font-['SFPRO'] text-[#00000040]"},Ei={class:"absolute w-full bottom-0 left-0 pl-[15em]"},Oi={key:0,class:"bg-[#0000000D] w-full h-[.25em]"},Ni={__name:"Settings",emits:["scroll"],setup(M,{emit:n}){const t=ee(),i=me(),{t:s}=ce(),f=I(!1),c=I(!1),_=k=>{f.value=k},w=n,g=k=>{const{scrollTop:S,scrollHeight:B,clientHeight:te}=k.target;w("scroll",{scrollTop:S,scrollHeight:B,clientHeight:te})},b=E(()=>t.cache.businesses.data||[]),T=E(()=>t.cache.citizens.data||[]),x=(k=!1)=>R(this,null,function*(){if(!(!k&&t.cache.businesses.isInitialized)){c.value=!0;try{const S=yield j("BILLING_GET_BUSINESSES",{});S.success&&t.cacheBusinesses(S.businesses||[])}catch(S){console.error("Error fetching businesses:",S)}finally{c.value=!1}}}),N=(k=!1)=>R(this,null,function*(){if(!(!k&&t.cache.citizens.isInitialized)){c.value=!0;try{const S=yield j("BILLING_GET_CITIZENS",{});S.success&&t.cacheCitizens(S.citizens||[])}catch(S){console.error("Error fetching citizens:",S)}finally{c.value=!1}}}),m=(k,S)=>R(this,null,function*(){S.stopPropagation();try{const B=yield j("BILLING_REMOVE_BUSINESS",{business_id:k});B.success?t.removeBusinessFromCache(k):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(B.message)||s("billing.failedToRemoveBusiness")})}catch(B){console.error("Error removing business:",B)}}),r=(k,S)=>R(this,null,function*(){S.stopPropagation();try{const B=yield j("BILLING_REMOVE_CITIZEN",{citizen_id:k});B.success?t.removeCitizenFromCache(k):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(B.message)||s("billing.failedToRemoveCitizen")})}catch(B){console.error("Error removing citizen:",B)}}),C=k=>{t.setSelectedBusinessId(k),t.setAdminPage("business_commission")},d=I({business:{header:s("billing.authorizeBusiness"),desc:s("billing.fillDetailsToAuthorizeBusiness"),fields:{job_name:{placeholder:s("billing.jobNamePlaceholder"),value:""},job_label:{placeholder:s("billing.jobLabelPlaceholder"),value:""}},cancel:()=>{_(!1)},submit:k=>R(this,null,function*(){try{const S=yield j("BILLING_ADD_BUSINESS",{job_name:k.job_name,job_label:k.job_label});if(S.success){_(!1);const B={id:S.business_id,job_name:k.job_name,job_label:k.job_label,can_invoice:1,created_by:S.created_by,created_at:new Date().toISOString()};t.addBusinessToCache(B)}else i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(S.message)||s("billing.failedToAddBusiness")})}catch(S){console.error("Error authorizing business:",S)}})},citizen:{header:s("billing.authorizeCitizen"),desc:s("billing.fillDetailsToAuthorizeCitizen"),fields:{identifier:{placeholder:s("billing.identifierPlaceholder"),value:""},name:{placeholder:s("billing.name"),value:""}},cancel:()=>{_(!1)},submit:k=>R(this,null,function*(){try{const S=yield j("BILLING_ADD_CITIZEN",{identifier:k.identifier,name:k.name});if(S.success){_(!1);const B={id:S.citizen_id,identifier:k.identifier,name:k.name,can_invoice:1,created_by:S.created_by,created_at:new Date().toISOString()};t.addCitizenToCache(B)}else i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(S.message)||s("billing.failedToAddCitizen")})}catch(S){console.error("Error authorizing citizen:",S)}})}});ae(()=>{t.setGeneralCategory("business"),x(),N()}),Fe(()=>{t.setGeneralCategory("unpaid")});const v=E(()=>{switch(t.general.category){case"business":return s("billing.businessAdministration");case"citizen":return s("billing.citizenAdministration");default:return s("billing.settings")}}),O=E(()=>t.general.category==="business"?b.value:T.value);return(k,S)=>(a(),u("div",vi,[f.value&&l(t).general.category==="business"?(a(),V(Ne,{key:0,onBack:d.value.business.cancel,onAdd:d.value.business.submit,header:d.value.business.header,label:d.value.business.desc,fields:d.value.business.fields,buttons:{cancel:l(s)("general.cancel"),submit:l(s)("billing.authorize")}},null,8,["onBack","onAdd","header","label","fields","buttons"])):f.value&&l(t).general.category==="citizen"?(a(),V(Ne,{key:1,onBack:d.value.citizen.cancel,onAdd:d.value.citizen.submit,header:d.value.citizen.header,label:d.value.citizen.desc,fields:d.value.citizen.fields,buttons:{cancel:l(s)("general.cancel"),submit:l(s)("billing.authorize")}},null,8,["onBack","onAdd","header","label","fields","buttons"])):A("",!0),e("div",pi,[e("div",hi,[e("div",{onClick:S[0]||(S[0]=B=>l(t).setAdminPage("main")),class:"h-full aspect-square rounded-full bg-white flex items-center justify-center cursor-pointer anim-hover-1"},S[2]||(S[2]=[e("svg",{class:"w-[14em] h-[14em]",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[e("path",{d:"M12.5 5L7.5 10L12.5 15",stroke:"black","stroke-width":"2","stroke-miterlimit":"16","stroke-linecap":"round"})],-1)])),e("p",Ci,o(v.value),1),e("div",{onClick:S[1]||(S[1]=B=>_(!0)),class:"h-full aspect-square rounded-full bg-white flex items-center justify-center cursor-pointer anim-hover-1"},S[3]||(S[3]=[e("svg",{class:"w-[12em] h-[12em]",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 0C9.5523 0 10 0.44772 10 1V8H17C17.5523 8 18 8.4477 18 9C18 9.5523 17.5523 10 17 10H10V17C10 17.5523 9.5523 18 9 18C8.4477 18 8 17.5523 8 17V10H1C0.44772 10 0 9.5523 0 9C0 8.4477 0.44772 8 1 8H8V1C8 0.44772 8.4477 0 9 0Z",fill:"black"})],-1)]))])]),e("div",bi,[e("div",{class:"w-full h-full bg-white rounded-[15em] overflow-auto no-scrollbar",onScroll:g},[c.value?(a(),u("div",xi,[e("p",yi,o(l(s)("general.loading")),1)])):O.value.length===0?(a(),u("div",_i,[e("p",wi,o(l(t).general.category==="business"?l(s)("billing.noBusinessesFound"):l(s)("billing.noCitizensFound")),1)])):(a(!0),u(ne,{key:2},fe(O.value,(B,te)=>(a(),u("div",{key:B.id,class:"w-full flex flex-col relative px-[15em] hover:bg-[#F9F9F9] transition-all h-[40em]"},[e("div",ki,[e("div",Ii,[e("p",$i,o(l(t).general.category==="business"?B.job_label:B.name),1),B.created_by===0?(a(),u("span",Si,o(l(s)("billing.config")),1)):A("",!0)]),l(t).general.category==="business"?(a(),u("div",Fi,[B.created_by!==0?(a(),u("p",{key:0,onClick:ie=>m(B.id,ie),class:"text-[10em] font-['SFPRO'] text-[#FD5F5F] cursor-pointer hover:opacity-95"},o(l(s)("billing.revoke")),9,Pi)):A("",!0),(a(),u("svg",{onClick:ie=>C(B.id),class:"w-[17em] h-[17em] transition-all opacity-[0.8] cursor-pointer hover:opacity-60",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},S[4]||(S[4]=[e("path",{d:"M9 6L15 12L9 18",stroke:"black","stroke-width":"1.5","stroke-miterlimit":"16"},null,-1)]),8,Ti))])):(a(),u(ne,{key:1},[B.created_by!==0?(a(),u("p",{key:0,onClick:ie=>r(B.id,ie),class:"text-[10em] font-['SFPRO'] text-[#FD5F5F] cursor-pointer hover:opacity-95"},o(l(s)("billing.revoke")),9,Bi)):(a(),u("p",Li,o(l(s)("billing.config")),1))],64))]),e("div",Ei,[te!==O.value.length-1?(a(),u("div",Oi)):A("",!0)])]))),128))],32)])]))}},ji=pe(Ni,[["__scopeId","data-v-30a5ee3d"]]),zi={class:"w-full h-full relative flex flex-col items-center overflow-hidden",style:{"background-color":"#FDD7D7"}},Ri={class:"w-full h-[12.6%] flex items-end px-[20em] flex-shrink-0"},Mi={class:"w-full h-[37%] relative flex items-center justify-between"},Ai={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%]"},Di={class:"w-full flex-1 px-[20em] pt-[15em] flex flex-col gap-y-[15em] overflow-y-auto"},Hi={class:"w-full bg-white rounded-[15em] py-[10em] px-[15em] flex items-center justify-between flex-shrink-0"},Gi={class:"flex items-center gap-x-[8em]"},Vi={class:"text-[11em] font-['SFPRO'] text-black"},Zi={key:0,class:"w-full flex items-center justify-center py-[20em]"},Ui={class:"text-[13em] font-['SFPRO'] text-black/50"},Ji={key:1,class:"w-full bg-white rounded-[15em] py-[15em] px-[20em] flex flex-col items-center gap-y-[12em] flex-shrink-0"},Yi=["src"],Xi={class:"text-[12em] font-['SFPRO'] text-center font-[500] text-black"},qi=["placeholder"],Wi={class:"text-[12em] font-['SFPRO'] text-[#FD5F5F] font-[500]"},Ki={key:3,class:"w-full bg-white rounded-[15em] py-[12em] px-[20em] flex items-center justify-center flex-shrink-0"},Qi={class:"text-[10em] font-['SFPRO'] text-[#00000040] text-center"},en={__name:"BusinessCommission",emits:["scroll"],setup(M,{emit:n}){const t=ee(),i=me(),{t:s}=ce(),f=I(null),c=I(!0),_=I(!1),w=E(()=>t.getSelectedBusiness),g=E(()=>{var r;return((r=w.value)==null?void 0:r.job_label)||"Business"}),b=()=>R(this,null,function*(){const r=w.value;if(!r){console.error("No business selected"),t.setAdminPage("settings");return}_.value=!0;try{const C=yield j("BILLING_GET_BUSINESS_DETAILS",{business_id:t.general.selectedBusinessId});if(C.success&&C.stats){const v=t.cache.businesses.data.find(O=>O.id===t.general.selectedBusinessId);v&&(v.commission_rate=C.stats.commission_rate,v.can_invoice=C.stats.can_invoice),f.value=Math.floor(C.stats.commission_rate||0),c.value=C.stats.can_invoice!==0}}catch(C){console.error("Error fetching business stats:",C),f.value=Math.floor(r.commission_rate||0),c.value=r.can_invoice!==0}finally{_.value=!1}}),T=()=>R(this,null,function*(){if(t.general.selectedBusinessId)try{const r=Math.floor(parseInt(f.value)||0),C=yield j("BILLING_UPDATE_BUSINESS_COMMISSION",{business_id:t.general.selectedBusinessId,commission_rate:r});if(C.success){const v=t.cache.businesses.data.find(O=>O.id===t.general.selectedBusinessId);v&&(v.commission_rate=r),i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s(C.message)||s("billing.commissionRateUpdated")})}else i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s(C.message)||s("billing.failedToUpdateCommissionRate")})}catch(r){console.error("Error updating commission rate:",r),i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s("billing.errorOccurredWhileProcessing")})}}),x=()=>R(this,null,function*(){if(t.general.selectedBusinessId)try{const r=yield j("BILLING_UPDATE_BUSINESS_CAN_INVOICE",{business_id:t.general.selectedBusinessId,can_invoice:c.value?1:0});if(r.success){const d=t.cache.businesses.data.find(v=>v.id===t.general.selectedBusinessId);d&&(d.can_invoice=c.value?1:0),i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:c.value?s("billing.invoicePermissionEnabled"):s("billing.invoicePermissionDisabled")})}else c.value=!c.value,i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s(r.message)||s("billing.failedToUpdateSetting")})}catch(r){console.error("Error updating can_invoice:",r),c.value=!c.value,i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s("billing.errorOccurredWhileProcessing")})}}),N=()=>R(this,null,function*(){if(t.general.selectedBusinessId)try{const r=yield j("BILLING_REMOVE_BUSINESS",{business_id:t.general.selectedBusinessId});r.success?(t.removeBusinessFromCache(t.general.selectedBusinessId),t.setAdminPage("settings"),i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s(r.message)||s("billing.businessRemoved")})):i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s(r.message)||s("billing.failedToRemoveBusiness")})}catch(r){console.error("Error removing business:",r),i.TriggerNotification({appname:"billing",header:s("billing.businessSettings"),message:s("billing.errorOccurredWhileProcessing")})}}),m=E(()=>{var r;return((r=w.value)==null?void 0:r.created_by)===0});return ae(()=>{t.setGeneralCategory("business"),b()}),Fe(()=>{t.setGeneralCategory("unpaid")}),(r,C)=>(a(),u("div",zi,[e("div",Ri,[e("div",Mi,[e("div",{onClick:C[0]||(C[0]=d=>l(t).setAdminPage("settings")),class:"h-full aspect-square rounded-full bg-white flex items-center justify-center cursor-pointer anim-hover-1"},C[3]||(C[3]=[e("svg",{class:"w-[14em] h-[14em]",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[e("path",{d:"M12.5 5L7.5 10L12.5 15",stroke:"black","stroke-width":"2","stroke-miterlimit":"16","stroke-linecap":"round"})],-1)])),e("p",Ai,o(g.value),1),C[4]||(C[4]=e("div",{class:"h-full aspect-square r flex items-center justify-center"},null,-1))])]),e("div",Di,[e("div",Hi,[e("div",Gi,[C[5]||(C[5]=e("div",{class:"w-[23em] h-[23em] flex items-center justify-center rounded-[6em] bg-[#3E5FFF]"},[e("svg",{class:"w-[12em] h-[12em]",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.7124 1.04297H8.28693C7.14758 1.04295 6.22865 1.04294 5.50581 1.141C4.75469 1.2429 4.12268 1.46098 3.62132 1.96688C3.12073 2.472 2.90564 3.10743 2.80502 3.86265C2.70798 4.59091 2.70799 5.51717 2.70801 6.66774V15.5853C2.70798 16.1759 2.70794 16.6845 2.76209 17.0737C2.81761 17.4728 2.95173 17.9269 3.37955 18.2025C4.01163 18.6096 4.71218 18.3277 5.10558 18.1219C5.33088 18.0041 5.9665 17.5734 6.14214 17.4527C6.36948 17.3093 6.49534 17.233 6.5896 17.1887C6.60768 17.1693 6.66734 17.1435 6.76138 17.1952C6.85655 17.2429 6.97814 17.3187 7.19056 17.4527L8.80526 18.471C9.00076 18.5943 9.18593 18.7111 9.35293 18.7936C9.53934 18.8856 9.75026 18.9596 9.99968 18.9596C10.2491 18.9596 10.46 18.8856 10.6464 18.7936C10.8133 18.7111 10.9985 18.5944 11.1939 18.4711L12.8088 17.4527C13.0362 17.3093 13.162 17.233 13.2563 17.1887C13.2772 17.171 13.3408 17.1474 13.428 17.1952C13.4873 17.2249 13.7208 17.3782 13.9401 17.5221C14.0732 17.6094 14.2009 17.6932 14.2812 17.7439C14.4568 17.8646 14.6685 18.0041 14.8938 18.1219C15.2872 18.3277 15.9878 18.6096 16.6198 18.2025C17.0476 17.9269 17.1818 17.4728 17.2373 17.0737C17.2914 16.6845 17.2913 16.1759 17.2913 15.5853V6.66779C17.2913 5.51719 17.2913 4.59092 17.1943 3.86265C17.0937 3.10743 16.8786 2.472 16.378 1.96688C15.8767 1.46098 15.2447 1.2429 14.4935 1.141C13.7707 1.04294 12.8518 1.04295 11.7124 1.04297ZM9.99968 9.16797C9.99968 9.62822 9.62659 10.0013 9.16634 10.0013H6.66634C6.20611 10.0013 5.83301 9.62822 5.83301 9.16797C5.83301 8.70772 6.20611 8.33464 6.66634 8.33464H9.16634C9.62659 8.33464 9.99968 8.70772 9.99968 9.16797ZM11.6663 6.66797C12.1266 6.66797 12.4997 6.29488 12.4997 5.83464C12.4997 5.3744 12.1266 5.0013 11.6663 5.0013H6.66634C6.20611 5.0013 5.83301 5.3744 5.83301 5.83464C5.83301 6.29488 6.20611 6.66797 6.66634 6.66797H11.6663Z",fill:"white"})])],-1)),e("p",Vi,o(l(s)("billing.billPlayers")),1)]),W(e("input",{type:"checkbox","onUpdate:modelValue":C[1]||(C[1]=d=>c.value=d),onChange:x,id:"toggle-1"},null,544),[[Qe,c.value]]),C[6]||(C[6]=e("label",{for:"toggle-1"},null,-1))]),_.value?(a(),u("div",Zi,[e("p",Ui,o(l(s)("general.loading")),1)])):(a(),u("div",Ji,[e("img",{src:l(K)["billing/commission.svg"],class:"w-[80em] h-[80em]"},null,8,Yi),e("p",Xi,o(l(s)("billing.commissionPerEmployee")),1),W(e("input",{type:"number","onUpdate:modelValue":C[2]||(C[2]=d=>f.value=d),class:"w-[100%] bg-[#F2F2F7] py-[.85em] block rounded-[.75em] placeholder:text-[#00000080] text-[#000000] font-['SFPRO'] text-[11em] font-[400] outline-none text-center text-black",placeholder:l(s)("billing.rate"),min:"0",max:"100",step:"1"},null,8,qi),[[he,f.value,void 0,{number:!0}]]),e("div",{onClick:T,class:"w-[100%] bg-[#3E5FFF] py-[.85em] cursor-pointer hover:opacity-90 transition-all rounded-[.75em] flex items-center justify-center text-white text-[12em] font-[500]"},o(l(s)("billing.set")),1)])),m.value?(a(),u("div",Ki,[e("p",Qi,o(l(s)("billing.cannotRemoveConfigBusiness")),1)])):(a(),u("div",{key:2,onClick:N,class:"w-full bg-white rounded-[15em] py-[12em] px-[20em] flex items-center justify-center cursor-pointer hover:bg-red-50 transition-all flex-shrink-0"},[e("p",Wi,o(l(s)("billing.removeBusiness")),1)]))])]))}},tn=pe(en,[["__scopeId","data-v-02a01a3f"]]),ln={class:"w-full h-full",style:{"background-color":"#FDD7D7"}},sn={class:"w-full h-[80em] flex items-end justify-center"},nn={class:"w-[90%] h-[37%] flex items-center justify-center px-[10em] relative"},an={class:"font-['SFPRO'] text-[15em] text-black leading-[100%] font-medium truncate"},on={class:"w-full h-[525em] px-[15em] pt-[26em]"},rn={class:"w-full h-full"},cn={class:"w-full h-[33em] flex items-end"},un={class:"font-['SFPRO'] text-[15em] text-black font-medium truncate"},dn={class:"w-full h-[33em] flex items-center"},fn={class:"font-['SFPRO'] text-[12em] text-black font-medium truncate"},gn={class:"text-black/50 ml-[0.2em]"},mn={class:"w-full h-[40em] flex items-end"},vn={class:"font-['SFPRO'] text-[15em] text-black font-medium truncate"},pn={class:"w-full h-[35em] bg-[#F2F2F7] rounded-[10em]"},hn=["placeholder"],Cn={class:"w-full h-[35em] bg-[#F2F2F7] rounded-[10em]"},bn=["placeholder"],xn={class:"w-full h-[35em] bg-[#F2F2F7] rounded-[10em]"},yn=["placeholder"],_n={class:"w-full h-[25em] flex items-center justify-between"},wn={class:"w-[40%] h-full flex items-center justify-end"},kn={class:"font-['SFPRO'] text-[15em] text-black font-medium leading-[100%] truncate"},In={class:"font-['SFPRO'] text-[16em] text-white font-medium leading-[100%] truncate"},$n={__name:"TaxDetails",setup(M){const n=ee(),t=me(),{t:i}=ce(),s=I(!1),f=I(!1),c=I(!1),_=I({id:null,reason:"",amount:0,interval_hours:1,tax_type:"citizen",job:null,is_active:!0}),w=I(""),g=I(""),b=I(""),T=E(()=>_.value.tax_type==="citizen"?i("billing.citizens"):_.value.job?_.value.job:i("billing.businesses")),x=()=>R(this,null,function*(){var C,d;s.value=!0;try{const v=n.general.invoiceId,O=yield j("BILLING_GET_TAX_DETAILS",{tax_id:v});O.success?(_.value=O.tax,w.value=O.tax.reason||"",g.value=((C=O.tax.amount)==null?void 0:C.toString())||"",b.value=((d=O.tax.interval_hours)==null?void 0:d.toString())||""):(t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(O.message)||i("billing.failedToLoadTaxDetails")}),n.setAdminPage("main"))}catch(v){console.error("Error fetching tax details:",v),t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i("billing.errorOccurredWhileProcessing")})}finally{s.value=!1}}),N=()=>R(this,null,function*(){if(!f.value){if(!w.value||!g.value||!b.value){t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i("billing.pleaseFillAllFields")});return}f.value=!0;try{const C=yield j("BILLING_UPDATE_TAX",{tax_id:_.value.id,reason:w.value,amount:parseFloat(g.value),interval_hours:parseInt(b.value)});C.success?(t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(C.message)||i("billing.taxUpdated")}),n.cache.taxes.all={data:[],pagination:null,lastFetch:null,isInitialized:!1},n.setAdminPage("main")):t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(C.message)||i("billing.failedToUpdateTax")})}catch(C){console.error("Error updating tax:",C),t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i("billing.errorOccurredWhileProcessing")})}finally{f.value=!1}}}),m=()=>R(this,null,function*(){try{const C=yield j("BILLING_DELETE_TAX",{tax_id:_.value.id});C.success?(t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(C.message)||i("billing.taxDeleted")}),n.cache.taxes.all={data:[],pagination:null,lastFetch:null,isInitialized:!1},c.value=!1,n.setAdminPage("main")):t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i(C.message)||i("billing.failedToDeleteTax")})}catch(C){console.error("Error deleting tax:",C),t.TriggerNotification({appname:"billing",header:i("billing.title"),message:i("billing.errorOccurredWhileProcessing")})}}),r=()=>{n.setAdminPage("main"),n.setGeneralCategory("taxes")};return ae(()=>{x()}),(C,d)=>(a(),u("div",ln,[c.value?(a(),V(Te,{key:0,header:l(i)("billing.deleteTax"),label:l(i)("billing.deleteTaxConfirmation"),buttons:{cancel:l(i)("general.cancel"),submit:l(i)("general.delete")},onSubmit:m,onCancel:d[0]||(d[0]=v=>c.value=!1)},null,8,["header","label","buttons"])):A("",!0),e("div",sn,[e("div",nn,[e("div",{onClick:r,class:"h-full absolute left-0 aspect-square rounded-full bg-white flex items-center justify-center cursor-pointer anim-hover-1 z-[2]"},d[5]||(d[5]=[e("svg",{class:"h-[35%]",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M6.41402 1L1.41406 6L6.41406 11",stroke:"black","stroke-width":"2","stroke-miterlimit":"16","stroke-linecap":"round"})],-1)])),e("div",{onClick:d[1]||(d[1]=v=>c.value=!0),class:"h-full absolute right-0 aspect-square rounded-full flex items-center justify-center bg-white cursor-pointer anim-hover-1 z-[2]"},d[6]||(d[6]=[e("svg",{class:"h-[45%]",viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.87192 18.6439C4.60539 18.6439 4.38224 18.5571 4.20249 18.3835C4.02274 18.2099 3.92666 17.9913 3.91427 17.7279L3.26343 4.82264H14.6995L14.0858 17.7279C14.0734 17.9973 13.9773 18.2174 13.7976 18.388C13.6178 18.5586 13.3916 18.6439 13.1188 18.6439H4.87192ZM6.66634 16.9601C6.56097 17.0589 6.42151 17.1082 6.24795 17.1082C6.07439 17.1082 5.93493 17.0604 5.82956 16.9646C5.72419 16.8688 5.6684 16.74 5.66221 16.5784L5.38328 6.97801C5.37708 6.82234 5.42822 6.69512 5.53669 6.59633C5.64516 6.49755 5.78617 6.44815 5.95973 6.44815C6.12709 6.44815 6.265 6.49605 6.37347 6.59184C6.48194 6.68764 6.53617 6.81337 6.53617 6.96903L6.8244 16.5784C6.8244 16.734 6.77171 16.8613 6.66634 16.9601ZM9.43701 16.9601C9.32544 17.0589 9.17978 17.1082 9.00002 17.1082C8.82647 17.1082 8.68391 17.0589 8.57234 16.9601C8.46076 16.8613 8.40498 16.734 8.40498 16.5784V6.97801C8.40498 6.82234 8.46076 6.69512 8.57234 6.59633C8.68391 6.49755 8.82647 6.44815 9.00002 6.44815C9.17978 6.44815 9.32544 6.49755 9.43701 6.59633C9.54858 6.69512 9.60437 6.82234 9.60437 6.97801V16.5784C9.60437 16.734 9.54858 16.8613 9.43701 16.9601ZM12.1705 16.9646C12.0651 17.0604 11.9288 17.1082 11.7614 17.1082C11.5816 17.1082 11.4391 17.0589 11.3337 16.9601C11.2283 16.8613 11.1787 16.734 11.1849 16.5784L11.4639 6.97801C11.4701 6.81636 11.5259 6.68764 11.6312 6.59184C11.7366 6.49605 11.873 6.44815 12.0403 6.44815C12.2201 6.44815 12.3626 6.49755 12.468 6.59633C12.5734 6.69512 12.623 6.82234 12.6168 6.97801L12.3379 16.5784C12.3316 16.74 12.2758 16.8688 12.1705 16.9646Z",fill:"#FF3B30"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.2676 20H4.74175C4.07232 20 3.53152 19.8099 3.11933 19.4297C2.70713 19.0496 2.48554 18.5362 2.45455 17.8896L1.81302 4.82264H0.697316C0.511365 4.82264 0.348658 4.75528 0.209195 4.62057C0.0697317 4.48587 0 4.32571 0 4.1401C0 3.96049 0.0697317 3.80333 0.209195 3.66862C0.348658 3.53391 0.511365 3.46655 0.697316 3.46655H4.91841V2.0925C4.91841 1.44589 5.1245 0.935489 5.53669 0.561295C5.94888 0.187098 6.51138 0 7.22419 0H10.7572C11.4701 0 12.0326 0.187098 12.4448 0.561295C12.857 0.935489 13.063 1.44589 13.063 2.0925V3.46655H17.312C17.498 3.46655 17.6592 3.53241 17.7955 3.66413C17.9318 3.79585 18 3.95451 18 4.1401C18 4.32571 17.9334 4.48587 17.8002 4.62057C17.6669 4.75528 17.5042 4.82264 17.312 4.82264H16.1963L15.5548 17.8806C15.5238 18.5272 15.3007 19.0421 14.8854 19.4252C14.4701 19.8084 13.9308 20 13.2676 20ZM11.5848 3.46655H6.39671V2.18232C6.39671 1.93085 6.48194 1.72729 6.65239 1.57162C6.82285 1.41596 7.04754 1.33813 7.32646 1.33813H10.655C10.9339 1.33813 11.1586 1.41596 11.329 1.57162C11.4995 1.72729 11.5848 1.93085 11.5848 2.18232V3.46655ZM4.20249 18.3835C4.38224 18.5571 4.60539 18.6439 4.87192 18.6439H13.1188C13.3916 18.6439 13.6178 18.5586 13.7976 18.388C13.9773 18.2174 14.0734 17.9973 14.0858 17.7279L14.6995 4.82264H3.26343L3.91427 17.7279C3.92666 17.9913 4.02274 18.2099 4.20249 18.3835Z",fill:"#FF3B30"})],-1)])),e("p",an,o(l(i)("billing.taxDetails")),1)])]),e("div",on,[e("div",{class:"w-full h-full px-[20em]",style:ge({backgroundImage:`url(${l(K)["billing/edittaxlarge.png"]})`,backgroundSize:"100% 100%"})},[e("div",rn,[e("div",cn,[e("p",un,o(l(i)("billing.lsBillingOffice")),1)]),e("div",dn,[e("p",fn,[Oe(o(l(i)("billing.to"))+": ",1),e("span",gn,o(T.value),1)])]),e("div",mn,[e("p",vn,o(l(i)("billing.taxReason")),1)]),d[8]||(d[8]=e("div",{class:"w-full h-[16em]"},null,-1)),e("div",pn,[W(e("input",{"onUpdate:modelValue":d[2]||(d[2]=v=>w.value=v),type:"text",class:"w-full h-full bg-transparent font-['SFPRO'] outline-none border-none text-[13em] font-medium pl-[0.7em] placeholder:text-black/50 text-black",placeholder:l(i)("billing.reason")},null,8,hn),[[he,w.value]])]),d[9]||(d[9]=e("div",{class:"w-full h-[10em]"},null,-1)),e("div",Cn,[W(e("input",{"onUpdate:modelValue":d[3]||(d[3]=v=>g.value=v),type:"number",class:"w-full h-full font-['SFPRO'] bg-transparent outline-none font-medium border-none text-[13em] placeholder:text-black/50 pl-[0.7em] text-black",placeholder:l(i)("billing.amount")},null,8,bn),[[he,g.value]])]),d[10]||(d[10]=e("div",{class:"w-full h-[10em]"},null,-1)),e("div",xn,[W(e("input",{"onUpdate:modelValue":d[4]||(d[4]=v=>b.value=v),type:"number",class:"w-full h-full font-['SFPRO'] bg-transparent outline-none font-medium border-none text-[13em] placeholder:text-black/50 pl-[0.7em] text-black",placeholder:l(i)("billing.intervalHours")},null,8,yn),[[he,b.value]])]),d[11]||(d[11]=e("div",{class:"w-full h-[160em]"},null,-1)),e("div",_n,[d[7]||(d[7]=e("div",{class:"w-[60%] h-full flex items-center"},[e("p",{class:"font-['SFPRO'] text-[15em] text-black font-medium leading-[100%] truncate"},"TOTAL")],-1)),e("div",wn,[e("p",kn,"$"+o(g.value?l(Ce)(parseFloat(g.value)):"0"),1)])]),d[12]||(d[12]=e("div",{class:"w-full h-[18.75em]"},null,-1)),e("div",{onClick:N,class:"w-full h-[48em] flex items-center justify-center cursor-pointer anim-hover-1"},[e("p",In,o(f.value?l(i)("billing.saving"):l(i)("general.save")),1)])])],4)])]))}},Sn=pe($n,[["__scopeId","data-v-2361f17e"]]),Fn={class:"w-full h-full"},Pn={__name:"BillingAdminRouter",setup(M){const n=ee(),t=I([{key:"main"},{key:"settings"},{key:"business_commission"},{key:"invoicedetails"},{key:"taxdetails"}]);ae(()=>{n.setGeneralGradientOpacity(1)});const i=({scrollTop:s,scrollHeight:f,clientHeight:c})=>{const _=f-c,w=s/_*100,g=70,b=95;w<=g?n.setGeneralGradientOpacity(1):w>=b?n.setGeneralGradientOpacity(0):n.setGeneralGradientOpacity(1-(w-g)/(b-g))};return(s,f)=>(a(),u("div",Fn,[Q(Pe,{"current-key":l(n).admin.page,items:t.value,duration:300,easing:"ease-in-out"},{main:J(()=>[l(n).admin.page=="main"?(a(),V(mi,{key:0,onScroll:i})):A("",!0)]),settings:J(()=>[l(n).admin.page=="settings"?(a(),V(ji,{key:0,onScroll:i})):A("",!0)]),business_commission:J(()=>[l(n).admin.page=="business_commission"?(a(),V(tn,{key:0,onScroll:i})):A("",!0)]),invoicedetails:J(()=>[l(n).admin.page=="invoicedetails"?(a(),V(Be,{key:0})):A("",!0)]),taxdetails:J(()=>[l(n).admin.page=="taxdetails"?(a(),V(Sn,{key:0})):A("",!0)]),_:1},8,["current-key","items"])]))}},Tn={class:"w-full h-full relative flex flex-col gap-y-[10em] items-center"},Bn={class:"w-[90%] h-[120em] flex items-center gap-x-[5em] justify-center mx-auto"},Ln={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},En={class:"flex flex-col items-center"},On={class:"text-[10.5em] font-['SFPRO'] text-black"},Nn={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},jn={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},zn={class:"flex flex-col items-center"},Rn={class:"text-[10.5em] font-['SFPRO'] text-black"},Mn={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},An={class:"flex-1 h-full rounded-[8em] bg-white flex flex-col gap-y-[5em] items-center justify-center"},Dn={class:"flex flex-col items-center"},Hn={class:"text-[10.5em] font-['SFPRO'] text-black"},Gn={class:"text-[10.5em] font-['SFPRO'] text-[#00000080]"},Vn={class:"w-full h-[60em] flex items-center justify-center flex-shrink-0"},Zn={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%]"},Un={key:0,class:"w-full h-[60em] flex items-center justify-center"},Jn={class:"text-black/50 text-[12em] font-['SFPRO']"},Yn={key:1,class:"w-full h-[60em] flex items-center justify-center"},Xn={class:"text-black/50 text-[12em] font-['SFPRO']"},qn={__name:"Main",emits:["scroll"],setup(M,{emit:n}){const t=ee(),i=me(),{t:s}=ce(),f=I(!1),c=I(!1),_=I(1),w=I(!1),g=I(null);I("");const b=E(()=>t.general.category=="unpaid"?s("billing.createdUnpaidInvoicesLabel"):s("billing.createdPaidInvoicesLabel")),T=E(()=>K["billing/billingsmall.png"]),x=E(()=>t.getFilteredInvoices("sent",t.general.category).data||[]),N=I({unpaid_count:0,paid_count:0,self_profit:0}),m=()=>R(this,null,function*(){try{const k=yield j("BILLING_GET_INDIVIDUAL_STATS",{});k&&k.success&&(N.value=k.stats)}catch(k){console.error("Error fetching citizen stats:",k)}}),r=(k=1,S=!1)=>R(this,null,function*(){if(!(f.value||c.value)){if(k===1&&!S){const B=t.getCachedInvoices("sent",t.general.category);if(B.isInitialized&&t.isCacheValid(B))return}k===1?f.value=!0:c.value=!0;try{const B=yield j("BILLING_GET_INVOICES",{type:"sent",status:t.general.category,page:k,limit:20,panel_type:"authorizedcitizen"});B&&B.success&&(S?t.appendInvoices("sent",t.general.category,B.invoices,B.pagination):t.cacheInvoices("sent",t.general.category,B.invoices,B.pagination),_.value=k)}catch(B){console.error("Error fetching invoices:",B)}finally{f.value=!1,c.value=!1}}}),C=n,d=k=>{const{scrollTop:S,scrollHeight:B,clientHeight:te}=k.target;if(C("scroll",{scrollTop:S,scrollHeight:B,clientHeight:te}),S+te>=B-50&&!c.value){const D=t.getCachedInvoices("sent",t.general.category).pagination;D&&_.value<D.totalPages&&r(_.value+1,!0)}},v=k=>R(this,null,function*(){k.type==="cancel"?(g.value=k.id,w.value=!0):k.type==="details"&&(t.setInvoiceId(k.id),t.setCitizenPage("invoicedetails"),t.general.lastPage="authorizedcitizen")}),O=()=>R(this,null,function*(){if(g.value)try{const k=yield j("BILLING_CANCEL_INVOICE",{invoice_id:g.value});k.success?(t.removeInvoiceFromCache(g.value),r(1,!1),m(),i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(k.message)||s("billing.invoiceCancelled")})):i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s(k.message)||s("billing.failedToCancelInvoice")})}catch(k){console.error("Error cancelling invoice:",k),i.TriggerNotification({appname:"billing",header:s("billing.title"),message:s("billing.errorOccurredWhileProcessing")})}finally{w.value=!1,g.value=null}});return se(()=>t.general.category,k=>{_.value=1,r(1,!1)}),ae(()=>{t.clearSentInvoicesCache(),m(),r(1,!1)}),(k,S)=>(a(),u("div",Tn,[Q(Re,{title:l(s)("billing.individual")},null,8,["title"]),e("div",Bn,[e("div",Ln,[S[1]||(S[1]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.9998 1.66797C8.08376 1.66797 1.6665 8.08522 1.6665 16.0013C1.6665 23.9174 8.08376 30.3346 15.9998 30.3346C23.916 30.3346 30.3332 23.9174 30.3332 16.0013C30.3332 8.08522 23.916 1.66797 15.9998 1.66797ZM17.3332 10.668C17.3332 9.93159 16.7362 9.33463 15.9998 9.33463C15.2634 9.33463 14.6665 9.93159 14.6665 10.668V16.0013C14.6665 16.3549 14.807 16.6941 15.057 16.9441L17.7237 19.6108C18.2444 20.1314 19.0886 20.1314 19.6093 19.6108C20.13 19.0901 20.13 18.2458 19.6093 17.7252L17.3332 15.449V10.668Z",fill:"#FF883E"})],-1)),e("div",En,[e("p",On,o(N.value.unpaid_count),1),e("p",Nn,o(l(s)("billing.unpaid")),1)])]),e("div",jn,[S[2]||(S[2]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M22.4468 10.817C25.6672 13.9341 27.8401 18.1088 28.578 22.5272C28.9557 24.7891 28.0828 26.7739 26.5825 28.16C25.0972 29.5324 22.9914 30.3333 20.7952 30.3333H11.2033C9.007 30.3333 6.90117 29.5324 5.4159 28.16C3.91562 26.7739 3.04262 24.7891 3.42036 22.5272C4.31384 17.1773 7.09265 13.1965 9.51684 10.8506C9.64012 10.7313 9.76346 10.6144 9.90233 10.513C10.2024 10.2939 10.7388 10.0768 11.1068 10.0255C11.2899 10 11.4216 10 11.685 10H20.3134C20.5768 10 20.7085 10 20.8916 10.0255C21.2596 10.0768 21.796 10.2939 22.096 10.513C22.2453 10.622 22.3125 10.687 22.4468 10.817Z",fill:"#1CB903"}),e("path",{d:"M14.1875 2.54322C14.5158 2.21378 15.1358 1.66797 15.9988 1.66797C16.8619 1.66797 17.4819 2.21378 17.8102 2.54322C18.2082 2.94261 18.5254 3.53958 19.0304 3.80678C19.448 4.02769 19.9867 3.8131 20.4035 3.70456C20.8007 3.60116 21.4062 3.44456 22.0478 3.52996C22.3266 3.56706 22.6924 3.65574 22.9758 3.9081C23.3115 4.20697 23.3656 4.57884 23.3166 4.85989C23.2568 5.20182 23.0451 5.48245 22.8371 5.74933L21.6474 7.28117C21.3407 7.67705 21.0372 8.08389 20.6298 8.38312C20.3279 8.60477 19.9459 8.66797 19.5715 8.66797H12.4262C12.0517 8.66797 11.6698 8.60477 11.368 8.38312C10.9605 8.08389 10.657 7.67705 10.3503 7.28117L9.16055 5.74933C8.95265 5.48245 8.74087 5.20184 8.68116 4.85989C8.63208 4.57884 8.68625 4.20697 9.02192 3.9081C9.30535 3.65574 9.67117 3.56706 9.94997 3.52996C10.5916 3.44456 11.197 3.60116 11.5943 3.70456C12.0111 3.8131 12.5496 4.02769 12.9673 3.80678C13.4724 3.53958 13.7895 2.94261 14.1875 2.54322Z",fill:"#1CB903"})],-1)),e("div",zn,[e("p",Rn,"$"+o(l(Ce)(N.value.self_profit)),1),e("p",Mn,o(l(s)("billing.selfProfit")),1)])]),e("div",An,[S[3]||(S[3]=e("svg",{class:"w-[17em] h-[17em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6668 29.9987C7.75075 29.9987 1.3335 23.5815 1.3335 15.6654C1.3335 7.74928 7.75075 1.33203 15.6668 1.33203C23.583 1.33203 30.0002 7.74928 30.0002 15.6654C30.0002 23.5815 23.583 29.9987 15.6668 29.9987ZM22.0244 12.5189C22.4959 11.9532 22.4195 11.1125 21.8538 10.6411C21.288 10.1696 20.4472 10.2461 19.9759 10.8118L14.2439 17.6902L11.2763 14.7226C10.7556 14.2019 9.91139 14.2019 9.39068 14.7226C8.86999 15.2432 8.86999 16.0875 9.39068 16.6082L13.3907 20.6082C13.6556 20.8731 14.0196 21.0143 14.3939 20.9974C14.7682 20.9803 15.118 20.8067 15.3578 20.519L22.0244 12.5189Z",fill:"#3E5FFF"})],-1)),e("div",Dn,[e("p",Hn,o(N.value.paid_count),1),e("p",Gn,o(l(s)("billing.paid")),1)])])]),e("div",{onScroll:d,class:"w-full h-[490em] px-[15em] pb-[50em] overflow-auto no-scrollbar flex flex-wrap content-start gap-y-[15em]"},[e("div",Vn,[e("p",Zn,o(b.value),1)]),(a(!0),u(ne,null,fe(x.value,B=>(a(),V(xe,{onClicked:v,key:B.id,id:B.id,backgroundImage:T.value,variant:"employee",isPaid:B.status==="paid",isOverdue:B.status==="overdue",title:B.receiver_name,amount:B.total,dueDate:B.due_date},null,8,["id","backgroundImage","isPaid","isOverdue","title","amount","dueDate"]))),128)),c.value?(a(),u("div",Un,[e("p",Jn,o(l(s)("billing.loadingMore")),1)])):x.value.length===0&&!f.value?(a(),u("div",Yn,[e("p",Xn,o(l(s)("billing.noInvoicesFound")),1)])):A("",!0),S[4]||(S[4]=e("div",{class:"w-full h-[60em]"},null,-1))],32),w.value?(a(),V(Te,{key:0,header:l(s)("billing.cancelInvoice"),label:l(s)("billing.cancelInvoiceConfirmation"),buttons:{cancel:l(s)("billing.no"),submit:l(s)("billing.yes")},onCancel:S[0]||(S[0]=B=>w.value=!1),onSubmit:O},null,8,["header","label","buttons"])):A("",!0)]))}},Wn=pe(qn,[["__scopeId","data-v-f05f8444"]]),Kn={class:"w-full h-full relative"},Qn={__name:"BillingAuthorizedCitizenRouter",setup(M){const n=I([{key:"main"},{key:"invoicedetails"}]),t=ee();ae(()=>{t.setGeneralGradientOpacity(1),t.setCitizenPage("main")});const i=({scrollTop:s,scrollHeight:f,clientHeight:c})=>{const _=f-c,w=s/_*100,g=70,b=95;w<=g?t.setGeneralGradientOpacity(1):w>=b?t.setGeneralGradientOpacity(0):t.setGeneralGradientOpacity(1-(w-g)/(b-g))};return(s,f)=>(a(),u("div",Kn,[Q(Pe,{"current-key":l(t).citizen.page,items:n.value,duration:300,easing:"ease-in-out"},{main:J(()=>[l(t).citizen.page=="main"?(a(),V(Wn,{key:0,onScroll:i})):A("",!0)]),invoicedetails:J(()=>[l(t).citizen.page=="invoicedetails"?(a(),V(Be,{key:0})):A("",!0)]),_:1},8,["current-key","items"])]))}},ea={class:"w-full h-[15%] flex items-center justify-center"},ta={class:"w-[89%] borderre h-[38%] flex items-center relative justify-center"},la={class:"font-['SFPRO'] text-[15em] text-black font-[400] leading-[100%] truncate"},sa={class:"flex items-center justify-between px-[20em] pt-[12em]"},ia={class:"text-black text-[15em] font-['SFPRO']"},na={class:"text-black text-[11em] opacity-[0.4] font-['SFPRO']"},aa={class:"flex items-center justify-between px-[20em]"},oa={class:"flex items-center gap-x-[5em]"},ra={class:"text-black text-[11em] font-['SFPRO']"},ca=["placeholder"],ua={class:"flex items-center justify-between px-[20em] relative"},da={class:"flex items-center gap-x-[5em]"},fa={class:"text-black text-[11em] font-['SFPRO']"},ga={class:"text-black text-[11em] font-['SFPRO'] opacity-[0.4]"},ma={class:"flex w-full px-[20em] flex-col gap-y-[6em] h-[210em]"},va={class:"text-black text-[15em] font-['SFPRO']"},pa=["onClick"],ha={class:"text-[10.5em] font-['SFPRO'] break-words overflow-hidden flex-1 min-w-0"},Ca={class:"text-[10.5em] font-['SFPRO'] flex-shrink-0"},ba=["placeholder"],xa={class:"flex items-center gap-x-[4em] w-full"},ya=["placeholder"],_a={class:"w-full flex flex-col px-[20em]"},wa={class:"w-full flex items-center justify-between"},ka={class:"text-[11em] opacity-[.5] text-['SFPRO']"},Ia={class:"text-[11em] text-['SFPRO']"},$a={class:"w-full flex items-center justify-between"},Sa={class:"text-[11em] opacity-[.5] text-['SFPRO']"},Fa={class:"text-[11em] text-['SFPRO']"},Pa={class:"w-full flex items-center justify-between"},Ta={class:"text-[11em]"},Ba={class:"text-[11em]"},La={__name:"CreateNewBill",setup(M){const{t:n}=ce(),t=me(),{appConfig:i}=Se(t),s=ee(),f=I(!1),c=I(null),_=I(""),w=I(null),g=I(null),b=I(null),T=I(null),x=I(null),N=I(!1),m=I(null),r=I(null),C=I(!1),d=E(()=>s.general.isAdmin&&s.general.lastPage==="admin"?"admin":s.general.isAuthorizedJob&&s.general.lastPage==="employee"?"business":"individual"),v=E(()=>s.general.lastPage==="admin"?"#FDD7D7":s.general.lastPage==="employee"?"#D8D7FD":"#F2F2F7"),O=E(()=>d.value==="admin"?n("billing.government"):d.value==="business"&&s.general.jobLabel?s.general.jobLabel:n("billing.invoice")),k=()=>{const p=new Date,$=String(p.getDate()).padStart(2,"0"),U=String(p.getMonth()+1).padStart(2,"0"),de=p.getFullYear();return`${$}.${U}.${de}`},S=p=>{if(!p)return n("billing.selectFromDatePicker");const $=String(p.getDate()).padStart(2,"0"),U=String(p.getMonth()+1).padStart(2,"0"),de=p.getFullYear();return`${$}.${U}.${de}`},B=()=>{N.value=!1},te=()=>{const p=new Date;return p.setDate(p.getDate()+1),p},ie=p=>{if(!p)return null;const $=p.getFullYear(),U=String(p.getMonth()+1).padStart(2,"0"),de=String(p.getDate()).padStart(2,"0");return`${$}-${U}-${de}`};ae(()=>{document.addEventListener("click",oe)}),Fe(()=>{document.removeEventListener("click",oe)});const oe=p=>{N.value&&r.value&&!r.value.contains(p.target)&&(p.target.closest("svg")||(N.value=!1))},D=p=>{(p.key==="-"||p.key==="e"||p.key==="E"||p.key==="+")&&p.preventDefault()},y=E(()=>{var p;return(((p=i.value.BillingConfig)==null?void 0:p.TaxRate)||0)*100}),L=I([]),F=()=>{if(_.value==""||w.value==null||g.value==null){t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.fill")});return}const p=L.value.find($=>$.reason===_.value&&$.price===w.value);p?p.amount=parseInt(p.amount)+parseInt(g.value):L.value.push({reason:_.value,price:parseFloat(w.value),amount:parseInt(g.value)}),_.value="",w.value=null,g.value=null,b.value.scrollTop=b.value.scrollHeight},G=p=>{const $=p.player||p;m.value={id:$.source||$.id||p.playerId,name:$.name},f.value=!1},ue=()=>R(this,null,function*(){if(c.value){const p=yield j("GET_PLAYER_BY_ID",{playerId:parseInt(c.value),checkBillingDistance:!0});p.success?(m.value={id:p.id,name:p.name},c.value=null):p.self?t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.cant_send")}):p.tooFar?t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.serverMessages.receiverTooFar")}):t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.playerNotFound")})}else f.value=!0}),le=E(()=>{let p=0;L.value.forEach(de=>{p+=de.price*de.amount});const $=p*y.value/100,U=p+$;return{subtotal:p,tax:$,total:U}}),re=p=>Ce(p),P=p=>{L.value.splice(p,1)},H=()=>R(this,null,function*(){if(!m.value){t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.selectPlayer")});return}if(L.value.length===0){t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.addAtLeastOneCharge")});return}if(!x.value){t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.selectDueDate")});return}C.value=!0;try{const p=yield j("BILLING_CREATE_INVOICE",{receiver_id:m.value.id,items:L.value,due_date:ie(x.value),sender_type:d.value});p&&p.success?(t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.success.invoiceCreated")}),s.clearSentInvoicesCache(),m.value=null,L.value=[],x.value=null,_.value="",w.value=null,g.value=null,s.setGeneralPage(s.general.lastPage)):t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n(p==null?void 0:p.message)||n("billing.errors.failedToCreateInvoice")})}catch(p){console.error("Error creating invoice:",p),t.TriggerNotification({appname:"billing",header:n("billing.title"),message:n("billing.errors.errorCreatingInvoice")})}finally{C.value=!1}});return(p,$)=>(a(),u("div",{class:"w-full h-full relative flex flex-col gap-y-[15em] pt-[15em] items-center",style:ge({backgroundColor:v.value})},[Q(t1,{header:l(n)("billing.players"),onCancel:$[0]||($[0]=U=>f.value=!1),onPlayerSelected:G,show:f.value},null,8,["header","show"]),e("div",ea,[e("div",ta,[e("p",la,o(l(n)("billing.newInvoice")),1),e("div",{onClick:$[1]||($[1]=U=>l(s).setGeneralPage(l(s).general.lastPage)),class:"absolute left-0 bottom-[10%] inline-flex h-[30em] aspect-square cursor-pointer anim-hover-1 items-center justify-center bg-white rounded-full"},$[10]||($[10]=[e("svg",{class:"w-[15em] h-[15em]",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[e("path",{d:"M12.5 5L7.5 10L12.5 15",stroke:"black","stroke-width":"2","stroke-miterlimit":"16","stroke-linecap":"round"})],-1)]))])]),e("div",{class:"h-[77%] w-[85%] flex flex-col gap-y-[12em]",style:ge({backgroundImage:`url(${l(K)["billing/createbill.png"]})`,backgroundSize:"100% 100%"})},[e("div",sa,[e("p",ia,o(O.value),1),e("p",na,o(k()),1)]),$[15]||($[15]=e("div",{class:"w-full h-[.5em] bg-[#0000000D]"},null,-1)),e("div",aa,[e("div",oa,[e("p",ra,o(l(n)("billing.to"))+":",1),m.value?(a(),u("p",{key:0,class:"px-[1.15em] py-[.1em] text-[10em] text-[#0088FE] font-['SFPRO'] bg-[#0088FE4D] rounded-[2em] cursor-pointer hover:bg-[#FF6B6B] hover:text-white transition-all",onClick:$[2]||($[2]=U=>m.value=null)},o(m.value.name),1)):W((a(),u("input",{key:1,"onUpdate:modelValue":$[3]||($[3]=U=>c.value=U),type:"number",placeholder:l(n)("billing.idPlaceholder"),class:"bg-transparent outline-none border-none text-black text-[11em] font-['SFPRO']"},null,8,ca)),[[he,c.value]])]),e("div",{onClick:ue,class:"w-[15.5em] h-[15.5em] border-[1.65em] border-[#0088FE] rounded-full flex items-center justify-center cursor-pointer anim-hover-1 flex-shrink-0"},$[11]||($[11]=[e("svg",{class:"w-[13em] h-[13em]",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M11.9999 20C11.5303 20 11.1572 19.8574 10.8805 19.5723C10.6037 19.2872 10.4653 18.9182 10.4653 18.4654V13.5346H5.5346C5.08172 13.5346 4.71273 13.3962 4.42764 13.1195C4.14255 12.8428 4 12.4696 4 12C4 11.5304 4.14255 11.1572 4.42764 10.8805C4.71273 10.6038 5.08172 10.4654 5.5346 10.4654H10.4653V5.53458C10.4653 5.08176 10.6037 4.71278 10.8805 4.42766C11.1572 4.14255 11.5303 4 11.9999 4C12.4696 4 12.8428 4.14255 13.1195 4.42766C13.3961 4.71278 13.5345 5.08176 13.5345 5.53458V10.4654H18.4654C18.9183 10.4654 19.2873 10.6038 19.5724 10.8805C19.8575 11.1572 20 11.5304 20 12C20 12.4696 19.8575 12.8428 19.5724 13.1195C19.2873 13.3962 18.9183 13.5346 18.4654 13.5346H13.5345V18.4654C13.5345 18.9182 13.3961 19.2872 13.1195 19.5723C12.8428 19.8574 12.4696 20 11.9999 20Z",fill:"#0088FE"})],-1)]))]),$[16]||($[16]=e("div",{class:"w-full h-[.5em] bg-[#0000000D]"},null,-1)),e("div",ua,[N.value?(a(),u("div",{key:0,onClick:$[4]||($[4]=U=>N.value=!1),class:"fixed inset-0 z-[1999]"})):A("",!0),Q(be,{name:"fade-scale"},{default:J(()=>[N.value?(a(),u("div",{key:0,ref_key:"datepickerRef",ref:r,style:{position:"absolute",right:"0",top:"30em","z-index":"2000"}},[Q(l(e1),{modelValue:x.value,"onUpdate:modelValue":[$[5]||($[5]=U=>x.value=U),B],ref_key:"datePicker",ref:T,inline:"","auto-apply":"","min-date":te(),"enable-time-picker":!1,mode:"date","hide-input-icon":""},null,8,["modelValue","min-date"])],512)):A("",!0)]),_:1}),e("div",da,[e("p",fa,o(l(n)("billing.due"))+":",1),e("p",ga,o(S(x.value)),1)]),(a(),u("svg",{onClick:$[6]||($[6]=U=>N.value=!N.value),class:"w-[15.5em] h-[15.5em] cursor-pointer anim-hover-1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},$[12]||($[12]=[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.1 1.25C8.63848 1.25 9.075 1.68754 9.075 2.22727V3.21284C9.6529 3.20453 10.2784 3.20453 10.9537 3.20454H13.0463C13.7216 3.20453 14.3471 3.20453 14.925 3.21284V2.22727C14.925 1.68754 15.3615 1.25 15.9 1.25C16.4385 1.25 16.875 1.68754 16.875 2.22727V3.29947C17.0513 3.31556 17.221 3.33437 17.3843 3.35638C18.5544 3.51407 19.5397 3.85141 20.3221 4.63573C21.1046 5.42004 21.4412 6.40758 21.5985 7.58045C21.75 8.71014 21.75 10.1465 21.75 11.9285V14.026C21.75 15.808 21.75 17.2444 21.5985 18.3741C21.4412 19.547 21.1046 20.5345 20.3221 21.3188C19.5397 22.1031 18.5544 22.4405 17.3843 22.5982C16.2572 22.75 14.8242 22.75 13.0463 22.75H10.9537C9.17581 22.75 7.74279 22.75 6.61573 22.5982C5.44558 22.4405 4.46035 22.1031 3.67786 21.3188C2.89537 20.5345 2.5588 19.547 2.40148 18.3741C2.24995 17.2444 2.24998 15.8081 2.25 14.0261V11.9285C2.24998 10.1465 2.24995 8.71012 2.40148 7.58045C2.5588 6.40758 2.89537 5.42004 3.67786 4.63573C4.46035 3.85141 5.44558 3.51407 6.61573 3.35638C6.77902 3.33437 6.94874 3.31556 7.125 3.29947V2.22727C7.125 1.68754 7.56152 1.25 8.1 1.25ZM4.21386 9.75C4.20045 10.3958 4.20001 11.1378 4.20001 12V13.9545C4.20001 15.8249 4.20208 17.1294 4.3341 18.1137C4.46235 19.0698 4.69693 19.5761 5.05673 19.9367C5.41652 20.2974 5.92166 20.5325 6.87557 20.6611C7.85752 20.7934 9.15897 20.7955 11.025 20.7955H12.975C14.8411 20.7955 16.1425 20.7934 17.1245 20.6611C18.0784 20.5325 18.5835 20.2974 18.9433 19.9367C19.3031 19.5761 19.5377 19.0698 19.6659 18.1137C19.7979 17.1294 19.8 15.8249 19.8 13.9545V12C19.8 11.1378 19.7996 10.3958 19.7862 9.75H4.21386Z",fill:"#0088FE"},null,-1),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 13.2734C10 12.7212 10.4477 12.2734 11 12.2734H16C16.5523 12.2734 17 12.7212 17 13.2734C17 13.8257 16.5523 14.2734 16 14.2734H11C10.4477 14.2734 10 13.8257 10 13.2734ZM7 13.2734C7 12.7212 7.44772 12.2734 8 12.2734H8.00898C8.56127 12.2734 9.00898 12.7212 9.00898 13.2734C9.00898 13.8257 8.56127 14.2734 8.00898 14.2734H8C7.44772 14.2734 7 13.8257 7 13.2734ZM7 17.2734C7 16.7212 7.44772 16.2734 8 16.2734H13C13.5523 16.2734 14 16.7212 14 17.2734C14 17.8257 13.5523 18.2734 13 18.2734H8C7.44772 18.2734 7 17.8257 7 17.2734ZM14.991 17.2734C14.991 16.7212 15.4387 16.2734 15.991 16.2734H16C16.5523 16.2734 17 16.7212 17 17.2734C17 17.8257 16.5523 18.2734 16 18.2734H15.991C15.4387 18.2734 14.991 17.8257 14.991 17.2734Z",fill:"#0088FE"},null,-1)])))]),$[17]||($[17]=e("div",{class:"w-full h-[.5em] bg-[#0000000D]"},null,-1)),e("div",ma,[e("p",va,o(l(n)("billing.charges")),1),e("div",{class:"w-full flex flex-col gap-y-[1em] max-h-[100em] overflow-auto no-scrollbar",ref_key:"scroll",ref:b},[(a(!0),u(ne,null,fe(L.value,(U,de)=>(a(),u("div",{class:"bill-item w-full py-[2em] flex items-center justify-between gap-x-[8em] cursor-pointer transition-all",onClick:ke=>P(de),key:de},[e("p",ha,o(U.reason)+" (x"+o(U.amount)+")",1),e("p",Ca,"$"+o(re(U.price*U.amount)),1)],8,pa))),128))],512),W(e("input",{"onUpdate:modelValue":$[7]||($[7]=U=>_.value=U),type:"text",placeholder:l(n)("billing.reason"),class:"outline-none border-none text-black text-[11em] font-['SFPRO'] w-full bg-[#F2F2F7] py-[.9em] px-[1em] rounded-[1em]"},null,8,ba),[[he,_.value]]),e("div",xa,[W(e("input",{type:"number","onUpdate:modelValue":$[8]||($[8]=U=>g.value=U),placeholder:"1x",min:"1",onKeydown:D,class:"outline-none border-none text-black text-center text-[11em] font-['SFPRO'] w-[20%] block bg-[#F2F2F7] py-[.9em] px-[1em] rounded-[1em]"},null,544),[[he,g.value]]),W(e("input",{type:"number","onUpdate:modelValue":$[9]||($[9]=U=>w.value=U),placeholder:l(n)("billing.amount"),min:"0",step:"0.01",onKeydown:D,class:"outline-none border-none text-black text-center text-[11em] font-['SFPRO'] w-[40%] block bg-[#F2F2F7] py-[.9em] px-[1em] rounded-[1em]"},null,40,ya),[[he,w.value]]),e("div",{onClick:F,class:"w-[40%] font-['SFPRO'] py-[.9em] px-[1em] rounded-[1em] bg-[#0088FE] text-white text-[11em] text-center cursor-pointer anim-hover-1 font-['SFPRO']"},o(l(n)("general.add")),1)])]),$[18]||($[18]=e("div",{class:"w-full h-[.5em] bg-[#0000000D]"},null,-1)),e("div",_a,[e("div",wa,[e("p",ka,o(l(n)("billing.subtotal")),1),e("p",Ia,"$"+o(re(le.value.subtotal)),1)]),$[13]||($[13]=e("div",{class:"my-[.5em]"},null,-1)),e("div",$a,[e("p",Sa,o(l(n)("billing.tax"))+" ("+o(y.value)+"%)",1),e("p",Fa,"$"+o(re(le.value.tax)),1)]),$[14]||($[14]=e("div",{class:"my-[3.5em]"},null,-1)),e("div",Pa,[e("p",Ta,o(l(n)("billing.total")),1),e("p",Ba,"$"+o(re(le.value.total)),1)])]),e("p",{onClick:H,class:X([{"opacity-50 cursor-not-allowed":C.value},"text-[15em] text-center text-white pt-[.85em] pb-[.85em] cursor-pointer anim-hover-1"])},o(C.value?l(n)("billing.creating"):l(n)("general.create")),3)],4)],4))}},Ea=pe(La,[["__scopeId","data-v-061c01f9"]]),Oa={class:"w-full h-[69em] absolute bottom-0 flex items-start justify-center"},Na={key:0,class:"w-full h-full flex items-start justify-center"},ja={key:0,class:"w-[90%] h-[75%] rounded-full overflow-hidden relative z-[101] flex items-center gap-x-[10em]"},za={class:"absolute inset-0 py-[5em] px-[5px] pointer-events-none"},Ra={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},Ma={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"18",viewBox:"0 0 20 18",fill:"none"},Aa=["fill"],Da={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},Ha={xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},Ga=["fill"],Va=["fill"],Za={class:"flex-1 flex items-center pl-[16em] pr-[1em]"},Ua={class:"w-[20em] h-full flex items-center justify-center"},Ja=["src"],Ya=["placeholder"],Xa=["src"],qa=["src"],Wa={key:1,class:"w-[90%] h-[75%] rounded-full overflow-hidden relative z-[101] flex items-center gap-x-[10em]"},Ka={class:"absolute inset-0 py-[5em] px-[5px] pointer-events-none"},Qa={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},e2={class:"h-[34%]",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t2=["fill"],l2={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},s2={class:"h-[34%]",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i2=["fill"],n2={key:2,class:"w-[90%] h-[75%] rounded-full overflow-hidden relative z-[101] flex items-center gap-x-[10em]"},a2={class:"absolute inset-0 py-[5em] px-[5px] pointer-events-none"},o2={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},r2={class:"h-[34%]",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c2=["fill"],u2={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},d2={class:"h-[34%]",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f2=["fill"],g2={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},m2={class:"h-[34%]",viewBox:"0 0 17 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v2=["fill"],p2={class:"flex-1 flex items-center pl-[16em] pr-[1em]"},h2={class:"w-[20em] h-full flex items-center justify-center"},C2=["src"],b2=["placeholder"],x2=["src"],y2=["src"],_2={__name:"NavBar",setup(M){const n=I(!1),t=I(""),i=ee(),{general:s}=Se(i),f=I(null),{t:c}=ce(),_=E(()=>{var T,x;return s.value.page==="employee"?i.general.isBoss?!0:(x=(T=i.general.employeePermissions)==null?void 0:T.can_create_invoices)!=null?x:!1:!0}),w=()=>{_.value&&i.setGeneralPage("createnewbill")},g=()=>{n.value=!n.value,n.value?setTimeout(()=>{var T;(T=f.value)==null||T.focus()},300):(t.value="",i.setSearchQuery(""))},b=()=>{n.value=!1,t.value="",i.setSearchQuery("")};return se(t,T=>{i.setSearchQuery(T)}),se(()=>s.value.page,()=>{b()}),se(()=>s.value.category,()=>{b()}),(T,x)=>{const N=je("motion");return a(),u("div",Oa,[e("div",{class:"absolute w-full h-[240em] left-0 bottom-0 pointer-events-none z-[100] transition-opacity duration-200",style:ge([{transform:"rotate(180deg)"},{background:"linear-gradient(180deg, #ADADAD 0%, rgba(173, 173, 173, 0.45) 53.38%, rgba(173, 173, 173, 0.00) 65.27%)",opacity:l(i).general.gradientOpacity}])},null,4),l(i).admin.page!="business_commission"?(a(),u("div",Na,[l(i).admin.page=="settings"?(a(),u("div",ja,[e("div",{class:X([n.value?"w-0 opacity-0":"w-[50%] opacity-100","h-full rounded-full bg-white flex transition-all duration-300 relative"])},[e("div",za,[e("div",{class:"h-full w-[41%] bg-[#0000000D] rounded-full transition-transform duration-250 ease-in-out",style:ge({transform:l(i).general.category==="business"?"translateX(10%)":"translateX(136%)"})},null,4)]),e("div",{class:"w-[50%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[0]||(x[0]=m=>{l(i).setGeneralCategory("business")})},[e("div",Ra,[(a(),u("svg",Ma,[e("path",{d:"M0.00447385 9.02347C0.361011 9.38729 0.848412 9.82857 1.486 10.274C2.89339 11.2572 4.98969 12.248 7.89372 12.5585C8.16359 13.3832 8.93927 13.9791 9.8542 13.9791C10.7688 13.9791 11.5429 13.3829 11.8128 12.5585C14.7178 12.2482 16.8147 11.2574 18.2224 10.274C18.8591 9.82912 19.3456 9.38793 19.702 9.02438C19.7053 9.41122 19.7084 9.82372 19.7084 10.2623V10.8264C19.7084 12.2944 19.7084 13.4665 19.5848 14.3856C19.4571 15.3354 19.1858 16.1175 18.567 16.7363C17.9482 17.3551 17.166 17.6264 16.2162 17.7542C15.2972 17.8777 14.125 17.8777 12.657 17.8777H7.05045C5.58265 17.8777 4.41107 17.8776 3.49211 17.7542C2.54229 17.6265 1.7602 17.355 1.14135 16.7363C0.522491 16.1175 0.25125 15.3354 0.12353 14.3856C-3.61974e-05 13.4665 -1.78868e-05 12.2945 4.46582e-07 10.8264V10.2623C-8.72009e-06 9.82335 0.00117384 9.41067 0.00447385 9.02347ZM10.5417 11.9166C10.5417 12.2962 10.2337 12.604 9.8542 12.6041C9.47451 12.6041 9.1667 12.2963 9.1667 11.9166V11.2291H10.5417V11.9166ZM9.8542 1.32333e-06C10.4833 1.32333e-06 11.0073 -0.000869629 11.4297 0.0420762C11.8635 0.0862412 12.2664 0.182794 12.6292 0.425215C12.9044 0.609108 13.1409 0.845599 13.3248 1.12077C13.5672 1.4837 13.6638 1.88641 13.708 2.32031C13.7342 2.5787 13.7418 2.87502 13.7455 3.21013C14.7186 3.21634 15.5361 3.24059 16.2153 3.33187C17.1651 3.45956 17.9473 3.73101 18.5661 4.34969C19.2565 5.04018 19.5138 5.93399 19.6224 7.03703C19.6379 7.19493 19.5985 7.35348 19.5105 7.48548L19.5016 7.49712C19.4119 7.6118 19.1717 7.91888 19.019 8.0826C18.7022 8.42213 18.2247 8.87148 17.5653 9.33229C16.3393 10.1886 14.496 11.0764 11.9158 11.3903V11C11.9158 10.3672 11.4027 9.85415 10.7699 9.85415H8.93661C8.30402 9.85442 7.79077 10.3674 7.79077 11V11.3903C5.21067 11.0763 3.36707 10.1886 2.14128 9.33229C1.48179 8.87148 1.00421 8.42213 0.6875 8.0826C0.529045 7.91265 0.276926 7.58897 0.196039 7.48548C0.108204 7.35357 0.068668 7.19482 0.0841414 7.03703C0.192629 5.93411 0.450176 5.04015 1.14046 4.34969C1.75921 3.73094 2.54155 3.45962 3.49121 3.33187C4.17043 3.24056 4.98808 3.21634 5.96102 3.21013C5.96472 2.875 5.97413 2.57871 6.00041 2.32031C6.04456 1.88636 6.14106 1.48373 6.38354 1.12077C6.56744 0.84559 6.8039 0.609099 7.0791 0.425215C7.44201 0.182849 7.84477 0.0862137 8.27863 0.0420762C8.70112 -0.000851295 9.225 1.32333e-06 9.8542 1.32333e-06ZM9.8542 1.375C9.1964 1.375 8.7541 1.37569 8.41741 1.40992C8.09245 1.44299 7.94209 1.50201 7.84269 1.56836C7.71766 1.65192 7.61026 1.75934 7.5267 1.88437C7.46028 1.98376 7.40134 2.13392 7.36824 2.45907C7.34756 2.66237 7.34035 2.90401 7.33691 3.20833H12.3705C12.3671 2.90403 12.3607 2.66236 12.3401 2.45907C12.307 2.13407 12.248 1.98376 12.1816 1.88437C12.0981 1.75935 11.9907 1.65193 11.8656 1.56836C11.7663 1.50198 11.6158 1.44302 11.291 1.40992C10.9542 1.37566 10.512 1.37501 9.8542 1.375Z",fill:l(i).general.category=="business"?"#FF883E":"#000000"},null,8,Aa)])),e("p",{class:X([l(i).general.category=="business"?"!text-[#FF883E]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.business")),3)])]),e("div",{class:"w-[50%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[1]||(x[1]=m=>{l(i).setGeneralCategory("citizen")})},[e("div",Da,[(a(),u("svg",Ha,[e("path",{d:"M6.1875 7.33203C6.1875 4.67416 8.34213 2.51953 11 2.51953C13.6579 2.51953 15.8125 4.67416 15.8125 7.33203C15.8125 9.98991 13.6579 12.1445 11 12.1445C8.34213 12.1445 6.1875 9.98991 6.1875 7.33203Z",fill:l(i).general.category=="citizen"?"#3E5FFF":"black"},null,8,Ga),e("path",{d:"M3.89551 18.7917C3.89551 14.8681 7.07615 11.6875 10.9997 11.6875C14.9232 11.6875 18.1038 14.8681 18.1038 18.7917C18.1038 19.1713 17.796 19.4792 17.4163 19.4792H4.58301C4.20332 19.4792 3.89551 19.1713 3.89551 18.7917Z",fill:l(i).general.category=="citizen"?"#3E5FFF":"black"},null,8,Va)])),e("p",{class:X([l(i).general.category=="citizen"?"!text-[#3E5FFF]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.citizen")),3)])])],2),e("div",{class:X(["h-full rounded-full bg-white flex items-center justify-between cursor-pointer transition-all duration-300 ease-out absolute right-0",n.value?"w-full":"w-[50em] aspect-square"])},[W(e("div",Za,[e("div",Ua,[e("img",{src:l(K)["call/searchwhite.svg"],class:"h-[35%] transition-opacity duration-300 absolute",alt:"Search"},null,8,Ja)]),W(e("input",{ref_key:"searchInput",ref:f,"onUpdate:modelValue":x[2]||(x[2]=m=>t.value=m),type:"text",placeholder:l(c)("billing.searchInvoices"),class:"w-full h-full border-none outline-none bg-transparent text-[11.5em] font-[400] text-black placeholder:text-black/50",onKeyup:He(b,["escape"]),style:{"line-height":"normal","letter-spacing":"-0.23px","margin-left":"1em"}},null,40,Ya),[[he,t.value]])],512),[[_e,n.value]]),e("div",{class:"min-w-[50em] w-[50em] h-full rounded-full flex items-center justify-center relative transition-all duration-300 hover:opacity-80",onClick:g},[W(e("img",{src:l(K)["call/searchwhite.svg"],class:"h-[32%] transition-opacity duration-300 absolute brightness-[0.3] group-hover:brightness-0 group-hover:invert",alt:"Search"},null,8,Xa),[[_e,!n.value]]),W(e("img",{src:l(K)["call/closewhite.svg"],class:"h-[32%] brightness-[0.3]",alt:""},null,8,qa),[[_e,n.value]])])],2)])):l(s).page=="authorizedcitizen"?(a(),u("div",Wa,[e("div",{class:X(["h-full rounded-full bg-white flex transition-all duration-300 relative",n.value?"w-0 opacity-0":"w-[50%] opacity-100"])},[e("div",Ka,[e("div",{class:"w-[41%] h-full bg-[#0000000D] rounded-full transition-transform duration-250 ease-in-out",style:ge({transform:l(i).general.category==="unpaid"?"translateX(10%)":"translateX(136%)"})},null,4)]),e("div",{class:"w-[50%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[3]||(x[3]=m=>{l(i).setGeneralCategory("unpaid")})},[e("div",Qa,[(a(),u("svg",e2,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.85417 0C4.41186 0 0 4.41186 0 9.85417C0 15.2965 4.41186 19.7083 9.85417 19.7083C15.2965 19.7083 19.7083 15.2965 19.7083 9.85417C19.7083 4.41186 15.2965 0 9.85417 0ZM10.7708 6.1875C10.7708 5.68124 10.3604 5.27083 9.85417 5.27083C9.34789 5.27083 8.9375 5.68124 8.9375 6.1875V9.85417C8.9375 10.0973 9.03412 10.3305 9.20599 10.5023L11.0393 12.3357C11.3973 12.6936 11.9777 12.6936 12.3357 12.3357C12.6936 11.9777 12.6936 11.3973 12.3357 11.0393L10.7708 9.47448V6.1875Z",fill:l(i).general.category=="unpaid"?"#FF883E":"#00000080"},null,8,t2)])),e("p",{class:X([l(i).general.category=="unpaid"?"!text-[#FF883E]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.unpaid")),3)])]),e("div",{class:"w-[50%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[4]||(x[4]=m=>{l(i).setGeneralCategory("paid")})},[e("div",l2,[(a(),u("svg",s2,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.85417 19.7083C4.41186 19.7083 0 15.2965 0 9.85417C0 4.41186 4.41186 0 9.85417 0C15.2965 0 19.7083 4.41186 19.7083 9.85417C19.7083 15.2965 15.2965 19.7083 9.85417 19.7083ZM14.225 7.691C14.5492 7.30207 14.4966 6.72406 14.1077 6.39996C13.7187 6.07586 13.1407 6.1284 12.8167 6.51733L8.8759 11.2462L6.83568 9.20599C6.4777 8.84803 5.8973 8.84803 5.53932 9.20599C5.18134 9.56395 5.18134 10.1444 5.53932 10.5023L8.28933 13.2523C8.47147 13.4345 8.72172 13.5316 8.97902 13.5199C9.23633 13.5082 9.47687 13.3888 9.64168 13.191L14.225 7.691Z",fill:l(i).general.category=="paid"?"#3E5FFF":"#00000080"},null,8,i2)])),e("p",{class:X([l(i).general.category=="paid"?"!text-[#3E5FFF]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.paid")),3)])])],2),W((a(),u("div",{onClick:w,class:X(["h-full w-[50em] aspect-square rounded-full bg-[#3E5FFF] flex items-center justify-center cursor-pointer transition-all duration-300 ease-out absolute right-0",_.value?"hover:bg-[#2E4FEF]":"opacity-50 cursor-not-allowed"]),initial:{opacity:0,scale:.8},enter:{opacity:1,scale:1,transition:{delay:200,duration:300,type:"spring",stiffness:200,damping:15}}},x[9]||(x[9]=[e("svg",{class:"w-[20em] h-[20em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M14.6682 25.3346V17.3346H6.66683C5.93046 17.3346 5.3335 16.7376 5.3335 16.0012C5.3335 15.265 5.93046 14.6679 6.66683 14.6679H14.6682V6.66536C14.6682 5.92899 15.2651 5.33203 16.0015 5.33203C16.7379 5.33204 17.3348 5.92899 17.3348 6.66536V14.6679H25.3362L25.4728 14.6744C26.145 14.743 26.6695 15.3111 26.6695 16.0012C26.6695 16.6915 26.145 17.2596 25.4728 17.3282L25.3362 17.3346H17.3348V25.3346C17.3348 26.071 16.7379 26.6679 16.0015 26.6679C15.2651 26.6679 14.6682 26.071 14.6682 25.3346Z",fill:"white"})],-1)]),2)),[[N]])])):(a(),u("div",n2,[e("div",{class:X(["h-full rounded-full bg-white flex transition-all duration-300 relative",n.value?"w-0 opacity-0":"w-[78%] opacity-100"])},[e("div",a2,[e("div",{class:X([l(i).general.category==="unpaid"||l(i).general.category==="taxes"?"w-[30%]":"w-[33%]","h-full bg-[#0000000D] rounded-full transition-transform duration-250 ease-in-out"]),style:ge({transform:l(i).general.category==="unpaid"?"translateX(3%)":l(i).general.category==="paid"?"translateX(100%)":l(i).general.category==="taxes"?"translateX(228%)":"translateX(0%)"})},null,6)]),e("div",{class:"w-[33%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[5]||(x[5]=m=>{l(i).setGeneralCategory("unpaid")})},[e("div",o2,[(a(),u("svg",r2,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.85417 0C4.41186 0 0 4.41186 0 9.85417C0 15.2965 4.41186 19.7083 9.85417 19.7083C15.2965 19.7083 19.7083 15.2965 19.7083 9.85417C19.7083 4.41186 15.2965 0 9.85417 0ZM10.7708 6.1875C10.7708 5.68124 10.3604 5.27083 9.85417 5.27083C9.34789 5.27083 8.9375 5.68124 8.9375 6.1875V9.85417C8.9375 10.0973 9.03412 10.3305 9.20599 10.5023L11.0393 12.3357C11.3973 12.6936 11.9777 12.6936 12.3357 12.3357C12.6936 11.9777 12.6936 11.3973 12.3357 11.0393L10.7708 9.47448V6.1875Z",fill:l(i).general.category=="unpaid"?"#FF883E":"#00000080"},null,8,c2)])),e("p",{class:X([l(i).general.category=="unpaid"?"!text-[#FF883E]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.unpaid")),3)])]),e("div",{class:"w-[33%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[6]||(x[6]=m=>{l(i).setGeneralCategory("paid")})},[e("div",u2,[(a(),u("svg",d2,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.85417 19.7083C4.41186 19.7083 0 15.2965 0 9.85417C0 4.41186 4.41186 0 9.85417 0C15.2965 0 19.7083 4.41186 19.7083 9.85417C19.7083 15.2965 15.2965 19.7083 9.85417 19.7083ZM14.225 7.691C14.5492 7.30207 14.4966 6.72406 14.1077 6.39996C13.7187 6.07586 13.1407 6.1284 12.8167 6.51733L8.8759 11.2462L6.83568 9.20599C6.4777 8.84803 5.8973 8.84803 5.53932 9.20599C5.18134 9.56395 5.18134 10.1444 5.53932 10.5023L8.28933 13.2523C8.47147 13.4345 8.72172 13.5316 8.97902 13.5199C9.23633 13.5082 9.47687 13.3888 9.64168 13.191L14.225 7.691Z",fill:l(i).general.category=="paid"?"#3E5FFF":"#00000080"},null,8,f2)])),e("p",{class:X([l(i).general.category=="paid"?"!text-[#3E5FFF]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.paid")),3)])]),e("div",{class:"w-[33%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:x[7]||(x[7]=m=>{l(i).setGeneralCategory("taxes")})},[e("div",g2,[(a(),u("svg",m2,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.90486 4.77958e-07H6.13681C4.88353 -1.78554e-05 3.87271 -3.61701e-05 3.07758 0.107837C2.25135 0.219927 1.55614 0.45981 1.00464 1.0163C0.45399 1.57194 0.217398 2.2709 0.106711 3.10165C-2.5666e-05 3.90274 -1.65143e-05 4.92162 1.81903e-06 6.18725V15.9966C-3.48476e-05 16.6462 -7.15889e-05 17.2057 0.0594934 17.6338C0.120562 18.0728 0.268099 18.5723 0.738698 18.8755C1.43399 19.3232 2.20459 19.0132 2.63733 18.7868C2.88515 18.6572 3.58434 18.1835 3.77755 18.0507C4.02762 17.893 4.16607 17.809 4.26975 17.7603C4.28963 17.739 4.35527 17.7106 4.45871 17.7675C4.5634 17.8199 4.69715 17.9033 4.93081 18.0507L6.70698 19.1708C6.92203 19.3065 7.12571 19.435 7.30941 19.5256C7.51447 19.6268 7.74648 19.7083 8.02083 19.7083C8.29519 19.7083 8.5272 19.6268 8.73226 19.5256C8.91587 19.435 9.11955 19.3066 9.33451 19.171L11.1109 18.0507C11.361 17.893 11.4994 17.809 11.6031 17.7603C11.6261 17.7408 11.696 17.7149 11.792 17.7675C11.8572 17.8001 12.1141 17.9688 12.3553 18.127C12.5017 18.2231 12.6422 18.3153 12.7305 18.371C12.9236 18.5037 13.1566 18.6572 13.4043 18.7868C13.8371 19.0132 14.6077 19.3232 15.303 18.8755C15.7735 18.5723 15.9211 18.0728 15.9822 17.6338C16.0418 17.2057 16.0417 16.6462 16.0417 15.9966V6.18731C16.0417 4.92165 16.0417 3.90275 15.935 3.10165C15.8242 2.2709 15.5876 1.57194 15.037 1.0163C14.4855 0.45981 13.7903 0.219927 12.9641 0.107837C12.1689 -3.61701e-05 11.1581 -1.78554e-05 9.90486 4.77958e-07ZM8.02083 8.9375C8.02083 9.44378 7.61044 9.85417 7.10417 9.85417H4.35417C3.84791 9.85417 3.4375 9.44378 3.4375 8.9375C3.4375 8.43123 3.84791 8.02083 4.35417 8.02083H7.10417C7.61044 8.02083 8.02083 8.43123 8.02083 8.9375ZM9.85417 6.1875C10.3604 6.1875 10.7708 5.7771 10.7708 5.27083C10.7708 4.76458 10.3604 4.35417 9.85417 4.35417H4.35417C3.84791 4.35417 3.4375 4.76458 3.4375 5.27083C3.4375 5.7771 3.84791 6.1875 4.35417 6.1875H9.85417Z",fill:l(i).general.category=="taxes"?"#1CB903":"#00000080"},null,8,v2)])),e("p",{class:X([l(i).general.category=="taxes"?"!text-[#1CB903]":"","text-[8em] font-['SFPRO'] text-black/70 font-[400] leading-[100%] mt-[0.8em] fixtext"])},o(l(c)("billing.taxes")),3)])])],2),l(s).page=="employee"||l(s).page=="admin"||l(s).page=="authorizedcitizen"?W((a(),u("div",{key:0,onClick:w,class:X(["h-full w-[50em] aspect-square rounded-full bg-[#3E5FFF] flex items-center justify-center cursor-pointer transition-all duration-300 ease-out absolute right-0",_.value?"hover:bg-[#2E4FEF]":"opacity-50 cursor-not-allowed"]),initial:{opacity:0,scale:.8},enter:{opacity:1,scale:1,transition:{delay:200,duration:300,type:"spring",stiffness:200,damping:15}}},x[10]||(x[10]=[e("svg",{class:"w-[20em] h-[20em]",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},[e("path",{d:"M14.6682 25.3346V17.3346H6.66683C5.93046 17.3346 5.3335 16.7376 5.3335 16.0012C5.3335 15.265 5.93046 14.6679 6.66683 14.6679H14.6682V6.66536C14.6682 5.92899 15.2651 5.33203 16.0015 5.33203C16.7379 5.33204 17.3348 5.92899 17.3348 6.66536V14.6679H25.3362L25.4728 14.6744C26.145 14.743 26.6695 15.3111 26.6695 16.0012C26.6695 16.6915 26.145 17.2596 25.4728 17.3282L25.3362 17.3346H17.3348V25.3346C17.3348 26.071 16.7379 26.6679 16.0015 26.6679C15.2651 26.6679 14.6682 26.071 14.6682 25.3346Z",fill:"white"})],-1)]),2)),[[N]]):W((a(),u("div",{key:1,class:X(["h-full rounded-full bg-white flex items-center justify-between cursor-pointer transition-all duration-300 ease-out absolute right-0",n.value?"w-full":"w-[50em] aspect-square"]),initial:{opacity:0,scale:.8},enter:{opacity:1,scale:1,transition:{delay:200,duration:300,type:"spring",stiffness:200,damping:15}}},[W(e("div",p2,[e("div",h2,[e("img",{src:l(K)["call/searchwhite.svg"],class:"h-[35%] transition-opacity duration-300 absolute",alt:"Search"},null,8,C2)]),W(e("input",{ref_key:"searchInput",ref:f,"onUpdate:modelValue":x[8]||(x[8]=m=>t.value=m),type:"text",placeholder:l(c)("billing.searchInvoices"),class:"w-full h-full border-none outline-none bg-transparent text-[11.5em] font-[400] text-black placeholder:text-black/50",onKeyup:He(b,["escape"]),style:{"line-height":"normal","letter-spacing":"-0.23px","margin-left":"1em"}},null,40,b2),[[he,t.value]])],512),[[_e,n.value]]),e("div",{class:"min-w-[50em] w-[50em] h-full rounded-full flex items-center justify-center relative transition-all duration-300 hover:opacity-80",onClick:g},[W(e("img",{src:l(K)["call/searchwhite.svg"],class:"h-[32%] transition-opacity duration-300 absolute brightness-[0.3]",alt:"Search"},null,8,x2),[[_e,!n.value]]),W(e("img",{src:l(K)["call/closewhite.svg"],class:"h-[32%] brightness-[0.3]",alt:""},null,8,y2),[[_e,n.value]])])],2)),[[N]])]))])):A("",!0)])}}},w2={class:"w-full rounded-[44em] bg-[#F2F2F7] h-full relative"},k2={key:0,class:"navbar-wrapper"},I2={__name:"BillingApp",setup(M){const n=ee(),t=ze(),i=me(),{networkSignal:s,appConfig:f}=Se(i),c=I([{key:"citizen"},{key:"employee"},{key:"admin"},{key:"createnewbill"},{key:"authorizedcitizen"}]),_=E(()=>{var b,T,x;const g=((x=(T=(b=f.value)==null?void 0:b.TowerConfig)==null?void 0:T.AppRequirements)==null?void 0:x.billing)||2;return s.value>=g}),w=()=>R(this,null,function*(){try{const g=yield j("BILLING_CHECK_JOB_AUTH",{});if(g.success&&(n.setIsAuthorizedJob(g.authorized),n.setIsBoss(g.is_boss||!1),g.authorized&&g.job_name&&g.job_label&&(n.setJobInfo(g.job_name,g.job_label),!g.is_boss)))try{const b=yield j("BILLING_GET_MY_PERMISSIONS",{});b.success&&b.permissions&&n.setEmployeePermissions(b.permissions)}catch(b){console.error("Error fetching employee permissions:",b)}}catch(g){console.error("Error checking job authorization:",g)}});return ae(()=>{w()}),se(()=>{var g,b,T;return{jobName:(g=t.JobData)==null?void 0:g.name,isBossJobby:(T=(b=t.JobData)==null?void 0:b.grade)==null?void 0:T.isboss,isBossBilling:n.general.isBoss}},(g,b)=>{if(b){const T=g.jobName!==b.jobName,x=g.isBossBilling||g.isBossJobby,N=b.isBossBilling||b.isBossJobby,m=x!==N;n.general.page==="employee"&&(T&&b.jobName?(n.setGeneralPage("citizen"),n.setEmployeePage("main"),n.cache.employees={data:[],lastFetch:null,isInitialized:!1,jobName:null}):!T&&m&&!x&&n.employee.page==="business_settings"&&n.setEmployeePage("main"))}},{deep:!0}),(g,b)=>(a(),u("div",w2,[_.value?(a(),u(ne,{key:1},[Q(Pe,{"current-key":l(n).general.page,items:c.value,duration:300,easing:"ease-in-out"},{citizen:J(()=>[l(n).general.page=="citizen"?(a(),V(Ll,{key:0})):A("",!0)]),employee:J(()=>[l(n).general.page=="employee"?(a(),V(As,{key:0})):A("",!0)]),admin:J(()=>[l(n).general.page=="admin"?(a(),V(Pn,{key:0})):A("",!0)]),createnewbill:J(()=>[l(n).general.page=="createnewbill"?(a(),V(Ea,{key:0})):A("",!0)]),authorizedcitizen:J(()=>[l(n).general.page=="authorizedcitizen"?(a(),V(Qn,{key:0})):A("",!0)]),_:1},8,["current-key","items"]),Q(be,{name:"fade-navbar"},{default:J(()=>[l(n).citizen.page!="invoicedetails"&&l(n).admin.page!="invoicedetails"&&l(n).admin.page!="taxdetails"&&l(n).employee.page!="business_settings"&&l(n).employee.page!="invoicedetails"&&l(n).general.page!="createnewbill"?(a(),u("div",k2,[Q(_2)])):A("",!0)]),_:1})],64)):(a(),V(s1,{key:0}))]))}},N2=pe(I2,[["__scopeId","data-v-5d3b2577"]]);export{N2 as default};
|