import{E as o,a as n}from"./router.88734ca5.js";import"./outputWidgets.c4f3de67.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d693e5f8-a99a-40df-8ac1-ce40cff33e02",a._sentryDebugIdIdentifier="sentry-dbid-d693e5f8-a99a-40df-8ac1-ce40cff33e02")}catch{}})();class r extends Error{constructor(e,t){super(e),this.status=t}static async fromResponse(e){const t=await e.text();return new r(t,e.status)}}class l{static async get(e){const s=await(await fetch(`${o.cloudApi}/console/${e}`,{headers:{...n.headers}})).text();return s?JSON.parse(s):null}static async getBlob(e){return await(await fetch(`${o.cloudApi}/console/${e}`,{headers:{...n.headers}})).blob()}static async post(e,t,s=!0){const c=s?{"Content-Type":"application/json"}:null,i=await fetch(`${o.cloudApi}/console/${e}`,{method:"POST",headers:{...c,...n.headers},body:s?JSON.stringify(t):t});if(!i.ok)throw await r.fromResponse(i);const d=await i.text();return d?JSON.parse(d):null}static async patch(e,t){const s=await fetch(`${o.cloudApi}/console/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json",...n.headers},body:JSON.stringify(t)});if(!s.ok)throw await r.fromResponse(s);const c=await s.text();return c?JSON.parse(c):null}static async delete(e){const t=await fetch(`${o.cloudApi}/console/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",...n.headers}});if(!t.ok)throw await r.fromResponse(t)}}export{l as C};
//# sourceMappingURL=gateway.5578a098.js.map
