import{a as _}from"./asyncComputed.3d996402.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 t,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.43a112d3.js";import{l as g,c as v}from"./router.663c6f19.js";import{a as z}from"./organization.a2f9c294.js";import"./tables.e2c76137.js";import{L as B}from"./LoadingContainer.4bbdf540.js";import"./index.919e954c.js";import"./record.dfeaef8c.js";import"./string.9f615d28.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]="71809d1a-3b67-4687-b8cd-5b7afc5fdc55",a._sentryDebugIdIdentifier="sentry-dbid-71809d1a-3b67-4687-b8cd-5b7afc5fdc55")}catch{}})();const D={key:1},U=["src"],O=b({__name:"Billing",setup(a){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: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.00b299ab.js.map
