import{a as _}from"./asyncComputed.3a882a5f.js";import{d as b,ea as w,k as h,u as e,a as d,a5 as k,f as o,b as a,h as I,o as n,A as f,g as c,ec as C,bR as x,de as l,e as N}from"./jwt-decode.esm.7c3d38f1.js";import{l as g,c as v}from"./router.3e8ff207.js";import{a as z}from"./organization.ef60f52a.js";import"./tables.910f41a2.js";import{L as B}from"./LoadingContainer.4f07415a.js";import"./index.4934c987.js";import"./record.db662be3.js";import"./string.58b2ae3d.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]="bc0146ee-cf88-4393-b2f8-cdc2a0dad0ba",t._sentryDebugIdIdentifier="sentry-dbid-bc0146ee-cf88-4393-b2f8-cdc2a0dad0ba")}catch{}})();const D={key:1},U=["src"],O=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(l),{justify:"space-between",align:"center"},{default:a(()=>[o(e(f),{level:3},{default:a(()=>[c("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:a(()=>[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:a(()=>[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:a(()=>[o(e(f),{level:4},{default:a(()=>[c("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{O as default};
//# sourceMappingURL=Billing.b05a2211.js.map
