import{E as a,b as n}from"./router.8fbd98d9.js";import"./outputWidgets.e822ff0f.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="9706fade-119a-479b-856e-bde2d1cb411c",o._sentryDebugIdIdentifier="sentry-dbid-9706fade-119a-479b-856e-bde2d1cb411c")}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 u{static async get(e){const s=await(await fetch(`${a.cloudApi}/console/${e}`,{headers:{...n.headers}})).text();return s?JSON.parse(s):null}static async getBlob(e){return await(await fetch(`${a.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(`${a.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(`${a.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(`${a.cloudApi}/console/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",...n.headers}});if(!t.ok)throw await r.fromResponse(t)}}export{u as C};
//# sourceMappingURL=gateway.349a9491.js.map
