define(["exports"],function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;function abortableFetch(input,init){var abortError,cancellation,signal=Request&&Request.prototype.isPrototypeOf(input)?input.signal:init?init.signal:void 0;if(signal){try{abortError=new DOMException("Aborted","AbortError")}catch(err){(abortError=new Error("Aborted")).name="AbortError"}return signal.aborted?Promise.reject(abortError):(cancellation=new Promise(function(_,reject){signal.addEventListener("abort",function(){return reject(abortError)},{once:!0})}),init&&init.signal&&delete init.signal,Promise.race([cancellation,realFetch(input,init)]))}return realFetch(input,init)}var fetch=globalThis.fetch,_globalThis$Request=globalThis.Request,NativeRequest=void 0===_globalThis$Request?fetch.Request:_globalThis$Request,realFetch=((Request=function(input,init){init&&init.signal&&(signal=init.signal,delete init.signal);var signal,input=new NativeRequest(input,init);return signal&&Object.defineProperty(input,"signal",{writable:!1,enumerable:!1,configurable:!0,value:signal}),input}).prototype=NativeRequest.prototype,fetch);globalThis.fetch=abortableFetch,globalThis.Request=Request,_exports.default=abortableFetch});