import{C as a}from"./router-D3FyrFLh.js";import"./jwt-decode.esm-TBTnMpAQ.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="cfd8b755-de0c-4cbf-90b7-b0bb12c8f616",r._sentryDebugIdIdentifier="sentry-dbid-cfd8b755-de0c-4cbf-90b7-b0bb12c8f616")}catch{}})();class u{urlPath="organizations";async create(t){return a.post(`${this.urlPath}`,t)}async delete(t){await a.delete(`${this.urlPath}/${t}`)}async rename(t,e){await a.patch(`${this.urlPath}/${t}`,{name:e})}async list(){return a.get(`${this.urlPath}`)}async get(t){return a.get(`${this.urlPath}/${t}`)}async getUsageReportUrl(t){return a.get(`${this.urlPath}/${t}/usage-report`)}async getConsumption(t,e,i,c={}){return a.get(`${this.urlPath}/${t}/consumption`,{month:e.toString(),year:i.toString(),endDate:c.endDate?.toISOString()})}async listSkills(t){return a.get(`${this.urlPath}/${t}/skills`)}async upsertSkill(t,e){await a.put(`${this.urlPath}/${t}/skills`,e)}async getMembershipsMetadata(t){return a.get(`${this.urlPath}/${t}/memberships-metadata`,void 0,{redirectOnForbidden:!1})}async updateMembershipsMetadata(t,e){return a.patch(`${this.urlPath}/${t}/memberships-metadata`,e)}}const s=new u;class n{constructor(t){this.dto=t}static async list(){return(await s.list()).map(e=>new n(e))}static async create(t){const e=await s.create({name:t});return new n(e)}static async get(t){const e=await s.get(t);return new n(e)}static async rename(t,e){return s.rename(t,e)}get id(){return this.dto.id}get name(){return this.dto.name}set name(t){this.dto.name=t}get featureFlags(){return this.dto.featureFlags}get billingMetadata(){return this.dto.billingMetadata}get coalescedPlan(){return this.billingMetadata.plan??"No active plan"}get hasUsageReport(){return["Business","Abstra"].includes(this.coalescedPlan)}async getUsageReportUrl(){return s.getUsageReportUrl(this.id)}static async getConsumption(t,e,i,c={}){return s.getConsumption(t,e,i,c)}}export{n as O,u as a};
//# sourceMappingURL=organization-c9JpfAmx.js.map
