"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=(e,c,i=!1)=>new Promise((n,a)=>{fetch(e,{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(c)}).then(function(t){t.status!==200&&a(t),i&&n(t.blob()),t.json().then(function(o){n(o)}).catch(()=>n(t.status))}).catch(function(t){a(t)})}),p=async(e,c={},i=!1)=>{try{const{headers:n,...a}=c,t=await fetch(e,{headers:{Accept:"application/json","Content-Type":"application/json",...n},...a});if(!t.ok)throw t;const o=await t.json();if(i){const s={};return t.headers.forEach((r,h)=>{s[h]=r}),{data:o,meta:s}}return o}catch(n){throw n}};exports.get=p;exports.post=f;
