import{a as _}from"./asyncComputed.15a1493f.js";import{d as w,eb 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 l,ed as C,bR as x,de as c,e as N}from"./jwt-decode.esm.95147216.js";import{l as g,c as v}from"./router.09c25b35.js";import{a as z}from"./organization.21f2f03d.js";import"./tables.7fcaf771.js";import{L as B}from"./LoadingContainer.b38f89e0.js";import"./index.574c12ce.js";import"./record.44df96f2.js";import"./string.c6b418fe.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]="08d0e14f-4174-4bf4-8d64-2a0d465dac27",a._sentryDebugIdIdentifier="sentry-dbid-08d0e14f-4174-4bf4-8d64-2a0d465dac27")}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(c),{justify:"space-between",align:"center"},{default:t(()=>[o(e(f),{level:3},{default:t(()=>[l("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:t(()=>[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:t(()=>[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:t(()=>[o(e(f),{level:4},{default:t(()=>[l("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{O as default};
//# sourceMappingURL=Billing.885ed8b9.js.map
