import{a as _}from"./asyncComputed.d84da1aa.js";import{d as b,ec as w,X as h,u as e,o as n,c as d,Y as k,b as o,w as a,S as C,dd as f,aG as l,ea as I,bT as x,dh as c,a as N}from"./index.97914b50.js";import"./gateway.f03e4b27.js";import{a as v}from"./organization.b5dce294.js";import"./tables.ef28572a.js";import{C as m}from"./router.25b634fb.js";import{L as z}from"./LoadingContainer.1cbd28bb.js";import{A as B}from"./index.0b2fdcf7.js";import"./popupNotifcation.f5d6fec9.js";import"./record.a76b6b89.js";import"./string.8b027234.js";import"./Badge.d34a57fa.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]="ba52ae7d-114f-44b9-bb16-ddaef64ca36a",t._sentryDebugIdIdentifier="sentry-dbid-ba52ae7d-114f-44b9-bb16-ddaef64ca36a")}catch{}})();const D={key:1},U=["src"],P=b({__name:"Billing",setup(t){const p=w().params.organizationId,{loading:g,result:r}=_(async()=>{const i=await v.get(p),u=await i.getUsageReportUrl();return{organization:i,reportUrl:u}});h(()=>{location.search.includes("upgrade")&&m.showNewMessage("I want to upgrade my plan")});const y=()=>m.showNewMessage("I want to upgrade my plan");return(i,u)=>e(g)?(n(),d(z,{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: "+I(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:a(()=>[l("Upgrade")]),_:1})]),_:1}),o(e(B),{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}))])):C("",!0)}});export{P as default};
//# sourceMappingURL=Billing.fcf82669.js.map
