1import{_ as u,e as m,a as y,u as x}from"./VueFinalModal.esm-DFl72DMY.js";import{f as g}from"./formatDate-C1YYpkoX.js";import{q as e,t as c,F as a,s as t,I as h,k as s,y as p,u as d}from"./charts-D6UZp-Tt.js";const _={data(){return{site:null,invoices:null}},created(){this.site=this.adminStore.getCurrSite},mounted(){this.site.subscription!=null&&this.site.subscription.id!==0&&this.getInvoices()},computed:{...m(x)},methods:{formatDate:g,async getInvoices(){const n=await y("/site/billing/invoices",{siteId:this.adminStore.getCurrSite.id},this.adminStore.getToken);n&&n.body&&n.body.data?this.invoices=n.body.data:this.invoices=[]}}},b={key:0,class:"w-full"},f={key:0,"data-testid":"billing-invoices-free-state",class:"rounded border border-gray-200 bg-white p-5 text-sm text-gray-600"},v={key:0,"data-testid":"billing-invoices-loading",class:"rounded border border-gray-200 bg-white p-5 text-sm text-gray-600"},k={key:0,"data-testid":"billing-invoices-empty-state",class:"rounded border border-gray-200 bg-white p-8 text-center text-sm text-gray-600"},D={class:"mt-4 overflow-hidden rounded border border-gray-200 bg-white"},w={"data-testid":"billing-invoices-table",class:"w-full text-left text-sm"},S={class:"divide-y divide-gray-100 text-gray-800"},Y={class:"px-4 py-3"},I={class:"px-4 py-3"},F={class:"font-medium text-gray-900"},M={class:"px-4 py-3"},B={key:0,class:"rounded bg-green-50 px-2 py-1 text-xs font-medium text-green-700"},C={key:1,class:"rounded bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600"},N={class:"px-4 py-3 text-right"},P=["href"];function T(n,o,V,A,r,l){return r.site!=null?(s(),e("div",b,[r.site.subscription==null||r.site.subscription.id===0?(s(),e("div",f," Invoices will appear here after this site is on a paid plan. ")):(s(),e(a,{key:1},[r.invoices==null?(s(),e("div",v," Loading invoices... ")):(s(),e(a,{key:1},[r.invoices.length==0?(s(),e("div",k," There are no invoices yet. ")):(s(),e(a,{key:1},[o[3]||(o[3]=t("div",{class:"text-sm text-gray-600"}," Your 10 most recent invoices. ",-1)),t("div",D,[t("table",w,[o[2]||(o[2]=t("thead",{class:"bg-gray-50 text-gray-500"},[t("tr",null,[t("th",{class:"px-4 py-3 font-medium"},"Period"),t("th",{class:"px-4 py-3 font-medium"},"Amount"),t("th",{class:"px-4 py-3 font-medium"},"Status"),t("th",{class:"px-4 py-3 font-medium text-right"},"Invoice")])],-1)),t("tbody",S,[(s(!0),e(a,null,h(r.invoices,i=>(s(),e("tr",{key:i.id||i.period_start},[t("td",Y,[p(d(l.formatDate(i.period_start,"unix-seconds","YYYY-MM-DD"))+" ",1),o[0]||(o[0]=t("span",{class:"mx-2 text-gray-400"},"to",-1)),p(" "+d(l.formatDate(i.period_end,"unix-seconds","YYYY-MM-DD")),1)]),t("td",I,[t("span",F,"$"+d((i.amount_paid/100).toFixed(2)),1),o[1]||(o[1]=t("span",{class:"ml-1 text-xs text-gray-400"},"USD",-1))]),t("td",M,[i.status==="paid"?(s(),e("span",B,"Paid")):(s(),e("span",C,d(i.status),1))]),t("td",N,[i.invoice_pdf!=null?(s(),e("a",{key:0,href:i.invoice_pdf,target:"_blank",class:"font-medium text-blue-600 hover:text-blue-700 hover:underline"}," Download PDF ",8,P)):c("",!0)])]))),128))])])])],64))],64))],64))])):c("",!0)}const G=u(_,[["render",T]]);export{G as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.