From 83bbf85277a5592a8042470d8ed43df19178004c Mon Sep 17 00:00:00 2001 From: pacoyang Date: Wed, 7 Feb 2024 11:52:02 +0800 Subject: [PATCH 1/2] feat: polyfill the sidevm quickjs functions --- src/lib/runQuickJs.ts | 11 +++-- src/lib/sandbox-wrappers.ts | 3 +- src/lib/sandbox.ts | 68 +++++++++++++++++------------- src/lib/sidevm-quickjs-bootcode.js | 1 + 4 files changed, 50 insertions(+), 33 deletions(-) create mode 100644 src/lib/sidevm-quickjs-bootcode.js diff --git a/src/lib/runQuickJs.ts b/src/lib/runQuickJs.ts index e69eac6..25b5803 100644 --- a/src/lib/runQuickJs.ts +++ b/src/lib/runQuickJs.ts @@ -201,16 +201,21 @@ export async function runQuickJs( ) { const QuickJS = await getQuickJS() if (options.isAsync) { - const { vm, run, isAsyncProcessRunning } = await createSandbox(QuickJS, {}, {}, { silent: options.silent }) + const { vm, run, isAsyncProcessRunning } = await createSandbox( + QuickJS, + {}, + { scriptArgs: args }, + { silent: options.silent } + ) await run(code) while(isAsyncProcessRunning()) { await new Promise((resolve) => setTimeout(resolve, 100)) } + await new Promise((resolve) => setTimeout(resolve, 100)) + rejectOpenPromises(vm) const output = vm .getProp(vm.global, 'scriptOutput') .consume(vm.dump) - await new Promise((resolve) => setTimeout(resolve, 100)) - rejectOpenPromises(vm) vm.dispose() return output } diff --git a/src/lib/sandbox-wrappers.ts b/src/lib/sandbox-wrappers.ts index c810774..706dac5 100644 --- a/src/lib/sandbox-wrappers.ts +++ b/src/lib/sandbox-wrappers.ts @@ -99,7 +99,8 @@ export function wrapObject( ): any { const vmObject = vm.newObject() - for (const [key, value] of Object.entries(obj)) { + for (const key in obj) { + const value = obj[key] const wrappedValue = wrap(vm, value, obj, beginAsyncProcess, endAsyncProcess) if (wrappedValue !== null) { diff --git a/src/lib/sandbox.ts b/src/lib/sandbox.ts index 32ce808..d126b59 100644 --- a/src/lib/sandbox.ts +++ b/src/lib/sandbox.ts @@ -1,17 +1,22 @@ +import upath from 'upath' +import { readFileSync } from 'node:fs' import { QuickJSWASMModule } from 'quickjs-emscripten' -import { - injectTimingFunctions, - wrap, - wrapObject, -} from './sandbox-wrappers' + +import { injectTimingFunctions, wrap, wrapObject } from './sandbox-wrappers' export default async function createSandbox( QuickJS: QuickJSWASMModule, requireLookup: Record = {}, globals: Record = {}, - options: Record = {}, + options: Record = {} ) { const vm = QuickJS.newContext() + vm.evalCode( + readFileSync( + require.resolve(upath.join(__dirname, 'sidevm-quickjs-bootcode.js')), + 'utf8' + ) + ) let errorState = false let lastError = '' @@ -35,6 +40,12 @@ export default async function createSandbox( const consoleHandle = vm.newObject() const exportsHandle = vm.newObject() + const fetchHandle = vm.newFunction('fetch', (...args) => { + const nativeArgs = args.map(vm.dump) + const result = fetch(nativeArgs[0], nativeArgs[1]) + return wrap(vm, result, {}, beginAsyncProcess, endAsyncProcess) + }) + const logHandle = vm.newFunction('log', (...args) => { const nativeArgs = args.map(vm.dump) console.log(...nativeArgs) @@ -62,14 +73,20 @@ export default async function createSandbox( lastError = JSON.stringify(nativeArgs) errorState = true } catch (e) { - console.log('Error in error:', e) + console.error('Error in error:', e) } }) const globalNames = Object.getOwnPropertyNames(globals) for (let i = 0; i < globalNames.length; i++) { - const globalOption: any = globals[globalNames[i]] - const globalObj = wrap(vm, globalOption.value, globalOption, beginAsyncProcess, endAsyncProcess) + const globalValue: any = globals[globalNames[i]] + const globalObj = wrap( + vm, + globalValue, + undefined, + beginAsyncProcess, + endAsyncProcess + ) vm.setProp(vm.global, globalNames[i], globalObj) globalObj.dispose() @@ -79,8 +96,13 @@ export default async function createSandbox( const requireHandle = vm.newFunction('require', (...args: any) => { const nativeArgs = args.map(vm.dump) - if(requireLookup[nativeArgs[0] as string]) { - const returnObj = wrapObject(vm, requireLookup[nativeArgs[0] as string], beginAsyncProcess, endAsyncProcess) + if (requireLookup[nativeArgs[0] as string]) { + const returnObj = wrapObject( + vm, + requireLookup[nativeArgs[0] as string], + beginAsyncProcess, + endAsyncProcess + ) return returnObj } else { return vm.undefined @@ -108,10 +130,12 @@ export default async function createSandbox( errorHandle.dispose() } + vm.setProp(vm.global, 'fetch', fetchHandle) vm.setProp(vm.global, 'console', consoleHandle) vm.setProp(vm.global, 'require', requireHandle) vm.setProp(vm.global, 'exports', exportsHandle) + fetchHandle.dispose() consoleHandle.dispose() requireHandle.dispose() exportsHandle.dispose() @@ -122,35 +146,21 @@ export default async function createSandbox( return lastError }, isAsyncProcessRunning, - run: (compiled: string): boolean => { + run: (code: string): boolean => { try { errorState = false - const result = vm.evalCode(compiled) + const result = vm.evalCode(code) if (result.error) { - // log out the compiled program with line numbers - const lines = compiled.split('\n') - for (let i = 0; i < lines.length; i++) { - console.log(`${i + 1}: ${lines[i]}`) - } - - console.log('Execution failed:', vm.dump(result.error)) - + console.error('Execution failed:', vm.dump(result.error)) result.error.dispose() return false } else { result.value.dispose() - - if (errorState) { - const lines = compiled.split('\n') - for (let i = 0; i < lines.length; i++) { - console.log(`${i + 1}: ${lines[i]}`) - } - } return !errorState } } catch (e) { - console.log(e) + console.error(e) } return false diff --git a/src/lib/sidevm-quickjs-bootcode.js b/src/lib/sidevm-quickjs-bootcode.js new file mode 100644 index 0000000..f04fe4e --- /dev/null +++ b/src/lib/sidevm-quickjs-bootcode.js @@ -0,0 +1 @@ +(()=>{var e={348:function(e,t,r){!function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function n(){}var o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void 0;function i(e){return"object"==typeof e&&null!==e||"function"==typeof e}var a=n,s=Promise,u=Promise.prototype.then,l=Promise.resolve.bind(s),c=Promise.reject.bind(s);function f(e){return new s(e)}function h(e){return l(e)}function d(e){return c(e)}function p(e,t,r){return u.call(e,t,r)}function v(e,t,r){p(p(e,t,r),void 0,a)}function b(e,t){v(e,t)}function y(e,t){v(e,void 0,t)}function _(e,t,r){return p(e,t,r)}function m(e){p(e,void 0,a)}var g=function(){var e=o&&o.queueMicrotask;if("function"==typeof e)return e;var t=h(void 0);return function(e){return p(t,e)}}();function w(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function S(e,t,r){try{return h(w(e,t,r))}catch(e){return d(e)}}var R=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.push=function(e){var t=this._back,r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size},e.prototype.shift=function(){var e=this._front,t=e,r=this._cursor,n=r+1,o=e._elements,i=o[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),o[r]=void 0,i},e.prototype.forEach=function(e){for(var t=this._cursor,r=this._front,n=r._elements;!(t===n.length&&void 0===r._next||t===n.length&&(t=0,0===(n=(r=r._next)._elements).length));)e(n[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function P(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?C(e):"closed"===t._state?function(e){C(e),j(e)}(e):x(e,t._storedError)}function T(e,t){return Rr(e._ownerReadableStream,t)}function E(e){"readable"===e._ownerReadableStream._state?k(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){x(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function O(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function C(e){e._closedPromise=f((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function x(e,t){C(e),k(e,t)}function k(e,t){void 0!==e._closedPromise_reject&&(m(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function j(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var q=t("[[AbortSteps]]"),A=t("[[ErrorSteps]]"),L=t("[[CancelSteps]]"),I=t("[[PullSteps]]"),B=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},H=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function F(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(t+" is not an object.");var r}function z(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function W(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function D(e,t,r){if(void 0===e)throw new TypeError("Parameter "+t+" is required in '"+r+"'.")}function U(e,t,r){if(void 0===e)throw new TypeError(t+" is required in '"+r+"'.")}function M(e){return Number(e)}function N(e){return 0===e?0:e}function G(e,t){var r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=N(n),!B(n))throw new TypeError(t+" is not a finite number");if((n=function(e){return N(H(e))}(n))<0||n>r)throw new TypeError(t+" is outside the accepted range of 0 to "+r+", inclusive");return B(n)&&0!==n?n:0}function V(e,t){if(!wr(e))throw new TypeError(t+" is not a ReadableStream.")}function Q(e){return new ee(e)}function $(e,t){e._reader._readRequests.push(t)}function Y(e,t,r){var n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function X(e){return e._reader._readRequests.length}function J(e){var t=e._reader;return void 0!==t&&!!te(t)}var K,Z,ee=function(){function e(e){if(D(e,1,"ReadableStreamDefaultReader"),V(e,"First parameter"),Sr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");P(this,e),this._readRequests=new R}return Object.defineProperty(e.prototype,"closed",{get:function(){return te(this)?this._closedPromise:d(ne("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),te(this)?void 0===this._ownerReadableStream?d(O("cancel")):T(this,e):d(ne("cancel"))},e.prototype.read=function(){if(!te(this))return d(ne("read"));if(void 0===this._ownerReadableStream)return d(O("read from"));var e,t,r=f((function(r,n){e=r,t=n}));return re(this,{_chunkSteps:function(t){return e({value:t,done:!1})},_closeSteps:function(){return e({value:void 0,done:!0})},_errorSteps:function(e){return t(e)}}),r},e.prototype.releaseLock=function(){if(!te(this))throw ne("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");E(this)}},e}();function te(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof ee}function re(e,t){var r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[I](t)}function ne(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}Object.defineProperties(ee.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ee.prototype,t.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof t.asyncIterator&&((K={})[t.asyncIterator]=function(){return this},Z=K,Object.defineProperty(Z,t.asyncIterator,{enumerable:!1}));var oe=function(){function e(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}return e.prototype.next=function(){var e=this,t=function(){return e._nextSteps()};return this._ongoingPromise=this._ongoingPromise?_(this._ongoingPromise,t,t):t(),this._ongoingPromise},e.prototype.return=function(e){var t=this,r=function(){return t._returnSteps(e)};return this._ongoingPromise?_(this._ongoingPromise,r,r):r()},e.prototype._nextSteps=function(){var e=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var t,r,n=this._reader;if(void 0===n._ownerReadableStream)return d(O("iterate"));var o=f((function(e,n){t=e,r=n}));return re(n,{_chunkSteps:function(r){e._ongoingPromise=void 0,g((function(){return t({value:r,done:!1})}))},_closeSteps:function(){e._ongoingPromise=void 0,e._isFinished=!0,E(n),t({value:void 0,done:!0})},_errorSteps:function(t){e._ongoingPromise=void 0,e._isFinished=!0,E(n),r(t)}}),o},e.prototype._returnSteps=function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var t=this._reader;if(void 0===t._ownerReadableStream)return d(O("finish iterating"));if(!this._preventCancel){var r=T(t,e);return E(t),_(r,(function(){return{value:e,done:!0}}))}return E(t),h({value:e,done:!0})},e}(),ie={next:function(){return ae(this)?this._asyncIteratorImpl.next():d(se("next"))},return:function(e){return ae(this)?this._asyncIteratorImpl.return(e):d(se("return"))}};function ae(e){if(!i(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof oe}catch(e){return!1}}function se(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}void 0!==Z&&Object.setPrototypeOf(ie,Z);var ue=Number.isNaN||function(e){return e!=e};function le(e){return e.slice()}function ce(e,t,r,n,o){new Uint8Array(e).set(new Uint8Array(r,n,o),t)}function fe(e,t,r){if(e.slice)return e.slice(t,r);var n=r-t,o=new ArrayBuffer(n);return ce(o,0,e,t,n),o}function he(e){var t=fe(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function de(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function pe(e,t,r){if("number"!=typeof(n=r)||ue(n)||n<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var n;e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function ve(e){e._queue=new R,e._queueTotalSize=0}var be=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!me(this))throw De("view");return this._view},enumerable:!1,configurable:!0}),e.prototype.respond=function(e){if(!me(this))throw De("respond");if(D(e,1,"respond"),e=G(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,Fe(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!me(this))throw De("respondWithNewView");if(D(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");e.buffer,ze(this._associatedReadableByteStreamController,e)},e}();Object.defineProperties(be.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(be.prototype,t.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var ye=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!_e(this))throw Ue("byobRequest");return Be(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!_e(this))throw Ue("desiredSize");return He(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!_e(this))throw Ue("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");Ae(this)},e.prototype.enqueue=function(e){if(!_e(this))throw Ue("enqueue");if(D(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");Le(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!_e(this))throw Ue("error");Ie(this,e)},e.prototype[L]=function(e){we(this),ve(this);var t=this._cancelAlgorithm(e);return qe(this),t},e.prototype[I]=function(e){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var r=this._queue.shift();this._queueTotalSize-=r.byteLength,Oe(this);var n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);e._chunkSteps(n)}else{var o=this._autoAllocateChunkSize;if(void 0!==o){var i=void 0;try{i=new ArrayBuffer(o)}catch(t){return void e._errorSteps(t)}var a={buffer:i,bufferByteLength:o,byteOffset:0,byteLength:o,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(a)}$(t,e),ge(this)}},e}();function _e(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof ye}function me(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof be}function ge(e){(function(e){var t=e._controlledReadableByteStream;return"readable"===t._state&&!e._closeRequested&&!!e._started&&(!!(J(t)&&X(t)>0)||!!(Ve(t)&&Ge(t)>0)||He(e)>0)})(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,v(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,ge(e))}),(function(t){Ie(e,t)}))))}function we(e){Ce(e),e._pendingPullIntos=new R}function Se(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=Re(t);"default"===t.readerType?Y(e,n,r):function(e,t,r){var n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Re(e){var t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Pe(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Te(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,o=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+o,a=i-i%r,s=o,u=!1;a>n&&(s=a-t.bytesFilled,u=!0);for(var l=e._queue;s>0;){var c=l.peek(),f=Math.min(s,c.byteLength),h=t.byteOffset+t.bytesFilled;ce(t.buffer,h,c.buffer,c.byteOffset,f),c.byteLength===f?l.shift():(c.byteOffset+=f,c.byteLength-=f),e._queueTotalSize-=f,Ee(0,f,t),s-=f}return u}function Ee(e,t,r){r.bytesFilled+=t}function Oe(e){0===e._queueTotalSize&&e._closeRequested?(qe(e),Pr(e._controlledReadableByteStream)):ge(e)}function Ce(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function xe(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();Te(e,t)&&(je(e),Se(e._controlledReadableByteStream,t))}}function ke(e,t){var r=e._pendingPullIntos.peek();Ce(e),"closed"===e._controlledReadableByteStream._state?function(e,t){var r=e._controlledReadableByteStream;if(Ve(r))for(;Ge(r)>0;)Se(r,je(e))}(e):function(e,t,r){if(Ee(0,t,r),!(r.bytesFilled0){var o=r.byteOffset+r.bytesFilled,i=fe(r.buffer,o-n,o);Pe(e,i,0,i.byteLength)}r.bytesFilled-=n,Se(e._controlledReadableByteStream,r),xe(e)}}(e,t,r),ge(e)}function je(e){return e._pendingPullIntos.shift()}function qe(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ae(e){var t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ie(e,r),r}qe(e),Pr(t)}}function Le(e,t){var r=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===r._state){var n=t.buffer,o=t.byteOffset,i=t.byteLength,a=n;if(e._pendingPullIntos.length>0){var s=e._pendingPullIntos.peek();s.buffer,s.buffer=s.buffer}Ce(e),J(r)?0===X(r)?Pe(e,a,o,i):(e._pendingPullIntos.length>0&&je(e),Y(r,new Uint8Array(a,o,i),!1)):Ve(r)?(Pe(e,a,o,i),xe(e)):Pe(e,a,o,i),ge(e)}}function Ie(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(we(e),ve(e),qe(e),Tr(r,t))}function Be(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){var t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(be.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(n,e,r),e._byobRequest=n}return e._byobRequest}function He(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Fe(e,t){var r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=r.buffer,ke(e,t)}function ze(e,t){var r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var n=t.byteLength;r.buffer=t.buffer,ke(e,n)}function We(e,t,r,n,o,i,a){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,ve(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=o,t._autoAllocateChunkSize=a,t._pendingPullIntos=new R,e._readableStreamController=t,v(h(r()),(function(){t._started=!0,ge(t)}),(function(e){Ie(t,e)}))}function De(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function Ue(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function Me(e){return new Qe(e)}function Ne(e,t){e._reader._readIntoRequests.push(t)}function Ge(e){return e._reader._readIntoRequests.length}function Ve(e){var t=e._reader;return void 0!==t&&!!$e(t)}Object.defineProperties(ye.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ye.prototype,t.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var Qe=function(){function e(e){if(D(e,1,"ReadableStreamBYOBReader"),V(e,"First parameter"),Sr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!_e(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");P(this,e),this._readIntoRequests=new R}return Object.defineProperty(e.prototype,"closed",{get:function(){return $e(this)?this._closedPromise:d(Xe("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),$e(this)?void 0===this._ownerReadableStream?d(O("cancel")):T(this,e):d(Xe("cancel"))},e.prototype.read=function(e){if(!$e(this))return d(Xe("read"));if(!ArrayBuffer.isView(e))return d(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return d(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return d(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,void 0===this._ownerReadableStream)return d(O("read from"));var t,r,n=f((function(e,n){t=e,r=n}));return Ye(this,e,{_chunkSteps:function(e){return t({value:e,done:!1})},_closeSteps:function(e){return t({value:e,done:!0})},_errorSteps:function(e){return r(e)}}),n},e.prototype.releaseLock=function(){if(!$e(this))throw Xe("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");E(this)}},e}();function $e(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Qe}function Ye(e,t,r){var n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){var n=e._controlledReadableByteStream,o=1;t.constructor!==DataView&&(o=t.constructor.BYTES_PER_ELEMENT);var i=t.constructor,a=t.buffer,s={buffer:a,bufferByteLength:a.byteLength,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:o,viewConstructor:i,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(s),void Ne(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Te(e,s)){var u=Re(s);return Oe(e),void r._chunkSteps(u)}if(e._closeRequested){var l=new TypeError("Insufficient bytes to fill elements in the given buffer");return Ie(e,l),void r._errorSteps(l)}}e._pendingPullIntos.push(s),Ne(n,r),ge(e)}else{var c=new i(s.buffer,s.byteOffset,0);r._closeSteps(c)}}(n._readableStreamController,t,r)}function Xe(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function Je(e,t){var r=e.highWaterMark;if(void 0===r)return t;if(ue(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Ke(e){return e.size||function(){return 1}}function Ze(e,t){F(e,t);var r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:M(r),size:void 0===n?void 0:et(n,t+" has member 'size' that")}}function et(e,t){return z(e,t),function(t){return M(e(t))}}function tt(e,t,r){return z(e,r),function(r){return S(e,t,[r])}}function rt(e,t,r){return z(e,r),function(){return S(e,t,[])}}function nt(e,t,r){return z(e,r),function(r){return w(e,t,[r])}}function ot(e,t,r){return z(e,r),function(r,n){return S(e,t,[r,n])}}function it(e,t){if(!ct(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(Qe.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Qe.prototype,t.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var at="function"==typeof AbortController,st=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:W(e,"First parameter");var r=Ze(t,"Second parameter"),n=function(e,t){F(e,t);var r=null==e?void 0:e.abort,n=null==e?void 0:e.close,o=null==e?void 0:e.start,i=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===r?void 0:tt(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:rt(n,e,t+" has member 'close' that"),start:void 0===o?void 0:nt(o,e,t+" has member 'start' that"),write:void 0===a?void 0:ot(a,e,t+" has member 'write' that"),type:i}}(e,"First parameter");if(lt(this),void 0!==n.type)throw new RangeError("Invalid type is specified");var o=Ke(r);!function(e,t,r,n){var o=Object.create(Ot.prototype),i=function(){},a=function(){return h(void 0)},s=function(){return h(void 0)},u=function(){return h(void 0)};void 0!==t.start&&(i=function(){return t.start(o)}),void 0!==t.write&&(a=function(e){return t.write(e,o)}),void 0!==t.close&&(s=function(){return t.close()}),void 0!==t.abort&&(u=function(e){return t.abort(e)}),xt(e,o,i,a,s,u,r,n)}(this,n,Je(r,1),o)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!ct(this))throw Bt("locked");return ft(this)},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),ct(this)?ft(this)?d(new TypeError("Cannot abort a stream that already has a writer")):ht(this,e):d(Bt("abort"))},e.prototype.close=function(){return ct(this)?ft(this)?d(new TypeError("Cannot close a stream that already has a writer")):yt(this)?d(new TypeError("Cannot close an already-closing stream")):dt(this):d(Bt("close"))},e.prototype.getWriter=function(){if(!ct(this))throw Bt("getWriter");return ut(this)},e}();function ut(e){return new gt(e)}function lt(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new R,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function ct(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof st}function ft(e){return void 0!==e._writer}function ht(e,t){var r;if("closed"===e._state||"errored"===e._state)return h(void 0);e._writableStreamController._abortReason=t,null===(r=e._writableStreamController._abortController)||void 0===r||r.abort();var n=e._state;if("closed"===n||"errored"===n)return h(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var o=!1;"erroring"===n&&(o=!0,t=void 0);var i=f((function(r,n){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:o}}));return e._pendingAbortRequest._promise=i,o||vt(e,t),i}function dt(e){var t=e._state;if("closed"===t||"errored"===t)return d(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var r,n=f((function(t,r){var n={_resolve:t,_reject:r};e._closeRequest=n})),o=e._writer;return void 0!==o&&e._backpressure&&"writable"===t&&$t(o),pe(r=e._writableStreamController,Et,0),qt(r),n}function pt(e,t){"writable"!==e._state?bt(e):vt(e,t)}function vt(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&Rt(n,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&bt(e)}function bt(e){e._state="errored",e._writableStreamController[A]();var t=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(t)})),e._writeRequests=new R,void 0!==e._pendingAbortRequest){var r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void _t(e);v(e._writableStreamController[q](r._reason),(function(){r._resolve(),_t(e)}),(function(t){r._reject(t),_t(e)}))}else _t(e)}function yt(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function _t(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&Ut(t,e._storedError)}function mt(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){Nt(e)}(r):$t(r)),e._backpressure=t}Object.defineProperties(st.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(st.prototype,t.toStringTag,{value:"WritableStream",configurable:!0});var gt=function(){function e(e){if(D(e,1,"WritableStreamDefaultWriter"),it(e,"First parameter"),ft(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t=e._state;if("writable"===t)!yt(e)&&e._backpressure?Nt(this):Vt(this),Wt(this);else if("erroring"===t)Gt(this,e._storedError),Wt(this);else if("closed"===t)Vt(this),Wt(this),Mt(this);else{var r=e._storedError;Gt(this,r),Dt(this,r)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return wt(this)?this._closedPromise:d(Ft("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!wt(this))throw Ft("desiredSize");if(void 0===this._ownerWritableStream)throw zt("desiredSize");return function(e){var t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:jt(t._writableStreamController)}(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return wt(this)?this._readyPromise:d(Ft("ready"))},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),wt(this)?void 0===this._ownerWritableStream?d(zt("abort")):function(e,t){return ht(e._ownerWritableStream,t)}(this,e):d(Ft("abort"))},e.prototype.close=function(){if(!wt(this))return d(Ft("close"));var e=this._ownerWritableStream;return void 0===e?d(zt("close")):yt(e)?d(new TypeError("Cannot close an already-closing stream")):St(this)},e.prototype.releaseLock=function(){if(!wt(this))throw Ft("releaseLock");void 0!==this._ownerWritableStream&&Pt(this)},e.prototype.write=function(e){return void 0===e&&(e=void 0),wt(this)?void 0===this._ownerWritableStream?d(zt("write to")):Tt(this,e):d(Ft("write"))},e}();function wt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof gt}function St(e){return dt(e._ownerWritableStream)}function Rt(e,t){"pending"===e._readyPromiseState?Qt(e,t):function(e,t){Gt(e,t)}(e,t)}function Pt(e){var t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Rt(e,r),function(e,t){"pending"===e._closedPromiseState?Ut(e,t):function(e,t){Dt(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function Tt(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,o=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return At(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return d(zt("write to"));var i=r._state;if("errored"===i)return d(r._storedError);if(yt(r)||"closed"===i)return d(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return d(r._storedError);var a=function(e){return f((function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{pe(e,t,r)}catch(t){return void At(e,t)}var n=e._controlledWritableStream;yt(n)||"writable"!==n._state||mt(n,Lt(e)),qt(e)}(n,t,o),a}Object.defineProperties(gt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(gt.prototype,t.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Et={},Ot=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"abortReason",{get:function(){if(!Ct(this))throw Ht("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"signal",{get:function(){if(!Ct(this))throw Ht("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),e.prototype.error=function(e){if(void 0===e&&(e=void 0),!Ct(this))throw Ht("error");"writable"===this._controlledWritableStream._state&&It(this,e)},e.prototype[q]=function(e){var t=this._abortAlgorithm(e);return kt(this),t},e.prototype[A]=function(){ve(this)},e}();function Ct(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Ot}function xt(e,t,r,n,o,i,a,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,ve(t),t._abortReason=void 0,t._abortController=function(){if(at)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._writeAlgorithm=n,t._closeAlgorithm=o,t._abortAlgorithm=i;var u=Lt(t);mt(e,u),v(h(r()),(function(){t._started=!0,qt(t)}),(function(r){t._started=!0,pt(e,r)}))}function kt(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function jt(e){return e._strategyHWM-e._queueTotalSize}function qt(e){var t=e._controlledWritableStream;if(e._started&&void 0===t._inFlightWriteRequest)if("erroring"!==t._state){if(0!==e._queue.length){var r=e._queue.peek().value;r===Et?function(e){var t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),de(e);var r=e._closeAlgorithm();kt(e),v(r,(function(){!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var t=e._writer;void 0!==t&&Mt(t)}(t)}),(function(e){!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),pt(e,t)}(t,e)}))}(e):function(e,t){var r=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(r),v(e._writeAlgorithm(t),(function(){!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);var t=r._state;if(de(e),!yt(r)&&"writable"===t){var n=Lt(e);mt(r,n)}qt(e)}),(function(t){"writable"===r._state&&kt(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,pt(e,t)}(r,t)}))}(e,r)}}else bt(t)}function At(e,t){"writable"===e._controlledWritableStream._state&&It(e,t)}function Lt(e){return jt(e)<=0}function It(e,t){var r=e._controlledWritableStream;kt(e),vt(r,t)}function Bt(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function Ht(e){return new TypeError("WritableStreamDefaultController.prototype."+e+" can only be used on a WritableStreamDefaultController")}function Ft(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function zt(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Wt(e){e._closedPromise=f((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Dt(e,t){Wt(e),Ut(e,t)}function Ut(e,t){void 0!==e._closedPromise_reject&&(m(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Mt(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Nt(e){e._readyPromise=f((function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function Gt(e,t){Nt(e),Qt(e,t)}function Vt(e){Nt(e),$t(e)}function Qt(e,t){void 0!==e._readyPromise_reject&&(m(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function $t(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Ot.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Ot.prototype,t.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Yt,Xt="undefined"!=typeof DOMException?DOMException:void 0,Jt=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(Xt)?Xt:((Yt=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(Yt.prototype,"constructor",{value:Yt,writable:!0,configurable:!0}),Yt);function Kt(e,t,r,o,i,a){var s=Q(e),u=ut(t);e._disturbed=!0;var l=!1,c=h(void 0);return f((function(_,g){var w,S,R,P;if(void 0!==a){if(w=function(){var r=new Jt("Aborted","AbortError"),n=[];o||n.push((function(){return"writable"===t._state?ht(t,r):h(void 0)})),i||n.push((function(){return"readable"===e._state?Rr(e,r):h(void 0)})),x((function(){return Promise.all(n.map((function(e){return e()})))}),!0,r)},a.aborted)return void w();a.addEventListener("abort",w)}if(C(e,s._closedPromise,(function(e){o?k(!0,e):x((function(){return ht(t,e)}),!0,e)})),C(t,u._closedPromise,(function(t){i?k(!0,t):x((function(){return Rr(e,t)}),!0,t)})),S=e,R=s._closedPromise,P=function(){r?k():x((function(){return function(e){var t=e._ownerWritableStream,r=t._state;return yt(t)||"closed"===r?h(void 0):"errored"===r?d(t._storedError):St(e)}(u)}))},"closed"===S._state?P():b(R,P),yt(t)||"closed"===t._state){var T=new TypeError("the destination writable stream closed before all data could be piped to it");i?k(!0,T):x((function(){return Rr(e,T)}),!0,T)}function O(){var e=c;return p(c,(function(){return e!==c?O():void 0}))}function C(e,t,r){"errored"===e._state?r(e._storedError):y(t,r)}function x(e,r,n){function o(){v(e(),(function(){return j(r,n)}),(function(e){return j(!0,e)}))}l||(l=!0,"writable"!==t._state||yt(t)?o():b(O(),o))}function k(e,r){l||(l=!0,"writable"!==t._state||yt(t)?j(e,r):b(O(),(function(){return j(e,r)})))}function j(e,t){Pt(u),E(s),void 0!==a&&a.removeEventListener("abort",w),e?g(t):_(void 0)}m(f((function(e,t){!function r(o){o?e():p(l?h(!0):p(u._readyPromise,(function(){return f((function(e,t){re(s,{_chunkSteps:function(t){c=p(Tt(u,t),void 0,n),e(!1)},_closeSteps:function(){return e(!0)},_errorSteps:t})}))})),r,t)}(!1)})))}))}var Zt=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!er(this))throw cr("desiredSize");return sr(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!er(this))throw cr("close");if(!ur(this))throw new TypeError("The stream is not in a state that permits close");or(this)},e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!er(this))throw cr("enqueue");if(!ur(this))throw new TypeError("The stream is not in a state that permits enqueue");return ir(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!er(this))throw cr("error");ar(this,e)},e.prototype[L]=function(e){ve(this);var t=this._cancelAlgorithm(e);return nr(this),t},e.prototype[I]=function(e){var t=this._controlledReadableStream;if(this._queue.length>0){var r=de(this);this._closeRequested&&0===this._queue.length?(nr(this),Pr(t)):tr(this),e._chunkSteps(r)}else $(t,e),tr(this)},e}();function er(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Zt}function tr(e){rr(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,v(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,tr(e))}),(function(t){ar(e,t)}))))}function rr(e){var t=e._controlledReadableStream;return!!ur(e)&&!!e._started&&(!!(Sr(t)&&X(t)>0)||sr(e)>0)}function nr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function or(e){if(ur(e)){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(nr(e),Pr(t))}}function ir(e,t){if(ur(e)){var r=e._controlledReadableStream;if(Sr(r)&&X(r)>0)Y(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(t){throw ar(e,t),t}try{pe(e,t,n)}catch(t){throw ar(e,t),t}}tr(e)}}function ar(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(ve(e),nr(e),Tr(r,t))}function sr(e){var t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function ur(e){var t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function lr(e,t,r,n,o,i,a){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,ve(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=a,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=o,e._readableStreamController=t,v(h(r()),(function(){t._started=!0,tr(t)}),(function(e){ar(t,e)}))}function cr(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function fr(e,t,r){return z(e,r),function(r){return S(e,t,[r])}}function hr(e,t,r){return z(e,r),function(r){return S(e,t,[r])}}function dr(e,t,r){return z(e,r),function(r){return w(e,t,[r])}}function pr(e,t){if("bytes"!=(e=""+e))throw new TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamType");return e}function vr(e,t){if("byob"!=(e=""+e))throw new TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamReaderMode");return e}function br(e,t){F(e,t);var r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,o=null==e?void 0:e.preventClose,i=null==e?void 0:e.signal;return void 0!==i&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(i,t+" has member 'signal' that"),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(o),signal:i}}Object.defineProperties(Zt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Zt.prototype,t.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var yr=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:W(e,"First parameter");var r=Ze(t,"Second parameter"),n=function(e,t){F(e,t);var r=e,n=null==r?void 0:r.autoAllocateChunkSize,o=null==r?void 0:r.cancel,i=null==r?void 0:r.pull,a=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:G(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===o?void 0:fr(o,r,t+" has member 'cancel' that"),pull:void 0===i?void 0:hr(i,r,t+" has member 'pull' that"),start:void 0===a?void 0:dr(a,r,t+" has member 'start' that"),type:void 0===s?void 0:pr(s,t+" has member 'type' that")}}(e,"First parameter");if(gr(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){var n=Object.create(ye.prototype),o=function(){},i=function(){return h(void 0)},a=function(){return h(void 0)};void 0!==t.start&&(o=function(){return t.start(n)}),void 0!==t.pull&&(i=function(){return t.pull(n)}),void 0!==t.cancel&&(a=function(e){return t.cancel(e)});var s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");We(e,n,o,i,a,r,s)}(this,n,Je(r,0))}else{var o=Ke(r);!function(e,t,r,n){var o=Object.create(Zt.prototype),i=function(){},a=function(){return h(void 0)},s=function(){return h(void 0)};void 0!==t.start&&(i=function(){return t.start(o)}),void 0!==t.pull&&(a=function(){return t.pull(o)}),void 0!==t.cancel&&(s=function(e){return t.cancel(e)}),lr(e,o,i,a,s,r,n)}(this,n,Je(r,1),o)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!wr(this))throw Er("locked");return Sr(this)},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),wr(this)?Sr(this)?d(new TypeError("Cannot cancel a stream that already has a reader")):Rr(this,e):d(Er("cancel"))},e.prototype.getReader=function(e){if(void 0===e&&(e=void 0),!wr(this))throw Er("getReader");return void 0===function(e,t){F(e,t);var r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:vr(r,t+" has member 'mode' that")}}(e,"First parameter").mode?Q(this):Me(this)},e.prototype.pipeThrough=function(e,t){if(void 0===t&&(t={}),!wr(this))throw Er("pipeThrough");D(e,1,"pipeThrough");var r=function(e,t){F(e,t);var r=null==e?void 0:e.readable;U(r,"readable","ReadableWritablePair"),V(r,t+" has member 'readable' that");var n=null==e?void 0:e.writable;return U(n,"writable","ReadableWritablePair"),it(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=br(t,"Second parameter");if(Sr(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(ft(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return m(Kt(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable},e.prototype.pipeTo=function(e,t){if(void 0===t&&(t={}),!wr(this))return d(Er("pipeTo"));if(void 0===e)return d("Parameter 1 is required in 'pipeTo'.");if(!ct(e))return d(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var r;try{r=br(t,"Second parameter")}catch(e){return d(e)}return Sr(this)?d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):ft(e)?d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Kt(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)},e.prototype.tee=function(){if(!wr(this))throw Er("tee");return le(function(e,t){return _e(e._readableStreamController)?function(e){var t,r,n,o,i,a=Q(e),s=!1,u=!1,l=!1,c=!1,d=!1,p=f((function(e){i=e}));function v(e){y(e._closedPromise,(function(t){e===a&&(Ie(n._readableStreamController,t),Ie(o._readableStreamController,t),c&&d||i(void 0))}))}function b(){$e(a)&&(E(a),v(a=Q(e))),re(a,{_chunkSteps:function(t){g((function(){u=!1,l=!1;var r=t,a=t;if(!c&&!d)try{a=he(t)}catch(t){return Ie(n._readableStreamController,t),Ie(o._readableStreamController,t),void i(Rr(e,t))}c||Le(n._readableStreamController,r),d||Le(o._readableStreamController,a),s=!1,u?m():l&&w()}))},_closeSteps:function(){s=!1,c||Ae(n._readableStreamController),d||Ae(o._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&Fe(n._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&Fe(o._readableStreamController,0),c&&d||i(void 0)},_errorSteps:function(){s=!1}})}function _(t,r){te(a)&&(E(a),v(a=Me(e)));var f=r?o:n,h=r?n:o;Ye(a,t,{_chunkSteps:function(t){g((function(){u=!1,l=!1;var n=r?d:c;if(r?c:d)n||ze(f._readableStreamController,t);else{var o=void 0;try{o=he(t)}catch(t){return Ie(f._readableStreamController,t),Ie(h._readableStreamController,t),void i(Rr(e,t))}n||ze(f._readableStreamController,t),Le(h._readableStreamController,o)}s=!1,u?m():l&&w()}))},_closeSteps:function(e){s=!1;var t=r?d:c,n=r?c:d;t||Ae(f._readableStreamController),n||Ae(h._readableStreamController),void 0!==e&&(t||ze(f._readableStreamController,e),!n&&h._readableStreamController._pendingPullIntos.length>0&&Fe(h._readableStreamController,0)),t&&n||i(void 0)},_errorSteps:function(){s=!1}})}function m(){if(s)return u=!0,h(void 0);s=!0;var e=Be(n._readableStreamController);return null===e?b():_(e._view,!1),h(void 0)}function w(){if(s)return l=!0,h(void 0);s=!0;var e=Be(o._readableStreamController);return null===e?b():_(e._view,!0),h(void 0)}function S(){}return n=mr(S,m,(function(n){if(c=!0,t=n,d){var o=le([t,r]),a=Rr(e,o);i(a)}return p})),o=mr(S,w,(function(n){if(d=!0,r=n,c){var o=le([t,r]),a=Rr(e,o);i(a)}return p})),v(a),[n,o]}(e):function(e,t){var r,n,o,i,a,s=Q(e),u=!1,l=!1,c=!1,d=!1,p=f((function(e){a=e}));function v(){return u?(l=!0,h(void 0)):(u=!0,re(s,{_chunkSteps:function(e){g((function(){l=!1;var t=e,r=e;c||ir(o._readableStreamController,t),d||ir(i._readableStreamController,r),u=!1,l&&v()}))},_closeSteps:function(){u=!1,c||or(o._readableStreamController),d||or(i._readableStreamController),c&&d||a(void 0)},_errorSteps:function(){u=!1}}),h(void 0))}function b(){}return o=_r(b,v,(function(t){if(c=!0,r=t,d){var o=le([r,n]),i=Rr(e,o);a(i)}return p})),i=_r(b,v,(function(t){if(d=!0,n=t,c){var o=le([r,n]),i=Rr(e,o);a(i)}return p})),y(s._closedPromise,(function(e){ar(o._readableStreamController,e),ar(i._readableStreamController,e),c&&d||a(void 0)})),[o,i]}(e)}(this))},e.prototype.values=function(e){if(void 0===e&&(e=void 0),!wr(this))throw Er("values");var t,r,n,o,i=function(e,t){F(e,"First parameter");var r=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(r)}}(e);return this,t=i.preventCancel,r=Q(this),n=new oe(r,t),(o=Object.create(ie))._asyncIteratorImpl=n,o},e}();function _r(e,t,r,n,o){void 0===n&&(n=1),void 0===o&&(o=function(){return 1});var i=Object.create(yr.prototype);return gr(i),lr(i,Object.create(Zt.prototype),e,t,r,n,o),i}function mr(e,t,r){var n=Object.create(yr.prototype);return gr(n),We(n,Object.create(ye.prototype),e,t,r,0,void 0),n}function gr(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function wr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof yr}function Sr(e){return void 0!==e._reader}function Rr(e,t){if(e._disturbed=!0,"closed"===e._state)return h(void 0);if("errored"===e._state)return d(e._storedError);Pr(e);var r=e._reader;return void 0!==r&&$e(r)&&(r._readIntoRequests.forEach((function(e){e._closeSteps(void 0)})),r._readIntoRequests=new R),_(e._readableStreamController[L](t),n)}function Pr(e){e._state="closed";var t=e._reader;void 0!==t&&(j(t),te(t)&&(t._readRequests.forEach((function(e){e._closeSteps()})),t._readRequests=new R))}function Tr(e,t){e._state="errored",e._storedError=t;var r=e._reader;void 0!==r&&(k(r,t),te(r)?(r._readRequests.forEach((function(e){e._errorSteps(t)})),r._readRequests=new R):(r._readIntoRequests.forEach((function(e){e._errorSteps(t)})),r._readIntoRequests=new R))}function Er(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function Or(e,t){F(e,t);var r=null==e?void 0:e.highWaterMark;return U(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:M(r)}}Object.defineProperties(yr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(yr.prototype,t.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof t.asyncIterator&&Object.defineProperty(yr.prototype,t.asyncIterator,{value:yr.prototype.values,writable:!0,configurable:!0});var Cr=function(e){return e.byteLength};try{Object.defineProperty(Cr,"name",{value:"size",configurable:!0})}catch(K){}var xr=function(){function e(e){D(e,1,"ByteLengthQueuingStrategy"),e=Or(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!jr(this))throw kr("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!jr(this))throw kr("size");return Cr},enumerable:!1,configurable:!0}),e}();function kr(e){return new TypeError("ByteLengthQueuingStrategy.prototype."+e+" can only be used on a ByteLengthQueuingStrategy")}function jr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof xr}Object.defineProperties(xr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(xr.prototype,t.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var qr=function(){return 1};try{Object.defineProperty(qr,"name",{value:"size",configurable:!0})}catch(K){}var Ar=function(){function e(e){D(e,1,"CountQueuingStrategy"),e=Or(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!Ir(this))throw Lr("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!Ir(this))throw Lr("size");return qr},enumerable:!1,configurable:!0}),e}();function Lr(e){return new TypeError("CountQueuingStrategy.prototype."+e+" can only be used on a CountQueuingStrategy")}function Ir(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Ar}function Br(e,t,r){return z(e,r),function(r){return S(e,t,[r])}}function Hr(e,t,r){return z(e,r),function(r){return w(e,t,[r])}}function Fr(e,t,r){return z(e,r),function(r,n){return S(e,t,[r,n])}}Object.defineProperties(Ar.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Ar.prototype,t.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var zr=function(){function e(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={}),void 0===e&&(e=null);var n=Ze(t,"Second parameter"),o=Ze(r,"Third parameter"),i=function(e,t){F(e,t);var r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,o=null==e?void 0:e.start,i=null==e?void 0:e.transform,a=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Br(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===o?void 0:Hr(o,e,t+" has member 'start' that"),transform:void 0===i?void 0:Fr(i,e,t+" has member 'transform' that"),writableType:a}}(e,"First parameter");if(void 0!==i.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==i.writableType)throw new RangeError("Invalid writableType specified");var a,s=Je(o,0),u=Ke(o),l=Je(n,1),c=Ke(n);!function(e,t,r,n,o,i){function a(){return t}e._writable=function(e,t,r,n,o,i){void 0===o&&(o=1),void 0===i&&(i=function(){return 1});var a=Object.create(st.prototype);return lt(a),xt(a,Object.create(Ot.prototype),e,t,r,n,o,i),a}(a,(function(t){return function(e,t){var r=e._transformStreamController;return e._backpressure?_(e._backpressureChangePromise,(function(){var n=e._writable;if("erroring"===n._state)throw n._storedError;return $r(r,t)})):$r(r,t)}(e,t)}),(function(){return function(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return Vr(r),_(n,(function(){if("errored"===t._state)throw t._storedError;or(t._readableStreamController)}),(function(r){throw Dr(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return Dr(e,t),h(void 0)}(e,t)}),r,n),e._readable=_r(a,(function(){return function(e){return Mr(e,!1),e._backpressureChangePromise}(e)}),(function(t){return Ur(e,t),h(void 0)}),o,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Mr(e,!0),e._transformStreamController=void 0}(this,f((function(e){a=e})),l,c,s,u),function(e,t){var r=Object.create(Nr.prototype),n=function(e){try{return Qr(r,e),h(void 0)}catch(e){return d(e)}},o=function(){return h(void 0)};void 0!==t.transform&&(n=function(e){return t.transform(e,r)}),void 0!==t.flush&&(o=function(){return t.flush(r)}),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,o)}(this,i),void 0!==i.start?a(i.start(this._transformStreamController)):a(void 0)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!Wr(this))throw Xr("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!Wr(this))throw Xr("writable");return this._writable},enumerable:!1,configurable:!0}),e}();function Wr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof zr}function Dr(e,t){ar(e._readable._readableStreamController,t),Ur(e,t)}function Ur(e,t){Vr(e._transformStreamController),At(e._writable._writableStreamController,t),e._backpressure&&Mr(e,!1)}function Mr(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=f((function(t){e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(zr.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(zr.prototype,t.toStringTag,{value:"TransformStream",configurable:!0});var Nr=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Gr(this))throw Yr("desiredSize");return sr(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!Gr(this))throw Yr("enqueue");Qr(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!Gr(this))throw Yr("error");var t;t=e,Dr(this._controlledTransformStream,t)},e.prototype.terminate=function(){if(!Gr(this))throw Yr("terminate");!function(e){var t=e._controlledTransformStream;or(t._readable._readableStreamController),Ur(t,new TypeError("TransformStream terminated"))}(this)},e}();function Gr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Nr}function Vr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Qr(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!ur(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{ir(n,t)}catch(e){throw Ur(r,e),r._readable._storedError}(function(e){return!rr(e)})(n)!==r._backpressure&&Mr(r,!0)}function $r(e,t){return _(e._transformAlgorithm(t),void 0,(function(t){throw Dr(e._controlledTransformStream,t),t}))}function Yr(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function Xr(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}Object.defineProperties(Nr.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Nr.prototype,t.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Jr={ReadableStream:yr,ReadableStreamDefaultController:Zt,ReadableByteStreamController:ye,ReadableStreamBYOBRequest:be,ReadableStreamDefaultReader:ee,ReadableStreamBYOBReader:Qe,WritableStream:st,WritableStreamDefaultController:Ot,WritableStreamDefaultWriter:gt,ByteLengthQueuingStrategy:xr,CountQueuingStrategy:Ar,TransformStream:zr,TransformStreamDefaultController:Nr};if(void 0!==o)for(var Kr in Jr)Object.prototype.hasOwnProperty.call(Jr,Kr)&&Object.defineProperty(o,Kr,{value:Jr[Kr],writable:!0,configurable:!0});e.ByteLengthQueuingStrategy=xr,e.CountQueuingStrategy=Ar,e.ReadableByteStreamController=ye,e.ReadableStream=yr,e.ReadableStreamBYOBReader=Qe,e.ReadableStreamBYOBRequest=be,e.ReadableStreamDefaultController=Zt,e.ReadableStreamDefaultReader=ee,e.TransformStream=zr,e.TransformStreamDefaultController=Nr,e.WritableStream=st,e.WritableStreamDefaultController=Ot,e.WritableStreamDefaultWriter=gt,Object.defineProperty(e,"__esModule",{value:!0})}(t)},7072:(e,t,r)=>{r(612),r(9628),r(7536)},7728:e=>{!function(t){var r,n,o,i,a,s,u;s=function(){class e{constructor(){this.onloadstart=null,this.onprogress=null,this.onabort=null,this.onerror=null,this.onload=null,this.ontimeout=null,this.onloadend=null,this._listeners={}}addEventListener(e,t){var r;e=e.toLowerCase(),(r=this._listeners)[e]||(r[e]=[]),this._listeners[e].push(t)}removeEventListener(e,t){var r;e=e.toLowerCase(),this._listeners[e]&&-1!==(r=this._listeners[e].indexOf(t))&&this._listeners[e].splice(r,1)}dispatchEvent(e){var t,r,n,o,i;if(e.currentTarget=e.target=this,t=e.type,i=this._listeners[t])for(r=0,n=i.length;r{switch(r){case"head":{const r=n;t.ok=2==(r.status/100|0),t.headers=n.headers,t.statusText=r.statusText,t.statusCode=r.status,t.url=r.Location||r.location||"",t.bodyUsed=!1,t.type="default",this._onHttpResponse(e,t);break}case"data":this._onHttpResponseData(t,n);break;case"end":this._onHttpResponseEnd(t),this._onHttpResponseClose(t);break;case"error":this._onHttpRequestError(e,n)}}));e.abort=()=>{Sidevm.close(r)},this._request=e,this._dispatchProgress("loadstart")}_finalizeHeaders(){var e;this._headers.Connection="keep-alive",this._anonymous&&(this._headers.Referer="about:blank"),(e=this._headers)["User-Agent"]||(e["User-Agent"]=this._userAgent),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)}_onHttpResponse(t,r){var n;if(this._request===t){switch(r.statusCode){case 301:case 302:case 303:case 307:case 308:return this._method="GET","content-type"in this._loweredHeaders&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),"Content-Type"in this._headers&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest()}return this._response=r,this.status=this._response.statusCode,this.statusText=this._response.statusText,this._parseResponseHeaders(r),(n=this._responseHeaders["content-length"])?(this._totalBytes=parseInt(n),this._lengthComputable=!0):this._lengthComputable=!1,this._setReadyState(e.HEADERS_RECEIVED)}}_onHttpResponseData(t,r){if(this._response===t)return this._responseParts.push(r),this._loadedBytes+=r.length,this.readyState!==e.LOADING&&this._setReadyState(e.LOADING),this._dispatchProgress("progress")}_onHttpResponseEnd(t){if(this._response===t)return this._parseResponse(),this._request=null,this._response=null,this._setReadyState(e.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend")}_onHttpResponseClose(t){var r;if(this._response===t)return r=this._request,this._setError(),r.abort(),this._setReadyState(e.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}_onHttpTimeout(t){if(this._request===t)return this._setError(),t.abort(),this._setReadyState(e.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend")}_onHttpRequestError(t,r){if(this._request===t)return this._setError(r),t.abort(),this._setReadyState(e.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}_dispatchProgress(e){var t;(t=new n(e)).lengthComputable=this._lengthComputable,t.loaded=this._loadedBytes,t.total=this._totalBytes,this.dispatchEvent(t)}_setError(e){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null,e&&(this.responseText=e)}_parseResponseHeaders(e){var t,r,n,o;for(r in this._responseHeaders={},n=e.headers)o=n[r],t=r.toLowerCase(),this._privateHeaders[t]||(null!==this._mimeOverride&&"content-type"===t&&(o=this._mimeOverride),this._responseHeaders[t]=o);null===this._mimeOverride||"content-type"in this._responseHeaders||(this._responseHeaders["content-type"]=this._mimeOverride)}_parseResponse(){var e,t,r,n,o,i;switch(t=Sidevm.concatU8a(this._responseParts),this._responseParts=null,this.responseType){case"text":default:this._parseTextResponse(t);break;case"json":this.responseText=null;try{this.response=JSON.parse(t.toString("utf-8"))}catch(e){this.response=null}break;case"buffer":this.responseText=null,this.response=t;break;case"arraybuffer":for(this.responseText=null,e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=n=0,o=t.length;0<=o?no;r=0<=o?++n:--n)i[r]=t[r];this.response=e}}_parseTextResponse(e){try{this.responseText=(new TextDecoder).decode(e)}catch(e){console.error("Failed to parse text response",e)}this.response=this.responseText}_parseResponseEncoding(){var e,t;return(e=this._responseHeaders["content-type"])&&(t=/\;\s*charset\=(.*)$/.exec(e))?t[1]:"utf-8"}}return e.prototype.onreadystatechange=null,e.prototype.readyState=null,e.prototype.response=null,e.prototype.responseText=null,e.prototype.responseType=null,e.prototype.status=null,e.prototype.timeout=null,e.prototype.upload=null,e.prototype.UNSENT=0,e.UNSENT=0,e.prototype.OPENED=1,e.OPENED=1,e.prototype.HEADERS_RECEIVED=2,e.HEADERS_RECEIVED=2,e.prototype.LOADING=3,e.LOADING=3,e.prototype.DONE=4,e.DONE=4,e.prototype._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},e.prototype._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,via:!0},e.prototype._privateHeaders={"set-cookie":!0,"set-cookie2":!0},e.prototype._userAgent="Sidevm HTTP Client",e}.call(this),e.exports=a,a.XMLHttpRequest=a,o=class extends Error{},a.SecurityError=o,r=class extends Error{},r=class extends Error{},a.InvalidStateError=r,Error,a.SyntaxError=i,i=class extends Error{},n=function(){class e{constructor(e){this.type=e,this.target=null,this.currentTarget=null,this.lengthComputable=!1,this.loaded=0,this.total=0}}return e.prototype.bubbles=!1,e.prototype.cancelable=!1,e.prototype.target=null,e.prototype.loaded=null,e.prototype.lengthComputable=null,e.prototype.total=null,e}.call(this),a.ProgressEvent=n,u=class extends s{constructor(e){super(),this._request=e,this._reset()}_reset(){this._contentType=null,this._body=null}_setData(e){null!=e&&("string"==typeof e?(0!==e.length&&(this._contentType="text/plain;charset=UTF-8"),this._body=(new TextEncoder).encode(e)):e instanceof ArrayBuffer&&(this._body=e))}_finalizeHeaders(e,t){this._contentType&&("content-type"in t||(e["Content-Type"]=this._contentType)),this._body&&(e["Content-Length"]=this._body.length.toString())}},a.XMLHttpRequestUpload=u,t.XMLHttpRequest=a}(globalThis)},4564:(e,t,r)=>{"use strict";var n=r(80);e.exports=n},9804:(e,t,r)=>{"use strict";var n=r(8348);e.exports=n},8424:(e,t,r)=>{"use strict";var n=r(4908);e.exports=n},7536:(e,t,r)=>{"use strict";var n=r(4564);e.exports=n},9628:(e,t,r)=>{"use strict";var n=r(9804);e.exports=n},612:(e,t,r)=>{"use strict";var n=r(8424);e.exports=n},1896:(e,t,r)=>{"use strict";var n=r(9063),o=r(4596),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a function")}},9472:(e,t,r)=>{"use strict";var n=r(968),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},2328:(e,t,r)=>{"use strict";var n=r(1840),o=r(8340),i=r(368).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},5796:(e,t,r)=>{"use strict";var n=r(6056),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new o("Incorrect invocation")}},6043:(e,t,r)=>{"use strict";var n=r(808),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not an object")}},7992:(e,t,r)=>{"use strict";var n=r(2880),o=r(892),i=r(6804),a=r(4136),s=r(4264),u=r(780),l=r(9480),c=r(8931),f=r(2704),h=r(7508),d=Array;e.exports=function(e){var t=i(e),r=u(this),p=arguments.length,v=p>1?arguments[1]:void 0,b=void 0!==v;b&&(v=n(v,p>2?arguments[2]:void 0));var y,_,m,g,w,S,R=h(t),P=0;if(!R||this===d&&s(R))for(y=l(t),_=r?new this(y):d(y);y>P;P++)S=b?v(t[P],P):t[P],c(_,P,S);else for(w=(g=f(t,R)).next,_=r?new this:[];!(m=o(w,g)).done;P++)S=b?a(g,v,[m.value,P],!0):m.value,c(_,P,S);return _.length=P,_}},2196:(e,t,r)=>{"use strict";var n=r(9740),o=r(4160),i=r(9480),a=function(e){return function(t,r,a){var s,u=n(t),l=i(u),c=o(a,l);if(e&&r!=r){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},7588:(e,t,r)=>{"use strict";var n=r(1447);e.exports=n([].slice)},584:(e,t,r)=>{"use strict";var n=r(7588),o=Math.floor,i=function(e,t){var r=e.length;if(r<8)for(var a,s,u=1;u0;)e[s]=e[--s];s!==u++&&(e[s]=a)}else for(var l=o(r/2),c=i(n(e,0,l),t),f=i(n(e,l),t),h=c.length,d=f.length,p=0,v=0;p{"use strict";var n=r(6043),o=r(2252);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){o(e,"throw",t)}}},5983:(e,t,r)=>{"use strict";var n=r(1447),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},8040:(e,t,r)=>{"use strict";var n=r(1712),o=r(9063),i=r(5983),a=r(1840)("toStringTag"),s=Object,u="Arguments"===i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:u?i(t):"Object"===(n=i(t))&&o(t.callee)?"Arguments":n}},4304:(e,t,r)=>{"use strict";var n=r(6216),o=r(9976),i=r(4560),a=r(368);e.exports=function(e,t,r){for(var s=o(t),u=a.f,l=i.f,c=0;c{"use strict";var n=r(6040);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2596:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},3652:(e,t,r)=>{"use strict";var n=r(3528),o=r(368),i=r(9200);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},9200:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},8931:(e,t,r)=>{"use strict";var n=r(8732),o=r(368),i=r(9200);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},1720:(e,t,r)=>{"use strict";var n=r(316),o=r(368);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},3244:(e,t,r)=>{"use strict";var n=r(9063),o=r(368),i=r(316),a=r(1544);e.exports=function(e,t,r,s){s||(s={});var u=s.enumerable,l=void 0!==s.name?s.name:t;if(n(r)&&i(r,l,s),s.global)u?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},5248:(e,t,r)=>{"use strict";var n=r(3244);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},1544:(e,t,r)=>{"use strict";var n=r(5624),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},3528:(e,t,r)=>{"use strict";var n=r(6040);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9308:(e,t,r)=>{"use strict";var n=r(5624),o=r(808),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},5848:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8280:(e,t,r)=>{"use strict";var n=r(9308)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},8232:e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3356:(e,t,r)=>{"use strict";var n,o,i=r(5624),a=r(8232),s=i.process,u=i.Deno,l=s&&s.versions||u&&u.version,c=l&&l.v8;c&&(o=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},4656:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3748:(e,t,r)=>{"use strict";var n=r(5624),o=r(4560).f,i=r(3652),a=r(3244),s=r(1544),u=r(4304),l=r(5272);e.exports=function(e,t){var r,c,f,h,d,p=e.target,v=e.global,b=e.stat;if(r=v?n:b?n[p]||s(p,{}):n[p]&&n[p].prototype)for(c in t){if(h=t[c],f=e.dontCallGetSet?(d=o(r,c))&&d.value:r[c],!l(v?c:p+(b?".":"#")+c,e.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(e.sham||f&&f.sham)&&i(h,"sham",!0),a(r,c,h,e)}}},6040:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},2880:(e,t,r)=>{"use strict";var n=r(8168),o=r(1896),i=r(5744),a=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},5744:(e,t,r)=>{"use strict";var n=r(6040);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},892:(e,t,r)=>{"use strict";var n=r(5744),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},3788:(e,t,r)=>{"use strict";var n=r(3528),o=r(6216),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),u=s&&"something"===function(){}.name,l=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:l}},6632:(e,t,r)=>{"use strict";var n=r(1447),o=r(1896);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},8168:(e,t,r)=>{"use strict";var n=r(5983),o=r(1447);e.exports=function(e){if("Function"===n(e))return o(e)}},1447:(e,t,r)=>{"use strict";var n=r(5744),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},4960:(e,t,r)=>{"use strict";var n=r(5624),o=r(9063);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},7508:(e,t,r)=>{"use strict";var n=r(8040),o=r(364),i=r(952),a=r(4920),s=r(1840)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[n(e)]}},2704:(e,t,r)=>{"use strict";var n=r(892),o=r(1896),i=r(6043),a=r(4596),s=r(7508),u=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(o(r))return i(n(r,e));throw new u(a(e)+" is not iterable")}},364:(e,t,r)=>{"use strict";var n=r(1896),o=r(952);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},5624:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},6216:(e,t,r)=>{"use strict";var n=r(1447),o=r(6804),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},6480:e=>{"use strict";e.exports={}},6836:(e,t,r)=>{"use strict";var n=r(4960);e.exports=n("document","documentElement")},784:(e,t,r)=>{"use strict";var n=r(3528),o=r(6040),i=r(9308);e.exports=!n&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},6212:(e,t,r)=>{"use strict";var n=r(1447),o=r(6040),i=r(5983),a=Object,s=n("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},8460:(e,t,r)=>{"use strict";var n=r(1447),o=r(9063),i=r(9136),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},5444:(e,t,r)=>{"use strict";var n,o,i,a=r(280),s=r(5624),u=r(808),l=r(3652),c=r(6216),f=r(9136),h=r(8192),d=r(6480),p="Object already initialized",v=s.TypeError,b=s.WeakMap;if(a||f.state){var y=f.state||(f.state=new b);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw new v(p);return t.facade=e,y.set(e,t),t},o=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var _=h("state");d[_]=!0,n=function(e,t){if(c(e,_))throw new v(p);return t.facade=e,l(e,_,t),t},o=function(e){return c(e,_)?e[_]:{}},i=function(e){return c(e,_)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw new v("Incompatible receiver, "+e+" required");return r}}}},4264:(e,t,r)=>{"use strict";var n=r(1840),o=r(4920),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},9063:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},780:(e,t,r)=>{"use strict";var n=r(1447),o=r(6040),i=r(9063),a=r(8040),s=r(4960),u=r(8460),l=function(){},c=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,h=n(f.exec),d=!f.test(l),p=function(e){if(!i(e))return!1;try{return c(l,[],e),!0}catch(e){return!1}},v=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!h(f,u(e))}catch(e){return!0}};v.sham=!0,e.exports=!c||o((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?v:p},5272:(e,t,r)=>{"use strict";var n=r(6040),o=r(9063),i=/#|\.prototype\./,a=function(e,t){var r=u[s(e)];return r===c||r!==l&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},952:e=>{"use strict";e.exports=function(e){return null==e}},808:(e,t,r)=>{"use strict";var n=r(9063);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},968:(e,t,r)=>{"use strict";var n=r(808);e.exports=function(e){return n(e)||null===e}},2804:e=>{"use strict";e.exports=!1},6232:(e,t,r)=>{"use strict";var n=r(4960),o=r(9063),i=r(6056),a=r(9448),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,s(e))}},2252:(e,t,r)=>{"use strict";var n=r(892),o=r(6043),i=r(364);e.exports=function(e,t,r){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return o(a),r}},7936:(e,t,r)=>{"use strict";var n=r(5412).IteratorPrototype,o=r(8340),i=r(9200),a=r(4200),s=r(4920),u=function(){return this};e.exports=function(e,t,r,l){var c=t+" Iterator";return e.prototype=o(n,{next:i(+!l,r)}),a(e,c,!1,!0),s[c]=u,e}},8752:(e,t,r)=>{"use strict";var n=r(3748),o=r(892),i=r(2804),a=r(3788),s=r(9063),u=r(7936),l=r(1304),c=r(5168),f=r(4200),h=r(3652),d=r(3244),p=r(1840),v=r(4920),b=r(5412),y=a.PROPER,_=a.CONFIGURABLE,m=b.IteratorPrototype,g=b.BUGGY_SAFARI_ITERATORS,w=p("iterator"),S="keys",R="values",P="entries",T=function(){return this};e.exports=function(e,t,r,a,p,b,E){u(r,t,a);var O,C,x,k=function(e){if(e===p&&I)return I;if(!g&&e&&e in A)return A[e];switch(e){case S:case R:case P:return function(){return new r(this,e)}}return function(){return new r(this)}},j=t+" Iterator",q=!1,A=e.prototype,L=A[w]||A["@@iterator"]||p&&A[p],I=!g&&L||k(p),B="Array"===t&&A.entries||L;if(B&&(O=l(B.call(new e)))!==Object.prototype&&O.next&&(i||l(O)===m||(c?c(O,m):s(O[w])||d(O,w,T)),f(O,j,!0,!0),i&&(v[j]=T)),y&&p===R&&L&&L.name!==R&&(!i&&_?h(A,"name",R):(q=!0,I=function(){return o(L,this)})),p)if(C={values:k(R),keys:b?I:k(S),entries:k(P)},E)for(x in C)(g||q||!(x in A))&&d(A,x,C[x]);else n({target:t,proto:!0,forced:g||q},C);return i&&!E||A[w]===I||d(A,w,I,{name:p}),v[t]=I,C}},5412:(e,t,r)=>{"use strict";var n,o,i,a=r(6040),s=r(9063),u=r(808),l=r(8340),c=r(1304),f=r(3244),h=r(1840),d=r(2804),p=h("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(n=o):v=!0),!u(n)||a((function(){var e={};return n[p].call(e)!==e}))?n={}:d&&(n=l(n)),s(n[p])||f(n,p,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},4920:e=>{"use strict";e.exports={}},9480:(e,t,r)=>{"use strict";var n=r(960);e.exports=function(e){return n(e.length)}},316:(e,t,r)=>{"use strict";var n=r(1447),o=r(6040),i=r(9063),a=r(6216),s=r(3528),u=r(3788).CONFIGURABLE,l=r(8460),c=r(5444),f=c.enforce,h=c.get,d=String,p=Object.defineProperty,v=n("".slice),b=n("".replace),y=n([].join),_=s&&!o((function(){return 8!==p((function(){}),"length",{value:8}).length})),m=String(String).split("String"),g=e.exports=function(e,t,r){"Symbol("===v(d(t),0,7)&&(t="["+b(d(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),_&&r&&a(r,"arity")&&e.length!==r.arity&&p(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=f(e);return a(n,"source")||(n.source=y(m,"string"==typeof t?t:"")),e};Function.prototype.toString=g((function(){return i(this)&&h(this).source||l(this)}),"toString")},1736:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},7048:(e,t,r)=>{"use strict";var n=r(3528),o=r(1447),i=r(892),a=r(6040),s=r(4152),u=r(8167),l=r(2460),c=r(6804),f=r(6212),h=Object.assign,d=Object.defineProperty,p=o([].concat);e.exports=!h||a((function(){if(n&&1!==h({b:1},h(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach((function(e){t[e]=e})),7!==h({},e)[r]||s(h({},t)).join("")!==o}))?function(e,t){for(var r=c(e),o=arguments.length,a=1,h=u.f,d=l.f;o>a;)for(var v,b=f(arguments[a++]),y=h?p(s(b),h(b)):s(b),_=y.length,m=0;_>m;)v=y[m++],n&&!i(d,b,v)||(r[v]=b[v]);return r}:h},8340:(e,t,r)=>{"use strict";var n,o=r(6043),i=r(5045),a=r(4656),s=r(6480),u=r(6836),l=r(9308),c=r(8192),f="prototype",h="script",d=c("IE_PROTO"),p=function(){},v=function(e){return"<"+h+">"+e+""},b=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;y="undefined"!=typeof document?document.domain&&n?b(n):(t=l("iframe"),r="java"+h+":",t.style.display="none",u.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):b(n);for(var o=a.length;o--;)delete y[f][a[o]];return y()};s[d]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p[f]=o(e),r=new p,p[f]=null,r[d]=e):r=y(),void 0===t?r:i.f(r,t)}},5045:(e,t,r)=>{"use strict";var n=r(3528),o=r(4859),i=r(368),a=r(6043),s=r(9740),u=r(4152);t.f=n&&!o?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),o=u(t),l=o.length,c=0;l>c;)i.f(e,r=o[c++],n[r]);return e}},368:(e,t,r)=>{"use strict";var n=r(3528),o=r(784),i=r(4859),a=r(6043),s=r(8732),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",d="writable";t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&d in r&&!r[d]){var n=c(e,t);n&&n[d]&&(e[t]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:f in r?r[f]:n[f],writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},4560:(e,t,r)=>{"use strict";var n=r(3528),o=r(892),i=r(2460),a=r(9200),s=r(9740),u=r(8732),l=r(6216),c=r(784),f=Object.getOwnPropertyDescriptor;t.f=n?f:function(e,t){if(e=s(e),t=u(t),c)try{return f(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},692:(e,t,r)=>{"use strict";var n=r(9232),o=r(4656).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},8167:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},1304:(e,t,r)=>{"use strict";var n=r(6216),o=r(9063),i=r(6804),a=r(8192),s=r(6740),u=a("IE_PROTO"),l=Object,c=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=i(e);if(n(t,u))return t[u];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof l?c:null}},6056:(e,t,r)=>{"use strict";var n=r(1447);e.exports=n({}.isPrototypeOf)},9232:(e,t,r)=>{"use strict";var n=r(1447),o=r(6216),i=r(9740),a=r(2196).indexOf,s=r(6480),u=n([].push);e.exports=function(e,t){var r,n=i(e),l=0,c=[];for(r in n)!o(s,r)&&o(n,r)&&u(c,r);for(;t.length>l;)o(n,r=t[l++])&&(~a(c,r)||u(c,r));return c}},4152:(e,t,r)=>{"use strict";var n=r(9232),o=r(4656);e.exports=Object.keys||function(e){return n(e,o)}},2460:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},5168:(e,t,r)=>{"use strict";var n=r(6632),o=r(6043),i=r(9472);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},7664:(e,t,r)=>{"use strict";var n=r(892),o=r(9063),i=r(808),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},9976:(e,t,r)=>{"use strict";var n=r(4960),o=r(1447),i=r(692),a=r(8167),s=r(6043),u=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?u(t,r(e)):t}},4880:(e,t,r)=>{"use strict";var n=r(5624);e.exports=n},2696:(e,t,r)=>{"use strict";var n=r(952),o=TypeError;e.exports=function(e){if(n(e))throw new o("Can't call method on "+e);return e}},3440:(e,t,r)=>{"use strict";var n=r(5624),o=r(3528),i=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!o)return n[e];var t=i(n,e);return t&&t.value}},4200:(e,t,r)=>{"use strict";var n=r(368).f,o=r(6216),i=r(1840)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},8192:(e,t,r)=>{"use strict";var n=r(8196),o=r(320),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},9136:(e,t,r)=>{"use strict";var n=r(5624),o=r(1544),i="__core-js_shared__",a=n[i]||o(i,{});e.exports=a},8196:(e,t,r)=>{"use strict";var n=r(2804),o=r(9136);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.35.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"})},1968:(e,t,r)=>{"use strict";var n=r(1447),o=r(3288),i=r(1992),a=r(2696),s=n("".charAt),u=n("".charCodeAt),l=n("".slice),c=function(e){return function(t,r){var n,c,f=i(a(t)),h=o(r),d=f.length;return h<0||h>=d?e?"":void 0:(n=u(f,h))<55296||n>56319||h+1===d||(c=u(f,h+1))<56320||c>57343?e?s(f,h):n:e?l(f,h,h+2):c-56320+(n-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},1572:(e,t,r)=>{"use strict";var n=r(1447),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,l=n(a.exec),c=Math.floor,f=String.fromCharCode,h=n("".charCodeAt),d=n([].join),p=n([].push),v=n("".replace),b=n("".split),y=n("".toLowerCase),_=function(e){return e+22+75*(e<26)},m=function(e,t,r){var n=0;for(e=r?c(e/700):e>>1,e+=c(e/t);e>455;)e=c(e/35),n+=36;return c(n+36*e/(e+38))},g=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r=55296&&o<=56319&&r=a&&nc((o-l)/w))throw new u(s);for(l+=(g-a)*w,a=g,r=0;ro)throw new u(s);if(n===a){for(var S=l,R=36;;){var P=R<=v?1:R>=v+26?26:R-v;if(S{"use strict";var n=r(3356),o=r(6040),i=r(5624).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4160:(e,t,r)=>{"use strict";var n=r(3288),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},9740:(e,t,r)=>{"use strict";var n=r(6212),o=r(2696);e.exports=function(e){return n(o(e))}},3288:(e,t,r)=>{"use strict";var n=r(1736);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},960:(e,t,r)=>{"use strict";var n=r(3288),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},6804:(e,t,r)=>{"use strict";var n=r(2696),o=Object;e.exports=function(e){return o(n(e))}},8176:(e,t,r)=>{"use strict";var n=r(892),o=r(808),i=r(6232),a=r(364),s=r(7664),u=r(1840),l=TypeError,c=u("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,u=a(e,c);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!o(r)||i(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},8732:(e,t,r)=>{"use strict";var n=r(8176),o=r(6232);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},1712:(e,t,r)=>{"use strict";var n={};n[r(1840)("toStringTag")]="z",e.exports="[object z]"===String(n)},1992:(e,t,r)=>{"use strict";var n=r(8040),o=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},4596:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},320:(e,t,r)=>{"use strict";var n=r(1447),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},8020:(e,t,r)=>{"use strict";var n=r(6040),o=r(1840),i=r(3528),a=r(2804),s=o("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),r.delete("a",2),r.delete("b",void 0),a&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(a||!i)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},9448:(e,t,r)=>{"use strict";var n=r(8972);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},4859:(e,t,r)=>{"use strict";var n=r(3528),o=r(6040);e.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},3416:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e{"use strict";var n=r(5624),o=r(9063),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},1840:(e,t,r)=>{"use strict";var n=r(5624),o=r(8196),i=r(6216),a=r(320),s=r(8972),u=r(9448),l=n.Symbol,c=o("wks"),f=u?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return i(c,e)||(c[e]=s&&i(l,e)?l[e]:f("Symbol."+e)),c[e]}},9120:(e,t,r)=>{"use strict";var n=r(9740),o=r(2328),i=r(4920),a=r(5444),s=r(368).f,u=r(8752),l=r(2596),c=r(2804),f=r(3528),h="Array Iterator",d=a.set,p=a.getterFor(h);e.exports=u(Array,"Array",(function(e,t){d(this,{type:h,target:n(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,l(void 0,!0);switch(e.kind){case"keys":return l(r,!1);case"values":return l(t[r],!1)}return l([r,t[r]],!1)}),"values");var v=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!c&&f&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(e){}},8928:(e,t,r)=>{"use strict";var n=r(1968).charAt,o=r(1992),i=r(5444),a=r(8752),s=r(2596),u="String Iterator",l=i.set,c=i.getterFor(u);a(String,"String",(function(e){l(this,{type:u,string:o(e),index:0})}),(function(){var e,t=c(this),r=t.string,o=t.index;return o>=r.length?s(void 0,!0):(e=n(r,o),t.index+=e.length,s(e,!1))}))},9708:(e,t,r)=>{"use strict";var n=r(5624),o=r(5848),i=r(8280),a=r(9120),s=r(3652),u=r(4200),l=r(1840)("iterator"),c=a.values,f=function(e,t){if(e){if(e[l]!==c)try{s(e,l,c)}catch(t){e[l]=c}if(u(e,t,!0),o[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var h in o)f(n[h]&&n[h].prototype,h);f(i,"DOMTokenList")},5704:(e,t,r)=>{"use strict";r(9120);var n=r(3748),o=r(5624),i=r(3440),a=r(892),s=r(1447),u=r(3528),l=r(8020),c=r(3244),f=r(1720),h=r(5248),d=r(4200),p=r(7936),v=r(5444),b=r(5796),y=r(9063),_=r(6216),m=r(2880),g=r(8040),w=r(6043),S=r(808),R=r(1992),P=r(8340),T=r(9200),E=r(2704),O=r(7508),C=r(2596),x=r(3416),k=r(1840),j=r(584),q=k("iterator"),A="URLSearchParams",L=A+"Iterator",I=v.set,B=v.getterFor(A),H=v.getterFor(L),F=i("fetch"),z=i("Request"),W=i("Headers"),D=z&&z.prototype,U=W&&W.prototype,M=o.RegExp,N=o.TypeError,G=o.decodeURIComponent,V=o.encodeURIComponent,Q=s("".charAt),$=s([].join),Y=s([].push),X=s("".replace),J=s([].shift),K=s([].splice),Z=s("".split),ee=s("".slice),te=/\+/g,re=Array(4),ne=function(e){return re[e-1]||(re[e-1]=M("((?:%[\\da-f]{2}){"+e+"})","gi"))},oe=function(e){try{return G(e)}catch(t){return e}},ie=function(e){var t=X(e,te," "),r=4;try{return G(t)}catch(e){for(;r;)t=X(t,ne(r--),oe);return t}},ae=/[!'()~]|%20/g,se={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ue=function(e){return se[e]},le=function(e){return X(V(e),ae,ue)},ce=p((function(e,t){I(this,{type:L,target:B(e).entries,index:0,kind:t})}),A,(function(){var e=H(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,C(void 0,!0);var n=t[r];switch(e.kind){case"keys":return C(n.key,!1);case"values":return C(n.value,!1)}return C([n.key,n.value],!1)}),!0),fe=function(e){this.entries=[],this.url=null,void 0!==e&&(S(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Q(e,0)?ee(e,1):e:R(e)))};fe.prototype={type:A,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,s,u,l=this.entries,c=O(e);if(c)for(r=(t=E(e,c)).next;!(n=a(r,t)).done;){if(i=(o=E(w(n.value))).next,(s=a(i,o)).done||(u=a(i,o)).done||!a(i,o).done)throw new N("Expected sequence with length 2");Y(l,{key:R(s.value),value:R(u.value)})}else for(var f in e)_(e,f)&&Y(l,{key:f,value:R(e[f])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,o=Z(e,"&"),i=0;i0?arguments[0]:void 0));u||(this.size=e.entries.length)},de=he.prototype;if(h(de,{append:function(e,t){var r=B(this);x(arguments.length,2),Y(r.entries,{key:R(e),value:R(t)}),u||this.length++,r.updateURL()},delete:function(e){for(var t=B(this),r=x(arguments.length,1),n=t.entries,o=R(e),i=r<2?void 0:arguments[1],a=void 0===i?i:R(i),s=0;st.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=B(this).entries,n=m(e,arguments.length>1?arguments[1]:void 0),o=0;o1?be(arguments[1]):{})}}),y(z)){var ye=function(e){return b(this,D),new z(e,arguments.length>1?be(arguments[1]):{})};D.constructor=ye,ye.prototype=D,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ye})}}e.exports={URLSearchParams:he,getState:B}},2168:(e,t,r)=>{"use strict";var n=r(3244),o=r(1447),i=r(1992),a=r(3416),s=URLSearchParams,u=s.prototype,l=o(u.append),c=o(u.delete),f=o(u.forEach),h=o([].push),d=new s("a=1&a=2&b=3");d.delete("a",1),d.delete("b",void 0),d+""!="a=2"&&n(u,"delete",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return c(this,e);var n=[];f(this,(function(e,t){h(n,{key:t,value:e})})),a(t,1);for(var o,s=i(e),u=i(r),d=0,p=0,v=!1,b=n.length;d{"use strict";var n=r(3244),o=r(1447),i=r(1992),a=r(3416),s=URLSearchParams,u=s.prototype,l=o(u.getAll),c=o(u.has),f=new s("a=1");!f.has("a",2)&&f.has("a",void 0)||n(u,"has",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return c(this,e);var n=l(this,e);a(t,1);for(var o=i(r),s=0;s{"use strict";r(5704)},8312:(e,t,r)=>{"use strict";var n=r(3528),o=r(1447),i=r(1720),a=URLSearchParams.prototype,s=o(a.forEach);n&&!("size"in a)&&i(a,"size",{get:function(){var e=0;return s(this,(function(){e++})),e},configurable:!0,enumerable:!0})},932:(e,t,r)=>{"use strict";var n=r(3748),o=r(4960),i=r(6040),a=r(3416),s=r(1992),u=r(8020),l=o("URL");n({target:"URL",stat:!0,forced:!(u&&i((function(){l.canParse()})))},{canParse:function(e){var t=a(arguments.length,1),r=s(e),n=t<2||void 0===arguments[1]?void 0:s(arguments[1]);try{return!!new l(r,n)}catch(e){return!1}}})},7332:(e,t,r)=>{"use strict";r(8928);var n,o=r(3748),i=r(3528),a=r(8020),s=r(5624),u=r(2880),l=r(1447),c=r(3244),f=r(1720),h=r(5796),d=r(6216),p=r(7048),v=r(7992),b=r(7588),y=r(1968).codeAt,_=r(1572),m=r(1992),g=r(4200),w=r(3416),S=r(5704),R=r(5444),P=R.set,T=R.getterFor("URL"),E=S.URLSearchParams,O=S.getState,C=s.URL,x=s.TypeError,k=s.parseInt,j=Math.floor,q=Math.pow,A=l("".charAt),L=l(/./.exec),I=l([].join),B=l(1..toString),H=l([].pop),F=l([].push),z=l("".replace),W=l([].shift),D=l("".split),U=l("".slice),M=l("".toLowerCase),N=l([].unshift),G="Invalid scheme",V="Invalid host",Q="Invalid port",$=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,J=/^0x/i,K=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,oe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)N(t,e%256),e=j(e/256);return I(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=B(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},se={},ue=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),le=p({},ue,{"#":1,"?":1,"{":1,"}":1}),ce=p({},le,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),fe=function(e,t){var r=y(e,0);return r>32&&r<127&&!d(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},de=function(e,t){var r;return 2===e.length&&L($,A(e,0))&&(":"===(r=A(e,1))||!t&&"|"===r)},pe=function(e){var t;return e.length>1&&de(U(e,0,2))&&(2===e.length||"/"===(t=A(e,2))||"\\"===t||"?"===t||"#"===t)},ve=function(e){return"."===e||"%2e"===M(e)},be={},ye={},_e={},me={},ge={},we={},Se={},Re={},Pe={},Te={},Ee={},Oe={},Ce={},xe={},ke={},je={},qe={},Ae={},Le={},Ie={},Be={},He=function(e,t,r){var n,o,i,a=m(e);if(t){if(o=this.parse(a))throw new x(o);this.searchParams=null}else{if(void 0!==r&&(n=new He(r,!0)),o=this.parse(a,null,n))throw new x(o);(i=O(new E)).bindURL(this),this.searchParams=i}};He.prototype={type:"URL",parse:function(e,t,r){var o,i,a,s,u,l=this,c=t||be,f=0,h="",p=!1,y=!1,_=!1;for(e=m(e),t||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,e=z(e,ne,""),e=z(e,oe,"$1")),e=z(e,ie,""),o=v(e);f<=o.length;){switch(i=o[f],c){case be:if(!i||!L($,i)){if(t)return G;c=_e;continue}h+=M(i),c=ye;break;case ye:if(i&&(L(Y,i)||"+"===i||"-"===i||"."===i))h+=M(i);else{if(":"!==i){if(t)return G;h="",c=_e,f=0;continue}if(t&&(l.isSpecial()!==d(he,h)||"file"===h&&(l.includesCredentials()||null!==l.port)||"file"===l.scheme&&!l.host))return;if(l.scheme=h,t)return void(l.isSpecial()&&he[l.scheme]===l.port&&(l.port=null));h="","file"===l.scheme?c=xe:l.isSpecial()&&r&&r.scheme===l.scheme?c=me:l.isSpecial()?c=Re:"/"===o[f+1]?(c=ge,f++):(l.cannotBeABaseURL=!0,F(l.path,""),c=Le)}break;case _e:if(!r||r.cannotBeABaseURL&&"#"!==i)return G;if(r.cannotBeABaseURL&&"#"===i){l.scheme=r.scheme,l.path=b(r.path),l.query=r.query,l.fragment="",l.cannotBeABaseURL=!0,c=Be;break}c="file"===r.scheme?xe:we;continue;case me:if("/"!==i||"/"!==o[f+1]){c=we;continue}c=Pe,f++;break;case ge:if("/"===i){c=Te;break}c=Ae;continue;case we:if(l.scheme=r.scheme,i===n)l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=b(r.path),l.query=r.query;else if("/"===i||"\\"===i&&l.isSpecial())c=Se;else if("?"===i)l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=b(r.path),l.query="",c=Ie;else{if("#"!==i){l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=b(r.path),l.path.length--,c=Ae;continue}l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=b(r.path),l.query=r.query,l.fragment="",c=Be}break;case Se:if(!l.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,c=Ae;continue}c=Te}else c=Pe;break;case Re:if(c=Pe,"/"!==i||"/"!==A(h,f+1))continue;f++;break;case Pe:if("/"!==i&&"\\"!==i){c=Te;continue}break;case Te:if("@"===i){p&&(h="%40"+h),p=!0,a=v(h);for(var g=0;g65535)return Q;l.port=l.isSpecial()&&R===he[l.scheme]?null:R,h=""}if(t)return;c=qe;continue}return Q}h+=i;break;case xe:if(l.scheme="file","/"===i||"\\"===i)c=ke;else{if(!r||"file"!==r.scheme){c=Ae;continue}switch(i){case n:l.host=r.host,l.path=b(r.path),l.query=r.query;break;case"?":l.host=r.host,l.path=b(r.path),l.query="",c=Ie;break;case"#":l.host=r.host,l.path=b(r.path),l.query=r.query,l.fragment="",c=Be;break;default:pe(I(b(o,f),""))||(l.host=r.host,l.path=b(r.path),l.shortenPath()),c=Ae;continue}}break;case ke:if("/"===i||"\\"===i){c=je;break}r&&"file"===r.scheme&&!pe(I(b(o,f),""))&&(de(r.path[0],!0)?F(l.path,r.path[0]):l.host=r.host),c=Ae;continue;case je:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!t&&de(h))c=Ae;else if(""===h){if(l.host="",t)return;c=qe}else{if(s=l.parseHost(h))return s;if("localhost"===l.host&&(l.host=""),t)return;h="",c=qe}continue}h+=i;break;case qe:if(l.isSpecial()){if(c=Ae,"/"!==i&&"\\"!==i)continue}else if(t||"?"!==i)if(t||"#"!==i){if(i!==n&&(c=Ae,"/"!==i))continue}else l.fragment="",c=Be;else l.query="",c=Ie;break;case Ae:if(i===n||"/"===i||"\\"===i&&l.isSpecial()||!t&&("?"===i||"#"===i)){if(".."===(u=M(u=h))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(l.shortenPath(),"/"===i||"\\"===i&&l.isSpecial()||F(l.path,"")):ve(h)?"/"===i||"\\"===i&&l.isSpecial()||F(l.path,""):("file"===l.scheme&&!l.path.length&&de(h)&&(l.host&&(l.host=""),h=A(h,0)+":"),F(l.path,h)),h="","file"===l.scheme&&(i===n||"?"===i||"#"===i))for(;l.path.length>1&&""===l.path[0];)W(l.path);"?"===i?(l.query="",c=Ie):"#"===i&&(l.fragment="",c=Be)}else h+=fe(i,le);break;case Le:"?"===i?(l.query="",c=Ie):"#"===i?(l.fragment="",c=Be):i!==n&&(l.path[0]+=fe(i,se));break;case Ie:t||"#"!==i?i!==n&&("'"===i&&l.isSpecial()?l.query+="%27":l.query+="#"===i?"%23":fe(i,se)):(l.fragment="",c=Be);break;case Be:i!==n&&(l.fragment+=fe(i,ue))}f++}},parseHost:function(e){var t,r,n;if("["===A(e,0)){if("]"!==A(e,e.length-1))return V;if(t=function(e){var t,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,f=0,h=function(){return A(e,f)};if(":"===h()){if(":"!==A(e,1))return;f+=2,c=++l}for(;h();){if(8===l)return;if(":"!==h()){for(t=r=0;r<4&&L(ee,h());)t=16*t+k(h(),16),f++,r++;if("."===h()){if(0===r)return;if(f-=r,l>6)return;for(n=0;h();){if(o=null,n>0){if(!("."===h()&&n<4))return;f++}if(!L(X,h()))return;for(;L(X,h());){if(i=k(h(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;f++}u[l]=256*u[l]+o,2!=++n&&4!==n||l++}if(4!==n)return;break}if(":"===h()){if(f++,!h())return}else if(h())return;u[l++]=t}else{if(null!==c)return;f++,c=++l}}if(null!==c)for(a=l-c,l=7;0!==l&&a>0;)s=u[l],u[l--]=u[c+a-1],u[c+--a]=s;else if(8!==l)return;return u}(U(e,1,-1)),!t)return V;this.host=t}else if(this.isSpecial()){if(e=_(e),L(te,e))return V;if(t=function(e){var t,r,n,o,i,a,s,u=D(e,".");if(u.length&&""===u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(r=[],n=0;n1&&"0"===A(o,0)&&(i=L(J,o)?16:8,o=U(o,8===i?1:2)),""===o)a=0;else{if(!L(10===i?Z:8===i?K:ee,o))return e;a=k(o,i)}F(r,a)}for(n=0;n=q(256,5-t))return null}else if(a>255)return null;for(s=H(r),n=0;n1?arguments[1]:void 0,n=P(t,new He(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ze=Fe.prototype,We=function(e,t){return{get:function(){return T(this)[e]()},set:t&&function(e){return T(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(f(ze,"href",We("serialize","setHref")),f(ze,"origin",We("getOrigin")),f(ze,"protocol",We("getProtocol","setProtocol")),f(ze,"username",We("getUsername","setUsername")),f(ze,"password",We("getPassword","setPassword")),f(ze,"host",We("getHost","setHost")),f(ze,"hostname",We("getHostname","setHostname")),f(ze,"port",We("getPort","setPort")),f(ze,"pathname",We("getPathname","setPathname")),f(ze,"search",We("getSearch","setSearch")),f(ze,"searchParams",We("getSearchParams")),f(ze,"hash",We("getHash","setHash"))),c(ze,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),c(ze,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),C){var De=C.createObjectURL,Ue=C.revokeObjectURL;De&&c(Fe,"createObjectURL",u(De,C)),Ue&&c(Fe,"revokeObjectURL",u(Ue,C))}g(Fe,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Fe})},544:(e,t,r)=>{"use strict";r(7332)},1060:(e,t,r)=>{"use strict";var n=r(3748),o=r(892);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},80:(e,t,r)=>{"use strict";var n=r(1048);r(9708),e.exports=n},8348:(e,t,r)=>{"use strict";r(544),r(932);var n=r(4880);e.exports=n.URL.canParse},4908:(e,t,r)=>{"use strict";var n=r(5517);e.exports=n},1048:(e,t,r)=>{"use strict";r(4088),r(2168),r(5104),r(8312);var n=r(4880);e.exports=n.URLSearchParams},5517:(e,t,r)=>{"use strict";r(1048),r(544),r(932),r(1060);var n=r(4880);e.exports=n.URL}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";!function(e){function t(e){var t=0|e.charCodeAt(0);if(55296<=t)if(56320>t)if(56320<=(e=0|e.charCodeAt(1))&&57343>=e){if(65535<(t=(t<<10)+e-56613888|0))return o(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533;else 57343>=t&&(t=65533);return 2047>=t?o(192|t>>>6,128|63&t):o(224|t>>>12,128|t>>>6&63,128|63&t)}function r(){}function n(e,r){var n=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,t),o=0|n.length,i=0,a=0,s=0|r.length,u=0|e.length;s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a=a+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((i+1|0)>1)|0)){var i=u.encode(e);if((0|i.length)=192&&(n=n<224?(31&n)<<6|63&e[r++]:n<240?(15&n)<<12|(63&e[r++])<<6|63&e[r++]:(7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]),t+=String.fromCharCode(n)}return t}},r(348),r(7072),r(7728);var e,t,n=Object.create,o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,l=((e,t,r)=>(r=null!=e?n(s(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of a(t))u.call(e,r)||undefined===r||o(e,r,{get:()=>t[r],enumerable:!(n=i(t,r))||n.enumerable});return e})(e&&e.__esModule?r:o(r,"default",{value:e,enumerable:!0}),e)))((e={"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){var r={decodeValues:!0,map:!1,silent:!1};function n(e){return"string"==typeof e&&!!e.trim()}function o(e,t){var o=e.split(";").filter(n),i=function(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}(o.shift()),a=i.name,s=i.value;t=t?Object.assign({},r,t):r;try{s=t.decodeValues?decodeURIComponent(s):s}catch(e){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+s+"'. Set options.decodeValues to false to disable this feature.",e)}var u={name:a,value:s};return o.forEach((function(e){var t=e.split("="),r=t.shift().trimLeft().toLowerCase(),n=t.join("=");"expires"===r?u.expires=new Date(n):"max-age"===r?u.maxAge=parseInt(n,10):"secure"===r?u.secure=!0:"httponly"===r?u.httpOnly=!0:"samesite"===r?u.sameSite=n:u[r]=n})),u}function i(e,t){if(t=t?Object.assign({},r,t):r,!e)return t.map?{}:[];if(e.headers)if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var i=e.headers[Object.keys(e.headers).find((function(e){return"set-cookie"===e.toLowerCase()}))];i||!e.headers.cookie||t.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=i}return Array.isArray(e)||(e=[e]),(t=t?Object.assign({},r,t):r).map?e.filter(n).reduce((function(e,r){var n=o(r,t);return e[n.name]=n,e}),{}):e.filter(n).map((function(e){return o(e,t)}))}t.exports=i,t.exports.parse=i,t.exports.parseString=o,t.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,r,n,o,i,a=[],s=0;function u(){for(;s=e.length)&&a.push(e.substring(t,e.length))}return a}}},function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports})()),c=/[^a-z0-9\-#$%&'*+.^_`|~]/i;function f(e){if(c.test(e)||""===e.trim())throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}var h=[String.fromCharCode(10),String.fromCharCode(13),String.fromCharCode(9),String.fromCharCode(32)],d=new RegExp(`(^[${h.join("")}]|$[${h.join("")}])`,"g");function p(e){return e.replace(d,"")}function v(e){if("string"!=typeof e)return!1;if(0===e.length)return!1;for(let t=0;t127||!b(r))return!1}return!0}function b(e){return![127,32,"(",")","<",">","@",",",";",":","\\",'"',"/","[","]","?","=","{","}"].includes(e)}function y(e){if("string"!=typeof e)return!1;if(e.trim()!==e)return!1;for(let t=0;t{this.append(t,e)}),this):Array.isArray(t)?t.forEach((([e,t])=>{this.append(e,Array.isArray(t)?t.join(", "):t)})):t&&Object.getOwnPropertyNames(t).forEach((e=>{const r=t[e];this.append(e,Array.isArray(r)?r.join(", "):r)}))}[(_=g,m=w,Symbol.iterator)](){return this.entries()}*keys(){for(const[e]of this.entries())yield e}*values(){for(const[,e]of this.entries())yield e}*entries(){let e=Object.keys(this[g]).sort(((e,t)=>e.localeCompare(t)));for(const t of e)if("set-cookie"===t)for(const e of this.getSetCookie())yield[t,e];else yield[t,this.get(t)]}has(e){if(!v(e))throw new TypeError(`Invalid header name "${e}"`);return this[g].hasOwnProperty(f(e))}get(e){if(!v(e))throw TypeError(`Invalid header name "${e}"`);return this[g][f(e)]??null}set(e,t){if(!v(e)||!y(t))return;const r=f(e),n=p(t);this[g][r]=p(n),this[w].set(r,e)}append(e,t){if(!v(e)||!y(t))return;const r=f(e),n=p(t);let o=this.has(r)?`${this.get(r)}, ${n}`:n;this.set(e,o)}delete(e){if(!v(e))return;if(!this.has(e))return;const t=f(e);delete this[g][t],this[w].delete(t)}forEach(e,t){for(const[r,n]of this.entries())e.call(t,n,r,this)}getSetCookie(){const e=this.get("set-cookie");return null===e?[]:""===e?[""]:(0,l.splitCookiesString)(e)}};globalThis.Headers=S})()})(); \ No newline at end of file From 71d9b08e74188a883015bc3ce0137b50b821c0cc Mon Sep 17 00:00:00 2001 From: pacoyang Date: Wed, 7 Feb 2024 12:10:44 +0800 Subject: [PATCH 2/2] fix: preventing path errors on windows --- src/lib/runWebpack.ts | 7 ++++++- src/lib/sync-request/index.ts | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/runWebpack.ts b/src/lib/runWebpack.ts index 0d66c07..a45ff39 100644 --- a/src/lib/runWebpack.ts +++ b/src/lib/runWebpack.ts @@ -37,7 +37,12 @@ const getBaseConfig = ( loader: require.resolve('ts-loader'), options: { context: projectDir, - configFile: require.resolve('../../tsconfig.build.json'), + configFile: require.resolve(upath.join( + __dirname, + '..', + '..', + 'tsconfig.build.json' + )), onlyCompileBundledFiles: true, } }, diff --git a/src/lib/sync-request/index.ts b/src/lib/sync-request/index.ts index b5d2eb5..26ec47e 100644 --- a/src/lib/sync-request/index.ts +++ b/src/lib/sync-request/index.ts @@ -1,9 +1,10 @@ +import upath from 'upath' import type { Dispatcher } from 'undici' export type HttpMethod = Dispatcher.HttpMethod const rpc = require('sync-rpc') -const remote = rpc(require.resolve('./worker')) +const remote = rpc(require.resolve(upath.join(__dirname, 'worker'))) export default function ( options: Omit & {