import{a as _}from"./asyncComputed.aa78e2c1.js";import{d as w,ea as b,k as h,u as e,a as d,a5 as k,f as o,b as t,h as I,o as n,A as f,g as c,ec as C,bR as x,dc as l,e as N}from"./jwt-decode.esm.23ceadb7.js";import{n as g,c as v}from"./router.0114316a.js";import{a as z}from"./organization.3aef6f13.js";import"./tables.2f395e4c.js";import{L as B}from"./LoadingContainer.f9ea3b67.js";import"./index.4e51ce12.js";import"./record.2149946a.js";import"./string.ce2d885c.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[s]="3c885ff2-8069-467e-a48c-476b5de45a6d",a._sentryDebugIdIdentifier="sentry-dbid-3c885ff2-8069-467e-a48c-476b5de45a6d")}catch{}})();const D={key:1},U=["src"],O=w({__name:"Billing",setup(a){const u=b().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(l),{justify:"space-between",align:"center"},{default:t(()=>[o(e(f),{level:3},{default:t(()=>[c("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:t(()=>[c("Upgrade")]),_:1})]),_:1}),o(e(v),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),d(e(l),{key:0,align:"center",justify:"center"},{default:t(()=>[N("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,U)]),_:1})):(n(),d(e(l),{key:1,align:"center",justify:"center"},{default:t(()=>[o(e(f),{level:4},{default:t(()=>[c("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{O as default};
//# sourceMappingURL=Billing.aecdf3a0.js.map
