@web3auth/no-modal 9.5.3 → 9.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see noModal.umd.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NoModal=t():e.NoModal=t()}(self,(()=>(()=>{var e={2682:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(273),{AbortError:o,codes:i}=r(1150),{isNodeStream:a,isWebStream:s,kControllerErrorFunction:l}=r(8104),c=r(2549),{ERR_INVALID_ARG_TYPE:u}=i;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!a(r)&&!s(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const i=a(t)?()=>{t.destroy(new o(void 0,{cause:e.reason}))}:()=>{t[l](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{f=f||r(8449).addAbortListener;const o=f(e,i);c(t,o[n])}return t}},8610:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:a}=r(273),{Buffer:s}=r(1048),{inspect:l}=r(8449);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[o](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,o=0;do{const i=r.data;if(!(e>i.length)){e===i.length?(t+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(i,0,e),this.head=r,r.data=n(i,e));break}t+=i,e-=i.length,++o}while(null!==(r=r.next));return this.length-=o,t}_getBuffer(e){const t=s.allocUnsafe(e),r=e;let n=this.head,o=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(i(t,s,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new a(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}i(t,s,r-e),e-=s.length,++o}while(null!==(n=n.next));return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},6009:(e,t,r)=>{"use strict";const{pipeline:n}=r(7103),o=r(6631),{destroyer:i}=r(863),{isNodeStream:a,isReadable:s,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:d}=r(8104),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:y}}=r(1150),g=r(2549);e.exports=function(...e){if(0===e.length)throw new y("streams");if(1===e.length)return o.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=o.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=o.from(e[t])}for(let r=0;r<e.length;++r)if(a(e[r])||c(e[r])){if(r<e.length-1&&!(s(e[r])||d(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,b,m,w,v;const _=e[0],E=n(e,(function(e){const t=w;w=null,t?t(e):e?v.destroy(e):A||S||v.destroy()})),S=!!(l(_)||f(_)||u(_)),A=!!(s(E)||d(E)||u(E));if(v=new o({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==E||!E.readableObjectMode),writable:S,readable:A}),S){if(a(_))v._write=function(e,t,n){_.write(e,t)?n():r=n},v._final=function(e){_.end(),b=e},_.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(c(_)){const e=(u(_)?_.writable:_).getWriter();v._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},v._final=async function(t){try{await e.ready,e.close().catch((()=>{})),b=t}catch(e){t(e)}}}const e=u(E)?E.readable:E;g(e,(()=>{if(b){const e=b;b=null,e()}}))}if(A)if(a(E))E.on("readable",(function(){if(m){const e=m;m=null,e()}})),E.on("end",(function(){v.push(null)})),v._read=function(){for(;;){const e=E.read();if(null===e)return void(m=v._read);if(!v.push(e))return}};else if(c(E)){const e=(u(E)?E.readable:E).getReader();v._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!v.push(t))return;if(r)return void v.push(null)}catch{return}}}return v._destroy=function(e,t){e||null===w||(e=new h),m=null,r=null,b=null,null===w?t(e):(w=t,a(E)&&i(E,e))},v}},863:(e,t,r)=>{"use strict";const n=r(9907),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=r(1150),{Symbol:s}=r(273),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(8104),d=s("kDestroy"),h=s("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function y(e,t,r){let o=!1;function i(t){if(o)return;o=!0;const i=e._readableState,a=e._writableState;p(t,a,i),a&&(a.closed=!0),i&&(i.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(g,e,t):n.nextTick(b,e)}try{e._destroy(t||null,i)}catch(t){i(t)}}function g(e,t){m(e,t),b(e)}function b(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function m(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function w(e,t,r){const o=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),o&&!o.errored&&(o.errored=t),r?n.nextTick(m,e,t):m(e,t))}function v(e){let t=!1;function r(r){if(t)return void w(e,null!=r?r:new i);t=!0;const o=e._readableState,a=e._writableState,s=a||o;o&&(o.constructed=!0),a&&(a.constructed=!0),s.destroyed?e.emit(d,r):r?w(e,r,!0):n.nextTick(_,e)}try{e._construct((e=>{n.nextTick(r,e)}))}catch(e){n.nextTick(r,e)}}function _(e){e.emit(h)}function E(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function S(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(S,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(v,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new a),f(e)?(e.socket=null,e.destroy(t)):E(e)?e.abort():E(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(A,e,t):n.nextTick(S,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,i=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?y(this,e,t):this.once(d,(function(r){y(this,o(r,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:w}},6631:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:i,ObjectSetPrototypeOf:a}=r(273);e.exports=c;const s=r(9333),l=r(789);a(c.prototype,s.prototype),a(c,s);{const e=i(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,f;function d(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...o(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(l.prototype,"writableLength")},writableFinished:{__proto__:null,...o(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return d().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return d().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(6821)),f(e,"body")}},6821:(e,t,r)=>{const n=r(9907),o=r(1048),{isReadable:i,isWritable:a,isIterable:s,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:h}=r(8104),p=r(2549),{AbortError:y,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:b}}=r(1150),{destroyer:m}=r(863),w=r(6631),v=r(9333),_=r(789),{createDeferredPromise:E}=r(8449),S=r(7533),A=globalThis.Blob||o.Blob,R=void 0!==A?function(e){return e instanceof A}:function(e){return!1},N=globalThis.AbortController||r(7083).AbortController,{FunctionPrototypeCall:O}=r(273);class P extends w{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?v.wrap(e.readable):e.readable,r=e.writable;let n,o,s,l,c,u=!!i(t),f=!!a(r);function d(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new P({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,(e=>{f=!1,e&&m(t,e),d(e)})),c._write=function(e,t,o){r.write(e,t)?o():n=o},c._final=function(e){r.end(),o=e},r.on("drain",(function(){if(n){const e=n;n=null,e()}})),r.on("finish",(function(){if(o){const e=o;o=null,e()}}))),u&&(p(t,(e=>{u=!1,e&&m(t,e),d(e)})),t.on("readable",(function(){if(s){const e=s;s=null,e()}})),t.on("end",(function(){c.push(null)})),c._read=function(){for(;;){const e=t.read();if(null===e)return void(s=c._read);if(!c.push(e))return}}),c._destroy=function(e,i){e||null===l||(e=new y),s=null,n=null,o=null,null===l?i(e):(l=i,m(r,e),m(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return T({readable:t});if(u(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if(d(t))return T({readable:v.fromWeb(t)});if(h(t))return T({writable:_.fromWeb(t)});if("function"==typeof t){const{value:e,write:o,final:i,destroy:a}=function(e){let{promise:t,resolve:r}=E();const o=new N,i=o.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:o,done:a,cb:s}=await e;if(n.nextTick(s),a)return;if(i.aborted)throw new y(void 0,{cause:i.reason});({promise:t,resolve:r}=E()),yield o}}(),{signal:i}),write(e,t,n){const o=r;r=null,o({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(s(e))return S(P,e,{objectMode:!0,write:o,final:i,destroy:a});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,(e=>{if(null!=e)throw new b("nully","body",e)}),(e=>{m(t,e)}));return t=new P({objectMode:!0,readable:!1,write:o,final(e){i((async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}}))},destroy:a})}throw new b("Iterable, AsyncIterable or AsyncFunction",r,e)}if(R(t))return e(t.arrayBuffer());if(s(t))return S(P,t,{objectMode:!0,writable:!1});if(d(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return P.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const o=null==t?void 0:t.then;if("function"==typeof o){let e;return O(o,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{m(e,t)})),e=new P({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},2549:(e,t,r)=>{const n=r(9907),{AbortError:o,codes:i}=r(1150),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=i,{kEmptyObject:l,once:c}=r(8449),{validateAbortSignal:u,validateFunction:f,validateObject:d,validateBoolean:h}=r(8080),{Promise:p,PromisePrototypeThen:y,SymbolDispose:g}=r(273),{isClosed:b,isReadable:m,isReadableNodeStream:w,isReadableStream:v,isReadableFinished:_,isReadableErrored:E,isWritable:S,isWritableNodeStream:A,isWritableStream:R,isWritableFinished:N,isWritableErrored:O,isNodeStream:P,willEmitClose:T,kIsClosedPromise:I}=r(8104);let C;const x=()=>{};function k(e,t,i){var h,p;if(2===arguments.length?(i=t,t=l):null==t?t=l:d(t,"options"),f(i,"callback"),u(t.signal,"options.signal"),i=c(i),v(e)||R(e))return function(e,t,i){let a=!1,s=x;if(t.signal)if(s=()=>{a=!0,i.call(e,new o(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(s);else{C=C||r(8449).addAbortListener;const n=C(t.signal,s),o=i;i=c(((...t)=>{n[g](),o.apply(e,t)}))}const l=(...t)=>{a||n.nextTick((()=>i.apply(e,t)))};return y(e[I].promise,l,l),x}(e,t,i);if(!P(e))throw new a("stream",["ReadableStream","WritableStream","Stream"],e);const k=null!==(h=t.readable)&&void 0!==h?h:w(e),j=null!==(p=t.writable)&&void 0!==p?p:A(e),L=e._writableState,M=e._readableState,U=()=>{e.writable||F()};let D=T(e)&&w(e)===k&&A(e)===j,B=N(e,!1);const F=()=>{B=!0,e.destroyed&&(D=!1),(!D||e.readable&&!k)&&(k&&!$||i.call(e))};let $=_(e,!1);const W=()=>{$=!0,e.destroyed&&(D=!1),(!D||e.writable&&!j)&&(j&&!B||i.call(e))},H=t=>{i.call(e,t)};let G=b(e);const q=()=>{G=!0;const t=O(e)||E(e);return t&&"boolean"!=typeof t?i.call(e,t):k&&!$&&w(e,!0)&&!_(e,!1)?i.call(e,new s):!j||B||N(e,!1)?void i.call(e):i.call(e,new s)},V=()=>{G=!0;const t=O(e)||E(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},J=()=>{e.req.on("finish",F)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?j&&!L&&(e.on("end",U),e.on("close",U)):(e.on("complete",F),D||e.on("abort",q),e.req?J():e.on("request",J)),D||"boolean"!=typeof e.aborted||e.on("aborted",q),e.on("end",W),e.on("finish",F),!1!==t.error&&e.on("error",H),e.on("close",q),G?n.nextTick(q):null!=L&&L.errorEmitted||null!=M&&M.errorEmitted?D||n.nextTick(V):(k||D&&!m(e)||!B&&!1!==S(e))&&(j||D&&!S(e)||!$&&!1!==m(e))?M&&e.req&&e.aborted&&n.nextTick(V):n.nextTick(V);const K=()=>{i=x,e.removeListener("aborted",q),e.removeListener("complete",F),e.removeListener("abort",q),e.removeListener("request",J),e.req&&e.req.removeListener("finish",F),e.removeListener("end",U),e.removeListener("close",U),e.removeListener("finish",F),e.removeListener("end",W),e.removeListener("error",H),e.removeListener("close",q)};if(t.signal&&!G){const a=()=>{const r=i;K(),r.call(e,new o(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{C=C||r(8449).addAbortListener;const n=C(t.signal,a),o=i;i=c(((...t)=>{n[g](),o.apply(e,t)}))}}return K}e.exports=k,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new p(((r,o)=>{const i=k(e,t,(e=>{n&&i(),e?o(e):r()}))}))}},7533:(e,t,r)=>{"use strict";const n=r(9907),{PromisePrototypeThen:o,SymbolAsyncIterator:i,SymbolIterator:a}=r(273),{Buffer:s}=r(1048),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(1150).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[i])f=!0,u=t[i]();else{if(!t||!t[a])throw new l("iterable",["Iterable"],t);f=!1,u=t[a]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)d.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new c;if(d.push(t))continue;h=!1}}catch(e){d.destroy(e)}break}}())},d._destroy=function(e,t){o(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),(()=>n.nextTick(t,e)),(r=>n.nextTick(t,r||e)))},d}},670:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:o}=r(273),{EventEmitter:i}=r(46);function a(e){i.call(this,e)}function s(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}o(a.prototype,i.prototype),o(a,i),a.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",c));let a=!1;function l(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return s(r,"error",u),s(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:a,prependListener:s}},8484:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(7083).AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:l}=r(1150),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(8080),d=r(273).Symbol("kWeak"),h=r(273).Symbol("kResistStopPropagation"),{finished:p}=r(2549),y=r(6009),{addAbortSignalNoValidate:g}=r(2682),{isWritable:b,isNodeStream:m}=r(8104),{deprecate:w}=r(8449),{ArrayPrototypePush:v,Boolean:_,MathFloor:E,Number:S,NumberIsNaN:A,Promise:R,PromiseReject:N,PromiseResolve:O,PromisePrototypeThen:P,Symbol:T}=r(273),I=T("kEmpty"),C=T("kEof");function x(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=E(t.concurrency));let o=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(o=E(t.highWaterMark)),u(n,"options.concurrency",1),u(o,"options.highWaterMark",0),o+=n,async function*(){const i=r(8449).AbortSignalAny([null==t?void 0:t.signal].filter(_)),a=this,s=[],c={signal:i};let u,f,d=!1,h=0;function p(){d=!0,y()}function y(){h-=1,g()}function g(){f&&!d&&h<n&&s.length<o&&(f(),f=null)}!async function(){try{for await(let t of a){if(d)return;if(i.aborted)throw new l;try{if(t=e(t,c),t===I)continue;t=O(t)}catch(e){t=N(e)}h+=1,P(t,y,p),s.push(t),u&&(u(),u=null),!d&&(s.length>=o||h>=n)&&await new R((e=>{f=e}))}s.push(C)}catch(e){const t=N(e);P(t,y,p),s.push(t)}finally{d=!0,u&&(u(),u=null)}}();try{for(;;){for(;s.length>0;){const e=await s[0];if(e===C)return;if(i.aborted)throw new l;e!==I&&(yield e),s.shift(),g()}await new R((e=>{u=e}))}}finally{d=!0,f&&(f(),f=null)}}.call(this)}async function k(e,t=void 0){for await(const r of j.call(this,e,t))return!0;return!1}function j(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return x.call(this,(async function(t,r){return await e(t,r)?t:I}),t)}class L extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=S(e),A(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:w((function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,n]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:j,flatMap:function(e,t){const r=x.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:x,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),m(e)&&!b(e))throw new o("stream",e,"must be writable");const r=y(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!await k.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);for await(const r of x.call(this,(async function(t,r){return await e(t,r),I}),t));},reduce:async function(e,t,r){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let a=arguments.length>1;if(null!=r&&null!==(o=r.signal)&&void 0!==o&&o.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const s=new n,u=s.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this,[h]:!0};r.signal.addEventListener("abort",(()=>s.abort()),e)}let y=!1;try{for await(const n of this){var g;if(y=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;a?t=await e(t,n,{signal:u}):(t=n,a=!0)}if(!y&&!a)throw new L}finally{s.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});v(t,n)}return t},some:k,find:async function(e,t){for await(const r of j.call(this,e,t))return r}}},5691:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(273);e.exports=i;const o=r(3273);function i(e){if(!(this instanceof i))return new i(e);o.call(this,e)}n(i.prototype,o.prototype),n(i,o),i.prototype._transform=function(e,t,r){r(null,e)}},7103:(e,t,r)=>{const n=r(9907),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:a,SymbolDispose:s}=r(273),l=r(2549),{once:c}=r(8449),u=r(863),f=r(6631),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:m}=r(1150),{validateFunction:w,validateAbortSignal:v}=r(8080),{isIterable:_,isReadable:E,isReadableNodeStream:S,isNodeStream:A,isTransformStream:R,isWebStream:N,isReadableStream:O,isReadableFinished:P}=r(8104),T=globalThis.AbortController||r(7083).AbortController;let I,C,x;function k(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:r},(e=>{n=!e}))}}function j(e){if(_(e))return e;if(S(e))return async function*(e){C||(C=r(9333)),yield*C.prototype[a].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function L(e,t,r,{end:n}){let o,a=null;const s=e=>{if(e&&(o=e),a){const e=a;a=null,e()}},c=()=>new i(((e,t)=>{o?t(o):a=()=>{o?t(o):e()}}));t.on("drain",s);const u=l(t,{readable:!1},s);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(o!==e?d(o,e):e)}finally{u(),t.off("drain",s)}}async function M(e,t,r,{end:n}){R(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch((()=>{}));await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function U(e,t,i){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new y("streams");const a=new T,l=a.signal,c=null==i?void 0:i.signal,u=[];function d(){F(new m)}let g,b,w;v(c,"options.signal"),x=x||r(8449).addAbortListener,c&&(g=x(c,d));const P=[];let C,U=0;function B(e){F(e,0==--U)}function F(e,r){var o;if(!e||b&&"ERR_STREAM_PREMATURE_CLOSE"!==b.code||(b=e),b||r){for(;P.length;)P.shift()(b);null===(o=g)||void 0===o||o[s](),a.abort(),r&&(b||u.forEach((e=>e())),n.nextTick(t,b,w))}}for(let G=0;G<e.length;G++){const q=e[G],V=G<e.length-1,J=G>0,K=V||!1!==(null==i?void 0:i.end),Y=G===e.length-1;if(A(q)){if(K){const{destroy:z,cleanup:X}=k(q,V,J);P.push(z),E(q)&&Y&&u.push(X)}function $(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&B(e)}q.on("error",$),E(q)&&Y&&u.push((()=>{q.removeListener("error",$)}))}if(0===G)if("function"==typeof q){if(C=q({signal:l}),!_(C))throw new p("Iterable, AsyncIterable or Stream","source",C)}else C=_(q)||S(q)||R(q)?q:f.from(q);else if("function"==typeof q){var W;if(C=R(C)?j(null===(W=C)||void 0===W?void 0:W.readable):j(C),C=q(C,{signal:l}),V){if(!_(C,!0))throw new p("AsyncIterable",`transform[${G-1}]`,C)}else{var H;I||(I=r(5691));const Q=new I({objectMode:!0}),Z=null===(H=C)||void 0===H?void 0:H.then;if("function"==typeof Z)U++,Z.call(C,(e=>{w=e,null!=e&&Q.write(e),K&&Q.end(),n.nextTick(B)}),(e=>{Q.destroy(e),n.nextTick(B,e)}));else if(_(C,!0))U++,L(C,Q,B,{end:K});else{if(!O(C)&&!R(C))throw new p("AsyncIterable or Promise","destination",C);{const re=C.readable||C;U++,L(re,Q,B,{end:K})}}C=Q;const{destroy:ee,cleanup:te}=k(C,!1,!0);P.push(ee),Y&&u.push(te)}}else if(A(q)){if(S(C)){U+=2;const ne=D(C,q,B,{end:K});E(q)&&Y&&u.push(ne)}else if(R(C)||O(C)){const oe=C.readable||C;U++,L(oe,q,B,{end:K})}else{if(!_(C))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);U++,L(C,q,B,{end:K})}C=q}else if(N(q)){if(S(C))U++,M(j(C),q,B,{end:K});else if(O(C)||_(C))U++,M(C,q,B,{end:K});else{if(!R(C))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);U++,M(C.readable,q,B,{end:K})}C=q}else C=f.from(q)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(d),C}function D(e,t,r,{end:o}){let i=!1;if(t.on("close",(()=>{i||r(new b)})),e.pipe(t,{end:!1}),o){function a(){i=!0,t.end()}P(e)?n.nextTick(a):e.once("end",a)}else r();return l(e,{readable:!0,writable:!1},(t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:U,pipeline:function(...e){return U(e,c(function(e){return w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},9333:(e,t,r)=>{const n=r(9907),{ArrayPrototypeIndexOf:o,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:p,Symbol:y}=r(273);e.exports=Y,Y.ReadableState=K;const{EventEmitter:g}=r(46),{Stream:b,prependListener:m}=r(670),{Buffer:w}=r(1048),{addAbortSignal:v}=r(2682),_=r(2549);let E=r(8449).debuglog("stream",(e=>{E=e}));const S=r(8610),A=r(863),{getHighWaterMark:R,getDefaultHighWaterMark:N}=r(7872),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:I,ERR_STREAM_PUSH_AFTER_EOF:C,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:k}=r(1150),{validateObject:j}=r(8080),L=y("kPaused"),{StringDecoder:M}=r(2664),U=r(7533);u(Y.prototype,b.prototype),u(Y,b);const D=()=>{},{errorOrDestroy:B}=A,F=1,$=16,W=32,H=64,G=2048,q=4096,V=65536;function J(e){return{enumerable:!1,get(){return!!(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function K(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(6631)),this.state=G|q|$|W,e&&e.objectMode&&(this.state|=F),n&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?R(this,e,"readableHighWaterMark",n):N(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,e&&!1===e.emitClose&&(this.state&=~G),e&&!1===e.autoDestroy&&(this.state&=~q),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function Y(e){if(!(this instanceof Y))return new Y(e);const t=this instanceof r(6631);this._readableState=new K(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&v(e.signal,this)),b.call(this,e),A.construct(this,(()=>{this._readableState.needReadable&&te(this,this._readableState)}))}function z(e,t,r,n){E("readableAddChunk",t);const o=e._readableState;let i;if(o.state&F||("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=w.from(t,r).toString(o.encoding):(t=w.from(t,r),r=""))):t instanceof w?r="":b._isUint8Array(t)?(t=b._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new P("chunk",["string","Buffer","Uint8Array"],t))),i)B(e,i);else if(null===t)o.state&=-9,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,ee(e))}}(e,o);else if(o.state&F||t&&t.length>0)if(n)if(4&o.state)B(e,new x);else{if(o.destroyed||o.errored)return!1;X(e,o,t,!0)}else if(o.ended)B(e,new C);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?X(e,o,t,!1):te(e,o)):X(e,o,t,!1)}else n||(o.state&=-9,te(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function X(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.state&V?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&H&&Z(e)),te(e,t)}function Q(e,t){return e<=0||0===t.length&&t.ended?0:t.state&F?1:a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){const t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(ee,e))}function ee(e){const t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ae(e)}function te(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function ne(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[L]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function oe(e){E("readable nexttick read 0"),e.read(0)}function ie(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ae(e),t.flowing&&!t.reading&&e.read(0)}function ae(e){const t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function se(e,t){"function"!=typeof e.read&&(e=Y.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=D;function o(t){this===e?(n(),n=D):n=t}e.on("readable",o);const i=_(e,{writable:!1},(e=>{r=e?O(r,e):null,n(),n=D}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(o)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",o),i()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function le(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ce(e){const t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(ue,t,e))}function ue(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(fe,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function fe(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let de;function he(){return void 0===de&&(de={}),de}l(K.prototype,{objectMode:J(F),ended:J(2),endEmitted:J(4),reading:J(8),constructed:J($),sync:J(W),needReadable:J(H),emittedReadable:J(128),readableListening:J(256),resumeScheduled:J(512),errorEmitted:J(1024),emitClose:J(G),autoDestroy:J(q),destroyed:J(8192),closed:J(16384),closeEmitted:J(32768),multiAwaitDrain:J(V),readingMore:J(1<<17),dataEmitted:J(1<<18)}),Y.prototype.destroy=A.destroy,Y.prototype._undestroy=A.undestroy,Y.prototype._destroy=function(e,t){t(e)},Y.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},Y.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new k,this.destroy(e)),new f(((t,r)=>_(this,(n=>n&&n!==e?r(n):t(null)))))},Y.prototype.push=function(e,t){return z(this,e,t,!1)},Y.prototype.unshift=function(e,t){return z(this,e,t,!0)},Y.prototype.isPaused=function(){const e=this._readableState;return!0===e[L]||!1===e.flowing},Y.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},Y.prototype.read=function(e){E("read",e),void 0===e?e=NaN:i(e)||(e=s(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new I("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ce(this):Z(this),null;if(0===(e=Q(e,t))&&t.ended)return 0===t.length&&ce(this),null;let n,o=!!(t.state&H);if(E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,E("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,E("reading, ended or constructing",o);else if(o){E("do read"),t.state|=8|W,0===t.length&&(t.state|=H);try{this._read(t.highWaterMark)}catch(e){B(this,e)}t.state&=~W,t.reading||(e=Q(r,t))}return n=e>0?le(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ce(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},Y.prototype._read=function(e){throw new T("_read()")},Y.prototype.pipe=function(e,t){const r=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new d(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(e),E("pipe count=%d opts=%j",o.pipes.length,t);const i=t&&!1===t.end||e===n.stdout||e===n.stderr?y:a;function a(){E("onend"),e.end()}let s;o.endEmitted?n.nextTick(i):r.once("end",i),e.on("unpipe",(function t(n,i){E("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,E("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),s&&e.removeListener("drain",s),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",u),l=!0,s&&o.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&s())}));let l=!1;function c(){l||(1===o.pipes.length&&o.pipes[0]===e?(E("false write response, pause",0),o.awaitDrainWriters=e,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(e)&&(E("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(e)),r.pause()),s||(s=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",s))}function u(t){E("ondata");const r=e.write(t);E("dest.write",r),!1===r&&c()}function f(t){if(E("onerror",t),y(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?B(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),y()}function p(){E("onfinish"),e.removeListener("close",h),y()}function y(){E("unpipe"),r.unpipe(e)}return r.on("data",u),m(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():o.flowing||(E("pipe resume"),r.resume()),e},Y.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=o(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},Y.prototype.on=function(e,t){const r=b.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,E("on readable",o.length,o.reading),o.length?Z(this):o.reading||n.nextTick(oe,this))),r},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(e,t){const r=b.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(ne,this),r},Y.prototype.off=Y.prototype.removeListener,Y.prototype.removeAllListeners=function(e){const t=b.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(ne,this),t},Y.prototype.resume=function(){const e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ie,e,t))}(this,e)),e[L]=!1,this},Y.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this},Y.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{B(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},Y.prototype[p]=function(){return se(this)},Y.prototype.iterator=function(e){return void 0!==e&&j(e,"options"),se(this,e)},l(Y.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(K.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[L]},set(e){this[L]=!!e}}}),Y._fromList=le,Y.from=function(e,t){return U(Y,e,t)},Y.fromWeb=function(e,t){return he().newStreamReadableFromReadableStream(e,t)},Y.toWeb=function(e,t){return he().newReadableStreamFromStreamReadable(e,t)},Y.wrap=function(e,t){var r,n;return new Y({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){A.destroyer(e,t),r(t)}}).wrap(e)}},7872:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:o}=r(273),{validateInteger:i}=r(8080),{ERR_INVALID_ARG_VALUE:a}=r(1150).codes;let s=16384,l=16;function c(e){return e?l:s}e.exports={getHighWaterMark:function(e,t,r,i){const s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=s){if(!o(s)||s<0)throw new a(i?`options.${r}`:"options.highWaterMark",s);return n(s)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?l=t:s=t}}},3273:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:o}=r(273);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:i}=r(1150).codes,a=r(6631),{getHighWaterMark:s}=r(7872);n(c.prototype,a.prototype),n(c,a);const l=o("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new i("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[l]=r)}))},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},8104:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:i}=r(273),a=i("nodejs.stream.destroyed"),s=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function h(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function y(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!(!e||y(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function b(e){return!(!e||y(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function m(e){return!(!e||y(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function w(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[a]||null!=n&&n.destroyed)}function v(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function _(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!w(e)&&h(e)&&e.readable&&!_(e)}function S(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!w(e)&&p(e)&&e.writable&&!v(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function R(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:w,kIsDestroyed:a,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,o,i,a,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(a=e[s])&&void 0!==a?a:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:s,isReadable:E,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:c,isClosed:function(e){if(!y(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return y(e)?!(!w(e)&&(!1!==(null==t?void 0:t.readable)&&E(e)||!1!==(null==t?void 0:t.writable)&&S(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[o]:"function"==typeof e[n]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,r;return y(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:y,isWebStream:function(e){return g(e)||b(e)||m(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:b,isWritableEnded:v,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return y(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:R,willEmitClose:function(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&R(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:m}},789:(e,t,r)=>{const n=r(9907),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=r(273);e.exports=j,j.WritableState=x;const{EventEmitter:h}=r(46),p=r(670).Stream,{Buffer:y}=r(1048),g=r(863),{addAbortSignal:b}=r(2682),{getHighWaterMark:m,getDefaultHighWaterMark:w}=r(7872),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:R,ERR_STREAM_NULL_VALUES:N,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:P}=r(1150).codes,{errorOrDestroy:T}=g;function I(){}c(j.prototype,p.prototype),c(j,p);const C=f("kOnFinished");function x(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(6631)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?m(this,e,"writableHighWaterMark",n):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const o=!(!e||!1!==e.decodeStrings);this.decodeStrings=!o,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,k(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function k(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function j(e){const t=this instanceof r(6631);if(!t&&!a(j,this))return new j(e);this._writableState=new x(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&b(e.signal,this)),p.call(this,e),g.construct(this,(()=>{const e=this._writableState;e.writing||W(this,e),G(this,e)}))}function L(e,t,r,o){const i=e._writableState;if("function"==typeof r)o=r,r=i.defaultEncoding;else{if(r){if("buffer"!==r&&!y.isEncoding(r))throw new P(r)}else r=i.defaultEncoding;"function"!=typeof o&&(o=I)}if(null===t)throw new N;if(!i.objectMode)if("string"==typeof t)!1!==i.decodeStrings&&(t=y.from(t,r),r="buffer");else if(t instanceof y)r="buffer";else{if(!p._isUint8Array(t))throw new v("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let a;return i.ending?a=new O:i.destroyed&&(a=new A("write")),a?(n.nextTick(o,a),T(e,a,!0),a):(i.pendingcb++,function(e,t,r,n,o){const i=t.objectMode?1:r.length;t.length+=i;const a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==I&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}(e,i,t,r,o))}function M(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function U(e,t,r,n){--t.pendingcb,n(r),$(t),T(e,r)}function D(e,t){const r=e._writableState,o=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?n.nextTick(U,e,r,t,i):U(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&W(e,r),o?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},n.nextTick(B,r.afterWriteTickInfo)):F(e,r,1,i))):T(e,new E)}function B({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,F(e,t,r,n)}function F(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&$(t),G(e,t)}function $(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[C].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}k(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:i}=t,a=r.length-n;if(!a)return;let s=n;if(t.bufferProcessing=!0,a>1&&e._writev){t.pendingcb-=a-1;const n=t.allNoop?I:e=>{for(let t=s;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===s?r:o(r,s);i.allBuffers=t.allBuffers,M(e,t,!0,t.length,i,"",n),k(t)}else{do{const{chunk:n,encoding:o,callback:a}=r[s];r[s++]=null,M(e,t,!1,i?1:n.length,n,o,a)}while(s<r.length&&!t.writing);s===r.length?k(t):s>256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function G(e,t,r){H(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function o(o){if(r)T(e,null!=o?o:E());else if(r=!0,t.pendingcb--,o){const r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e](o);T(e,o,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(q,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick(((e,t)=>{H(t)?q(e,t):t.pendingcb--}),e,t)):H(t)&&(t.pendingcb++,q(e,t))))}function q(e,t){t.pendingcb--,t.finished=!0;const r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},s(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(j,d,{__proto__:null,value:function(e){return!!a(this,e)||this===j&&e&&e._writableState instanceof x}}),j.prototype.pipe=function(){T(this,new S)},j.prototype.write=function(e,t,r){return!0===L(this,e,t,r)},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!y.isEncoding(e))throw new P(e);return this._writableState.defaultEncoding=e,this},j.prototype._write=function(e,t,r){if(!this._writev)throw new _("_write()");this._writev([{chunk:e,encoding:t}],r)},j.prototype._writev=null,j.prototype.end=function(e,t,r){const o=this._writableState;let a;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=L(this,e,t);r instanceof i&&(a=r)}return o.corked&&(o.corked=1,this.uncork()),a||(o.errored||o.ending?o.finished?a=new R("end"):o.destroyed&&(a=new A("end")):(o.ending=!0,G(this,o,!0),o.ended=!0)),"function"==typeof r&&(a||o.finished?n.nextTick(r,a):o[C].push(r)),this},l(j.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const V=g.destroy;let J;function K(){return void 0===J&&(J={}),J}j.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[C].length)&&n.nextTick($,r),V.call(this,e,t),this},j.prototype._undestroy=g.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},j.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},j.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},8080:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:y,StringPrototypeTrim:g}=r(273),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:m,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:E}}=r(1150),{normalizeEncoding:S}=r(8449),{isAsyncFunction:A,isArrayBufferView:R}=r(8449).types,N={},O=/^[0-7]+$/,P=b(((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),T=b(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),I=b(((e,t,r=!1)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);const n=r?1:0,o=4294967295;if(e<n||e>o)throw new _(t,`>= ${n} && <= ${o}`,e)}));function C(e,t){if("string"!=typeof e)throw new w(t,"string",e)}const x=b(((e,t,r)=>{if(!o(r,e)){const n=i(a(r,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new v(t,e,"must be one of: "+n)}}));function k(e,t){if("boolean"!=typeof e)throw new w(t,"boolean",e)}function j(e,t,r){return null!=e&&d(e,t)?e[t]:r}const L=b(((e,t,r=null)=>{const o=j(r,"allowArray",!1),i=j(r,"allowFunction",!1);if(!j(r,"nullable",!1)&&null===e||!o&&n(e)||"object"!=typeof e&&(!i||"function"!=typeof e))throw new w(t,"Object",e)})),M=b(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new w(t,"a dictionary",e)})),U=b(((e,t,r=0)=>{if(!n(e))throw new w(t,"Array",e);if(e.length<r)throw new v(t,e,`must be longer than ${r}`)})),D=b(((e,t="buffer")=>{if(!R(e))throw new w(t,["Buffer","TypedArray","DataView"],e)})),B=b(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new w(t,"AbortSignal",e)})),F=b(((e,t)=>{if("function"!=typeof e)throw new w(t,"Function",e)})),$=b(((e,t)=>{if("function"!=typeof e||A(e))throw new w(t,"Function",e)})),W=b(((e,t)=>{if(void 0!==e)throw new w(t,"undefined",e)})),H=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function G(e,t){if(void 0===e||!h(H,e))throw new v(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(O,e))throw new v(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return I(e,t),e},validateArray:U,validateStringArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)C(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)k(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++){const n=e[r],o=`${t}[${r}]`;if(null==n)throw new w(o,"AbortSignal",n);B(n,o)}},validateBoolean:k,validateBuffer:D,validateDictionary:M,validateEncoding:function(e,t){const r=S(t),n=e.length;if("hex"===r&&n%2!=0)throw new v("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:T,validateInteger:P,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new w(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:L,validateOneOf:x,validatePlainFunction:$,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new m(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(C(e,t),void 0===N[e]){if(void 0!==N[y(e)])throw new E(e+" (signals must use all capital letters)");throw new E(e)}},validateString:C,validateUint32:I,validateUndefined:W,validateUnion:function(e,t,r){if(!o(r,e))throw new w(t,`('${i(r,"|")}')`,e)},validateAbortSignal:B,validateLinkHeaderValue:function(e){if("string"==typeof e)return G(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const o=e[n];G(o,"hints"),r+=o,n!==t-1&&(r+=", ")}return r}throw new v("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},3625:(e,t,r)=>{"use strict";const n=r(4041),o=r(6970),i=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=i,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),e.exports.Stream=n.Stream,e.exports.default=e.exports},1150:(e,t,r)=>{"use strict";const{format:n,inspect:o,AggregateError:i}=r(8449),a=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function d(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function h(e,t,r){r||(r=Error);class o extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return f(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[s]=!0,u[e]=o}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class y extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],a=[],s=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?i.push(e.toLowerCase()):c.test(e)?a.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),s.push(e));if(a.length>0){const e=i.indexOf("object");-1!==e&&(i.splice(i,e,1),a.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const e=i.pop();n+=`one of type ${i.join(", ")}, or ${e}`}}(a.length>0||s.length>0)&&(n+=" or ")}if(a.length>0){switch(a.length){case 1:n+=`an instance of ${a[0]}`;break;case 2:n+=`an instance of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`an instance of ${a.join(", ")}, or ${e}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`one of ${s.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${o(r,{depth:-1})}`}else{let e=o(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n}),TypeError),h("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let n=o(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),h("ERR_MISSING_ARGS",((...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((e,t,r)=>{let n;return f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?n=d(String(r)):"bigint"==typeof r?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=d(n)),n+="n"):n=o(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new a([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:p,codes:u}},273:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},8449:(e,t,r)=>{"use strict";const n=r(1048),{kResistStopPropagation:o,SymbolDispose:i}=r(273),a=globalThis.AbortSignal||r(7083).AbortSignal,s=globalThis.AbortController||r(7083).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,c=globalThis.Blob||n.Blob,u=void 0!==c?function(e){return e instanceof c}:function(e){return!1},f=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class d extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:d,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof l,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:u,deprecate:(e,t)=>e,addAbortListener:r(46).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let r;return f(e,"signal"),(e=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[o]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[i](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:a.any||function(e){if(1===e.length)return e[0];const t=new s,r=()=>t.abort();return e.forEach((e=>{f(e,"signals"),e.addEventListener("abort",r,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",r)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},4041:(e,t,r)=>{const{Buffer:n}=r(1048),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:a}=r(273),{promisify:{custom:s}}=r(8449),{streamReturningOperators:l,promiseReturningOperators:c}=r(8484),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(1150),f=r(6009),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=r(7872),{pipeline:p}=r(7103),{destroyer:y}=r(863),g=r(2549),b=r(6970),m=r(8104),w=e.exports=r(670).Stream;w.isDestroyed=m.isDestroyed,w.isDisturbed=m.isDisturbed,w.isErrored=m.isErrored,w.isReadable=m.isReadable,w.isWritable=m.isWritable,w.Readable=r(9333);for(const E of i(l)){const S=l[E];function v(...e){if(new.target)throw u();return w.Readable.from(a(S,this,e))}o(v,"name",{__proto__:null,value:S.name}),o(v,"length",{__proto__:null,value:S.length}),o(w.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(const A of i(c)){const R=c[A];function v(...e){if(new.target)throw u();return a(R,this,e)}o(v,"name",{__proto__:null,value:R.name}),o(v,"length",{__proto__:null,value:R.length}),o(w.Readable.prototype,A,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}w.Writable=r(789),w.Duplex=r(6631),w.Transform=r(3273),w.PassThrough=r(5691),w.pipeline=p;const{addAbortSignal:_}=r(2682);w.addAbortSignal=_,w.finished=g,w.destroy=y,w.compose=f,w.setDefaultHighWaterMark=d,w.getDefaultHighWaterMark=h,o(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>b}),o(p,s,{__proto__:null,enumerable:!0,get:()=>b.pipeline}),o(g,s,{__proto__:null,enumerable:!0,get:()=>b.finished}),w.Stream=w,w._isUint8Array=function(e){return e instanceof Uint8Array},w._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},6970:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:o}=r(273),{isIterable:i,isNodeStream:a,isWebStream:s}=r(8104),{pipelineImpl:l}=r(7103),{finished:c}=r(2549);r(4041),e.exports={finished:c,pipeline:function(...e){return new o(((t,r)=>{let o,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!a(u)&&!i(u)&&!s(u)){const t=n(e);o=t.signal,c=t.end}l(e,((e,n)=>{e?r(e):t(n)}),{signal:o,end:c})}))}}},2664:(e,t,r)=>{"use strict";var n=r(5636).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7083:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],l=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),u=0,f=l>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;s<c;s+=a)i.push(l(e,s,s+a>c?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1048:(e,t,r)=>{"use strict";const n=r(7991),o=r(9318),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const o=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(o)return n?-1:V(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return N(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function v(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(z(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return K(V(t,e.length-r),e,r,n)}function E(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return K(J(t),e,r,n)}function A(e,t,r,n){return K(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function N(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(i=l));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(i=l))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))o+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},l.byteLength=y,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?N(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,o){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==u[e]){i=c[e],a=u[e];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=X[e[n]];return o}function C(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function x(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function L(e,t,r,n,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function M(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),l.prototype.readBigUInt64BE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Q((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Q((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=l.isBuffer(e)?e:l.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const B={};function F(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=$(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=$(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function J(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},9818:(e,t,r)=>{"use strict";var n=r(528),o=r(8498),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},8498:(e,t,r)=>{"use strict";var n=r(9138),o=r(528),i=r(6108),a=r(3468),s=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(l,s),u=r(4940),f=o("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=c(n,l,arguments);return i(t,1+f(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};u?u(e.exports,"apply",{value:d}):e.exports.apply=d},2743:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||o,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?l.arrayMerge(e,r,l):function(e,t,r){var o={};return r.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=n(e[t],r)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&r.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return s;var r=t.customMerge(e);return"function"==typeof r?r:s}(i,r)(e[i],t[i],r):o[i]=n(t[i],r))})),o}(e,r,l):n(r,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return s(e,r,t)}),{})};var l=s;e.exports=l},686:(e,t,r)=>{"use strict";var n=r(4940),o=r(5731),i=r(3468),a=r(9336);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===l&&f?f.writable:!l});else{if(!u&&(s||l||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},4940:(e,t,r)=>{"use strict";var n=r(528)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},9110:e=>{"use strict";e.exports=EvalError},9838:e=>{"use strict";e.exports=Error},1155:e=>{"use strict";e.exports=RangeError},4943:e=>{"use strict";e.exports=ReferenceError},5731:e=>{"use strict";e.exports=SyntaxError},3468:e=>{"use strict";e.exports=TypeError},2140:e=>{"use strict";e.exports=URIError},46:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=l(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=u.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8794:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=r(0,o.length-a.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var t=o.apply(this,n(a,arguments));return Object(t)===t?t:this}return o.apply(e,n(a,arguments))})),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},9138:(e,t,r)=>{"use strict";var n=r(8794);e.exports=Function.prototype.bind||n},528:(e,t,r)=>{"use strict";var n,o=r(9838),i=r(9110),a=r(1155),s=r(4943),l=r(5731),c=r(3468),u=r(2140),f=Function,d=function(e){try{return f('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}var p=function(){throw new c},y=h?function(){try{return p}catch(e){try{return h(arguments,"callee").get}catch(e){return p}}}():p,g=r(3558)(),b=r(6869)(),m=Object.getPrototypeOf||(b?function(e){return e.__proto__}:null),w={},v="undefined"!=typeof Uint8Array&&m?m(Uint8Array):n,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&m?m([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":w,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&m?m(m([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&m?m((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&m?m((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&m?m(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":v,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(m)try{null.error}catch(e){var E=m(m(e));_["%Error.prototype%"]=E}var S=function e(t){var r;if("%AsyncFunction%"===t)r=d("async function () {}");else if("%GeneratorFunction%"===t)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=d("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&m&&(r=m(o.prototype))}return _[t]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=r(9138),N=r(8554),O=R.call(Function.call,Array.prototype.concat),P=R.call(Function.apply,Array.prototype.splice),T=R.call(Function.call,String.prototype.replace),I=R.call(Function.call,String.prototype.slice),C=R.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,j=function(e,t){var r,n=e;if(N(A,n)&&(n="%"+(r=A[n])[0]+"%"),N(_,n)){var o=_[n];if(o===w&&(o=S(n)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=I(e,0,1),r=I(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return T(e,x,(function(e,t,r,o){n[n.length]=r?T(o,k,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=j("%"+n+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],P(r,O([0,1],u)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],y=I(p,0,1),g=I(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===g||"'"===g||"`"===g)&&y!==g)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&d||(s=!0),N(_,i="%"+(n+="."+p)+"%"))a=_[i];else if(null!=a){if(!(p in a)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(h&&f+1>=r.length){var b=h(a,p);a=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:a[p]}else d=N(a,p),a=a[p];d&&!s&&(_[i]=a)}}return a}},9336:(e,t,r)=>{"use strict";var n=r(528)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},7239:(e,t,r)=>{"use strict";var n=r(4940),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},6869:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},3558:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(2908);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},2908:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},8554:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(9138);e.exports=i.call(n,o)},9318:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+f],f+=d,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+e[t+f],f+=d,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(t*l-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},5172:(e,t,r)=>{"use strict";var n=("undefined"!=typeof JSON?JSON:r(6998)).stringify,o=r(9549),i=r(9228),a=r(8498),s=r(9818),l=s("Array.prototype.join"),c=s("Array.prototype.push"),u=function(e,t){for(var r="",n=0;n<e;n+=1)r+=t;return r},f=function(e,t,r){return r};e.exports=function(e){var t=arguments.length>1?arguments[1]:void 0,r=t&&t.space||"";"number"==typeof r&&(r=u(r," "));var s=!!t&&"boolean"==typeof t.cycles&&t.cycles,d=t&&t.replacer?a(t.replacer):f,h="function"==typeof t?t:t&&t.cmp,p=h&&function(e){var t=h.length>2&&function(t){return e[t]};return function(r,n){return h({key:r,value:e[r]},{key:n,value:e[n]},t?{__proto__:null,get:t}:void 0)}},y=[];return function e(t,a,f,h){var g=r?"\n"+u(h,r):"",b=r?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),void 0!==(f=d(t,a,f))){if("object"!=typeof f||null===f)return n(f);if(o(f)){for(var m=[],w=0;w<f.length;w++){var v=e(f,w,f[w],h+1)||n(null);c(m,g+r+v)}return"["+l(m,",")+g+"]"}if(-1!==y.indexOf(f)){if(s)return n("__cycle__");throw new TypeError("Converting circular structure to JSON")}c(y,f);var _=i(f).sort(p&&p(f));for(m=[],w=0;w<_.length;w++){var E=e(f,a=_[w],f[a],h+1);if(E){var S=n(a)+b+E;c(m,g+r+S)}}return y.splice(y.indexOf(f),1),"{"+l(m,",")+g+"}"}}({"":e},"",e,0)}},9549:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},6998:(e,t,r)=>{"use strict";t.parse=r(6921),t.stringify=r(9191)},6921:e=>{"use strict";var t,r,n,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(e){throw{name:"SyntaxError",message:e,at:t,text:n}}function a(e){return e&&e!==r&&i("Expected '"+e+"' instead of '"+r+"'"),r=n.charAt(t),t+=1,r}function s(){var e,t="";for("-"===r&&(t="-",a("-"));r>="0"&&r<="9";)t+=r,a();if("."===r)for(t+=".";a()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,a(),"-"!==r&&"+"!==r||(t+=r,a());r>="0"&&r<="9";)t+=r,a();return e=Number(t),isFinite(e)||i("Bad number"),e}function l(){var e,t,n,s="";if('"'===r)for(;a();){if('"'===r)return a(),s;if("\\"===r)if(a(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(a(),16),isFinite(e));t+=1)n=16*n+e;s+=String.fromCharCode(n)}else{if("string"!=typeof o[r])break;s+=o[r]}else s+=r}i("Bad string")}function c(){for(;r&&r<=" ";)a()}function u(){switch(c(),r){case"{":return function(){var e,t={};if("{"===r){if(a("{"),c(),"}"===r)return a("}"),t;for(;r;){if(e=l(),c(),a(":"),Object.prototype.hasOwnProperty.call(t,e)&&i('Duplicate key "'+e+'"'),t[e]=u(),c(),"}"===r)return a("}"),t;a(","),c()}}i("Bad object")}();case"[":return function(){var e=[];if("["===r){if(a("["),c(),"]"===r)return a("]"),e;for(;r;){if(e.push(u()),c(),"]"===r)return a("]"),e;a(","),c()}}i("Bad array")}();case'"':return l();case"-":return s();default:return r>="0"&&r<="9"?s():function(){switch(r){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null;default:i("Unexpected '"+r+"'")}}()}}e.exports=function(e,o){var a;return n=e,t=0,r=" ",a=u(),c(),r&&i("Syntax error"),"function"==typeof o?function e(t,r){var n,i,a=t[r];if(a&&"object"==typeof a)for(n in u)Object.prototype.hasOwnProperty.call(a,n)&&(void 0===(i=e(a,n))?delete a[n]:a[n]=i);return o.call(t,r,a)}({"":a},""):a}},9191:e=>{"use strict";var t,r,n,o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,(function(e){var t=i[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function s(e,o){var i,l,c,u,f,d=t,h=o[e];switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(e)),"function"==typeof n&&(h=n.call(o,e,h)),typeof h){case"string":return a(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(t+=r,f=[],"[object Array]"===Object.prototype.toString.apply(h)){for(u=h.length,i=0;i<u;i+=1)f[i]=s(i,h)||"null";return c=0===f.length?"[]":t?"[\n"+t+f.join(",\n"+t)+"\n"+d+"]":"["+f.join(",")+"]",t=d,c}if(n&&"object"==typeof n)for(u=n.length,i=0;i<u;i+=1)"string"==typeof(l=n[i])&&(c=s(l,h))&&f.push(a(l)+(t?": ":":")+c);else for(l in h)Object.prototype.hasOwnProperty.call(h,l)&&(c=s(l,h))&&f.push(a(l)+(t?": ":":")+c);return c=0===f.length?"{}":t?"{\n"+t+f.join(",\n"+t)+"\n"+d+"}":"{"+f.join(",")+"}",t=d,c}}e.exports=function(e,o,i){var a;if(t="",r="","number"==typeof i)for(a=0;a<i;a+=1)r+=" ";else"string"==typeof i&&(r=i);if(n=o,o&&"function"!=typeof o&&("object"!=typeof o||"number"!=typeof o.length))throw new Error("JSON.stringify");return s("",{"":e})}},5880:function(e,t,r){var n,o;!function(){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(){for(var r=this.getLevel(),o=0;o<n.length;o++){var i=n[o];this[i]=o<r?e:this.methodFactory(i,r,this.name)}if(this.log=this.debug,typeof console===t&&r<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function u(n,o,i){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?s:void 0!==console[n]?a(console,n):void 0!==console.log?a(console,"log"):e)}(n)||c.apply(this,arguments)}function f(e,r){var a,s,c,f=this,d="loglevel";function h(){var e;if(typeof window!==t&&d){try{e=window.localStorage[d]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=encodeURIComponent(d),o=r.indexOf(n+"=");-1!==o&&(e=/^([^;]+)/.exec(r.slice(o+n.length+1))[1])}catch(e){}return void 0===f.levels[e]&&(e=void 0),e}}function p(e){var t=e;if("string"==typeof t&&void 0!==f.levels[t.toUpperCase()]&&(t=f.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=f.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?d+=":"+e:"symbol"==typeof e&&(d=void 0),f.name=e,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=r||u,f.getLevel=function(){return null!=c?c:null!=s?s:a},f.setLevel=function(e,r){return c=p(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&d){try{return void(window.localStorage[d]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"="+r+";"}catch(e){}}}(c),l.call(f)},f.setDefaultLevel=function(e){s=p(e),h()||f.setLevel(e,!1)},f.resetLevel=function(){c=null,function(){if(typeof window!==t&&d){try{window.localStorage.removeItem(d)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),l.call(f)},f.enableAll=function(e){f.setLevel(f.levels.TRACE,e)},f.disableAll=function(e){f.setLevel(f.levels.SILENT,e)},f.rebuild=function(){if(i!==f&&(a=p(i.getLevel())),l.call(f),i===f)for(var e in o)o[e].rebuild()},a=p(i?i.getLevel():"WARN");var y=h();null!=y&&(c=p(y)),l.call(f)}(i=new f).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new f(e,i.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=d),i},i.getLoggers=function(){return o},i.default=i,i},void 0===(o=n.call(t,r,t,e))||(e.exports=o)}()},8160:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(968),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)d.push(String(y));if(n&&e.length>0)for(var g=0;g<e.length;++g)d.push(String(g));else for(var b in e)p&&"prototype"===b||!o.call(e,b)||d.push(String(b));if(l)for(var m=function(e){if("undefined"==typeof window||!h)return f(e);try{return f(e)}catch(e){return!1}}(e),w=0;w<u.length;++w)m&&"constructor"===u[w]||!o.call(e,u[w])||d.push(u[w]);return d}}e.exports=n},9228:(e,t,r)=>{"use strict";var n=Array.prototype.slice,o=r(968),i=Object.keys,a=i?function(e){return i(e)}:r(8160),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},968:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},9907:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,l=[],c=!1,u=-1;function f(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new h(e,t)),1!==l.length||c||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5636:(e,t,r)=>{var n=r(1048),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},6108:(e,t,r)=>{"use strict";var n=r(528),o=r(686),i=r(7239)(),a=r(9336),s=r(3468),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,r,n){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?o(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}r.r(n),r.d(n,{Web3AuthNoModal:()=>$e});var a=r(46);function s(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class l extends a.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const o=n[e];if(void 0===o)return!1;if("function"==typeof o)s(o,this,t);else{const e=o.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(o);for(let n=0;n<e;n+=1)s(r[n],this,t)}return!0}}const c={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},u={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},f={[u.SAPPHIRE_MAINNET]:"https://api.web3auth.io/signer-service",[u.SAPPHIRE_DEVNET]:"https://api.web3auth.io/signer-service",[c.MAINNET]:"https://api.web3auth.io/signer-service",[c.TESTNET]:"https://api.web3auth.io/signer-service",[c.CYAN]:"https://api.web3auth.io/signer-polygon-service",[c.AQUA]:"https://api.web3auth.io/signer-polygon-service",[c.CELESTE]:"https://api.web3auth.io/signer-polygon-service"},d=c,h=i(i({},u),d),p="sms_passwordless";var y,g=(y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},y(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=function(e){function t(t,r){var n,o,i,a=this.constructor,s=e.call(this,t,r)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),n=s,o=a.prototype,(i=Object.setPrototypeOf)?i(n,o):n.__proto__=o,function(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}(s),s}return g(t,e),t}(Error);function m(e){const t=e.findIndex((e=>e instanceof Error)),r=e.findIndex((e=>"string"==typeof e)),n=e.findIndex((e=>e&&"object"==typeof e&&"status"in e&&"type"in e));let o;if(-1!==n){const t=e[n];o=new Error(`${t.status} ${t.type.toString()} ${t.statusText}`)}else o=-1!==t?e.splice(t,1)[0]:-1!==r?new Error(e.splice(r,1)[0]):new Error("Unknown error");return[o,e]}class w extends b{constructor(e,r,n){super(r),t(this,"code",void 0),t(this,"message",void 0),t(this,"cause",void 0),this.code=e,this.message=r||"",this.cause=n,Object.defineProperty(this,"name",{value:"Web3AuthError"})}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:m([this.cause])}}toString(){return JSON.stringify(this.toJSON())}}class v extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletInitializationError"})}static fromCode(e,t="",r){return new v(e,`${v.messages[e]}, ${t}`,r)}static notFound(e="",t){return v.fromCode(5001,e,t)}static notInstalled(e="",t){return v.fromCode(5002,e,t)}static notReady(e="",t){return v.fromCode(5003,e,t)}static windowBlocked(e="",t){return v.fromCode(5004,e,t)}static windowClosed(e="",t){return v.fromCode(5005,e,t)}static incompatibleChainNameSpace(e="",t){return v.fromCode(5006,e,t)}static duplicateAdapterError(e="",t){return v.fromCode(5007,e,t)}static invalidProviderConfigError(e="",t){return v.fromCode(5008,e,t)}static providerNotReadyError(e="",t){return v.fromCode(5009,e,t)}static rpcConnectionError(e="",t){return v.fromCode(5010,e,t)}static invalidParams(e="",t){return v.fromCode(5011,e,t)}static invalidNetwork(e="",t){return v.fromCode(5013,e,t)}}t(v,"messages",{5e3:"Custom",5001:"Wallet is not found",5002:"Wallet is not installed",5003:"Wallet is not ready yet",5004:"Wallet window is blocked",5005:"Wallet window has been closed by the user",5006:"Incompatible chain namespace provided",5007:"Adapter has already been included",5008:"Invalid provider Config",5009:"Provider is not ready yet",5010:"Failed to connect with rpc url",5011:"Invalid params passed in",5013:"Invalid network provided"});class _ extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletLoginError"})}static fromCode(e,t="",r){return new _(e,`${_.messages[e]}. ${t}`,r)}static connectionError(e="",t){return _.fromCode(5111,e,t)}static disconnectionError(e="",t){return _.fromCode(5112,e,t)}static notConnectedError(e="",t){return _.fromCode(5113,e,t)}static popupClosed(e="",t){return _.fromCode(5114,e,t)}static mfaEnabled(e="",t){return _.fromCode(5115,e,t)}static chainConfigNotAdded(e="",t){return _.fromCode(5116,e,t)}static unsupportedOperation(e="",t){return _.fromCode(5117,e,t)}static coreKitKeyNotFound(e="",t){return _.fromCode(5118,e,t)}static userNotLoggedIn(e="",t){return _.fromCode(5119,e,t)}}t(_,"messages",{5e3:"Custom",5111:"Failed to connect with wallet",5112:"Failed to disconnect from wallet",5113:"Wallet is not connected",5114:"Wallet popup has been closed by the user",5115:"User has already enabled mfa, please use the @web3auth/web3auth-web sdk for login with mfa",5116:"Chain config has not been added. Please add the chain config before calling switchChain",5117:"Unsupported operation",5118:"useCoreKitKey flag is enabled but coreKitKey is not available",5119:"User not logged in."});class E extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletOperationsError"})}static fromCode(e,t="",r){return new E(e,`${E.messages[e]}, ${t}`,r)}static chainIDNotAllowed(e="",t){return E.fromCode(5201,e,t)}static operationNotAllowed(e="",t){return E.fromCode(5202,e,t)}static chainNamespaceNotAllowed(e="",t){return E.fromCode(5203,e,t)}}t(E,"messages",{5e3:"Custom",5201:"Provided chainId is not allowed",5202:"This operation is not allowed"});class S extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletProviderError"})}static fromCode(e,t="",r){return new E(e,`${S.messages[e]}, ${t}`,r)}static invalidRequestArgs(e="",t){return E.fromCode(5301,e,t)}static invalidRequestMethod(e="",t){return E.fromCode(5302,e,t)}static invalidRequestParams(e="",t){return E.fromCode(5303,e,t)}}t(S,"messages",{5e3:"Custom",5301:"Expected a single, non-array, object argument.",5302:"'args.method' must be a non-empty string.",5303:"'args.params' must be an object or array if provided."});const A={EIP155:"eip155",SOLANA:"solana",CASPER:"casper",XRPL:"xrpl",OTHER:"other"},R="multichain",N=(e,t)=>{if(e===A.OTHER)return null;const r=t?"number"==typeof t?t:parseInt(t,16):(e=>{if(e===A.EIP155)return 1;if(e===A.SOLANA)return 1;if(e===A.XRPL)return 1;throw v.invalidParams(`Chain namespace ${e} is not supported`)})(e);return e===A.EIP155?(e=>{const t=A.EIP155;return 1===e?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:t,chainId:"0x1",rpcTarget:"https://rpc.ankr.com/eth",displayName:"Ethereum Mainnet",blockExplorerUrl:"https://etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:5===e?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:t,chainId:"0x5",rpcTarget:"https://rpc.ankr.com/eth_goerli",displayName:"Goerli Testnet",blockExplorerUrl:"https://goerli.etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:11155111===e?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:t,chainId:"0xaa36a7",rpcTarget:"https://rpc.ankr.com/eth_sepolia",displayName:"Sepolia Testnet",blockExplorerUrl:"https://sepolia.etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:137===e?{logo:"https://images.toruswallet.io/polygon.svg",chainNamespace:t,chainId:"0x89",rpcTarget:"https://rpc.ankr.com/polygon",displayName:"Polygon Mainnet",blockExplorerUrl:"https://polygonscan.com",ticker:"POL",tickerName:"Polygon Ecosystem Token"}:80002===e?{logo:"https://images.toruswallet.io/polygon.svg",chainNamespace:t,chainId:"0x13882",rpcTarget:"https://rpc.ankr.com/polygon_amoy",displayName:"Polygon Amoy Testnet",blockExplorerUrl:"https://www.oklink.com/amoy",ticker:"POL",tickerName:"Polygon Ecosystem Token",decimals:18}:56===e?{logo:"https://images.toruswallet.io/bnb.png",chainNamespace:t,chainId:"0x38",rpcTarget:"https://rpc.ankr.com/bsc",displayName:"Binance SmartChain Mainnet",blockExplorerUrl:"https://bscscan.com",ticker:"BNB",tickerName:"Binance SmartChain",decimals:18}:97===e?{logo:"https://images.toruswallet.io/bnb.png",chainNamespace:t,chainId:"0x61",rpcTarget:"https://rpc.ankr.com/bsc_testnet_chapel",displayName:"Binance SmartChain Testnet",blockExplorerUrl:"https://testnet.bscscan.com",ticker:"BNB",tickerName:"Binance SmartChain",decimals:18}:25===e?{logo:"https://images.toruswallet.io/cro.svg",chainNamespace:t,chainId:"0x19",rpcTarget:"https://rpc.cronos.org",displayName:"Cronos Mainnet",blockExplorerUrl:"https://cronoscan.com/",ticker:"CRO",tickerName:"Cronos"}:338===e?{logo:"https://images.toruswallet.io/cro.svg",chainNamespace:t,chainId:"0x152",rpcTarget:"https://rpc-t3.cronos.org/",displayName:"Cronos Testnet",blockExplorerUrl:"https://cronoscan.com/",ticker:"CRO",tickerName:"Cronos",decimals:18}:8217===e?{logo:"https://images.toruswallet.io/klay.svg",chainNamespace:t,chainId:"0x2019",rpcTarget:"https://public-node-api.klaytnapi.com/v1/cypress",displayName:"Klaytn Mainnet",blockExplorerUrl:"https://scope.klaytn.com",ticker:"KLAY",tickerName:"Klaytn",decimals:18}:1946===e?{chainNamespace:A.EIP155,chainId:"0x79a",rpcTarget:"https://rpc.minato.soneium.org",displayName:"Soneium Minato Testnet",blockExplorerUrl:"https://explorer-testnet.soneium.org",ticker:"ETH",tickerName:"ETH",logo:"https://cryptologos.cc/logos/soneium-logo.png"}:null})(r):e===A.SOLANA?(e=>{const t=A.SOLANA;return 1===e?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:t,chainId:"0x1",rpcTarget:"https://rpc.ankr.com/solana",displayName:"Solana Mainnet",blockExplorerUrl:"https://explorer.solana.com",ticker:"SOL",tickerName:"Solana",decimals:9}:2===e?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:t,chainId:"0x2",rpcTarget:"https://api.testnet.solana.com",displayName:"Solana Testnet",blockExplorerUrl:"https://explorer.solana.com?cluster=testnet",ticker:"SOL",tickerName:"Solana",decimals:9}:3===e?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:t,chainId:"0x3",rpcTarget:"https://api.devnet.solana.com",displayName:"Solana Devnet",blockExplorerUrl:"https://explorer.solana.com?cluster=devnet",ticker:"SOL",tickerName:"Solana",decimals:9}:null})(r):e===A.XRPL?(e=>{const t=A.XRPL;return 1===e?{chainNamespace:t,decimals:15,chainId:"0x1",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://ripple-node.tor.us",wsTarget:"wss://s2.ripple.com",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl mainnet",blockExplorerUrl:"https://livenet.xrpl.org"}:2===e?{chainNamespace:t,decimals:15,chainId:"0x2",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://testnet-ripple-node.tor.us",wsTarget:"wss://s.altnet.rippletest.net",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl testnet",blockExplorerUrl:"https://testnet.xrpl.org",isTestnet:!0}:3===e?{chainNamespace:t,decimals:15,chainId:"0x3",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://devnet-ripple-node.tor.us",wsTarget:"wss://s.devnet.rippletest.net/",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl devnet",blockExplorerUrl:"https://devnet.xrpl.org",isTestnet:!0}:null})(r):null},O={AUTH:"auth",WALLET_CONNECT_V2:"wallet-connect-v2",SFA:"sfa"},P=i({TORUS_SOLANA:"torus-solana"},O),T=i({TORUS_EVM:"torus-evm",COINBASE:"coinbase"},O),I=i(i({},T),P),C=(P.TORUS_SOLANA,T.TORUS_EVM,T.COINBASE,{NOT_READY:"not_ready",READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"}),x=i(i({},C),{},{ADAPTER_DATA_UPDATED:"adapter_data_updated",CACHE_CLEAR:"cache_clear"});var k=r(5880),j=r.n(k),L=j().getLogger("web3auth-logger"),M=r(2743),U=r.n(M);const D=j().getLogger("http-helpers");D.setLevel(k.levels.INFO);let B="torus-default";const F=async(e,t={},r={})=>{const n={mode:"cors",headers:{}};r.useAPIKey&&(n.headers=i(i({},n.headers),function(){const e={};return B&&(e["x-api-key"]=B),e}())),t.method="GET";const o=U()(n,t),a=await async function(e,t){let r=null;try{r=new URL(e)}catch(e){}return fetch(e,t)}(e,o);if(a.ok){const e=a.headers.get("content-type");return null!=e&&e.includes("application/json")?a.json():a.text()}throw function(e){D.info(`Response: ${e.status} ${e.statusText}`),D.info(`Url: ${e.url}`)}(a),a};function $(e){let t,r=!1,n=0;try{t=window[e],r=!0,n=t.length;const o="__storage_test__";return t.setItem(o,o),t.removeItem(o),!0}catch(e){const t=e;return!(!t||22!==t.code&&1014!==t.code&&"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||!r||0===n)}}const W=i(i({},A),{},{MULTICHAIN:"multichain"}),H={READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"},G=(i({},H),i(i({},{WALLET_SERVICES:"wallet-services",NFT_CHECKOUT:"nft-checkout"}),{SOLANA:"solana"}),()=>!0),q=["newListener","removeListener"],V=e=>!q.includes(e);function J(e,t){let r=(t||{}).eventFilter||G;if("string"==typeof r&&"skipInternal"===r&&(r=V),"function"!=typeof r)throw new Error("createEventEmitterProxy - Invalid eventFilter");let n=e,o=e=>{if(n===e)return;const t=n;n=e,t.eventNames().filter(r).forEach((r=>{(function(e,t){return void 0!==e.rawListeners?e.rawListeners(t):e.listeners(t)})(t,r).forEach((t=>{e.on(r,t)}))})),t.removeAllListeners()};return new Proxy({},{get:(e,t)=>"setTarget"===t?o:n[t],set:(e,t,r)=>"setTarget"===t?(o=r,!0):(n[t]=r,!0),has:(e,t)=>"_"!==t[0]&&t in n})}r(3625);const K=j().getLogger("auth");K.setLevel("error");var Y=r(5172),z=r.n(Y);const X=-32e3,Q=-32001,Z=-32002,ee=-32003,te=-32004,re=-32005,ne=-32700,oe=-32600,ie=-32601,ae=-32602,se=-32603,le={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},ce="Unspecified error message. This is a bug, please report it.",ue="Unspecified server error.";function fe(e){return Number.isInteger(e)}function de(e){return"string"==typeof e&&e.length>0}function he(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}function pe(e){const t=e;return!(!t||!fe(t.code)||!de(t.message)||t.stack&&!de(t.stack))}function ye(e,t=ce){if(fe(e)){const t=e.toString();if(Object.hasOwn(le,t))return le[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return ue}return t}const ge={code:se,message:ye(se)};function be(e){try{JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"===e||"constructor"===e)throw new Error("Not valid json");if("function"==typeof t||"symbol"==typeof t)throw new Error("Not valid json");return t})),((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))}catch(e){return!1}return!0}function me(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const n=e[r];return be(n)&&(t[r]=n),t}),{})}function we(e){return Array.isArray(e)?e.map((e=>be(e)?e:he(e)?me(e):null)):he(e)?me(e):be(e)?e:null}function ve(e,{fallbackError:t=ge,shouldIncludeStack:r=!0}={}){if(!pe(t))throw new Error("Must provide fallback error with integer number code and string message.");const n=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if(pe(e))return e;const r=we(e);return i(i({},t),{},{data:{cause:r}})}(e,t);return r||delete n.stack,n}function _e(e,t){if("[Circular]"!==t)return t}class Ee extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||"string"!=typeof r)throw new Error('"message" must be a non-empty string.');!function(e){return he(e)&&Object.hasOwn(e,"cause")&&he(e.cause)}(n)?(super(r),t(this,"cause",void 0),t(this,"code",void 0),t(this,"data",void 0)):(super(r,{cause:n.cause}),t(this,"cause",void 0),t(this,"code",void 0),t(this,"data",void 0),Object.hasOwn(this,"cause")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e,this.cause=null==n?void 0:n.cause}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=we(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return z()(this.serialize(),{replacer:_e,space:2})}}class Se extends Ee{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function Ae(e,t){const[r,n]=function(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[null!=t?t:void 0,r]}}return[]}(t);return new Ee(e,null!=r?r:ye(e),n)}const Re={parse:e=>Ae(ne,e),invalidRequest:e=>Ae(oe,e),invalidParams:e=>Ae(ae,e),methodNotFound:e=>Ae(ie,e),internal:e=>Ae(se,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ae(t,e)},invalidInput:e=>Ae(X,e),resourceNotFound:e=>Ae(Q,e),resourceUnavailable:e=>Ae(Z,e),transactionRejected:e=>Ae(ee,e),methodNotSupported:e=>Ae(te,e),limitExceeded:e=>Ae(re,e)};class Ne extends Error{constructor({code:e,message:r,data:n}){if(!Number.isInteger(e))throw new Error("code must be an integer");if(!r||"string"!=typeof r)throw new Error("message must be string");super(r),t(this,"code",void 0),t(this,"data",void 0),this.code=e,void 0!==n&&(this.data=n)}toString(){return z()({code:this.code,message:this.message,data:this.data,stack:this.stack})}}function Oe(e){const{message:t="",code:r=-32603,stack:n="Stack trace is not available.",data:o=""}=e,i=parseInt((null==r?void 0:r.toString())||"-32603");return{message:t||(null==e?void 0:e.toString())||ye(i),code:i,stack:n,data:o||t||(null==e?void 0:e.toString())}}class Pe extends l{constructor(){super(),t(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,r){const n=[];let o=null,i=!1;for(const a of r)if([o,i]=await Pe._runMiddleware(e,t,a,n),i)break;return[o,i,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise((o=>{const i=e=>{const r=e||t.error;r&&("object"==typeof r&&!1===Object.keys(r).includes("stack")&&(r.stack="Stack trace is not available."),K.error(r),t.error=ve(r,{shouldIncludeStack:!0,fallbackError:Oe(r)})),o([r,!0])},a=e=>{t.error?i(t.error):(e&&("function"!=typeof e&&i(new Ne({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),n.push(e)),o([null,!1]))};try{r(e,t,a,i)}catch(e){i(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new Ne({code:-32603,message:"Response has no error or result for request"});if(!r)throw new Ne({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[o,i,a]=await Pe._runAllMiddleware(e,t,this._middleware);return i?(await Pe._runReturnHandlers(a),n(o)):r((async e=>{try{await Pe._runReturnHandlers(a)}catch(t){return e(t)}return e()}))}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise(((t,r)=>{this._handle(e,((e,n)=>{e&&void 0===n?r(e):t(n)})).catch(r)}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const e=new Ne({code:-32603,message:"request must be plain object"});return t(e,{id:void 0,jsonrpc:"2.0",error:e})}if("string"!=typeof e.method){const r=new Ne({code:-32603,message:"method must be string"});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=i({},e),n={id:r.id,jsonrpc:r.jsonrpc};let o=null;try{await this._processRequest(r,n)}catch(e){o=e}return o&&(delete n.result,n.error||("object"==typeof o&&!1===Object.keys(o).includes("stack")&&(o.stack="Stack trace is not available."),K.error(o),n.error=ve(o,{shouldIncludeStack:!0,fallbackError:Oe(o)}))),t(o,n)}async _processRequest(e,t){const[r,n,o]=await Pe._runAllMiddleware(e,t,this._middleware);if(Pe._checkForCompletion(e,t,n),await Pe._runReturnHandlers(o),r)throw r}}class Te extends l{constructor({config:e={},state:r={}}){super(),t(this,"defaultConfig",{}),t(this,"defaultState",{}),t(this,"disabled",!1),t(this,"name","BaseController"),t(this,"initialConfig",void 0),t(this,"initialState",void 0),t(this,"internalConfig",this.defaultConfig),t(this,"internalState",this.defaultState),this.initialState=r,this.initialConfig=e}get config(){return this.internalConfig}get state(){return this.internalState}configure(e,t=!1,r=!0){if(r){this.internalConfig=t?e:Object.assign(this.internalConfig,e);for(const e in this.internalConfig)void 0!==this.internalConfig[e]&&(this[e]=this.internalConfig[e])}else for(const t in e)void 0!==this.internalConfig[t]&&(this.internalConfig[t]=e[t],this[t]=e[t])}update(e,t=!1){this.internalState=i(t?{}:i({},this.internalState),e),this.emit("store",this.internalState)}initialize(){return this.internalState=this.defaultState,this.internalConfig=this.defaultConfig,this.configure(this.initialConfig),this.update(this.initialState),this}}class Ie extends Te{constructor({config:e,state:r}){if(super({config:e,state:r}),t(this,"_providerEngineProxy",null),t(this,"keyExportFlagSetByCode",!1),!e.chainConfig)throw v.invalidProviderConfigError("Please provide chainConfig");if(!e.chainConfig.chainId)throw v.invalidProviderConfigError("Please provide chainId inside chainConfig");if(!e.chainConfig.rpcTarget)throw v.invalidProviderConfigError("Please provide rpcTarget inside chainConfig");"boolean"==typeof e.keyExportEnabled&&(this.keyExportFlagSetByCode=!0),this.defaultState={chainId:"loading"},this.defaultConfig={chainConfig:e.chainConfig,networks:{[e.chainConfig.chainId]:e.chainConfig},keyExportEnabled:"boolean"!=typeof e.keyExportEnabled||e.keyExportEnabled},super.initialize()}get currentChainConfig(){return this.config.chainConfig}get provider(){return this._providerEngineProxy}get chainId(){return this.state.chainId}set provider(e){throw new Error("Method not implemented.")}async request(e){var t;if(!e||"object"!=typeof e||Array.isArray(e))throw Re.invalidRequest({message:S.invalidRequestArgs().message,data:i(i({},e||{}),{},{cause:S.invalidRequestArgs().message})});const{method:r,params:n}=e;if("string"!=typeof r||0===r.length)throw Re.invalidRequest({message:S.invalidRequestMethod().message,data:i(i({},e||{}),{},{cause:S.invalidRequestMethod().message})});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw Re.invalidRequest({message:S.invalidRequestParams().message,data:i(i({},e||{}),{},{cause:S.invalidRequestParams().message})});return null===(t=this.provider)||void 0===t?void 0:t.request(e)}sendAsync(e,t){return t?this.send(e,t):this.request(e)}send(e,t){this.request(e).then((e=>t(null,{result:e}))).catch((e=>t(e,null)))}addChain(e){if(!e.chainId)throw Re.invalidParams("chainId is required");if(!e.rpcTarget)throw Re.invalidParams("chainId is required");this.configure({networks:i(i({},this.config.networks),{},{[e.chainId]:e})})}getChainConfig(e){var t;const r=null===(t=this.config.networks)||void 0===t?void 0:t[e];if(!r)throw Re.invalidRequest(`Chain ${e} is not supported, please add chainConfig for it`);return r}updateProviderEngineProxy(e){this._providerEngineProxy?this._providerEngineProxy.setTarget(e):this._providerEngineProxy=J(e)}setKeyExportFlag(e){this.keyExportFlagSetByCode||this.configure({keyExportEnabled:e})}getProviderEngineProxy(){return this._providerEngineProxy}}const Ce=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"];function xe(e){switch(e.status){case 405:throw Re.methodNotFound();case 418:throw Re.internal({message:"Request is being rate limited.",data:{cause:e}});case 503:case 504:throw Re.internal({message:"Gateway timeout. The request took too long to process.This can happen when querying over too wide a block range.",data:{cause:e}})}}function ke(e){return new Promise((t=>{setTimeout(t,e)}))}function je(e,t){if(200!==e.status)throw Re.internal({message:`Non-200 status code: '${e.status}'`,data:t});var r;if(t.error)throw Re.internal({data:t.error,message:null===(r=t.error)||void 0===r?void 0:r.message});return t.result}function Le(e){return(t,r,n,o)=>"chainId"===t.method?(r.result=e,o()):n()}function Me(e){return(t,r,n,o)=>"provider_config"===t.method?(r.result=e,o()):n()}function Ue(e){const{chainId:t,rpcTarget:r}=e,n=function({rpcTarget:e,originHttpHeaderKey:t}){return r=async(r,n,o)=>{const{fetchUrl:i,fetchParams:a}=function({req:e,rpcTarget:t,originHttpHeaderKey:r}){const n=new URL(t),o={id:e.id,jsonrpc:e.jsonrpc,method:e.method,params:e.params},i=e.origin,a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)};return r&&i&&(a.headers[r]=i),{fetchUrl:n.href,fetchParams:a}}({req:r,rpcTarget:e,originHttpHeaderKey:t});for(let e=0;e<5;e++){try{const e=await fetch(i,a);xe(e);const t=await e.json(),r=je(e,t);return void(n.result=r)}catch(e){const t=(e.message||e).toString();if(!Ce.some((e=>t.includes(e))))throw e}await ke(1e3)}},async(e,t,n,o)=>{let i;const a=new Promise((e=>{i=e}));let s=null,l=!1;try{await r(e,t),l?(await a,s(null)):o(null)}catch(e){const t=e;s?s(t):o(t)}};var r}({rpcTarget:r});return{networkMiddleware:function(e){const t=new Pe;return e.forEach((e=>{t.push(e)})),t.asMiddleware()}([Le(t),Me(e),n]),fetchMiddleware:n}}var De;class Be extends Ie{constructor({config:e,state:t}){super({config:e,state:t})}async setupProvider(){const{networkMiddleware:e}=Ue(this.config.chainConfig),t=new Pe;t.push(e);const r=function(e){const t=new l;return t.sendAsync=async t=>{const r=await e.handle(t);if(r.error){"object"==typeof r.error&&!1===Object.keys(r.error).includes("stack")&&(r.error.stack="Stack trace is not available."),K.error(r.error);const e=ve(r.error,{fallbackError:Oe(r.error),shouldIncludeStack:!0});throw Re.internal(e)}return r.result},t.send=(t,r)=>{if("function"!=typeof r)throw new Error('Must provide callback to "send" method.');e.handle(t,r)},e.on&&e.on("notification",(e=>{t.emit("data",null,e)})),t.request=async e=>{const r=i(i({},e),{},{id:Math.random().toString(36).slice(2),jsonrpc:"2.0"});return await t.sendAsync(r)},t}(t);this.updateProviderEngineProxy(r);const n=this.config.chainConfig.chainId;this.state.chainId!==n&&(this.emit("chainChanged",n),this.emit("connect",{chainId:n})),this.update({chainId:this.config.chainConfig.chainId})}async switchChain(e){if(!this._providerEngineProxy)throw(e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new Se(t,r,n)})({message:"Provider is not initialized",code:4902});const t=this.getChainConfig(e.chainId);this.update({chainId:"loading"}),this.configure({chainConfig:t}),await this.setupProvider()}updateProviderEngineProxy(e){this._providerEngineProxy?this._providerEngineProxy.setTarget(e):this._providerEngineProxy=J(e)}getProviderEngineProxy(){return this._providerEngineProxy}lookupNetwork(){throw new Error("Method not implemented.")}}De=Be,t(Be,"getProviderInstance",(async e=>{const t=new De({config:{chainConfig:e.chainConfig}});return await t.setupProvider(),t}));const Fe="Web3Auth-cachedAdapter";class $e extends l{constructor(e){var r,n,o,a;if(super(),t(this,"coreOptions",void 0),t(this,"connectedAdapterName",null),t(this,"status",C.NOT_READY),t(this,"cachedAdapter",null),t(this,"walletAdapters",{}),t(this,"commonJRPCProvider",null),t(this,"plugins",{}),t(this,"storage","localStorage"),!e.clientId)throw v.invalidParams("Please provide a valid clientId in constructor");if(e.enableLogging?L.enableAll():L.setLevel("error"),!e.privateKeyProvider&&!e.chainConfig)throw v.invalidParams("Please provide chainConfig or privateKeyProvider");if(e.chainConfig=e.chainConfig||e.privateKeyProvider.currentChainConfig,null===(r=e.chainConfig)||void 0===r||!r.chainNamespace||!Object.values(A).includes(null===(n=e.chainConfig)||void 0===n?void 0:n.chainNamespace))throw v.invalidParams("Please provide a valid chainNamespace in chainConfig");"session"===e.storageKey&&(this.storage="sessionStorage"),this.cachedAdapter=$(this.storage)?window[this.storage].getItem(Fe):null,this.coreOptions=i(i({},e),{},{chainConfig:i(i({},N(null===(o=e.chainConfig)||void 0===o?void 0:o.chainNamespace,null===(a=e.chainConfig)||void 0===a?void 0:a.chainId)||{}),e.chainConfig)}),this.subscribeToAdapterEvents=this.subscribeToAdapterEvents.bind(this)}get connected(){return Boolean(this.connectedAdapterName)}get provider(){return this.status!==C.NOT_READY&&this.commonJRPCProvider?this.commonJRPCProvider:null}set provider(e){throw new Error("Not implemented")}async init(){let e;this.commonJRPCProvider=await Be.getProviderInstance({chainConfig:this.coreOptions.chainConfig});try{var t;e=await(async(e,t,r)=>{const n=new URL(`${(e=>f[null!=e?e:h.SAPPHIRE_MAINNET])(t)}/api/configuration`);return n.searchParams.append("project_id",e),n.searchParams.append("network",t),n.searchParams.append("whitelist","true"),r&&n.searchParams.append("aa_provider",r),await F(n.href)})(this.coreOptions.clientId,this.coreOptions.web3AuthNetwork,null===(t=this.coreOptions.accountAbstractionProvider)||void 0===t?void 0:t.config.smartAccountInit.name)}catch(e){throw L.error("Failed to fetch project configurations",e),v.notReady("failed to fetch project configurations",e)}const r=Object.keys(this.walletAdapters).map((async t=>{if(this.subscribeToAdapterEvents(this.walletAdapters[t]),this.walletAdapters[t].chainConfigProxy)this.walletAdapters[t].setAdapterSettings({sessionTime:this.coreOptions.sessionTime,clientId:this.coreOptions.clientId,web3AuthNetwork:this.coreOptions.web3AuthNetwork,useCoreKitKey:this.coreOptions.useCoreKitKey});else{const e=this.coreOptions.chainConfig;if(!e.chainNamespace)throw v.invalidParams("Please provide chainNamespace in chainConfig");this.walletAdapters[t].setAdapterSettings({chainConfig:e,sessionTime:this.coreOptions.sessionTime,clientId:this.coreOptions.clientId,web3AuthNetwork:this.coreOptions.web3AuthNetwork,useCoreKitKey:this.coreOptions.useCoreKitKey})}if(t===I.AUTH){const r=this.walletAdapters[t],{whitelabel:n}=e;this.coreOptions.uiConfig=U()(function(e){try{return structuredClone(e)}catch(t){return JSON.parse(JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t)))}}(n||{}),this.coreOptions.uiConfig||{}),this.coreOptions.uiConfig.mode||(this.coreOptions.uiConfig.mode="light");const{sms_otp_enabled:o,whitelist:i,key_export_enabled:a}=e;if(void 0!==o&&r.setAdapterSettings({loginConfig:{[p]:{showOnModal:o,showOnDesktop:o,showOnMobile:o,showOnSocialBackupFactor:o}}}),i&&r.setAdapterSettings({originData:i.signed_urls}),"boolean"==typeof a&&(this.coreOptions.privateKeyProvider.setKeyExportFlag(a),this.commonJRPCProvider.setKeyExportFlag(a)),this.coreOptions.privateKeyProvider){if(r.currentChainNamespace!==this.coreOptions.privateKeyProvider.currentChainConfig.chainNamespace)throw v.incompatibleChainNameSpace("private key provider is not compatible with provided chainNamespace for auth adapter");r.setAdapterSettings({privateKeyProvider:this.coreOptions.privateKeyProvider})}if(r.setAdapterSettings({whiteLabel:this.coreOptions.uiConfig}),!r.privateKeyProvider)throw v.invalidParams("privateKeyProvider is required for auth adapter")}else if(t===I.WALLET_CONNECT_V2){const r=this.walletAdapters[t],{wallet_connect_enabled:n,wallet_connect_project_id:o}=e;if(!1===n)throw v.invalidParams("Please enable wallet connect v2 addon on dashboard");if(!o)throw v.invalidParams("Invalid wallet connect project id. Please configure it on the dashboard");r.setAdapterSettings({adapterSettings:{walletConnectInitOptions:{projectId:o}}})}return this.walletAdapters[t].init({autoConnect:this.cachedAdapter===t}).catch((e=>L.error(e,t)))}));await Promise.all(r),this.status===C.NOT_READY&&(this.status=C.READY,this.emit(x.READY))}getAdapter(e){return this.walletAdapters[e]||null}configureAdapter(e){this.checkInitRequirements();const t=this.coreOptions.chainConfig;if(!t.chainNamespace)throw v.invalidParams("Please provide chainNamespace in chainConfig");if(this.walletAdapters[e.name])throw v.duplicateAdapterError(`Wallet adapter for ${e.name} already exists`);if(e.adapterNamespace!==R&&e.adapterNamespace!==t.chainNamespace)throw v.incompatibleChainNameSpace(`This wallet adapter belongs to ${e.adapterNamespace} which is incompatible with currently used namespace: ${t.chainNamespace}`);return e.adapterNamespace===R&&e.currentChainNamespace&&t.chainNamespace!==e.currentChainNamespace&&e.setAdapterSettings({chainConfig:t}),this.walletAdapters[e.name]=e,this}clearCache(){$(this.storage)&&(window[this.storage].removeItem(Fe),this.cachedAdapter=null)}async addChain(e){if(this.status===C.CONNECTED&&this.connectedAdapterName)return this.walletAdapters[this.connectedAdapterName].addChain(e);if(this.commonJRPCProvider)return this.commonJRPCProvider.addChain(e);throw v.notReady("No wallet is ready")}async switchChain(e){if(this.status===C.CONNECTED&&this.connectedAdapterName)return this.walletAdapters[this.connectedAdapterName].switchChain(e);if(this.commonJRPCProvider)return this.commonJRPCProvider.switchChain(e);throw v.notReady("No wallet is ready")}async connectTo(e,t){if(!this.walletAdapters[e]||!this.commonJRPCProvider)throw v.notFound(`Please add wallet adapter for ${e} wallet, before connecting`);return new Promise(((r,n)=>{this.once(x.CONNECTED,(e=>{r(this.provider)})),this.once(x.ERRORED,(e=>{n(e)})),this.walletAdapters[e].connect(t)}))}async logout(e={cleanup:!1}){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");await this.walletAdapters[this.connectedAdapterName].disconnect(e)}async getUserInfo(){if(L.debug("Getting user info",this.status,this.connectedAdapterName),this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");return this.walletAdapters[this.connectedAdapterName].getUserInfo()}async enableMFA(e){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");if(this.connectedAdapterName!==I.AUTH)throw _.unsupportedOperation("EnableMFA is not supported for this adapter.");return this.walletAdapters[this.connectedAdapterName].enableMFA(e)}async manageMFA(e){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");if(this.connectedAdapterName!==I.AUTH)throw _.unsupportedOperation("ManageMFA is not supported for this adapter.");return this.walletAdapters[this.connectedAdapterName].manageMFA(e)}async authenticateUser(){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");return this.walletAdapters[this.connectedAdapterName].authenticateUser()}addPlugin(e){if(this.plugins[e.name])throw v.duplicateAdapterError(`Plugin ${e.name} already exist`);if(e.pluginNamespace!==W.MULTICHAIN&&e.pluginNamespace!==this.coreOptions.chainConfig.chainNamespace)throw v.incompatibleChainNameSpace(`This plugin belongs to ${e.pluginNamespace} namespace which is incompatible with currently used namespace: ${this.coreOptions.chainConfig.chainNamespace}`);return this.plugins[e.name]=e,this.status===C.CONNECTED&&this.connectedAdapterName&&this.connectToPlugins({adapter:this.connectedAdapterName}),this}getPlugin(e){return this.plugins[e]||null}subscribeToAdapterEvents(e){e.on(x.CONNECTED,(async e=>{if(!this.commonJRPCProvider)throw v.notFound("CommonJrpcProvider not found");const{provider:t}=e;let r=t.provider||t;this.coreOptions.accountAbstractionProvider&&(e.adapter===I.AUTH||e.adapter!==I.AUTH&&this.coreOptions.useAAWithExternalWallet)&&(await this.coreOptions.accountAbstractionProvider.setupProvider(t),r=this.coreOptions.accountAbstractionProvider),this.commonJRPCProvider.updateProviderEngineProxy(r),this.connectedAdapterName=e.adapter,this.status=C.CONNECTED,this.cacheWallet(e.adapter),L.debug("connected",this.status,this.connectedAdapterName),this.connectToPlugins(e),this.emit(x.CONNECTED,i({},e))})),e.on(x.DISCONNECTED,(async()=>{if(this.status=C.READY,$(this.storage)){const e=window[this.storage].getItem(Fe);this.connectedAdapterName===e&&this.clearCache()}L.debug("disconnected",this.status,this.connectedAdapterName),await Promise.all(Object.values(this.plugins).map((e=>e.disconnect().catch((e=>{5211!==e.code&&L.error(e)}))))),this.connectedAdapterName=null,this.emit(x.DISCONNECTED)})),e.on(x.CONNECTING,(e=>{this.status=C.CONNECTING,this.emit(x.CONNECTING,e),L.debug("connecting",this.status,this.connectedAdapterName)})),e.on(x.ERRORED,(e=>{this.status=C.ERRORED,this.clearCache(),this.emit(x.ERRORED,e),L.debug("errored",this.status,this.connectedAdapterName)})),e.on(x.ADAPTER_DATA_UPDATED,(e=>{L.debug("adapter data updated",e),this.emit(x.ADAPTER_DATA_UPDATED,e)})),e.on(x.CACHE_CLEAR,(e=>{L.debug("adapter cache clear",e),$(this.storage)&&this.clearCache()}))}checkInitRequirements(){if(this.status===C.CONNECTING)throw v.notReady("Already pending connection");if(this.status===C.CONNECTED)throw v.notReady("Already connected");if(this.status===C.READY)throw v.notReady("Adapter is already initialized")}cacheWallet(e){$(this.storage)&&(window[this.storage].setItem(Fe,e),this.cachedAdapter=e)}connectToPlugins(e){Object.values(this.plugins).map((async t=>{try{if(!t.SUPPORTED_ADAPTERS.includes("all")&&!t.SUPPORTED_ADAPTERS.includes(e.adapter))return;if(t.status===H.CONNECTED)return;const{authInstance:r}=this.walletAdapters[this.connectedAdapterName],{options:n,sessionId:o,sessionNamespace:i}=r||{};await t.initWithWeb3Auth(this,null==n?void 0:n.whiteLabel),await t.connect({sessionId:o,sessionNamespace:i})}catch(e){if(5211===e.code)return;L.error(e)}}))}}})(),n})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NoModal=t():e.NoModal=t()}(self,(()=>(()=>{var e={2682:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(273),{AbortError:o,codes:i}=r(1150),{isNodeStream:a,isWebStream:s,kControllerErrorFunction:l}=r(8104),c=r(2549),{ERR_INVALID_ARG_TYPE:u}=i;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!a(r)&&!s(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const i=a(t)?()=>{t.destroy(new o(void 0,{cause:e.reason}))}:()=>{t[l](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{f=f||r(8449).addAbortListener;const o=f(e,i);c(t,o[n])}return t}},8610:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:a}=r(273),{Buffer:s}=r(1048),{inspect:l}=r(8449);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[o](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,o=0;do{const i=r.data;if(!(e>i.length)){e===i.length?(t+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(i,0,e),this.head=r,r.data=n(i,e));break}t+=i,e-=i.length,++o}while(null!==(r=r.next));return this.length-=o,t}_getBuffer(e){const t=s.allocUnsafe(e),r=e;let n=this.head,o=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(i(t,s,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new a(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}i(t,s,r-e),e-=s.length,++o}while(null!==(n=n.next));return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},6009:(e,t,r)=>{"use strict";const{pipeline:n}=r(7103),o=r(6631),{destroyer:i}=r(863),{isNodeStream:a,isReadable:s,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:d}=r(8104),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:y}}=r(1150),g=r(2549);e.exports=function(...e){if(0===e.length)throw new y("streams");if(1===e.length)return o.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=o.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=o.from(e[t])}for(let r=0;r<e.length;++r)if(a(e[r])||c(e[r])){if(r<e.length-1&&!(s(e[r])||d(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,b,m,w,v;const _=e[0],E=n(e,(function(e){const t=w;w=null,t?t(e):e?v.destroy(e):A||S||v.destroy()})),S=!!(l(_)||f(_)||u(_)),A=!!(s(E)||d(E)||u(E));if(v=new o({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==E||!E.readableObjectMode),writable:S,readable:A}),S){if(a(_))v._write=function(e,t,n){_.write(e,t)?n():r=n},v._final=function(e){_.end(),b=e},_.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(c(_)){const e=(u(_)?_.writable:_).getWriter();v._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},v._final=async function(t){try{await e.ready,e.close().catch((()=>{})),b=t}catch(e){t(e)}}}const e=u(E)?E.readable:E;g(e,(()=>{if(b){const e=b;b=null,e()}}))}if(A)if(a(E))E.on("readable",(function(){if(m){const e=m;m=null,e()}})),E.on("end",(function(){v.push(null)})),v._read=function(){for(;;){const e=E.read();if(null===e)return void(m=v._read);if(!v.push(e))return}};else if(c(E)){const e=(u(E)?E.readable:E).getReader();v._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!v.push(t))return;if(r)return void v.push(null)}catch{return}}}return v._destroy=function(e,t){e||null===w||(e=new h),m=null,r=null,b=null,null===w?t(e):(w=t,a(E)&&i(E,e))},v}},863:(e,t,r)=>{"use strict";const n=r(9907),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=r(1150),{Symbol:s}=r(273),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(8104),d=s("kDestroy"),h=s("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function y(e,t,r){let o=!1;function i(t){if(o)return;o=!0;const i=e._readableState,a=e._writableState;p(t,a,i),a&&(a.closed=!0),i&&(i.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(g,e,t):n.nextTick(b,e)}try{e._destroy(t||null,i)}catch(t){i(t)}}function g(e,t){m(e,t),b(e)}function b(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function m(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function w(e,t,r){const o=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),o&&!o.errored&&(o.errored=t),r?n.nextTick(m,e,t):m(e,t))}function v(e){let t=!1;function r(r){if(t)return void w(e,null!=r?r:new i);t=!0;const o=e._readableState,a=e._writableState,s=a||o;o&&(o.constructed=!0),a&&(a.constructed=!0),s.destroyed?e.emit(d,r):r?w(e,r,!0):n.nextTick(_,e)}try{e._construct((e=>{n.nextTick(r,e)}))}catch(e){n.nextTick(r,e)}}function _(e){e.emit(h)}function E(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function S(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(S,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(v,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new a),f(e)?(e.socket=null,e.destroy(t)):E(e)?e.abort():E(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(A,e,t):n.nextTick(S,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,i=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?y(this,e,t):this.once(d,(function(r){y(this,o(r,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:w}},6631:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:i,ObjectSetPrototypeOf:a}=r(273);e.exports=c;const s=r(9333),l=r(789);a(c.prototype,s.prototype),a(c,s);{const e=i(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,f;function d(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...o(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(l.prototype,"writableLength")},writableFinished:{__proto__:null,...o(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return d().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return d().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(6821)),f(e,"body")}},6821:(e,t,r)=>{const n=r(9907),o=r(1048),{isReadable:i,isWritable:a,isIterable:s,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:h}=r(8104),p=r(2549),{AbortError:y,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:b}}=r(1150),{destroyer:m}=r(863),w=r(6631),v=r(9333),_=r(789),{createDeferredPromise:E}=r(8449),S=r(7533),A=globalThis.Blob||o.Blob,R=void 0!==A?function(e){return e instanceof A}:function(e){return!1},N=globalThis.AbortController||r(7083).AbortController,{FunctionPrototypeCall:O}=r(273);class P extends w{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?v.wrap(e.readable):e.readable,r=e.writable;let n,o,s,l,c,u=!!i(t),f=!!a(r);function d(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new P({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,(e=>{f=!1,e&&m(t,e),d(e)})),c._write=function(e,t,o){r.write(e,t)?o():n=o},c._final=function(e){r.end(),o=e},r.on("drain",(function(){if(n){const e=n;n=null,e()}})),r.on("finish",(function(){if(o){const e=o;o=null,e()}}))),u&&(p(t,(e=>{u=!1,e&&m(t,e),d(e)})),t.on("readable",(function(){if(s){const e=s;s=null,e()}})),t.on("end",(function(){c.push(null)})),c._read=function(){for(;;){const e=t.read();if(null===e)return void(s=c._read);if(!c.push(e))return}}),c._destroy=function(e,i){e||null===l||(e=new y),s=null,n=null,o=null,null===l?i(e):(l=i,m(r,e),m(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return T({readable:t});if(u(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if(d(t))return T({readable:v.fromWeb(t)});if(h(t))return T({writable:_.fromWeb(t)});if("function"==typeof t){const{value:e,write:o,final:i,destroy:a}=function(e){let{promise:t,resolve:r}=E();const o=new N,i=o.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:o,done:a,cb:s}=await e;if(n.nextTick(s),a)return;if(i.aborted)throw new y(void 0,{cause:i.reason});({promise:t,resolve:r}=E()),yield o}}(),{signal:i}),write(e,t,n){const o=r;r=null,o({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(s(e))return S(P,e,{objectMode:!0,write:o,final:i,destroy:a});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,(e=>{if(null!=e)throw new b("nully","body",e)}),(e=>{m(t,e)}));return t=new P({objectMode:!0,readable:!1,write:o,final(e){i((async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}}))},destroy:a})}throw new b("Iterable, AsyncIterable or AsyncFunction",r,e)}if(R(t))return e(t.arrayBuffer());if(s(t))return S(P,t,{objectMode:!0,writable:!1});if(d(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return P.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const o=null==t?void 0:t.then;if("function"==typeof o){let e;return O(o,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{m(e,t)})),e=new P({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},2549:(e,t,r)=>{const n=r(9907),{AbortError:o,codes:i}=r(1150),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=i,{kEmptyObject:l,once:c}=r(8449),{validateAbortSignal:u,validateFunction:f,validateObject:d,validateBoolean:h}=r(8080),{Promise:p,PromisePrototypeThen:y,SymbolDispose:g}=r(273),{isClosed:b,isReadable:m,isReadableNodeStream:w,isReadableStream:v,isReadableFinished:_,isReadableErrored:E,isWritable:S,isWritableNodeStream:A,isWritableStream:R,isWritableFinished:N,isWritableErrored:O,isNodeStream:P,willEmitClose:T,kIsClosedPromise:I}=r(8104);let C;const x=()=>{};function k(e,t,i){var h,p;if(2===arguments.length?(i=t,t=l):null==t?t=l:d(t,"options"),f(i,"callback"),u(t.signal,"options.signal"),i=c(i),v(e)||R(e))return function(e,t,i){let a=!1,s=x;if(t.signal)if(s=()=>{a=!0,i.call(e,new o(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(s);else{C=C||r(8449).addAbortListener;const n=C(t.signal,s),o=i;i=c(((...t)=>{n[g](),o.apply(e,t)}))}const l=(...t)=>{a||n.nextTick((()=>i.apply(e,t)))};return y(e[I].promise,l,l),x}(e,t,i);if(!P(e))throw new a("stream",["ReadableStream","WritableStream","Stream"],e);const k=null!==(h=t.readable)&&void 0!==h?h:w(e),j=null!==(p=t.writable)&&void 0!==p?p:A(e),L=e._writableState,M=e._readableState,U=()=>{e.writable||F()};let D=T(e)&&w(e)===k&&A(e)===j,B=N(e,!1);const F=()=>{B=!0,e.destroyed&&(D=!1),(!D||e.readable&&!k)&&(k&&!$||i.call(e))};let $=_(e,!1);const W=()=>{$=!0,e.destroyed&&(D=!1),(!D||e.writable&&!j)&&(j&&!B||i.call(e))},H=t=>{i.call(e,t)};let G=b(e);const q=()=>{G=!0;const t=O(e)||E(e);return t&&"boolean"!=typeof t?i.call(e,t):k&&!$&&w(e,!0)&&!_(e,!1)?i.call(e,new s):!j||B||N(e,!1)?void i.call(e):i.call(e,new s)},V=()=>{G=!0;const t=O(e)||E(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},J=()=>{e.req.on("finish",F)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?j&&!L&&(e.on("end",U),e.on("close",U)):(e.on("complete",F),D||e.on("abort",q),e.req?J():e.on("request",J)),D||"boolean"!=typeof e.aborted||e.on("aborted",q),e.on("end",W),e.on("finish",F),!1!==t.error&&e.on("error",H),e.on("close",q),G?n.nextTick(q):null!=L&&L.errorEmitted||null!=M&&M.errorEmitted?D||n.nextTick(V):(k||D&&!m(e)||!B&&!1!==S(e))&&(j||D&&!S(e)||!$&&!1!==m(e))?M&&e.req&&e.aborted&&n.nextTick(V):n.nextTick(V);const K=()=>{i=x,e.removeListener("aborted",q),e.removeListener("complete",F),e.removeListener("abort",q),e.removeListener("request",J),e.req&&e.req.removeListener("finish",F),e.removeListener("end",U),e.removeListener("close",U),e.removeListener("finish",F),e.removeListener("end",W),e.removeListener("error",H),e.removeListener("close",q)};if(t.signal&&!G){const a=()=>{const r=i;K(),r.call(e,new o(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{C=C||r(8449).addAbortListener;const n=C(t.signal,a),o=i;i=c(((...t)=>{n[g](),o.apply(e,t)}))}}return K}e.exports=k,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new p(((r,o)=>{const i=k(e,t,(e=>{n&&i(),e?o(e):r()}))}))}},7533:(e,t,r)=>{"use strict";const n=r(9907),{PromisePrototypeThen:o,SymbolAsyncIterator:i,SymbolIterator:a}=r(273),{Buffer:s}=r(1048),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(1150).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[i])f=!0,u=t[i]();else{if(!t||!t[a])throw new l("iterable",["Iterable"],t);f=!1,u=t[a]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)d.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new c;if(d.push(t))continue;h=!1}}catch(e){d.destroy(e)}break}}())},d._destroy=function(e,t){o(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),(()=>n.nextTick(t,e)),(r=>n.nextTick(t,r||e)))},d}},670:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:o}=r(273),{EventEmitter:i}=r(46);function a(e){i.call(this,e)}function s(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}o(a.prototype,i.prototype),o(a,i),a.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",c));let a=!1;function l(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return s(r,"error",u),s(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:a,prependListener:s}},8484:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(7083).AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:l}=r(1150),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(8080),d=r(273).Symbol("kWeak"),h=r(273).Symbol("kResistStopPropagation"),{finished:p}=r(2549),y=r(6009),{addAbortSignalNoValidate:g}=r(2682),{isWritable:b,isNodeStream:m}=r(8104),{deprecate:w}=r(8449),{ArrayPrototypePush:v,Boolean:_,MathFloor:E,Number:S,NumberIsNaN:A,Promise:R,PromiseReject:N,PromiseResolve:O,PromisePrototypeThen:P,Symbol:T}=r(273),I=T("kEmpty"),C=T("kEof");function x(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=E(t.concurrency));let o=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(o=E(t.highWaterMark)),u(n,"options.concurrency",1),u(o,"options.highWaterMark",0),o+=n,async function*(){const i=r(8449).AbortSignalAny([null==t?void 0:t.signal].filter(_)),a=this,s=[],c={signal:i};let u,f,d=!1,h=0;function p(){d=!0,y()}function y(){h-=1,g()}function g(){f&&!d&&h<n&&s.length<o&&(f(),f=null)}!async function(){try{for await(let t of a){if(d)return;if(i.aborted)throw new l;try{if(t=e(t,c),t===I)continue;t=O(t)}catch(e){t=N(e)}h+=1,P(t,y,p),s.push(t),u&&(u(),u=null),!d&&(s.length>=o||h>=n)&&await new R((e=>{f=e}))}s.push(C)}catch(e){const t=N(e);P(t,y,p),s.push(t)}finally{d=!0,u&&(u(),u=null)}}();try{for(;;){for(;s.length>0;){const e=await s[0];if(e===C)return;if(i.aborted)throw new l;e!==I&&(yield e),s.shift(),g()}await new R((e=>{u=e}))}}finally{d=!0,f&&(f(),f=null)}}.call(this)}async function k(e,t=void 0){for await(const r of j.call(this,e,t))return!0;return!1}function j(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return x.call(this,(async function(t,r){return await e(t,r)?t:I}),t)}class L extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=S(e),A(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:w((function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,n]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:j,flatMap:function(e,t){const r=x.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:x,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),m(e)&&!b(e))throw new o("stream",e,"must be writable");const r=y(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!await k.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);for await(const r of x.call(this,(async function(t,r){return await e(t,r),I}),t));},reduce:async function(e,t,r){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let a=arguments.length>1;if(null!=r&&null!==(o=r.signal)&&void 0!==o&&o.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const s=new n,u=s.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this,[h]:!0};r.signal.addEventListener("abort",(()=>s.abort()),e)}let y=!1;try{for await(const n of this){var g;if(y=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;a?t=await e(t,n,{signal:u}):(t=n,a=!0)}if(!y&&!a)throw new L}finally{s.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});v(t,n)}return t},some:k,find:async function(e,t){for await(const r of j.call(this,e,t))return r}}},5691:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(273);e.exports=i;const o=r(3273);function i(e){if(!(this instanceof i))return new i(e);o.call(this,e)}n(i.prototype,o.prototype),n(i,o),i.prototype._transform=function(e,t,r){r(null,e)}},7103:(e,t,r)=>{const n=r(9907),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:a,SymbolDispose:s}=r(273),l=r(2549),{once:c}=r(8449),u=r(863),f=r(6631),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:m}=r(1150),{validateFunction:w,validateAbortSignal:v}=r(8080),{isIterable:_,isReadable:E,isReadableNodeStream:S,isNodeStream:A,isTransformStream:R,isWebStream:N,isReadableStream:O,isReadableFinished:P}=r(8104),T=globalThis.AbortController||r(7083).AbortController;let I,C,x;function k(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:r},(e=>{n=!e}))}}function j(e){if(_(e))return e;if(S(e))return async function*(e){C||(C=r(9333)),yield*C.prototype[a].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function L(e,t,r,{end:n}){let o,a=null;const s=e=>{if(e&&(o=e),a){const e=a;a=null,e()}},c=()=>new i(((e,t)=>{o?t(o):a=()=>{o?t(o):e()}}));t.on("drain",s);const u=l(t,{readable:!1},s);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(o!==e?d(o,e):e)}finally{u(),t.off("drain",s)}}async function M(e,t,r,{end:n}){R(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch((()=>{}));await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function U(e,t,i){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new y("streams");const a=new T,l=a.signal,c=null==i?void 0:i.signal,u=[];function d(){F(new m)}let g,b,w;v(c,"options.signal"),x=x||r(8449).addAbortListener,c&&(g=x(c,d));const P=[];let C,U=0;function B(e){F(e,0==--U)}function F(e,r){var o;if(!e||b&&"ERR_STREAM_PREMATURE_CLOSE"!==b.code||(b=e),b||r){for(;P.length;)P.shift()(b);null===(o=g)||void 0===o||o[s](),a.abort(),r&&(b||u.forEach((e=>e())),n.nextTick(t,b,w))}}for(let G=0;G<e.length;G++){const q=e[G],V=G<e.length-1,J=G>0,K=V||!1!==(null==i?void 0:i.end),Y=G===e.length-1;if(A(q)){if(K){const{destroy:z,cleanup:X}=k(q,V,J);P.push(z),E(q)&&Y&&u.push(X)}function $(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&B(e)}q.on("error",$),E(q)&&Y&&u.push((()=>{q.removeListener("error",$)}))}if(0===G)if("function"==typeof q){if(C=q({signal:l}),!_(C))throw new p("Iterable, AsyncIterable or Stream","source",C)}else C=_(q)||S(q)||R(q)?q:f.from(q);else if("function"==typeof q){var W;if(C=R(C)?j(null===(W=C)||void 0===W?void 0:W.readable):j(C),C=q(C,{signal:l}),V){if(!_(C,!0))throw new p("AsyncIterable",`transform[${G-1}]`,C)}else{var H;I||(I=r(5691));const Q=new I({objectMode:!0}),Z=null===(H=C)||void 0===H?void 0:H.then;if("function"==typeof Z)U++,Z.call(C,(e=>{w=e,null!=e&&Q.write(e),K&&Q.end(),n.nextTick(B)}),(e=>{Q.destroy(e),n.nextTick(B,e)}));else if(_(C,!0))U++,L(C,Q,B,{end:K});else{if(!O(C)&&!R(C))throw new p("AsyncIterable or Promise","destination",C);{const re=C.readable||C;U++,L(re,Q,B,{end:K})}}C=Q;const{destroy:ee,cleanup:te}=k(C,!1,!0);P.push(ee),Y&&u.push(te)}}else if(A(q)){if(S(C)){U+=2;const ne=D(C,q,B,{end:K});E(q)&&Y&&u.push(ne)}else if(R(C)||O(C)){const oe=C.readable||C;U++,L(oe,q,B,{end:K})}else{if(!_(C))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);U++,L(C,q,B,{end:K})}C=q}else if(N(q)){if(S(C))U++,M(j(C),q,B,{end:K});else if(O(C)||_(C))U++,M(C,q,B,{end:K});else{if(!R(C))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);U++,M(C.readable,q,B,{end:K})}C=q}else C=f.from(q)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(d),C}function D(e,t,r,{end:o}){let i=!1;if(t.on("close",(()=>{i||r(new b)})),e.pipe(t,{end:!1}),o){function a(){i=!0,t.end()}P(e)?n.nextTick(a):e.once("end",a)}else r();return l(e,{readable:!0,writable:!1},(t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:U,pipeline:function(...e){return U(e,c(function(e){return w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},9333:(e,t,r)=>{const n=r(9907),{ArrayPrototypeIndexOf:o,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:p,Symbol:y}=r(273);e.exports=Y,Y.ReadableState=K;const{EventEmitter:g}=r(46),{Stream:b,prependListener:m}=r(670),{Buffer:w}=r(1048),{addAbortSignal:v}=r(2682),_=r(2549);let E=r(8449).debuglog("stream",(e=>{E=e}));const S=r(8610),A=r(863),{getHighWaterMark:R,getDefaultHighWaterMark:N}=r(7872),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:I,ERR_STREAM_PUSH_AFTER_EOF:C,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:k}=r(1150),{validateObject:j}=r(8080),L=y("kPaused"),{StringDecoder:M}=r(2664),U=r(7533);u(Y.prototype,b.prototype),u(Y,b);const D=()=>{},{errorOrDestroy:B}=A,F=1,$=16,W=32,H=64,G=2048,q=4096,V=65536;function J(e){return{enumerable:!1,get(){return!!(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function K(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(6631)),this.state=G|q|$|W,e&&e.objectMode&&(this.state|=F),n&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?R(this,e,"readableHighWaterMark",n):N(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,e&&!1===e.emitClose&&(this.state&=~G),e&&!1===e.autoDestroy&&(this.state&=~q),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function Y(e){if(!(this instanceof Y))return new Y(e);const t=this instanceof r(6631);this._readableState=new K(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&v(e.signal,this)),b.call(this,e),A.construct(this,(()=>{this._readableState.needReadable&&te(this,this._readableState)}))}function z(e,t,r,n){E("readableAddChunk",t);const o=e._readableState;let i;if(o.state&F||("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=w.from(t,r).toString(o.encoding):(t=w.from(t,r),r=""))):t instanceof w?r="":b._isUint8Array(t)?(t=b._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new P("chunk",["string","Buffer","Uint8Array"],t))),i)B(e,i);else if(null===t)o.state&=-9,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,ee(e))}}(e,o);else if(o.state&F||t&&t.length>0)if(n)if(4&o.state)B(e,new x);else{if(o.destroyed||o.errored)return!1;X(e,o,t,!0)}else if(o.ended)B(e,new C);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?X(e,o,t,!1):te(e,o)):X(e,o,t,!1)}else n||(o.state&=-9,te(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function X(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.state&V?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&H&&Z(e)),te(e,t)}function Q(e,t){return e<=0||0===t.length&&t.ended?0:t.state&F?1:a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){const t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(ee,e))}function ee(e){const t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ae(e)}function te(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function ne(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[L]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function oe(e){E("readable nexttick read 0"),e.read(0)}function ie(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ae(e),t.flowing&&!t.reading&&e.read(0)}function ae(e){const t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function se(e,t){"function"!=typeof e.read&&(e=Y.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=D;function o(t){this===e?(n(),n=D):n=t}e.on("readable",o);const i=_(e,{writable:!1},(e=>{r=e?O(r,e):null,n(),n=D}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(o)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",o),i()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function le(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ce(e){const t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(ue,t,e))}function ue(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(fe,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function fe(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let de;function he(){return void 0===de&&(de={}),de}l(K.prototype,{objectMode:J(F),ended:J(2),endEmitted:J(4),reading:J(8),constructed:J($),sync:J(W),needReadable:J(H),emittedReadable:J(128),readableListening:J(256),resumeScheduled:J(512),errorEmitted:J(1024),emitClose:J(G),autoDestroy:J(q),destroyed:J(8192),closed:J(16384),closeEmitted:J(32768),multiAwaitDrain:J(V),readingMore:J(1<<17),dataEmitted:J(1<<18)}),Y.prototype.destroy=A.destroy,Y.prototype._undestroy=A.undestroy,Y.prototype._destroy=function(e,t){t(e)},Y.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},Y.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new k,this.destroy(e)),new f(((t,r)=>_(this,(n=>n&&n!==e?r(n):t(null)))))},Y.prototype.push=function(e,t){return z(this,e,t,!1)},Y.prototype.unshift=function(e,t){return z(this,e,t,!0)},Y.prototype.isPaused=function(){const e=this._readableState;return!0===e[L]||!1===e.flowing},Y.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},Y.prototype.read=function(e){E("read",e),void 0===e?e=NaN:i(e)||(e=s(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new I("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ce(this):Z(this),null;if(0===(e=Q(e,t))&&t.ended)return 0===t.length&&ce(this),null;let n,o=!!(t.state&H);if(E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,E("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,E("reading, ended or constructing",o);else if(o){E("do read"),t.state|=8|W,0===t.length&&(t.state|=H);try{this._read(t.highWaterMark)}catch(e){B(this,e)}t.state&=~W,t.reading||(e=Q(r,t))}return n=e>0?le(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ce(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},Y.prototype._read=function(e){throw new T("_read()")},Y.prototype.pipe=function(e,t){const r=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new d(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(e),E("pipe count=%d opts=%j",o.pipes.length,t);const i=t&&!1===t.end||e===n.stdout||e===n.stderr?y:a;function a(){E("onend"),e.end()}let s;o.endEmitted?n.nextTick(i):r.once("end",i),e.on("unpipe",(function t(n,i){E("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,E("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),s&&e.removeListener("drain",s),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",u),l=!0,s&&o.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&s())}));let l=!1;function c(){l||(1===o.pipes.length&&o.pipes[0]===e?(E("false write response, pause",0),o.awaitDrainWriters=e,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(e)&&(E("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(e)),r.pause()),s||(s=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",s))}function u(t){E("ondata");const r=e.write(t);E("dest.write",r),!1===r&&c()}function f(t){if(E("onerror",t),y(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?B(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),y()}function p(){E("onfinish"),e.removeListener("close",h),y()}function y(){E("unpipe"),r.unpipe(e)}return r.on("data",u),m(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():o.flowing||(E("pipe resume"),r.resume()),e},Y.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=o(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},Y.prototype.on=function(e,t){const r=b.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,E("on readable",o.length,o.reading),o.length?Z(this):o.reading||n.nextTick(oe,this))),r},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(e,t){const r=b.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(ne,this),r},Y.prototype.off=Y.prototype.removeListener,Y.prototype.removeAllListeners=function(e){const t=b.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(ne,this),t},Y.prototype.resume=function(){const e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ie,e,t))}(this,e)),e[L]=!1,this},Y.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this},Y.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{B(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},Y.prototype[p]=function(){return se(this)},Y.prototype.iterator=function(e){return void 0!==e&&j(e,"options"),se(this,e)},l(Y.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(K.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[L]},set(e){this[L]=!!e}}}),Y._fromList=le,Y.from=function(e,t){return U(Y,e,t)},Y.fromWeb=function(e,t){return he().newStreamReadableFromReadableStream(e,t)},Y.toWeb=function(e,t){return he().newReadableStreamFromStreamReadable(e,t)},Y.wrap=function(e,t){var r,n;return new Y({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){A.destroyer(e,t),r(t)}}).wrap(e)}},7872:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:o}=r(273),{validateInteger:i}=r(8080),{ERR_INVALID_ARG_VALUE:a}=r(1150).codes;let s=16384,l=16;function c(e){return e?l:s}e.exports={getHighWaterMark:function(e,t,r,i){const s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=s){if(!o(s)||s<0)throw new a(i?`options.${r}`:"options.highWaterMark",s);return n(s)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?l=t:s=t}}},3273:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:o}=r(273);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:i}=r(1150).codes,a=r(6631),{getHighWaterMark:s}=r(7872);n(c.prototype,a.prototype),n(c,a);const l=o("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new i("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[l]=r)}))},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},8104:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:i}=r(273),a=i("nodejs.stream.destroyed"),s=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function h(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function y(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!(!e||y(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function b(e){return!(!e||y(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function m(e){return!(!e||y(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function w(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[a]||null!=n&&n.destroyed)}function v(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function _(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!w(e)&&h(e)&&e.readable&&!_(e)}function S(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!w(e)&&p(e)&&e.writable&&!v(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function R(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:w,kIsDestroyed:a,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,o,i,a,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(a=e[s])&&void 0!==a?a:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:s,isReadable:E,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:c,isClosed:function(e){if(!y(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return y(e)?!(!w(e)&&(!1!==(null==t?void 0:t.readable)&&E(e)||!1!==(null==t?void 0:t.writable)&&S(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[o]:"function"==typeof e[n]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,r;return y(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:y,isWebStream:function(e){return g(e)||b(e)||m(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:b,isWritableEnded:v,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return y(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:R,willEmitClose:function(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&R(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:m}},789:(e,t,r)=>{const n=r(9907),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=r(273);e.exports=j,j.WritableState=x;const{EventEmitter:h}=r(46),p=r(670).Stream,{Buffer:y}=r(1048),g=r(863),{addAbortSignal:b}=r(2682),{getHighWaterMark:m,getDefaultHighWaterMark:w}=r(7872),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:R,ERR_STREAM_NULL_VALUES:N,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:P}=r(1150).codes,{errorOrDestroy:T}=g;function I(){}c(j.prototype,p.prototype),c(j,p);const C=f("kOnFinished");function x(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(6631)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?m(this,e,"writableHighWaterMark",n):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const o=!(!e||!1!==e.decodeStrings);this.decodeStrings=!o,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,k(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function k(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function j(e){const t=this instanceof r(6631);if(!t&&!a(j,this))return new j(e);this._writableState=new x(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&b(e.signal,this)),p.call(this,e),g.construct(this,(()=>{const e=this._writableState;e.writing||W(this,e),G(this,e)}))}function L(e,t,r,o){const i=e._writableState;if("function"==typeof r)o=r,r=i.defaultEncoding;else{if(r){if("buffer"!==r&&!y.isEncoding(r))throw new P(r)}else r=i.defaultEncoding;"function"!=typeof o&&(o=I)}if(null===t)throw new N;if(!i.objectMode)if("string"==typeof t)!1!==i.decodeStrings&&(t=y.from(t,r),r="buffer");else if(t instanceof y)r="buffer";else{if(!p._isUint8Array(t))throw new v("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let a;return i.ending?a=new O:i.destroyed&&(a=new A("write")),a?(n.nextTick(o,a),T(e,a,!0),a):(i.pendingcb++,function(e,t,r,n,o){const i=t.objectMode?1:r.length;t.length+=i;const a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==I&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}(e,i,t,r,o))}function M(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function U(e,t,r,n){--t.pendingcb,n(r),$(t),T(e,r)}function D(e,t){const r=e._writableState,o=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?n.nextTick(U,e,r,t,i):U(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&W(e,r),o?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},n.nextTick(B,r.afterWriteTickInfo)):F(e,r,1,i))):T(e,new E)}function B({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,F(e,t,r,n)}function F(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&$(t),G(e,t)}function $(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[C].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}k(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:i}=t,a=r.length-n;if(!a)return;let s=n;if(t.bufferProcessing=!0,a>1&&e._writev){t.pendingcb-=a-1;const n=t.allNoop?I:e=>{for(let t=s;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===s?r:o(r,s);i.allBuffers=t.allBuffers,M(e,t,!0,t.length,i,"",n),k(t)}else{do{const{chunk:n,encoding:o,callback:a}=r[s];r[s++]=null,M(e,t,!1,i?1:n.length,n,o,a)}while(s<r.length&&!t.writing);s===r.length?k(t):s>256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function G(e,t,r){H(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function o(o){if(r)T(e,null!=o?o:E());else if(r=!0,t.pendingcb--,o){const r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e](o);T(e,o,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(q,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick(((e,t)=>{H(t)?q(e,t):t.pendingcb--}),e,t)):H(t)&&(t.pendingcb++,q(e,t))))}function q(e,t){t.pendingcb--,t.finished=!0;const r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},s(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(j,d,{__proto__:null,value:function(e){return!!a(this,e)||this===j&&e&&e._writableState instanceof x}}),j.prototype.pipe=function(){T(this,new S)},j.prototype.write=function(e,t,r){return!0===L(this,e,t,r)},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!y.isEncoding(e))throw new P(e);return this._writableState.defaultEncoding=e,this},j.prototype._write=function(e,t,r){if(!this._writev)throw new _("_write()");this._writev([{chunk:e,encoding:t}],r)},j.prototype._writev=null,j.prototype.end=function(e,t,r){const o=this._writableState;let a;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=L(this,e,t);r instanceof i&&(a=r)}return o.corked&&(o.corked=1,this.uncork()),a||(o.errored||o.ending?o.finished?a=new R("end"):o.destroyed&&(a=new A("end")):(o.ending=!0,G(this,o,!0),o.ended=!0)),"function"==typeof r&&(a||o.finished?n.nextTick(r,a):o[C].push(r)),this},l(j.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const V=g.destroy;let J;function K(){return void 0===J&&(J={}),J}j.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[C].length)&&n.nextTick($,r),V.call(this,e,t),this},j.prototype._undestroy=g.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},j.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},j.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},8080:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:y,StringPrototypeTrim:g}=r(273),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:m,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:E}}=r(1150),{normalizeEncoding:S}=r(8449),{isAsyncFunction:A,isArrayBufferView:R}=r(8449).types,N={},O=/^[0-7]+$/,P=b(((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),T=b(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),I=b(((e,t,r=!1)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);const n=r?1:0,o=4294967295;if(e<n||e>o)throw new _(t,`>= ${n} && <= ${o}`,e)}));function C(e,t){if("string"!=typeof e)throw new w(t,"string",e)}const x=b(((e,t,r)=>{if(!o(r,e)){const n=i(a(r,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new v(t,e,"must be one of: "+n)}}));function k(e,t){if("boolean"!=typeof e)throw new w(t,"boolean",e)}function j(e,t,r){return null!=e&&d(e,t)?e[t]:r}const L=b(((e,t,r=null)=>{const o=j(r,"allowArray",!1),i=j(r,"allowFunction",!1);if(!j(r,"nullable",!1)&&null===e||!o&&n(e)||"object"!=typeof e&&(!i||"function"!=typeof e))throw new w(t,"Object",e)})),M=b(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new w(t,"a dictionary",e)})),U=b(((e,t,r=0)=>{if(!n(e))throw new w(t,"Array",e);if(e.length<r)throw new v(t,e,`must be longer than ${r}`)})),D=b(((e,t="buffer")=>{if(!R(e))throw new w(t,["Buffer","TypedArray","DataView"],e)})),B=b(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new w(t,"AbortSignal",e)})),F=b(((e,t)=>{if("function"!=typeof e)throw new w(t,"Function",e)})),$=b(((e,t)=>{if("function"!=typeof e||A(e))throw new w(t,"Function",e)})),W=b(((e,t)=>{if(void 0!==e)throw new w(t,"undefined",e)})),H=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function G(e,t){if(void 0===e||!h(H,e))throw new v(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(O,e))throw new v(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return I(e,t),e},validateArray:U,validateStringArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)C(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)k(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++){const n=e[r],o=`${t}[${r}]`;if(null==n)throw new w(o,"AbortSignal",n);B(n,o)}},validateBoolean:k,validateBuffer:D,validateDictionary:M,validateEncoding:function(e,t){const r=S(t),n=e.length;if("hex"===r&&n%2!=0)throw new v("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:T,validateInteger:P,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new w(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:L,validateOneOf:x,validatePlainFunction:$,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new m(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(C(e,t),void 0===N[e]){if(void 0!==N[y(e)])throw new E(e+" (signals must use all capital letters)");throw new E(e)}},validateString:C,validateUint32:I,validateUndefined:W,validateUnion:function(e,t,r){if(!o(r,e))throw new w(t,`('${i(r,"|")}')`,e)},validateAbortSignal:B,validateLinkHeaderValue:function(e){if("string"==typeof e)return G(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const o=e[n];G(o,"hints"),r+=o,n!==t-1&&(r+=", ")}return r}throw new v("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},3625:(e,t,r)=>{"use strict";const n=r(4041),o=r(6970),i=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=i,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),e.exports.Stream=n.Stream,e.exports.default=e.exports},1150:(e,t,r)=>{"use strict";const{format:n,inspect:o,AggregateError:i}=r(8449),a=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function d(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function h(e,t,r){r||(r=Error);class o extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return f(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[s]=!0,u[e]=o}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class y extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],a=[],s=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?i.push(e.toLowerCase()):c.test(e)?a.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),s.push(e));if(a.length>0){const e=i.indexOf("object");-1!==e&&(i.splice(i,e,1),a.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const e=i.pop();n+=`one of type ${i.join(", ")}, or ${e}`}}(a.length>0||s.length>0)&&(n+=" or ")}if(a.length>0){switch(a.length){case 1:n+=`an instance of ${a[0]}`;break;case 2:n+=`an instance of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`an instance of ${a.join(", ")}, or ${e}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`one of ${s.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${o(r,{depth:-1})}`}else{let e=o(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n}),TypeError),h("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let n=o(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),h("ERR_MISSING_ARGS",((...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((e,t,r)=>{let n;return f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?n=d(String(r)):"bigint"==typeof r?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=d(n)),n+="n"):n=o(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new a([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:p,codes:u}},273:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},8449:(e,t,r)=>{"use strict";const n=r(1048),{kResistStopPropagation:o,SymbolDispose:i}=r(273),a=globalThis.AbortSignal||r(7083).AbortSignal,s=globalThis.AbortController||r(7083).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,c=globalThis.Blob||n.Blob,u=void 0!==c?function(e){return e instanceof c}:function(e){return!1},f=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class d extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:d,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof l,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:u,deprecate:(e,t)=>e,addAbortListener:r(46).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let r;return f(e,"signal"),(e=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[o]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[i](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:a.any||function(e){if(1===e.length)return e[0];const t=new s,r=()=>t.abort();return e.forEach((e=>{f(e,"signals"),e.addEventListener("abort",r,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",r)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},4041:(e,t,r)=>{const{Buffer:n}=r(1048),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:a}=r(273),{promisify:{custom:s}}=r(8449),{streamReturningOperators:l,promiseReturningOperators:c}=r(8484),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(1150),f=r(6009),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=r(7872),{pipeline:p}=r(7103),{destroyer:y}=r(863),g=r(2549),b=r(6970),m=r(8104),w=e.exports=r(670).Stream;w.isDestroyed=m.isDestroyed,w.isDisturbed=m.isDisturbed,w.isErrored=m.isErrored,w.isReadable=m.isReadable,w.isWritable=m.isWritable,w.Readable=r(9333);for(const E of i(l)){const S=l[E];function v(...e){if(new.target)throw u();return w.Readable.from(a(S,this,e))}o(v,"name",{__proto__:null,value:S.name}),o(v,"length",{__proto__:null,value:S.length}),o(w.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(const A of i(c)){const R=c[A];function v(...e){if(new.target)throw u();return a(R,this,e)}o(v,"name",{__proto__:null,value:R.name}),o(v,"length",{__proto__:null,value:R.length}),o(w.Readable.prototype,A,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}w.Writable=r(789),w.Duplex=r(6631),w.Transform=r(3273),w.PassThrough=r(5691),w.pipeline=p;const{addAbortSignal:_}=r(2682);w.addAbortSignal=_,w.finished=g,w.destroy=y,w.compose=f,w.setDefaultHighWaterMark=d,w.getDefaultHighWaterMark=h,o(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>b}),o(p,s,{__proto__:null,enumerable:!0,get:()=>b.pipeline}),o(g,s,{__proto__:null,enumerable:!0,get:()=>b.finished}),w.Stream=w,w._isUint8Array=function(e){return e instanceof Uint8Array},w._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},6970:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:o}=r(273),{isIterable:i,isNodeStream:a,isWebStream:s}=r(8104),{pipelineImpl:l}=r(7103),{finished:c}=r(2549);r(4041),e.exports={finished:c,pipeline:function(...e){return new o(((t,r)=>{let o,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!a(u)&&!i(u)&&!s(u)){const t=n(e);o=t.signal,c=t.end}l(e,((e,n)=>{e?r(e):t(n)}),{signal:o,end:c})}))}}},2664:(e,t,r)=>{"use strict";var n=r(5636).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7083:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],l=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),u=0,f=l>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;s<c;s+=a)i.push(l(e,s,s+a>c?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1048:(e,t,r)=>{"use strict";const n=r(7991),o=r(9318),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const o=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(o)return n?-1:V(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return N(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function v(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(z(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return K(V(t,e.length-r),e,r,n)}function E(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return K(J(t),e,r,n)}function A(e,t,r,n){return K(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function N(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(i=l));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(i=l))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))o+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},l.byteLength=y,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?N(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,o){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==u[e]){i=c[e],a=u[e];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=X[e[n]];return o}function C(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function x(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function L(e,t,r,n,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function M(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),l.prototype.readBigUInt64BE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Q((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Q((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=l.isBuffer(e)?e:l.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const B={};function F(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=$(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=$(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function J(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},9818:(e,t,r)=>{"use strict";var n=r(528),o=r(8498),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},8498:(e,t,r)=>{"use strict";var n=r(9138),o=r(528),i=r(6108),a=r(3468),s=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(l,s),u=r(4940),f=o("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=c(n,l,arguments);return i(t,1+f(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};u?u(e.exports,"apply",{value:d}):e.exports.apply=d},2743:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||o,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?l.arrayMerge(e,r,l):function(e,t,r){var o={};return r.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=n(e[t],r)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&r.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return s;var r=t.customMerge(e);return"function"==typeof r?r:s}(i,r)(e[i],t[i],r):o[i]=n(t[i],r))})),o}(e,r,l):n(r,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return s(e,r,t)}),{})};var l=s;e.exports=l},686:(e,t,r)=>{"use strict";var n=r(4940),o=r(5731),i=r(3468),a=r(9336);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===l&&f?f.writable:!l});else{if(!u&&(s||l||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},4940:(e,t,r)=>{"use strict";var n=r(528)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},9110:e=>{"use strict";e.exports=EvalError},9838:e=>{"use strict";e.exports=Error},1155:e=>{"use strict";e.exports=RangeError},4943:e=>{"use strict";e.exports=ReferenceError},5731:e=>{"use strict";e.exports=SyntaxError},3468:e=>{"use strict";e.exports=TypeError},2140:e=>{"use strict";e.exports=URIError},46:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=l(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=u.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8794:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=r(0,o.length-a.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var t=o.apply(this,n(a,arguments));return Object(t)===t?t:this}return o.apply(e,n(a,arguments))})),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},9138:(e,t,r)=>{"use strict";var n=r(8794);e.exports=Function.prototype.bind||n},528:(e,t,r)=>{"use strict";var n,o=r(9838),i=r(9110),a=r(1155),s=r(4943),l=r(5731),c=r(3468),u=r(2140),f=Function,d=function(e){try{return f('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}var p=function(){throw new c},y=h?function(){try{return p}catch(e){try{return h(arguments,"callee").get}catch(e){return p}}}():p,g=r(3558)(),b=r(6869)(),m=Object.getPrototypeOf||(b?function(e){return e.__proto__}:null),w={},v="undefined"!=typeof Uint8Array&&m?m(Uint8Array):n,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&m?m([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":w,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&m?m(m([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&m?m((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&m?m((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&m?m(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":v,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(m)try{null.error}catch(e){var E=m(m(e));_["%Error.prototype%"]=E}var S=function e(t){var r;if("%AsyncFunction%"===t)r=d("async function () {}");else if("%GeneratorFunction%"===t)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=d("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&m&&(r=m(o.prototype))}return _[t]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=r(9138),N=r(8554),O=R.call(Function.call,Array.prototype.concat),P=R.call(Function.apply,Array.prototype.splice),T=R.call(Function.call,String.prototype.replace),I=R.call(Function.call,String.prototype.slice),C=R.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,j=function(e,t){var r,n=e;if(N(A,n)&&(n="%"+(r=A[n])[0]+"%"),N(_,n)){var o=_[n];if(o===w&&(o=S(n)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=I(e,0,1),r=I(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return T(e,x,(function(e,t,r,o){n[n.length]=r?T(o,k,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=j("%"+n+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],P(r,O([0,1],u)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],y=I(p,0,1),g=I(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===g||"'"===g||"`"===g)&&y!==g)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&d||(s=!0),N(_,i="%"+(n+="."+p)+"%"))a=_[i];else if(null!=a){if(!(p in a)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(h&&f+1>=r.length){var b=h(a,p);a=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:a[p]}else d=N(a,p),a=a[p];d&&!s&&(_[i]=a)}}return a}},9336:(e,t,r)=>{"use strict";var n=r(528)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},7239:(e,t,r)=>{"use strict";var n=r(4940),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},6869:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},3558:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(2908);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},2908:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},8554:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(9138);e.exports=i.call(n,o)},9318:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+f],f+=d,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+e[t+f],f+=d,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(t*l-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},5172:(e,t,r)=>{"use strict";var n=("undefined"!=typeof JSON?JSON:r(6998)).stringify,o=r(9549),i=r(9228),a=r(8498),s=r(9818),l=s("Array.prototype.join"),c=s("Array.prototype.push"),u=function(e,t){for(var r="",n=0;n<e;n+=1)r+=t;return r},f=function(e,t,r){return r};e.exports=function(e){var t=arguments.length>1?arguments[1]:void 0,r=t&&t.space||"";"number"==typeof r&&(r=u(r," "));var s=!!t&&"boolean"==typeof t.cycles&&t.cycles,d=t&&t.replacer?a(t.replacer):f,h="function"==typeof t?t:t&&t.cmp,p=h&&function(e){var t=h.length>2&&function(t){return e[t]};return function(r,n){return h({key:r,value:e[r]},{key:n,value:e[n]},t?{__proto__:null,get:t}:void 0)}},y=[];return function e(t,a,f,h){var g=r?"\n"+u(h,r):"",b=r?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),void 0!==(f=d(t,a,f))){if("object"!=typeof f||null===f)return n(f);if(o(f)){for(var m=[],w=0;w<f.length;w++){var v=e(f,w,f[w],h+1)||n(null);c(m,g+r+v)}return"["+l(m,",")+g+"]"}if(-1!==y.indexOf(f)){if(s)return n("__cycle__");throw new TypeError("Converting circular structure to JSON")}c(y,f);var _=i(f).sort(p&&p(f));for(m=[],w=0;w<_.length;w++){var E=e(f,a=_[w],f[a],h+1);if(E){var S=n(a)+b+E;c(m,g+r+S)}}return y.splice(y.indexOf(f),1),"{"+l(m,",")+g+"}"}}({"":e},"",e,0)}},9549:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},6998:(e,t,r)=>{"use strict";t.parse=r(6921),t.stringify=r(9191)},6921:e=>{"use strict";var t,r,n,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(e){throw{name:"SyntaxError",message:e,at:t,text:n}}function a(e){return e&&e!==r&&i("Expected '"+e+"' instead of '"+r+"'"),r=n.charAt(t),t+=1,r}function s(){var e,t="";for("-"===r&&(t="-",a("-"));r>="0"&&r<="9";)t+=r,a();if("."===r)for(t+=".";a()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,a(),"-"!==r&&"+"!==r||(t+=r,a());r>="0"&&r<="9";)t+=r,a();return e=Number(t),isFinite(e)||i("Bad number"),e}function l(){var e,t,n,s="";if('"'===r)for(;a();){if('"'===r)return a(),s;if("\\"===r)if(a(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(a(),16),isFinite(e));t+=1)n=16*n+e;s+=String.fromCharCode(n)}else{if("string"!=typeof o[r])break;s+=o[r]}else s+=r}i("Bad string")}function c(){for(;r&&r<=" ";)a()}function u(){switch(c(),r){case"{":return function(){var e,t={};if("{"===r){if(a("{"),c(),"}"===r)return a("}"),t;for(;r;){if(e=l(),c(),a(":"),Object.prototype.hasOwnProperty.call(t,e)&&i('Duplicate key "'+e+'"'),t[e]=u(),c(),"}"===r)return a("}"),t;a(","),c()}}i("Bad object")}();case"[":return function(){var e=[];if("["===r){if(a("["),c(),"]"===r)return a("]"),e;for(;r;){if(e.push(u()),c(),"]"===r)return a("]"),e;a(","),c()}}i("Bad array")}();case'"':return l();case"-":return s();default:return r>="0"&&r<="9"?s():function(){switch(r){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null;default:i("Unexpected '"+r+"'")}}()}}e.exports=function(e,o){var a;return n=e,t=0,r=" ",a=u(),c(),r&&i("Syntax error"),"function"==typeof o?function e(t,r){var n,i,a=t[r];if(a&&"object"==typeof a)for(n in u)Object.prototype.hasOwnProperty.call(a,n)&&(void 0===(i=e(a,n))?delete a[n]:a[n]=i);return o.call(t,r,a)}({"":a},""):a}},9191:e=>{"use strict";var t,r,n,o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,(function(e){var t=i[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function s(e,o){var i,l,c,u,f,d=t,h=o[e];switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(e)),"function"==typeof n&&(h=n.call(o,e,h)),typeof h){case"string":return a(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(t+=r,f=[],"[object Array]"===Object.prototype.toString.apply(h)){for(u=h.length,i=0;i<u;i+=1)f[i]=s(i,h)||"null";return c=0===f.length?"[]":t?"[\n"+t+f.join(",\n"+t)+"\n"+d+"]":"["+f.join(",")+"]",t=d,c}if(n&&"object"==typeof n)for(u=n.length,i=0;i<u;i+=1)"string"==typeof(l=n[i])&&(c=s(l,h))&&f.push(a(l)+(t?": ":":")+c);else for(l in h)Object.prototype.hasOwnProperty.call(h,l)&&(c=s(l,h))&&f.push(a(l)+(t?": ":":")+c);return c=0===f.length?"{}":t?"{\n"+t+f.join(",\n"+t)+"\n"+d+"}":"{"+f.join(",")+"}",t=d,c}}e.exports=function(e,o,i){var a;if(t="",r="","number"==typeof i)for(a=0;a<i;a+=1)r+=" ";else"string"==typeof i&&(r=i);if(n=o,o&&"function"!=typeof o&&("object"!=typeof o||"number"!=typeof o.length))throw new Error("JSON.stringify");return s("",{"":e})}},5880:function(e,t,r){var n,o;!function(){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(){for(var r=this.getLevel(),o=0;o<n.length;o++){var i=n[o];this[i]=o<r?e:this.methodFactory(i,r,this.name)}if(this.log=this.debug,typeof console===t&&r<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function u(n,o,i){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?s:void 0!==console[n]?a(console,n):void 0!==console.log?a(console,"log"):e)}(n)||c.apply(this,arguments)}function f(e,r){var a,s,c,f=this,d="loglevel";function h(){var e;if(typeof window!==t&&d){try{e=window.localStorage[d]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=encodeURIComponent(d),o=r.indexOf(n+"=");-1!==o&&(e=/^([^;]+)/.exec(r.slice(o+n.length+1))[1])}catch(e){}return void 0===f.levels[e]&&(e=void 0),e}}function p(e){var t=e;if("string"==typeof t&&void 0!==f.levels[t.toUpperCase()]&&(t=f.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=f.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?d+=":"+e:"symbol"==typeof e&&(d=void 0),f.name=e,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=r||u,f.getLevel=function(){return null!=c?c:null!=s?s:a},f.setLevel=function(e,r){return c=p(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&d){try{return void(window.localStorage[d]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"="+r+";"}catch(e){}}}(c),l.call(f)},f.setDefaultLevel=function(e){s=p(e),h()||f.setLevel(e,!1)},f.resetLevel=function(){c=null,function(){if(typeof window!==t&&d){try{window.localStorage.removeItem(d)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),l.call(f)},f.enableAll=function(e){f.setLevel(f.levels.TRACE,e)},f.disableAll=function(e){f.setLevel(f.levels.SILENT,e)},f.rebuild=function(){if(i!==f&&(a=p(i.getLevel())),l.call(f),i===f)for(var e in o)o[e].rebuild()},a=p(i?i.getLevel():"WARN");var y=h();null!=y&&(c=p(y)),l.call(f)}(i=new f).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new f(e,i.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=d),i},i.getLoggers=function(){return o},i.default=i,i},void 0===(o=n.call(t,r,t,e))||(e.exports=o)}()},8160:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(968),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)d.push(String(y));if(n&&e.length>0)for(var g=0;g<e.length;++g)d.push(String(g));else for(var b in e)p&&"prototype"===b||!o.call(e,b)||d.push(String(b));if(l)for(var m=function(e){if("undefined"==typeof window||!h)return f(e);try{return f(e)}catch(e){return!1}}(e),w=0;w<u.length;++w)m&&"constructor"===u[w]||!o.call(e,u[w])||d.push(u[w]);return d}}e.exports=n},9228:(e,t,r)=>{"use strict";var n=Array.prototype.slice,o=r(968),i=Object.keys,a=i?function(e){return i(e)}:r(8160),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},968:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},9907:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,l=[],c=!1,u=-1;function f(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new h(e,t)),1!==l.length||c||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5636:(e,t,r)=>{var n=r(1048),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},6108:(e,t,r)=>{"use strict";var n=r(528),o=r(686),i=r(7239)(),a=r(9336),s=r(3468),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,r,n){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?o(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}r.r(n),r.d(n,{Web3AuthNoModal:()=>$e});var a=r(46);function s(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class l extends a.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const o=n[e];if(void 0===o)return!1;if("function"==typeof o)s(o,this,t);else{const e=o.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(o);for(let n=0;n<e;n+=1)s(r[n],this,t)}return!0}}const c={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},u={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},f={[u.SAPPHIRE_MAINNET]:"https://api.web3auth.io/signer-service",[u.SAPPHIRE_DEVNET]:"https://api.web3auth.io/signer-service",[c.MAINNET]:"https://api.web3auth.io/signer-service",[c.TESTNET]:"https://api.web3auth.io/signer-service",[c.CYAN]:"https://api.web3auth.io/signer-polygon-service",[c.AQUA]:"https://api.web3auth.io/signer-polygon-service",[c.CELESTE]:"https://api.web3auth.io/signer-polygon-service"},d=c,h=i(i({},u),d),p="sms_passwordless";var y,g=(y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},y(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=function(e){function t(t,r){var n,o,i,a=this.constructor,s=e.call(this,t,r)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),n=s,o=a.prototype,(i=Object.setPrototypeOf)?i(n,o):n.__proto__=o,function(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}(s),s}return g(t,e),t}(Error);function m(e){const t=e.findIndex((e=>e instanceof Error)),r=e.findIndex((e=>"string"==typeof e)),n=e.findIndex((e=>e&&"object"==typeof e&&"status"in e&&"type"in e));let o;if(-1!==n){const t=e[n];o=new Error(`${t.status} ${t.type.toString()} ${t.statusText}`)}else o=-1!==t?e.splice(t,1)[0]:-1!==r?new Error(e.splice(r,1)[0]):new Error("Unknown error");return[o,e]}class w extends b{constructor(e,r,n){super(r),t(this,"code",void 0),t(this,"message",void 0),t(this,"cause",void 0),this.code=e,this.message=r||"",this.cause=n,Object.defineProperty(this,"name",{value:"Web3AuthError"})}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:m([this.cause])}}toString(){return JSON.stringify(this.toJSON())}}class v extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletInitializationError"})}static fromCode(e,t="",r){return new v(e,`${v.messages[e]}, ${t}`,r)}static notFound(e="",t){return v.fromCode(5001,e,t)}static notInstalled(e="",t){return v.fromCode(5002,e,t)}static notReady(e="",t){return v.fromCode(5003,e,t)}static windowBlocked(e="",t){return v.fromCode(5004,e,t)}static windowClosed(e="",t){return v.fromCode(5005,e,t)}static incompatibleChainNameSpace(e="",t){return v.fromCode(5006,e,t)}static duplicateAdapterError(e="",t){return v.fromCode(5007,e,t)}static invalidProviderConfigError(e="",t){return v.fromCode(5008,e,t)}static providerNotReadyError(e="",t){return v.fromCode(5009,e,t)}static rpcConnectionError(e="",t){return v.fromCode(5010,e,t)}static invalidParams(e="",t){return v.fromCode(5011,e,t)}static invalidNetwork(e="",t){return v.fromCode(5013,e,t)}}t(v,"messages",{5e3:"Custom",5001:"Wallet is not found",5002:"Wallet is not installed",5003:"Wallet is not ready yet",5004:"Wallet window is blocked",5005:"Wallet window has been closed by the user",5006:"Incompatible chain namespace provided",5007:"Adapter has already been included",5008:"Invalid provider Config",5009:"Provider is not ready yet",5010:"Failed to connect with rpc url",5011:"Invalid params passed in",5013:"Invalid network provided"});class _ extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletLoginError"})}static fromCode(e,t="",r){return new _(e,`${_.messages[e]}. ${t}`,r)}static connectionError(e="",t){return _.fromCode(5111,e,t)}static disconnectionError(e="",t){return _.fromCode(5112,e,t)}static notConnectedError(e="",t){return _.fromCode(5113,e,t)}static popupClosed(e="",t){return _.fromCode(5114,e,t)}static mfaEnabled(e="",t){return _.fromCode(5115,e,t)}static chainConfigNotAdded(e="",t){return _.fromCode(5116,e,t)}static unsupportedOperation(e="",t){return _.fromCode(5117,e,t)}static coreKitKeyNotFound(e="",t){return _.fromCode(5118,e,t)}static userNotLoggedIn(e="",t){return _.fromCode(5119,e,t)}}t(_,"messages",{5e3:"Custom",5111:"Failed to connect with wallet",5112:"Failed to disconnect from wallet",5113:"Wallet is not connected",5114:"Wallet popup has been closed by the user",5115:"User has already enabled mfa, please use the @web3auth/web3auth-web sdk for login with mfa",5116:"Chain config has not been added. Please add the chain config before calling switchChain",5117:"Unsupported operation",5118:"useCoreKitKey flag is enabled but coreKitKey is not available",5119:"User not logged in."});class E extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletOperationsError"})}static fromCode(e,t="",r){return new E(e,`${E.messages[e]}, ${t}`,r)}static chainIDNotAllowed(e="",t){return E.fromCode(5201,e,t)}static operationNotAllowed(e="",t){return E.fromCode(5202,e,t)}static chainNamespaceNotAllowed(e="",t){return E.fromCode(5203,e,t)}}t(E,"messages",{5e3:"Custom",5201:"Provided chainId is not allowed",5202:"This operation is not allowed"});class S extends w{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,"name",{value:"WalletProviderError"})}static fromCode(e,t="",r){return new E(e,`${S.messages[e]}, ${t}`,r)}static invalidRequestArgs(e="",t){return E.fromCode(5301,e,t)}static invalidRequestMethod(e="",t){return E.fromCode(5302,e,t)}static invalidRequestParams(e="",t){return E.fromCode(5303,e,t)}}t(S,"messages",{5e3:"Custom",5301:"Expected a single, non-array, object argument.",5302:"'args.method' must be a non-empty string.",5303:"'args.params' must be an object or array if provided."});const A={EIP155:"eip155",SOLANA:"solana",CASPER:"casper",XRPL:"xrpl",OTHER:"other"},R="multichain",N=(e,t)=>{if(e===A.OTHER)return null;const r=t?"number"==typeof t?t:parseInt(t,16):(e=>{if(e===A.EIP155)return 1;if(e===A.SOLANA)return 1;if(e===A.XRPL)return 1;throw v.invalidParams(`Chain namespace ${e} is not supported`)})(e);return e===A.EIP155?(e=>{const t=A.EIP155;return 1===e?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:t,chainId:"0x1",rpcTarget:"https://rpc.ankr.com/eth",displayName:"Ethereum Mainnet",blockExplorerUrl:"https://etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:5===e?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:t,chainId:"0x5",rpcTarget:"https://rpc.ankr.com/eth_goerli",displayName:"Goerli Testnet",blockExplorerUrl:"https://goerli.etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:11155111===e?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:t,chainId:"0xaa36a7",rpcTarget:"https://rpc.ankr.com/eth_sepolia",displayName:"Sepolia Testnet",blockExplorerUrl:"https://sepolia.etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:137===e?{logo:"https://images.toruswallet.io/polygon.svg",chainNamespace:t,chainId:"0x89",rpcTarget:"https://rpc.ankr.com/polygon",displayName:"Polygon Mainnet",blockExplorerUrl:"https://polygonscan.com",ticker:"POL",tickerName:"Polygon Ecosystem Token"}:80002===e?{logo:"https://images.toruswallet.io/polygon.svg",chainNamespace:t,chainId:"0x13882",rpcTarget:"https://rpc.ankr.com/polygon_amoy",displayName:"Polygon Amoy Testnet",blockExplorerUrl:"https://www.oklink.com/amoy",ticker:"POL",tickerName:"Polygon Ecosystem Token",decimals:18}:56===e?{logo:"https://images.toruswallet.io/bnb.png",chainNamespace:t,chainId:"0x38",rpcTarget:"https://rpc.ankr.com/bsc",displayName:"Binance SmartChain Mainnet",blockExplorerUrl:"https://bscscan.com",ticker:"BNB",tickerName:"Binance SmartChain",decimals:18}:97===e?{logo:"https://images.toruswallet.io/bnb.png",chainNamespace:t,chainId:"0x61",rpcTarget:"https://rpc.ankr.com/bsc_testnet_chapel",displayName:"Binance SmartChain Testnet",blockExplorerUrl:"https://testnet.bscscan.com",ticker:"BNB",tickerName:"Binance SmartChain",decimals:18}:25===e?{logo:"https://images.toruswallet.io/cro.svg",chainNamespace:t,chainId:"0x19",rpcTarget:"https://rpc.cronos.org",displayName:"Cronos Mainnet",blockExplorerUrl:"https://cronoscan.com/",ticker:"CRO",tickerName:"Cronos"}:338===e?{logo:"https://images.toruswallet.io/cro.svg",chainNamespace:t,chainId:"0x152",rpcTarget:"https://rpc-t3.cronos.org/",displayName:"Cronos Testnet",blockExplorerUrl:"https://cronoscan.com/",ticker:"CRO",tickerName:"Cronos",decimals:18}:8217===e?{logo:"https://images.toruswallet.io/klay.svg",chainNamespace:t,chainId:"0x2019",rpcTarget:"https://public-node-api.klaytnapi.com/v1/cypress",displayName:"Klaytn Mainnet",blockExplorerUrl:"https://scope.klaytn.com",ticker:"KLAY",tickerName:"Klaytn",decimals:18}:1946===e?{chainNamespace:A.EIP155,chainId:"0x79a",rpcTarget:"https://rpc.minato.soneium.org",displayName:"Soneium Minato Testnet",blockExplorerUrl:"https://explorer-testnet.soneium.org",ticker:"ETH",tickerName:"ETH",logo:"https://iili.io/2i5xce2.png"}:1868===e?{chainNamespace:A.EIP155,chainId:"0x74c",rpcTarget:"https://rpc.soneium.org",displayName:"Soneium Mainnet",blockExplorerUrl:"https://soneium.blockscout.com",ticker:"ETH",tickerName:"ETH",logo:"https://iili.io/2i5xce2.png"}:null})(r):e===A.SOLANA?(e=>{const t=A.SOLANA;return 101===e?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:t,chainId:"0x65",rpcTarget:"https://rpc.ankr.com/solana",displayName:"Solana Mainnet",blockExplorerUrl:"https://explorer.solana.com",ticker:"SOL",tickerName:"Solana",decimals:9}:102===e?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:t,chainId:"0x66",rpcTarget:"https://api.testnet.solana.com",displayName:"Solana Testnet",blockExplorerUrl:"https://explorer.solana.com?cluster=testnet",ticker:"SOL",tickerName:"Solana",decimals:9}:103===e?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:t,chainId:"0x67",rpcTarget:"https://api.devnet.solana.com",displayName:"Solana Devnet",blockExplorerUrl:"https://explorer.solana.com?cluster=devnet",ticker:"SOL",tickerName:"Solana",decimals:9}:null})(r):e===A.XRPL?(e=>{const t=A.XRPL;return 1===e?{chainNamespace:t,decimals:15,chainId:"0x1",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://ripple-node.tor.us",wsTarget:"wss://s2.ripple.com",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl mainnet",blockExplorerUrl:"https://livenet.xrpl.org"}:2===e?{chainNamespace:t,decimals:15,chainId:"0x2",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://testnet-ripple-node.tor.us",wsTarget:"wss://s.altnet.rippletest.net",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl testnet",blockExplorerUrl:"https://testnet.xrpl.org",isTestnet:!0}:3===e?{chainNamespace:t,decimals:15,chainId:"0x3",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://devnet-ripple-node.tor.us",wsTarget:"wss://s.devnet.rippletest.net/",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl devnet",blockExplorerUrl:"https://devnet.xrpl.org",isTestnet:!0}:null})(r):null},O={AUTH:"auth",WALLET_CONNECT_V2:"wallet-connect-v2",SFA:"sfa"},P=i({TORUS_SOLANA:"torus-solana"},O),T=i({TORUS_EVM:"torus-evm",COINBASE:"coinbase"},O),I=i(i({},T),P),C=(P.TORUS_SOLANA,T.TORUS_EVM,T.COINBASE,{NOT_READY:"not_ready",READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"}),x=i(i({},C),{},{ADAPTER_DATA_UPDATED:"adapter_data_updated",CACHE_CLEAR:"cache_clear"});var k=r(5880),j=r.n(k),L=j().getLogger("web3auth-logger"),M=r(2743),U=r.n(M);const D=j().getLogger("http-helpers");D.setLevel(k.levels.INFO);let B="torus-default";const F=async(e,t={},r={})=>{const n={mode:"cors",headers:{}};r.useAPIKey&&(n.headers=i(i({},n.headers),function(){const e={};return B&&(e["x-api-key"]=B),e}())),t.method="GET";const o=U()(n,t),a=await async function(e,t){let r=null;try{r=new URL(e)}catch(e){}return fetch(e,t)}(e,o);if(a.ok){const e=a.headers.get("content-type");return null!=e&&e.includes("application/json")?a.json():a.text()}throw function(e){D.info(`Response: ${e.status} ${e.statusText}`),D.info(`Url: ${e.url}`)}(a),a};function $(e){let t,r=!1,n=0;try{t=window[e],r=!0,n=t.length;const o="__storage_test__";return t.setItem(o,o),t.removeItem(o),!0}catch(e){const t=e;return!(!t||22!==t.code&&1014!==t.code&&"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||!r||0===n)}}const W=i(i({},A),{},{MULTICHAIN:"multichain"}),H={READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"},G=(i({},H),i(i({},{WALLET_SERVICES:"wallet-services",NFT_CHECKOUT:"nft-checkout"}),{SOLANA:"solana"}),()=>!0),q=["newListener","removeListener"],V=e=>!q.includes(e);function J(e,t){let r=(t||{}).eventFilter||G;if("string"==typeof r&&"skipInternal"===r&&(r=V),"function"!=typeof r)throw new Error("createEventEmitterProxy - Invalid eventFilter");let n=e,o=e=>{if(n===e)return;const t=n;n=e,t.eventNames().filter(r).forEach((r=>{(function(e,t){return void 0!==e.rawListeners?e.rawListeners(t):e.listeners(t)})(t,r).forEach((t=>{e.on(r,t)}))})),t.removeAllListeners()};return new Proxy({},{get:(e,t)=>"setTarget"===t?o:n[t],set:(e,t,r)=>"setTarget"===t?(o=r,!0):(n[t]=r,!0),has:(e,t)=>"_"!==t[0]&&t in n})}r(3625);const K=j().getLogger("auth");K.setLevel("error");var Y=r(5172),z=r.n(Y);const X=-32e3,Q=-32001,Z=-32002,ee=-32003,te=-32004,re=-32005,ne=-32700,oe=-32600,ie=-32601,ae=-32602,se=-32603,le={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},ce="Unspecified error message. This is a bug, please report it.",ue="Unspecified server error.";function fe(e){return Number.isInteger(e)}function de(e){return"string"==typeof e&&e.length>0}function he(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}function pe(e){const t=e;return!(!t||!fe(t.code)||!de(t.message)||t.stack&&!de(t.stack))}function ye(e,t=ce){if(fe(e)){const t=e.toString();if(Object.hasOwn(le,t))return le[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return ue}return t}const ge={code:se,message:ye(se)};function be(e){try{JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"===e||"constructor"===e)throw new Error("Not valid json");if("function"==typeof t||"symbol"==typeof t)throw new Error("Not valid json");return t})),((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))}catch(e){return!1}return!0}function me(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const n=e[r];return be(n)&&(t[r]=n),t}),{})}function we(e){return Array.isArray(e)?e.map((e=>be(e)?e:he(e)?me(e):null)):he(e)?me(e):be(e)?e:null}function ve(e,{fallbackError:t=ge,shouldIncludeStack:r=!0}={}){if(!pe(t))throw new Error("Must provide fallback error with integer number code and string message.");const n=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if(pe(e))return e;const r=we(e);return i(i({},t),{},{data:{cause:r}})}(e,t);return r||delete n.stack,n}function _e(e,t){if("[Circular]"!==t)return t}class Ee extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||"string"!=typeof r)throw new Error('"message" must be a non-empty string.');!function(e){return he(e)&&Object.hasOwn(e,"cause")&&he(e.cause)}(n)?(super(r),t(this,"cause",void 0),t(this,"code",void 0),t(this,"data",void 0)):(super(r,{cause:n.cause}),t(this,"cause",void 0),t(this,"code",void 0),t(this,"data",void 0),Object.hasOwn(this,"cause")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e,this.cause=null==n?void 0:n.cause}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=we(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return z()(this.serialize(),{replacer:_e,space:2})}}class Se extends Ee{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function Ae(e,t){const[r,n]=function(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[null!=t?t:void 0,r]}}return[]}(t);return new Ee(e,null!=r?r:ye(e),n)}const Re={parse:e=>Ae(ne,e),invalidRequest:e=>Ae(oe,e),invalidParams:e=>Ae(ae,e),methodNotFound:e=>Ae(ie,e),internal:e=>Ae(se,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ae(t,e)},invalidInput:e=>Ae(X,e),resourceNotFound:e=>Ae(Q,e),resourceUnavailable:e=>Ae(Z,e),transactionRejected:e=>Ae(ee,e),methodNotSupported:e=>Ae(te,e),limitExceeded:e=>Ae(re,e)};class Ne extends Error{constructor({code:e,message:r,data:n}){if(!Number.isInteger(e))throw new Error("code must be an integer");if(!r||"string"!=typeof r)throw new Error("message must be string");super(r),t(this,"code",void 0),t(this,"data",void 0),this.code=e,void 0!==n&&(this.data=n)}toString(){return z()({code:this.code,message:this.message,data:this.data,stack:this.stack})}}function Oe(e){const{message:t="",code:r=-32603,stack:n="Stack trace is not available.",data:o=""}=e,i=parseInt((null==r?void 0:r.toString())||"-32603");return{message:t||(null==e?void 0:e.toString())||ye(i),code:i,stack:n,data:o||t||(null==e?void 0:e.toString())}}class Pe extends l{constructor(){super(),t(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,r){const n=[];let o=null,i=!1;for(const a of r)if([o,i]=await Pe._runMiddleware(e,t,a,n),i)break;return[o,i,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise((o=>{const i=e=>{const r=e||t.error;r&&("object"==typeof r&&!1===Object.keys(r).includes("stack")&&(r.stack="Stack trace is not available."),K.error(r),t.error=ve(r,{shouldIncludeStack:!0,fallbackError:Oe(r)})),o([r,!0])},a=e=>{t.error?i(t.error):(e&&("function"!=typeof e&&i(new Ne({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),n.push(e)),o([null,!1]))};try{r(e,t,a,i)}catch(e){i(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new Ne({code:-32603,message:"Response has no error or result for request"});if(!r)throw new Ne({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[o,i,a]=await Pe._runAllMiddleware(e,t,this._middleware);return i?(await Pe._runReturnHandlers(a),n(o)):r((async e=>{try{await Pe._runReturnHandlers(a)}catch(t){return e(t)}return e()}))}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise(((t,r)=>{this._handle(e,((e,n)=>{e&&void 0===n?r(e):t(n)})).catch(r)}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const e=new Ne({code:-32603,message:"request must be plain object"});return t(e,{id:void 0,jsonrpc:"2.0",error:e})}if("string"!=typeof e.method){const r=new Ne({code:-32603,message:"method must be string"});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=i({},e),n={id:r.id,jsonrpc:r.jsonrpc};let o=null;try{await this._processRequest(r,n)}catch(e){o=e}return o&&(delete n.result,n.error||("object"==typeof o&&!1===Object.keys(o).includes("stack")&&(o.stack="Stack trace is not available."),K.error(o),n.error=ve(o,{shouldIncludeStack:!0,fallbackError:Oe(o)}))),t(o,n)}async _processRequest(e,t){const[r,n,o]=await Pe._runAllMiddleware(e,t,this._middleware);if(Pe._checkForCompletion(e,t,n),await Pe._runReturnHandlers(o),r)throw r}}class Te extends l{constructor({config:e={},state:r={}}){super(),t(this,"defaultConfig",{}),t(this,"defaultState",{}),t(this,"disabled",!1),t(this,"name","BaseController"),t(this,"initialConfig",void 0),t(this,"initialState",void 0),t(this,"internalConfig",this.defaultConfig),t(this,"internalState",this.defaultState),this.initialState=r,this.initialConfig=e}get config(){return this.internalConfig}get state(){return this.internalState}configure(e,t=!1,r=!0){if(r){this.internalConfig=t?e:Object.assign(this.internalConfig,e);for(const e in this.internalConfig)void 0!==this.internalConfig[e]&&(this[e]=this.internalConfig[e])}else for(const t in e)void 0!==this.internalConfig[t]&&(this.internalConfig[t]=e[t],this[t]=e[t])}update(e,t=!1){this.internalState=i(t?{}:i({},this.internalState),e),this.emit("store",this.internalState)}initialize(){return this.internalState=this.defaultState,this.internalConfig=this.defaultConfig,this.configure(this.initialConfig),this.update(this.initialState),this}}class Ie extends Te{constructor({config:e,state:r}){if(super({config:e,state:r}),t(this,"_providerEngineProxy",null),t(this,"keyExportFlagSetByCode",!1),!e.chainConfig)throw v.invalidProviderConfigError("Please provide chainConfig");if(!e.chainConfig.chainId)throw v.invalidProviderConfigError("Please provide chainId inside chainConfig");if(!e.chainConfig.rpcTarget)throw v.invalidProviderConfigError("Please provide rpcTarget inside chainConfig");"boolean"==typeof e.keyExportEnabled&&(this.keyExportFlagSetByCode=!0),this.defaultState={chainId:"loading"},this.defaultConfig={chainConfig:e.chainConfig,networks:{[e.chainConfig.chainId]:e.chainConfig},keyExportEnabled:"boolean"!=typeof e.keyExportEnabled||e.keyExportEnabled},super.initialize()}get currentChainConfig(){return this.config.chainConfig}get provider(){return this._providerEngineProxy}get chainId(){return this.state.chainId}set provider(e){throw new Error("Method not implemented.")}async request(e){var t;if(!e||"object"!=typeof e||Array.isArray(e))throw Re.invalidRequest({message:S.invalidRequestArgs().message,data:i(i({},e||{}),{},{cause:S.invalidRequestArgs().message})});const{method:r,params:n}=e;if("string"!=typeof r||0===r.length)throw Re.invalidRequest({message:S.invalidRequestMethod().message,data:i(i({},e||{}),{},{cause:S.invalidRequestMethod().message})});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw Re.invalidRequest({message:S.invalidRequestParams().message,data:i(i({},e||{}),{},{cause:S.invalidRequestParams().message})});return null===(t=this.provider)||void 0===t?void 0:t.request(e)}sendAsync(e,t){return t?this.send(e,t):this.request(e)}send(e,t){this.request(e).then((e=>t(null,{result:e}))).catch((e=>t(e,null)))}addChain(e){if(!e.chainId)throw Re.invalidParams("chainId is required");if(!e.rpcTarget)throw Re.invalidParams("chainId is required");this.configure({networks:i(i({},this.config.networks),{},{[e.chainId]:e})})}getChainConfig(e){var t;const r=null===(t=this.config.networks)||void 0===t?void 0:t[e];if(!r)throw Re.invalidRequest(`Chain ${e} is not supported, please add chainConfig for it`);return r}updateProviderEngineProxy(e){this._providerEngineProxy?this._providerEngineProxy.setTarget(e):this._providerEngineProxy=J(e)}setKeyExportFlag(e){this.keyExportFlagSetByCode||this.configure({keyExportEnabled:e})}getProviderEngineProxy(){return this._providerEngineProxy}}const Ce=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"];function xe(e){switch(e.status){case 405:throw Re.methodNotFound();case 418:throw Re.internal({message:"Request is being rate limited.",data:{cause:e}});case 503:case 504:throw Re.internal({message:"Gateway timeout. The request took too long to process.This can happen when querying over too wide a block range.",data:{cause:e}})}}function ke(e){return new Promise((t=>{setTimeout(t,e)}))}function je(e,t){if(200!==e.status)throw Re.internal({message:`Non-200 status code: '${e.status}'`,data:t});var r;if(t.error)throw Re.internal({data:t.error,message:null===(r=t.error)||void 0===r?void 0:r.message});return t.result}function Le(e){return(t,r,n,o)=>"chainId"===t.method?(r.result=e,o()):n()}function Me(e){return(t,r,n,o)=>"provider_config"===t.method?(r.result=e,o()):n()}function Ue(e){const{chainId:t,rpcTarget:r}=e,n=function({rpcTarget:e,originHttpHeaderKey:t}){return r=async(r,n,o)=>{const{fetchUrl:i,fetchParams:a}=function({req:e,rpcTarget:t,originHttpHeaderKey:r}){const n=new URL(t),o={id:e.id,jsonrpc:e.jsonrpc,method:e.method,params:e.params},i=e.origin,a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)};return r&&i&&(a.headers[r]=i),{fetchUrl:n.href,fetchParams:a}}({req:r,rpcTarget:e,originHttpHeaderKey:t});for(let e=0;e<5;e++){try{const e=await fetch(i,a);xe(e);const t=await e.json(),r=je(e,t);return void(n.result=r)}catch(e){const t=(e.message||e).toString();if(!Ce.some((e=>t.includes(e))))throw e}await ke(1e3)}},async(e,t,n,o)=>{let i;const a=new Promise((e=>{i=e}));let s=null,l=!1;try{await r(e,t),l?(await a,s(null)):o(null)}catch(e){const t=e;s?s(t):o(t)}};var r}({rpcTarget:r});return{networkMiddleware:function(e){const t=new Pe;return e.forEach((e=>{t.push(e)})),t.asMiddleware()}([Le(t),Me(e),n]),fetchMiddleware:n}}var De;class Be extends Ie{constructor({config:e,state:t}){super({config:e,state:t})}async setupProvider(){const{networkMiddleware:e}=Ue(this.config.chainConfig),t=new Pe;t.push(e);const r=function(e){const t=new l;return t.sendAsync=async t=>{const r=await e.handle(t);if(r.error){"object"==typeof r.error&&!1===Object.keys(r.error).includes("stack")&&(r.error.stack="Stack trace is not available."),K.error(r.error);const e=ve(r.error,{fallbackError:Oe(r.error),shouldIncludeStack:!0});throw Re.internal(e)}return r.result},t.send=(t,r)=>{if("function"!=typeof r)throw new Error('Must provide callback to "send" method.');e.handle(t,r)},e.on&&e.on("notification",(e=>{t.emit("data",null,e)})),t.request=async e=>{const r=i(i({},e),{},{id:Math.random().toString(36).slice(2),jsonrpc:"2.0"});return await t.sendAsync(r)},t}(t);this.updateProviderEngineProxy(r);const n=this.config.chainConfig.chainId;this.state.chainId!==n&&(this.emit("chainChanged",n),this.emit("connect",{chainId:n})),this.update({chainId:this.config.chainConfig.chainId})}async switchChain(e){if(!this._providerEngineProxy)throw(e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new Se(t,r,n)})({message:"Provider is not initialized",code:4902});const t=this.getChainConfig(e.chainId);this.update({chainId:"loading"}),this.configure({chainConfig:t}),await this.setupProvider()}updateProviderEngineProxy(e){this._providerEngineProxy?this._providerEngineProxy.setTarget(e):this._providerEngineProxy=J(e)}getProviderEngineProxy(){return this._providerEngineProxy}lookupNetwork(){throw new Error("Method not implemented.")}}De=Be,t(Be,"getProviderInstance",(async e=>{const t=new De({config:{chainConfig:e.chainConfig}});return await t.setupProvider(),t}));const Fe="Web3Auth-cachedAdapter";class $e extends l{constructor(e){var r,n,o,a;if(super(),t(this,"coreOptions",void 0),t(this,"connectedAdapterName",null),t(this,"status",C.NOT_READY),t(this,"cachedAdapter",null),t(this,"walletAdapters",{}),t(this,"commonJRPCProvider",null),t(this,"plugins",{}),t(this,"storage","localStorage"),!e.clientId)throw v.invalidParams("Please provide a valid clientId in constructor");if(e.enableLogging?L.enableAll():L.setLevel("error"),!e.privateKeyProvider&&!e.chainConfig)throw v.invalidParams("Please provide chainConfig or privateKeyProvider");if(e.chainConfig=e.chainConfig||e.privateKeyProvider.currentChainConfig,null===(r=e.chainConfig)||void 0===r||!r.chainNamespace||!Object.values(A).includes(null===(n=e.chainConfig)||void 0===n?void 0:n.chainNamespace))throw v.invalidParams("Please provide a valid chainNamespace in chainConfig");"session"===e.storageKey&&(this.storage="sessionStorage"),this.cachedAdapter=$(this.storage)?window[this.storage].getItem(Fe):null,this.coreOptions=i(i({},e),{},{chainConfig:i(i({},N(null===(o=e.chainConfig)||void 0===o?void 0:o.chainNamespace,null===(a=e.chainConfig)||void 0===a?void 0:a.chainId)||{}),e.chainConfig)}),this.subscribeToAdapterEvents=this.subscribeToAdapterEvents.bind(this)}get connected(){return Boolean(this.connectedAdapterName)}get provider(){return this.status!==C.NOT_READY&&this.commonJRPCProvider?this.commonJRPCProvider:null}set provider(e){throw new Error("Not implemented")}async init(){let e;this.commonJRPCProvider=await Be.getProviderInstance({chainConfig:this.coreOptions.chainConfig});try{var t;e=await(async(e,t,r)=>{const n=new URL(`${(e=>f[null!=e?e:h.SAPPHIRE_MAINNET])(t)}/api/configuration`);return n.searchParams.append("project_id",e),n.searchParams.append("network",t),n.searchParams.append("whitelist","true"),r&&n.searchParams.append("aa_provider",r),await F(n.href)})(this.coreOptions.clientId,this.coreOptions.web3AuthNetwork,null===(t=this.coreOptions.accountAbstractionProvider)||void 0===t?void 0:t.config.smartAccountInit.name)}catch(e){throw L.error("Failed to fetch project configurations",e),v.notReady("failed to fetch project configurations",e)}const r=Object.keys(this.walletAdapters).map((async t=>{if(this.subscribeToAdapterEvents(this.walletAdapters[t]),this.walletAdapters[t].chainConfigProxy)this.walletAdapters[t].setAdapterSettings({sessionTime:this.coreOptions.sessionTime,clientId:this.coreOptions.clientId,web3AuthNetwork:this.coreOptions.web3AuthNetwork,useCoreKitKey:this.coreOptions.useCoreKitKey});else{const e=this.coreOptions.chainConfig;if(!e.chainNamespace)throw v.invalidParams("Please provide chainNamespace in chainConfig");this.walletAdapters[t].setAdapterSettings({chainConfig:e,sessionTime:this.coreOptions.sessionTime,clientId:this.coreOptions.clientId,web3AuthNetwork:this.coreOptions.web3AuthNetwork,useCoreKitKey:this.coreOptions.useCoreKitKey})}if(t===I.AUTH){const r=this.walletAdapters[t],{whitelabel:n}=e;this.coreOptions.uiConfig=U()(function(e){try{return structuredClone(e)}catch(t){return JSON.parse(JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t)))}}(n||{}),this.coreOptions.uiConfig||{}),this.coreOptions.uiConfig.mode||(this.coreOptions.uiConfig.mode="light");const{sms_otp_enabled:o,whitelist:i,key_export_enabled:a}=e;if(void 0!==o&&r.setAdapterSettings({loginConfig:{[p]:{showOnModal:o,showOnDesktop:o,showOnMobile:o,showOnSocialBackupFactor:o}}}),i&&r.setAdapterSettings({originData:i.signed_urls}),"boolean"==typeof a&&(this.coreOptions.privateKeyProvider.setKeyExportFlag(a),this.commonJRPCProvider.setKeyExportFlag(a)),this.coreOptions.privateKeyProvider){if(r.currentChainNamespace!==this.coreOptions.privateKeyProvider.currentChainConfig.chainNamespace)throw v.incompatibleChainNameSpace("private key provider is not compatible with provided chainNamespace for auth adapter");r.setAdapterSettings({privateKeyProvider:this.coreOptions.privateKeyProvider})}if(r.setAdapterSettings({whiteLabel:this.coreOptions.uiConfig}),!r.privateKeyProvider)throw v.invalidParams("privateKeyProvider is required for auth adapter")}else if(t===I.WALLET_CONNECT_V2){const r=this.walletAdapters[t],{wallet_connect_enabled:n,wallet_connect_project_id:o}=e;if(!1===n)throw v.invalidParams("Please enable wallet connect v2 addon on dashboard");if(!o)throw v.invalidParams("Invalid wallet connect project id. Please configure it on the dashboard");r.setAdapterSettings({adapterSettings:{walletConnectInitOptions:{projectId:o}}})}return this.walletAdapters[t].init({autoConnect:this.cachedAdapter===t}).catch((e=>L.error(e,t)))}));await Promise.all(r),this.status===C.NOT_READY&&(this.status=C.READY,this.emit(x.READY))}getAdapter(e){return this.walletAdapters[e]||null}configureAdapter(e){this.checkInitRequirements();const t=this.coreOptions.chainConfig;if(!t.chainNamespace)throw v.invalidParams("Please provide chainNamespace in chainConfig");if(this.walletAdapters[e.name])throw v.duplicateAdapterError(`Wallet adapter for ${e.name} already exists`);if(e.adapterNamespace!==R&&e.adapterNamespace!==t.chainNamespace)throw v.incompatibleChainNameSpace(`This wallet adapter belongs to ${e.adapterNamespace} which is incompatible with currently used namespace: ${t.chainNamespace}`);return e.adapterNamespace===R&&e.currentChainNamespace&&t.chainNamespace!==e.currentChainNamespace&&e.setAdapterSettings({chainConfig:t}),this.walletAdapters[e.name]=e,this}clearCache(){$(this.storage)&&(window[this.storage].removeItem(Fe),this.cachedAdapter=null)}async addChain(e){if(this.status===C.CONNECTED&&this.connectedAdapterName)return this.walletAdapters[this.connectedAdapterName].addChain(e);if(this.commonJRPCProvider)return this.commonJRPCProvider.addChain(e);throw v.notReady("No wallet is ready")}async switchChain(e){if(this.status===C.CONNECTED&&this.connectedAdapterName)return this.walletAdapters[this.connectedAdapterName].switchChain(e);if(this.commonJRPCProvider)return this.commonJRPCProvider.switchChain(e);throw v.notReady("No wallet is ready")}async connectTo(e,t){if(!this.walletAdapters[e]||!this.commonJRPCProvider)throw v.notFound(`Please add wallet adapter for ${e} wallet, before connecting`);return new Promise(((r,n)=>{this.once(x.CONNECTED,(e=>{r(this.provider)})),this.once(x.ERRORED,(e=>{n(e)})),this.walletAdapters[e].connect(t)}))}async logout(e={cleanup:!1}){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");await this.walletAdapters[this.connectedAdapterName].disconnect(e)}async getUserInfo(){if(L.debug("Getting user info",this.status,this.connectedAdapterName),this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");return this.walletAdapters[this.connectedAdapterName].getUserInfo()}async enableMFA(e){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");if(this.connectedAdapterName!==I.AUTH)throw _.unsupportedOperation("EnableMFA is not supported for this adapter.");return this.walletAdapters[this.connectedAdapterName].enableMFA(e)}async manageMFA(e){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");if(this.connectedAdapterName!==I.AUTH)throw _.unsupportedOperation("ManageMFA is not supported for this adapter.");return this.walletAdapters[this.connectedAdapterName].manageMFA(e)}async authenticateUser(){if(this.status!==C.CONNECTED||!this.connectedAdapterName)throw _.notConnectedError("No wallet is connected");return this.walletAdapters[this.connectedAdapterName].authenticateUser()}addPlugin(e){if(this.plugins[e.name])throw v.duplicateAdapterError(`Plugin ${e.name} already exist`);if(e.pluginNamespace!==W.MULTICHAIN&&e.pluginNamespace!==this.coreOptions.chainConfig.chainNamespace)throw v.incompatibleChainNameSpace(`This plugin belongs to ${e.pluginNamespace} namespace which is incompatible with currently used namespace: ${this.coreOptions.chainConfig.chainNamespace}`);return this.plugins[e.name]=e,this.status===C.CONNECTED&&this.connectedAdapterName&&this.connectToPlugins({adapter:this.connectedAdapterName}),this}getPlugin(e){return this.plugins[e]||null}subscribeToAdapterEvents(e){e.on(x.CONNECTED,(async e=>{if(!this.commonJRPCProvider)throw v.notFound("CommonJrpcProvider not found");const{provider:t}=e;let r=t.provider||t;this.coreOptions.accountAbstractionProvider&&(e.adapter===I.AUTH||e.adapter!==I.AUTH&&this.coreOptions.useAAWithExternalWallet)&&(await this.coreOptions.accountAbstractionProvider.setupProvider(t),r=this.coreOptions.accountAbstractionProvider),this.commonJRPCProvider.updateProviderEngineProxy(r),this.connectedAdapterName=e.adapter,this.status=C.CONNECTED,this.cacheWallet(e.adapter),L.debug("connected",this.status,this.connectedAdapterName),this.connectToPlugins(e),this.emit(x.CONNECTED,i({},e))})),e.on(x.DISCONNECTED,(async()=>{if(this.status=C.READY,$(this.storage)){const e=window[this.storage].getItem(Fe);this.connectedAdapterName===e&&this.clearCache()}L.debug("disconnected",this.status,this.connectedAdapterName),await Promise.all(Object.values(this.plugins).map((e=>e.disconnect().catch((e=>{5211!==e.code&&L.error(e)}))))),this.connectedAdapterName=null,this.emit(x.DISCONNECTED)})),e.on(x.CONNECTING,(e=>{this.status=C.CONNECTING,this.emit(x.CONNECTING,e),L.debug("connecting",this.status,this.connectedAdapterName)})),e.on(x.ERRORED,(e=>{this.status=C.ERRORED,this.clearCache(),this.emit(x.ERRORED,e),L.debug("errored",this.status,this.connectedAdapterName)})),e.on(x.ADAPTER_DATA_UPDATED,(e=>{L.debug("adapter data updated",e),this.emit(x.ADAPTER_DATA_UPDATED,e)})),e.on(x.CACHE_CLEAR,(e=>{L.debug("adapter cache clear",e),$(this.storage)&&this.clearCache()}))}checkInitRequirements(){if(this.status===C.CONNECTING)throw v.notReady("Already pending connection");if(this.status===C.CONNECTED)throw v.notReady("Already connected");if(this.status===C.READY)throw v.notReady("Adapter is already initialized")}cacheWallet(e){$(this.storage)&&(window[this.storage].setItem(Fe,e),this.cachedAdapter=e)}connectToPlugins(e){Object.values(this.plugins).map((async t=>{try{if(!t.SUPPORTED_ADAPTERS.includes("all")&&!t.SUPPORTED_ADAPTERS.includes(e.adapter))return;if(t.status===H.CONNECTED)return;const{authInstance:r}=this.walletAdapters[this.connectedAdapterName],{options:n,sessionId:o,sessionNamespace:i}=r||{};await t.initWithWeb3Auth(this,null==n?void 0:n.whiteLabel),await t.connect({sessionId:o,sessionNamespace:i})}catch(e){if(5211===e.code)return;L.error(e)}}))}}})(),n})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web3auth/no-modal",
3
- "version": "9.5.3",
3
+ "version": "9.6.0",
4
4
  "description": "Multi chain wallet aggregator for web3Auth",
5
5
  "keywords": [
6
6
  "web3Auth/no-modal",
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@web3auth/auth": "^9.6.4",
41
- "@web3auth/base": "^9.5.3",
42
- "@web3auth/base-provider": "^9.5.3",
41
+ "@web3auth/base": "^9.6.0",
42
+ "@web3auth/base-provider": "^9.6.0",
43
43
  "deepmerge": "^4.3.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@web3auth/account-abstraction-provider": "^9.5.3",
47
- "@web3auth/auth-adapter": "^9.5.3",
48
- "@web3auth/wallet-connect-v2-adapter": "^9.5.3"
46
+ "@web3auth/account-abstraction-provider": "^9.6.0",
47
+ "@web3auth/auth-adapter": "^9.6.0",
48
+ "@web3auth/wallet-connect-v2-adapter": "^9.6.0"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "@web3auth/auth-adapter": {
@@ -75,5 +75,5 @@
75
75
  "node": ">=18.x",
76
76
  "npm": ">=9.x"
77
77
  },
78
- "gitHead": "c20737e769c5de072a87993a872eb511065b2c5f"
78
+ "gitHead": "0595f01b81de11cca2123656d981f0316de53027"
79
79
  }