import{b as o}from"./router-C9ojQjj-.js";import{l as d}from"./fetch-BGNhONZ3.js";import{E as p}from"./record-D5CgGTou.js";import"./jwt-decode.esm-og2W_mys.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="03e4aa12-dbb2-4abe-807f-18df1b77551a",s._sentryDebugIdIdentifier="sentry-dbid-03e4aa12-dbb2-4abe-807f-18df1b77551a")}catch{}})();class i{record;constructor(t){this.record=p.from(t)}get id(){return this.record.get("id")}get name(){return this.record.get("name")}get description(){return this.record.get("description")||""}set description(t){this.record.set("description",t)}get projectId(){return this.record.get("projectId")}static from(t){return new i(t)}commit(){this.record.commit()}hasChanges(){return this.record.hasChanges()}get changes(){return this.record.changes}update(t){this.record.update(t)}}class h{urlPath="roles";async create(t,e){return o.post(`projects/${t}/${this.urlPath}`,e)}async delete(t,e){await o.delete(`projects/${t}/${this.urlPath}/${e}`)}async list(t,{limit:e,offset:r}){const a={};e&&(a.limit=e.toString()),r&&(a.offset=r.toString());const c=new URLSearchParams(a);return o.get(`projects/${t}/${this.urlPath}?${c.toString()}`)}async update(t,e,r){return o.patch(`projects/${t}/${this.urlPath}/${e}`,r)}}const n=new h;class y{constructor(t){this.projectId=t}async list(t,e){return(await n.list(this.projectId,{limit:t,offset:e})).map(i.from)}async create(t){await n.create(this.projectId,t)}async update(t,e){await n.update(this.projectId,t,e)}async delete(t){await n.delete(this.projectId,t)}}class b{constructor(t=d){this.fetch=t}async list(t,e){const r={};t&&(r.limit=t.toString()),e&&(r.offset=e.toString());const a=new URLSearchParams(r);return(await(await this.fetch(`/_editor/api/roles?${a.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})).json()).map(i.from)}}export{y as C,b as E};
//# sourceMappingURL=repository-BeBNOTO-.js.map
