import{a as _}from"./asyncComputed.51381bdd.js";import{d as b,ec as w,k as h,u as e,a as d,a4 as k,f as o,b as a,h as I,o as n,A as f,g as l,ea as C,bQ as x,db as c,e as N}from"./jwt-decode.esm.ea959866.js";import{n as g,c as v}from"./router.1aba945d.js";import{a as z}from"./organization.ac21adf7.js";import"./tables.7de2b283.js";import{L as B}from"./LoadingContainer.7c7a251a.js";import"./record.c2cb775d.js";import"./string.07f8f578.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7f2318ec-8c76-4b6a-9d17-1a2eaa463abd",t._sentryDebugIdIdentifier="sentry-dbid-7f2318ec-8c76-4b6a-9d17-1a2eaa463abd")}catch{}})();const D={key:1},U=["src"],F=b({__name:"Billing",setup(t){const u=w().params.organizationId,{loading:m,result:r}=_(async()=>{const i=await z.get(u),p=await i.getUsageReportUrl();return{organization:i,reportUrl:p}});h(()=>{location.search.includes("upgrade")&&g.showNewMessage("I want to upgrade my plan")});const y=()=>g.showNewMessage("I want to upgrade my plan");return(i,p)=>e(m)?(n(),d(B,{key:0})):e(r)?(n(),k("div",D,[o(e(c),{justify:"space-between",align:"center"},{default:a(()=>[o(e(f),{level:3},{default:a(()=>[l("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:a(()=>[l("Upgrade")]),_:1})]),_:1}),o(e(v),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),d(e(c),{key:0,align:"center",justify:"center"},{default:a(()=>[N("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,U)]),_:1})):(n(),d(e(c),{key:1,align:"center",justify:"center"},{default:a(()=>[o(e(f),{level:4},{default:a(()=>[l("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{F as default};
//# sourceMappingURL=Billing.e7f95ade.js.map
