@blob-solutions/vcr-am-sdk 0.5.0 → 0.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.
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +5 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.global.js +5 -5
- package/lib/index.global.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
package/lib/index.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var vcrsdk=(()=>{var xl=Object.create;var yn=Object.defineProperty;var Al=Object.getOwnPropertyDescriptor;var Ol=Object.getOwnPropertyNames;var Bl=Object.getPrototypeOf,Il=Object.prototype.hasOwnProperty;var di=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Z=(n,e)=>()=>(n&&(e=n(n=0)),e);var ze=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),bn=(n,e)=>{for(var r in e)yn(n,r,{get:e[r],enumerable:!0})},fi=(n,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ol(e))!Il.call(n,i)&&i!==r&&yn(n,i,{get:()=>e[i],enumerable:!(s=Al(e,i))||s.enumerable});return n};var ot=(n,e,r)=>(r=n!=null?xl(Bl(n)):{},fi(e||!n||!n.__esModule?yn(r,"default",{value:n,enumerable:!0}):r,n)),Dl=n=>fi(yn({},"__esModule",{value:!0}),n);var hi={};bn(hi,{default:()=>Wl});function Wl(n,e){return e=e||{},new Promise(function(r,s){var i=new XMLHttpRequest,u=[],c={},d=function h(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:h,headers:{keys:function(){return u},entries:function(){return u.map(function(p){return[p,i.getResponseHeader(p)]})},get:function(p){return i.getResponseHeader(p)},has:function(p){return i.getResponseHeader(p)!=null}}}};for(var m in i.open(e.method||"get",n,!0),i.onload=function(){i.getAllResponseHeaders().toLowerCase().replace(/^(.+?):/gm,function(h,p){c[p]||u.push(c[p]=p)}),r(d())},i.onerror=s,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(m,e.headers[m]);i.send(e.body||null)})}var mi=Z(()=>{"use strict"});var Ta=ze(()=>{"use strict"});var pi=ze(()=>{"use strict"});var yi=ze(()=>{"use strict"});var Ea=ze(()=>{"use strict"});var Ca=Z(()=>{"use strict"});function jl(n){if(!/^data:/i.test(n))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');n=n.replace(/\r?\n/g,"");let e=n.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=n.substring(5,e).split(";"),s="",i=!1,u=r[0]||"text/plain",c=u;for(let p=1;p<r.length;p++)r[p]==="base64"?i=!0:r[p]&&(c+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(s=r[p].substring(8)));!r[0]&&!s.length&&(c+=";charset=US-ASCII",s="US-ASCII");let d=i?"base64":"ascii",m=unescape(n.substring(e+1)),h=Buffer.from(m,d);return h.type=u,h.typeFull=c,h.charset=s,h}var bi,_i=Z(()=>{"use strict";bi=jl});var _n=Z(()=>{"use strict"});var gi=ze(()=>{"use strict"});var wi=ze(()=>{"use strict"});var vi=ze((gn,Si)=>{"use strict";(function(n,e){typeof gn=="object"&&typeof Si<"u"?e(gn):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.WebStreamsPolyfill={}))})(gn,function(n){"use strict";function e(){}function r(t){return typeof t=="object"&&t!==null||typeof t=="function"}let s=e;function i(t,a){try{Object.defineProperty(t,"name",{value:a,configurable:!0})}catch{}}let u=Promise,c=Promise.prototype.then,d=Promise.reject.bind(u);function m(t){return new u(t)}function h(t){return m(a=>a(t))}function p(t){return d(t)}function k(t,a,o){return c.call(t,a,o)}function R(t,a,o){k(k(t,a,o),void 0,s)}function q(t,a){R(t,a)}function g(t,a){R(t,void 0,a)}function z(t,a,o){return k(t,a,o)}function T(t){k(t,void 0,s)}let j=t=>{if(typeof queueMicrotask=="function")j=queueMicrotask;else{let a=h(void 0);j=o=>k(a,o)}return j(t)};function H(t,a,o){if(typeof t!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,a,o)}function J(t,a,o){try{return h(H(t,a,o))}catch(l){return p(l)}}let $=16384;class M{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(a){let o=this._back,l=o;o._elements.length===$-1&&(l={_elements:[],_next:void 0}),o._elements.push(a),l!==o&&(this._back=l,o._next=l),++this._size}shift(){let a=this._front,o=a,l=this._cursor,f=l+1,y=a._elements,b=y[l];return f===$&&(o=a._next,f=0),--this._size,this._cursor=f,a!==o&&(this._front=o),y[l]=void 0,b}forEach(a){let o=this._cursor,l=this._front,f=l._elements;for(;(o!==f.length||l._next!==void 0)&&!(o===f.length&&(l=l._next,f=l._elements,o=0,f.length===0));)a(f[o]),++o}peek(){let a=this._front,o=this._cursor;return a._elements[o]}}let Y=Symbol("[[AbortSteps]]"),Ge=Symbol("[[ErrorSteps]]"),fr=Symbol("[[CancelSteps]]"),Ln=Symbol("[[PullSteps]]"),Nn=Symbol("[[ReleaseSteps]]");function Qa(t,a){t._ownerReadableStream=a,a._reader=t,a._state==="readable"?$n(t):a._state==="closed"?No(t):Ga(t,a._storedError)}function zn(t,a){let o=t._ownerReadableStream;return we(o,a)}function Be(t){let a=t._ownerReadableStream;a._state==="readable"?Mn(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):zo(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),a._readableStreamController[Nn](),a._reader=void 0,t._ownerReadableStream=void 0}function Nr(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function $n(t){t._closedPromise=m((a,o)=>{t._closedPromise_resolve=a,t._closedPromise_reject=o})}function Ga(t,a){$n(t),Mn(t,a)}function No(t){$n(t),Ja(t)}function Mn(t,a){t._closedPromise_reject!==void 0&&(T(t._closedPromise),t._closedPromise_reject(a),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}function zo(t,a){Ga(t,a)}function Ja(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}let Ka=Number.isFinite||function(t){return typeof t=="number"&&isFinite(t)},$o=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function Mo(t){return typeof t=="object"||typeof t=="function"}function Ee(t,a){if(t!==void 0&&!Mo(t))throw new TypeError(`${a} is not an object.`)}function he(t,a){if(typeof t!="function")throw new TypeError(`${a} is not a function.`)}function Fo(t){return typeof t=="object"&&t!==null||typeof t=="function"}function Xa(t,a){if(!Fo(t))throw new TypeError(`${a} is not an object.`)}function Ie(t,a,o){if(t===void 0)throw new TypeError(`Parameter ${a} is required in '${o}'.`)}function Fn(t,a,o){if(t===void 0)throw new TypeError(`${a} is required in '${o}'.`)}function Un(t){return Number(t)}function es(t){return t===0?0:t}function Uo(t){return es($o(t))}function Vn(t,a){let l=Number.MAX_SAFE_INTEGER,f=Number(t);if(f=es(f),!Ka(f))throw new TypeError(`${a} is not a finite number`);if(f=Uo(f),f<0||f>l)throw new TypeError(`${a} is outside the accepted range of 0 to ${l}, inclusive`);return!Ka(f)||f===0?0:f}function Zn(t,a){if(!nt(t))throw new TypeError(`${a} is not a ReadableStream.`)}function Ut(t){return new Je(t)}function ts(t,a){t._reader._readRequests.push(a)}function Hn(t,a,o){let f=t._reader._readRequests.shift();o?f._closeSteps():f._chunkSteps(a)}function zr(t){return t._reader._readRequests.length}function rs(t){let a=t._reader;return!(a===void 0||!Ke(a))}class Je{constructor(a){if(Ie(a,1,"ReadableStreamDefaultReader"),Zn(a,"First parameter"),at(a))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Qa(this,a),this._readRequests=new M}get closed(){return Ke(this)?this._closedPromise:p($r("closed"))}cancel(a=void 0){return Ke(this)?this._ownerReadableStream===void 0?p(Nr("cancel")):zn(this,a):p($r("cancel"))}read(){if(!Ke(this))return p($r("read"));if(this._ownerReadableStream===void 0)return p(Nr("read from"));let a,o,l=m((y,b)=>{a=y,o=b});return hr(this,{_chunkSteps:y=>a({value:y,done:!1}),_closeSteps:()=>a({value:void 0,done:!0}),_errorSteps:y=>o(y)}),l}releaseLock(){if(!Ke(this))throw $r("releaseLock");this._ownerReadableStream!==void 0&&Vo(this)}}Object.defineProperties(Je.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Je.prototype.cancel,"cancel"),i(Je.prototype.read,"read"),i(Je.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Je.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Ke(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_readRequests")?!1:t instanceof Je}function hr(t,a){let o=t._ownerReadableStream;o._disturbed=!0,o._state==="closed"?a._closeSteps():o._state==="errored"?a._errorSteps(o._storedError):o._readableStreamController[Ln](a)}function Vo(t){Be(t);let a=new TypeError("Reader was released");ns(t,a)}function ns(t,a){let o=t._readRequests;t._readRequests=new M,o.forEach(l=>{l._errorSteps(a)})}function $r(t){return new TypeError(`ReadableStreamDefaultReader.prototype.${t} can only be used on a ReadableStreamDefaultReader`)}let Zo=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class as{constructor(a,o){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=a,this._preventCancel=o}next(){let a=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?z(this._ongoingPromise,a,a):a(),this._ongoingPromise}return(a){let o=()=>this._returnSteps(a);return this._ongoingPromise?z(this._ongoingPromise,o,o):o()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let a=this._reader,o,l,f=m((b,S)=>{o=b,l=S});return hr(a,{_chunkSteps:b=>{this._ongoingPromise=void 0,j(()=>o({value:b,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Be(a),o({value:void 0,done:!0})},_errorSteps:b=>{this._ongoingPromise=void 0,this._isFinished=!0,Be(a),l(b)}}),f}_returnSteps(a){if(this._isFinished)return Promise.resolve({value:a,done:!0});this._isFinished=!0;let o=this._reader;if(!this._preventCancel){let l=zn(o,a);return Be(o),z(l,()=>({value:a,done:!0}))}return Be(o),h({value:a,done:!0})}}let ss={next(){return is(this)?this._asyncIteratorImpl.next():p(os("next"))},return(t){return is(this)?this._asyncIteratorImpl.return(t):p(os("return"))}};Object.setPrototypeOf(ss,Zo);function Ho(t,a){let o=Ut(t),l=new as(o,a),f=Object.create(ss);return f._asyncIteratorImpl=l,f}function is(t){if(!r(t)||!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl"))return!1;try{return t._asyncIteratorImpl instanceof as}catch{return!1}}function os(t){return new TypeError(`ReadableStreamAsyncIterator.${t} can only be used on a ReadableSteamAsyncIterator`)}let us=Number.isNaN||function(t){return t!==t};var Yn,Qn,Gn;function mr(t){return t.slice()}function ls(t,a,o,l,f){new Uint8Array(t).set(new Uint8Array(o,l,f),a)}let De=t=>(typeof t.transfer=="function"?De=a=>a.transfer():typeof structuredClone=="function"?De=a=>structuredClone(a,{transfer:[a]}):De=a=>a,De(t)),Xe=t=>(typeof t.detached=="boolean"?Xe=a=>a.detached:Xe=a=>a.byteLength===0,Xe(t));function cs(t,a,o){if(t.slice)return t.slice(a,o);let l=o-a,f=new ArrayBuffer(l);return ls(f,0,t,a,l),f}function Mr(t,a){let o=t[a];if(o!=null){if(typeof o!="function")throw new TypeError(`${String(a)} is not a function`);return o}}function Yo(t){let a={[Symbol.iterator]:()=>t.iterator},o=async function*(){return yield*a}(),l=o.next;return{iterator:o,nextMethod:l,done:!1}}let Jn=(Gn=(Yn=Symbol.asyncIterator)!==null&&Yn!==void 0?Yn:(Qn=Symbol.for)===null||Qn===void 0?void 0:Qn.call(Symbol,"Symbol.asyncIterator"))!==null&&Gn!==void 0?Gn:"@@asyncIterator";function ds(t,a="sync",o){if(o===void 0)if(a==="async"){if(o=Mr(t,Jn),o===void 0){let y=Mr(t,Symbol.iterator),b=ds(t,"sync",y);return Yo(b)}}else o=Mr(t,Symbol.iterator);if(o===void 0)throw new TypeError("The object is not iterable");let l=H(o,t,[]);if(!r(l))throw new TypeError("The iterator method must return an object");let f=l.next;return{iterator:l,nextMethod:f,done:!1}}function Qo(t){let a=H(t.nextMethod,t.iterator,[]);if(!r(a))throw new TypeError("The iterator.next() method must return an object");return a}function Go(t){return!!t.done}function Jo(t){return t.value}function Ko(t){return!(typeof t!="number"||us(t)||t<0)}function fs(t){let a=cs(t.buffer,t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(a)}function Kn(t){let a=t._queue.shift();return t._queueTotalSize-=a.size,t._queueTotalSize<0&&(t._queueTotalSize=0),a.value}function Xn(t,a,o){if(!Ko(o)||o===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t._queue.push({value:a,size:o}),t._queueTotalSize+=o}function Xo(t){return t._queue.peek().value}function et(t){t._queue=new M,t._queueTotalSize=0}function hs(t){return t===DataView}function eu(t){return hs(t.constructor)}function tu(t){return hs(t)?1:t.BYTES_PER_ELEMENT}class yt{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!ea(this))throw sa("view");return this._view}respond(a){if(!ea(this))throw sa("respond");if(Ie(a,1,"respond"),a=Vn(a,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Xe(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Zr(this._associatedReadableByteStreamController,a)}respondWithNewView(a){if(!ea(this))throw sa("respondWithNewView");if(Ie(a,1,"respondWithNewView"),!ArrayBuffer.isView(a))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Xe(a.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Hr(this._associatedReadableByteStreamController,a)}}Object.defineProperties(yt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(yt.prototype.respond,"respond"),i(yt.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class We{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!bt(this))throw yr("byobRequest");return aa(this)}get desiredSize(){if(!bt(this))throw yr("desiredSize");return Rs(this)}close(){if(!bt(this))throw yr("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let a=this._controlledReadableByteStream._state;if(a!=="readable")throw new TypeError(`The stream (in ${a} state) is not in the readable state and cannot be closed`);pr(this)}enqueue(a){if(!bt(this))throw yr("enqueue");if(Ie(a,1,"enqueue"),!ArrayBuffer.isView(a))throw new TypeError("chunk must be an array buffer view");if(a.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(a.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let o=this._controlledReadableByteStream._state;if(o!=="readable")throw new TypeError(`The stream (in ${o} state) is not in the readable state and cannot be enqueued to`);Vr(this,a)}error(a=void 0){if(!bt(this))throw yr("error");me(this,a)}[fr](a){ms(this),et(this);let o=this._cancelAlgorithm(a);return Ur(this),o}[Ln](a){let o=this._controlledReadableByteStream;if(this._queueTotalSize>0){vs(this,a);return}let l=this._autoAllocateChunkSize;if(l!==void 0){let f;try{f=new ArrayBuffer(l)}catch(b){a._errorSteps(b);return}let y={buffer:f,bufferByteLength:l,byteOffset:0,byteLength:l,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(y)}ts(o,a),_t(this)}[Nn](){if(this._pendingPullIntos.length>0){let a=this._pendingPullIntos.peek();a.readerType="none",this._pendingPullIntos=new M,this._pendingPullIntos.push(a)}}}Object.defineProperties(We.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(We.prototype.close,"close"),i(We.prototype.enqueue,"enqueue"),i(We.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(We.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function bt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")?!1:t instanceof We}function ea(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")?!1:t instanceof yt}function _t(t){if(!iu(t))return;if(t._pulling){t._pullAgain=!0;return}t._pulling=!0;let o=t._pullAlgorithm();R(o,()=>(t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,_t(t)),null),l=>(me(t,l),null))}function ms(t){ra(t),t._pendingPullIntos=new M}function ta(t,a){let o=!1;t._state==="closed"&&(o=!0);let l=ps(a);a.readerType==="default"?Hn(t,l,o):fu(t,l,o)}function ps(t){let a=t.bytesFilled,o=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,a/o)}function Fr(t,a,o,l){t._queue.push({buffer:a,byteOffset:o,byteLength:l}),t._queueTotalSize+=l}function ys(t,a,o,l){let f;try{f=cs(a,o,o+l)}catch(y){throw me(t,y),y}Fr(t,f,0,l)}function bs(t,a){a.bytesFilled>0&&ys(t,a.buffer,a.byteOffset,a.bytesFilled),Vt(t)}function _s(t,a){let o=Math.min(t._queueTotalSize,a.byteLength-a.bytesFilled),l=a.bytesFilled+o,f=o,y=!1,b=l%a.elementSize,S=l-b;S>=a.minimumFill&&(f=S-a.bytesFilled,y=!0);let O=t._queue;for(;f>0;){let C=O.peek(),B=Math.min(f,C.byteLength),W=a.byteOffset+a.bytesFilled;ls(a.buffer,W,C.buffer,C.byteOffset,B),C.byteLength===B?O.shift():(C.byteOffset+=B,C.byteLength-=B),t._queueTotalSize-=B,gs(t,B,a),f-=B}return y}function gs(t,a,o){o.bytesFilled+=a}function ws(t){t._queueTotalSize===0&&t._closeRequested?(Ur(t),vr(t._controlledReadableByteStream)):_t(t)}function ra(t){t._byobRequest!==null&&(t._byobRequest._associatedReadableByteStreamController=void 0,t._byobRequest._view=null,t._byobRequest=null)}function na(t){for(;t._pendingPullIntos.length>0;){if(t._queueTotalSize===0)return;let a=t._pendingPullIntos.peek();_s(t,a)&&(Vt(t),ta(t._controlledReadableByteStream,a))}}function ru(t){let a=t._controlledReadableByteStream._reader;for(;a._readRequests.length>0;){if(t._queueTotalSize===0)return;let o=a._readRequests.shift();vs(t,o)}}function nu(t,a,o,l){let f=t._controlledReadableByteStream,y=a.constructor,b=tu(y),{byteOffset:S,byteLength:O}=a,C=o*b,B;try{B=De(a.buffer)}catch(F){l._errorSteps(F);return}let W={buffer:B,bufferByteLength:B.byteLength,byteOffset:S,byteLength:O,bytesFilled:0,minimumFill:C,elementSize:b,viewConstructor:y,readerType:"byob"};if(t._pendingPullIntos.length>0){t._pendingPullIntos.push(W),Cs(f,l);return}if(f._state==="closed"){let F=new y(W.buffer,W.byteOffset,0);l._closeSteps(F);return}if(t._queueTotalSize>0){if(_s(t,W)){let F=ps(W);ws(t),l._chunkSteps(F);return}if(t._closeRequested){let F=new TypeError("Insufficient bytes to fill elements in the given buffer");me(t,F),l._errorSteps(F);return}}t._pendingPullIntos.push(W),Cs(f,l),_t(t)}function au(t,a){a.readerType==="none"&&Vt(t);let o=t._controlledReadableByteStream;if(ia(o))for(;ks(o)>0;){let l=Vt(t);ta(o,l)}}function su(t,a,o){if(gs(t,a,o),o.readerType==="none"){bs(t,o),na(t);return}if(o.bytesFilled<o.minimumFill)return;Vt(t);let l=o.bytesFilled%o.elementSize;if(l>0){let f=o.byteOffset+o.bytesFilled;ys(t,o.buffer,f-l,l)}o.bytesFilled-=l,ta(t._controlledReadableByteStream,o),na(t)}function Ss(t,a){let o=t._pendingPullIntos.peek();ra(t),t._controlledReadableByteStream._state==="closed"?au(t,o):su(t,a,o),_t(t)}function Vt(t){return t._pendingPullIntos.shift()}function iu(t){let a=t._controlledReadableByteStream;return a._state!=="readable"||t._closeRequested||!t._started?!1:!!(rs(a)&&zr(a)>0||ia(a)&&ks(a)>0||Rs(t)>0)}function Ur(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function pr(t){let a=t._controlledReadableByteStream;if(!(t._closeRequested||a._state!=="readable")){if(t._queueTotalSize>0){t._closeRequested=!0;return}if(t._pendingPullIntos.length>0){let o=t._pendingPullIntos.peek();if(o.bytesFilled%o.elementSize!==0){let l=new TypeError("Insufficient bytes to fill elements in the given buffer");throw me(t,l),l}}Ur(t),vr(a)}}function Vr(t,a){let o=t._controlledReadableByteStream;if(t._closeRequested||o._state!=="readable")return;let{buffer:l,byteOffset:f,byteLength:y}=a;if(Xe(l))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let b=De(l);if(t._pendingPullIntos.length>0){let S=t._pendingPullIntos.peek();if(Xe(S.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");ra(t),S.buffer=De(S.buffer),S.readerType==="none"&&bs(t,S)}if(rs(o))if(ru(t),zr(o)===0)Fr(t,b,f,y);else{t._pendingPullIntos.length>0&&Vt(t);let S=new Uint8Array(b,f,y);Hn(o,S,!1)}else ia(o)?(Fr(t,b,f,y),na(t)):Fr(t,b,f,y);_t(t)}function me(t,a){let o=t._controlledReadableByteStream;o._state==="readable"&&(ms(t),et(t),Ur(t),Js(o,a))}function vs(t,a){let o=t._queue.shift();t._queueTotalSize-=o.byteLength,ws(t);let l=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);a._chunkSteps(l)}function aa(t){if(t._byobRequest===null&&t._pendingPullIntos.length>0){let a=t._pendingPullIntos.peek(),o=new Uint8Array(a.buffer,a.byteOffset+a.bytesFilled,a.byteLength-a.bytesFilled),l=Object.create(yt.prototype);uu(l,t,o),t._byobRequest=l}return t._byobRequest}function Rs(t){let a=t._controlledReadableByteStream._state;return a==="errored"?null:a==="closed"?0:t._strategyHWM-t._queueTotalSize}function Zr(t,a){let o=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(a!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(a===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(o.bytesFilled+a>o.byteLength)throw new RangeError("bytesWritten out of range")}o.buffer=De(o.buffer),Ss(t,a)}function Hr(t,a){let o=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(a.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(a.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(o.byteOffset+o.bytesFilled!==a.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(o.bufferByteLength!==a.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(o.bytesFilled+a.byteLength>o.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let f=a.byteLength;o.buffer=De(a.buffer),Ss(t,f)}function Ts(t,a,o,l,f,y,b){a._controlledReadableByteStream=t,a._pullAgain=!1,a._pulling=!1,a._byobRequest=null,a._queue=a._queueTotalSize=void 0,et(a),a._closeRequested=!1,a._started=!1,a._strategyHWM=y,a._pullAlgorithm=l,a._cancelAlgorithm=f,a._autoAllocateChunkSize=b,a._pendingPullIntos=new M,t._readableStreamController=a;let S=o();R(h(S),()=>(a._started=!0,_t(a),null),O=>(me(a,O),null))}function ou(t,a,o){let l=Object.create(We.prototype),f,y,b;a.start!==void 0?f=()=>a.start(l):f=()=>{},a.pull!==void 0?y=()=>a.pull(l):y=()=>h(void 0),a.cancel!==void 0?b=O=>a.cancel(O):b=()=>h(void 0);let S=a.autoAllocateChunkSize;if(S===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Ts(t,l,f,y,b,o,S)}function uu(t,a,o){t._associatedReadableByteStreamController=a,t._view=o}function sa(t){return new TypeError(`ReadableStreamBYOBRequest.prototype.${t} can only be used on a ReadableStreamBYOBRequest`)}function yr(t){return new TypeError(`ReadableByteStreamController.prototype.${t} can only be used on a ReadableByteStreamController`)}function lu(t,a){Ee(t,a);let o=t?.mode;return{mode:o===void 0?void 0:cu(o,`${a} has member 'mode' that`)}}function cu(t,a){if(t=`${t}`,t!=="byob")throw new TypeError(`${a} '${t}' is not a valid enumeration value for ReadableStreamReaderMode`);return t}function du(t,a){var o;Ee(t,a);let l=(o=t?.min)!==null&&o!==void 0?o:1;return{min:Vn(l,`${a} has member 'min' that`)}}function Es(t){return new tt(t)}function Cs(t,a){t._reader._readIntoRequests.push(a)}function fu(t,a,o){let f=t._reader._readIntoRequests.shift();o?f._closeSteps(a):f._chunkSteps(a)}function ks(t){return t._reader._readIntoRequests.length}function ia(t){let a=t._reader;return!(a===void 0||!gt(a))}class tt{constructor(a){if(Ie(a,1,"ReadableStreamBYOBReader"),Zn(a,"First parameter"),at(a))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!bt(a._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Qa(this,a),this._readIntoRequests=new M}get closed(){return gt(this)?this._closedPromise:p(Yr("closed"))}cancel(a=void 0){return gt(this)?this._ownerReadableStream===void 0?p(Nr("cancel")):zn(this,a):p(Yr("cancel"))}read(a,o={}){if(!gt(this))return p(Yr("read"));if(!ArrayBuffer.isView(a))return p(new TypeError("view must be an array buffer view"));if(a.byteLength===0)return p(new TypeError("view must have non-zero byteLength"));if(a.buffer.byteLength===0)return p(new TypeError("view's buffer must have non-zero byteLength"));if(Xe(a.buffer))return p(new TypeError("view's buffer has been detached"));let l;try{l=du(o,"options")}catch(C){return p(C)}let f=l.min;if(f===0)return p(new TypeError("options.min must be greater than 0"));if(eu(a)){if(f>a.byteLength)return p(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(f>a.length)return p(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return p(Nr("read from"));let y,b,S=m((C,B)=>{y=C,b=B});return Ps(this,a,f,{_chunkSteps:C=>y({value:C,done:!1}),_closeSteps:C=>y({value:C,done:!0}),_errorSteps:C=>b(C)}),S}releaseLock(){if(!gt(this))throw Yr("releaseLock");this._ownerReadableStream!==void 0&&hu(this)}}Object.defineProperties(tt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(tt.prototype.cancel,"cancel"),i(tt.prototype.read,"read"),i(tt.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function gt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")?!1:t instanceof tt}function Ps(t,a,o,l){let f=t._ownerReadableStream;f._disturbed=!0,f._state==="errored"?l._errorSteps(f._storedError):nu(f._readableStreamController,a,o,l)}function hu(t){Be(t);let a=new TypeError("Reader was released");xs(t,a)}function xs(t,a){let o=t._readIntoRequests;t._readIntoRequests=new M,o.forEach(l=>{l._errorSteps(a)})}function Yr(t){return new TypeError(`ReadableStreamBYOBReader.prototype.${t} can only be used on a ReadableStreamBYOBReader`)}function br(t,a){let{highWaterMark:o}=t;if(o===void 0)return a;if(us(o)||o<0)throw new RangeError("Invalid highWaterMark");return o}function Qr(t){let{size:a}=t;return a||(()=>1)}function Gr(t,a){Ee(t,a);let o=t?.highWaterMark,l=t?.size;return{highWaterMark:o===void 0?void 0:Un(o),size:l===void 0?void 0:mu(l,`${a} has member 'size' that`)}}function mu(t,a){return he(t,a),o=>Un(t(o))}function pu(t,a){Ee(t,a);let o=t?.abort,l=t?.close,f=t?.start,y=t?.type,b=t?.write;return{abort:o===void 0?void 0:yu(o,t,`${a} has member 'abort' that`),close:l===void 0?void 0:bu(l,t,`${a} has member 'close' that`),start:f===void 0?void 0:_u(f,t,`${a} has member 'start' that`),write:b===void 0?void 0:gu(b,t,`${a} has member 'write' that`),type:y}}function yu(t,a,o){return he(t,o),l=>J(t,a,[l])}function bu(t,a,o){return he(t,o),()=>J(t,a,[])}function _u(t,a,o){return he(t,o),l=>H(t,a,[l])}function gu(t,a,o){return he(t,o),(l,f)=>J(t,a,[l,f])}function As(t,a){if(!Zt(t))throw new TypeError(`${a} is not a WritableStream.`)}function wu(t){if(typeof t!="object"||t===null)return!1;try{return typeof t.aborted=="boolean"}catch{return!1}}let Su=typeof AbortController=="function";function vu(){if(Su)return new AbortController}class rt{constructor(a={},o={}){a===void 0?a=null:Xa(a,"First parameter");let l=Gr(o,"Second parameter"),f=pu(a,"First parameter");if(Bs(this),f.type!==void 0)throw new RangeError("Invalid type is specified");let b=Qr(l),S=br(l,1);ju(this,f,S,b)}get locked(){if(!Zt(this))throw tn("locked");return Ht(this)}abort(a=void 0){return Zt(this)?Ht(this)?p(new TypeError("Cannot abort a stream that already has a writer")):Jr(this,a):p(tn("abort"))}close(){return Zt(this)?Ht(this)?p(new TypeError("Cannot close a stream that already has a writer")):Ce(this)?p(new TypeError("Cannot close an already-closing stream")):Is(this):p(tn("close"))}getWriter(){if(!Zt(this))throw tn("getWriter");return Os(this)}}Object.defineProperties(rt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(rt.prototype.abort,"abort"),i(rt.prototype.close,"close"),i(rt.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rt.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Os(t){return new je(t)}function Ru(t,a,o,l,f=1,y=()=>1){let b=Object.create(rt.prototype);Bs(b);let S=Object.create(Yt.prototype);return Ns(b,S,t,a,o,l,f,y),b}function Bs(t){t._state="writable",t._storedError=void 0,t._writer=void 0,t._writableStreamController=void 0,t._writeRequests=new M,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function Zt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")?!1:t instanceof rt}function Ht(t){return t._writer!==void 0}function Jr(t,a){var o;if(t._state==="closed"||t._state==="errored")return h(void 0);t._writableStreamController._abortReason=a,(o=t._writableStreamController._abortController)===null||o===void 0||o.abort(a);let l=t._state;if(l==="closed"||l==="errored")return h(void 0);if(t._pendingAbortRequest!==void 0)return t._pendingAbortRequest._promise;let f=!1;l==="erroring"&&(f=!0,a=void 0);let y=m((b,S)=>{t._pendingAbortRequest={_promise:void 0,_resolve:b,_reject:S,_reason:a,_wasAlreadyErroring:f}});return t._pendingAbortRequest._promise=y,f||ua(t,a),y}function Is(t){let a=t._state;if(a==="closed"||a==="errored")return p(new TypeError(`The stream (in ${a} state) is not in the writable state and cannot be closed`));let o=m((f,y)=>{let b={_resolve:f,_reject:y};t._closeRequest=b}),l=t._writer;return l!==void 0&&t._backpressure&&a==="writable"&&ya(l),qu(t._writableStreamController),o}function Tu(t){return m((o,l)=>{let f={_resolve:o,_reject:l};t._writeRequests.push(f)})}function oa(t,a){if(t._state==="writable"){ua(t,a);return}la(t)}function ua(t,a){let o=t._writableStreamController;t._state="erroring",t._storedError=a;let l=t._writer;l!==void 0&&Ws(l,a),!xu(t)&&o._started&&la(t)}function la(t){t._state="errored",t._writableStreamController[Ge]();let a=t._storedError;if(t._writeRequests.forEach(f=>{f._reject(a)}),t._writeRequests=new M,t._pendingAbortRequest===void 0){Kr(t);return}let o=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,o._wasAlreadyErroring){o._reject(a),Kr(t);return}let l=t._writableStreamController[Y](o._reason);R(l,()=>(o._resolve(),Kr(t),null),f=>(o._reject(f),Kr(t),null))}function Eu(t){t._inFlightWriteRequest._resolve(void 0),t._inFlightWriteRequest=void 0}function Cu(t,a){t._inFlightWriteRequest._reject(a),t._inFlightWriteRequest=void 0,oa(t,a)}function ku(t){t._inFlightCloseRequest._resolve(void 0),t._inFlightCloseRequest=void 0,t._state==="erroring"&&(t._storedError=void 0,t._pendingAbortRequest!==void 0&&(t._pendingAbortRequest._resolve(),t._pendingAbortRequest=void 0)),t._state="closed";let o=t._writer;o!==void 0&&Fs(o)}function Pu(t,a){t._inFlightCloseRequest._reject(a),t._inFlightCloseRequest=void 0,t._pendingAbortRequest!==void 0&&(t._pendingAbortRequest._reject(a),t._pendingAbortRequest=void 0),oa(t,a)}function Ce(t){return!(t._closeRequest===void 0&&t._inFlightCloseRequest===void 0)}function xu(t){return!(t._inFlightWriteRequest===void 0&&t._inFlightCloseRequest===void 0)}function Au(t){t._inFlightCloseRequest=t._closeRequest,t._closeRequest=void 0}function Ou(t){t._inFlightWriteRequest=t._writeRequests.shift()}function Kr(t){t._closeRequest!==void 0&&(t._closeRequest._reject(t._storedError),t._closeRequest=void 0);let a=t._writer;a!==void 0&&ma(a,t._storedError)}function ca(t,a){let o=t._writer;o!==void 0&&a!==t._backpressure&&(a?Uu(o):ya(o)),t._backpressure=a}class je{constructor(a){if(Ie(a,1,"WritableStreamDefaultWriter"),As(a,"First parameter"),Ht(a))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=a,a._writer=this;let o=a._state;if(o==="writable")!Ce(a)&&a._backpressure?nn(this):Us(this),rn(this);else if(o==="erroring")pa(this,a._storedError),rn(this);else if(o==="closed")Us(this),Mu(this);else{let l=a._storedError;pa(this,l),Ms(this,l)}}get closed(){return wt(this)?this._closedPromise:p(St("closed"))}get desiredSize(){if(!wt(this))throw St("desiredSize");if(this._ownerWritableStream===void 0)throw gr("desiredSize");return Wu(this)}get ready(){return wt(this)?this._readyPromise:p(St("ready"))}abort(a=void 0){return wt(this)?this._ownerWritableStream===void 0?p(gr("abort")):Bu(this,a):p(St("abort"))}close(){if(!wt(this))return p(St("close"));let a=this._ownerWritableStream;return a===void 0?p(gr("close")):Ce(a)?p(new TypeError("Cannot close an already-closing stream")):Ds(this)}releaseLock(){if(!wt(this))throw St("releaseLock");this._ownerWritableStream!==void 0&&js(this)}write(a=void 0){return wt(this)?this._ownerWritableStream===void 0?p(gr("write to")):qs(this,a):p(St("write"))}}Object.defineProperties(je.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(je.prototype.abort,"abort"),i(je.prototype.close,"close"),i(je.prototype.releaseLock,"releaseLock"),i(je.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(je.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function wt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")?!1:t instanceof je}function Bu(t,a){let o=t._ownerWritableStream;return Jr(o,a)}function Ds(t){let a=t._ownerWritableStream;return Is(a)}function Iu(t){let a=t._ownerWritableStream,o=a._state;return Ce(a)||o==="closed"?h(void 0):o==="errored"?p(a._storedError):Ds(t)}function Du(t,a){t._closedPromiseState==="pending"?ma(t,a):Fu(t,a)}function Ws(t,a){t._readyPromiseState==="pending"?Vs(t,a):Vu(t,a)}function Wu(t){let a=t._ownerWritableStream,o=a._state;return o==="errored"||o==="erroring"?null:o==="closed"?0:zs(a._writableStreamController)}function js(t){let a=t._ownerWritableStream,o=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ws(t,o),Du(t,o),a._writer=void 0,t._ownerWritableStream=void 0}function qs(t,a){let o=t._ownerWritableStream,l=o._writableStreamController,f=Lu(l,a);if(o!==t._ownerWritableStream)return p(gr("write to"));let y=o._state;if(y==="errored")return p(o._storedError);if(Ce(o)||y==="closed")return p(new TypeError("The stream is closing or closed and cannot be written to"));if(y==="erroring")return p(o._storedError);let b=Tu(o);return Nu(l,a,f),b}let Ls={};class Yt{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!da(this))throw ha("abortReason");return this._abortReason}get signal(){if(!da(this))throw ha("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(a=void 0){if(!da(this))throw ha("error");this._controlledWritableStream._state==="writable"&&$s(this,a)}[Y](a){let o=this._abortAlgorithm(a);return Xr(this),o}[Ge](){et(this)}}Object.defineProperties(Yt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Yt.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function da(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")?!1:t instanceof Yt}function Ns(t,a,o,l,f,y,b,S){a._controlledWritableStream=t,t._writableStreamController=a,a._queue=void 0,a._queueTotalSize=void 0,et(a),a._abortReason=void 0,a._abortController=vu(),a._started=!1,a._strategySizeAlgorithm=S,a._strategyHWM=b,a._writeAlgorithm=l,a._closeAlgorithm=f,a._abortAlgorithm=y;let O=fa(a);ca(t,O);let C=o(),B=h(C);R(B,()=>(a._started=!0,en(a),null),W=>(a._started=!0,oa(t,W),null))}function ju(t,a,o,l){let f=Object.create(Yt.prototype),y,b,S,O;a.start!==void 0?y=()=>a.start(f):y=()=>{},a.write!==void 0?b=C=>a.write(C,f):b=()=>h(void 0),a.close!==void 0?S=()=>a.close():S=()=>h(void 0),a.abort!==void 0?O=C=>a.abort(C):O=()=>h(void 0),Ns(t,f,y,b,S,O,o,l)}function Xr(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function qu(t){Xn(t,Ls,0),en(t)}function Lu(t,a){try{return t._strategySizeAlgorithm(a)}catch(o){return _r(t,o),1}}function zs(t){return t._strategyHWM-t._queueTotalSize}function Nu(t,a,o){try{Xn(t,a,o)}catch(f){_r(t,f);return}let l=t._controlledWritableStream;if(!Ce(l)&&l._state==="writable"){let f=fa(t);ca(l,f)}en(t)}function en(t){let a=t._controlledWritableStream;if(!t._started||a._inFlightWriteRequest!==void 0)return;if(a._state==="erroring"){la(a);return}if(t._queue.length===0)return;let l=Xo(t);l===Ls?zu(t):$u(t,l)}function _r(t,a){t._controlledWritableStream._state==="writable"&&$s(t,a)}function zu(t){let a=t._controlledWritableStream;Au(a),Kn(t);let o=t._closeAlgorithm();Xr(t),R(o,()=>(ku(a),null),l=>(Pu(a,l),null))}function $u(t,a){let o=t._controlledWritableStream;Ou(o);let l=t._writeAlgorithm(a);R(l,()=>{Eu(o);let f=o._state;if(Kn(t),!Ce(o)&&f==="writable"){let y=fa(t);ca(o,y)}return en(t),null},f=>(o._state==="writable"&&Xr(t),Cu(o,f),null))}function fa(t){return zs(t)<=0}function $s(t,a){let o=t._controlledWritableStream;Xr(t),ua(o,a)}function tn(t){return new TypeError(`WritableStream.prototype.${t} can only be used on a WritableStream`)}function ha(t){return new TypeError(`WritableStreamDefaultController.prototype.${t} can only be used on a WritableStreamDefaultController`)}function St(t){return new TypeError(`WritableStreamDefaultWriter.prototype.${t} can only be used on a WritableStreamDefaultWriter`)}function gr(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function rn(t){t._closedPromise=m((a,o)=>{t._closedPromise_resolve=a,t._closedPromise_reject=o,t._closedPromiseState="pending"})}function Ms(t,a){rn(t),ma(t,a)}function Mu(t){rn(t),Fs(t)}function ma(t,a){t._closedPromise_reject!==void 0&&(T(t._closedPromise),t._closedPromise_reject(a),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="rejected")}function Fu(t,a){Ms(t,a)}function Fs(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved")}function nn(t){t._readyPromise=m((a,o)=>{t._readyPromise_resolve=a,t._readyPromise_reject=o}),t._readyPromiseState="pending"}function pa(t,a){nn(t),Vs(t,a)}function Us(t){nn(t),ya(t)}function Vs(t,a){t._readyPromise_reject!==void 0&&(T(t._readyPromise),t._readyPromise_reject(a),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="rejected")}function Uu(t){nn(t)}function Vu(t,a){pa(t,a)}function ya(t){t._readyPromise_resolve!==void 0&&(t._readyPromise_resolve(void 0),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="fulfilled")}function Zu(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}let ba=Zu();function Hu(t){if(!(typeof t=="function"||typeof t=="object")||t.name!=="DOMException")return!1;try{return new t,!0}catch{return!1}}function Yu(){let t=ba?.DOMException;return Hu(t)?t:void 0}function Qu(){let t=function(o,l){this.message=o||"",this.name=l||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return i(t,"DOMException"),t.prototype=Object.create(Error.prototype),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,configurable:!0}),t}let Gu=Yu()||Qu();function Zs(t,a,o,l,f,y){let b=Ut(t),S=Os(a);t._disturbed=!0;let O=!1,C=h(void 0);return m((B,W)=>{let F;if(y!==void 0){if(F=()=>{let P=y.reason!==void 0?y.reason:new Gu("Aborted","AbortError"),L=[];l||L.push(()=>a._state==="writable"?Jr(a,P):h(void 0)),f||L.push(()=>t._state==="readable"?we(t,P):h(void 0)),ne(()=>Promise.all(L.map(U=>U())),!0,P)},y.aborted){F();return}y.addEventListener("abort",F)}function Se(){return m((P,L)=>{function U(oe){oe?P():k(Kt(),U,L)}U(!1)})}function Kt(){return O?h(!0):k(S._readyPromise,()=>m((P,L)=>{hr(b,{_chunkSteps:U=>{C=k(qs(S,U),void 0,e),P(!1)},_closeSteps:()=>P(!0),_errorSteps:L})}))}if(Le(t,b._closedPromise,P=>(l?pe(!0,P):ne(()=>Jr(a,P),!0,P),null)),Le(a,S._closedPromise,P=>(f?pe(!0,P):ne(()=>we(t,P),!0,P),null)),ee(t,b._closedPromise,()=>(o?pe():ne(()=>Iu(S)),null)),Ce(a)||a._state==="closed"){let P=new TypeError("the destination writable stream closed before all data could be piped to it");f?pe(!0,P):ne(()=>we(t,P),!0,P)}T(Se());function it(){let P=C;return k(C,()=>P!==C?it():void 0)}function Le(P,L,U){P._state==="errored"?U(P._storedError):g(L,U)}function ee(P,L,U){P._state==="closed"?U():q(L,U)}function ne(P,L,U){if(O)return;O=!0,a._state==="writable"&&!Ce(a)?q(it(),oe):oe();function oe(){return R(P(),()=>Ne(L,U),Xt=>Ne(!0,Xt)),null}}function pe(P,L){O||(O=!0,a._state==="writable"&&!Ce(a)?q(it(),()=>Ne(P,L)):Ne(P,L))}function Ne(P,L){return js(S),Be(b),y!==void 0&&y.removeEventListener("abort",F),P?W(L):B(void 0),null}})}class qe{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!an(this))throw on("desiredSize");return _a(this)}close(){if(!an(this))throw on("close");if(!Gt(this))throw new TypeError("The stream is not in a state that permits close");vt(this)}enqueue(a=void 0){if(!an(this))throw on("enqueue");if(!Gt(this))throw new TypeError("The stream is not in a state that permits enqueue");return Qt(this,a)}error(a=void 0){if(!an(this))throw on("error");ge(this,a)}[fr](a){et(this);let o=this._cancelAlgorithm(a);return sn(this),o}[Ln](a){let o=this._controlledReadableStream;if(this._queue.length>0){let l=Kn(this);this._closeRequested&&this._queue.length===0?(sn(this),vr(o)):wr(this),a._chunkSteps(l)}else ts(o,a),wr(this)}[Nn](){}}Object.defineProperties(qe.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(qe.prototype.close,"close"),i(qe.prototype.enqueue,"enqueue"),i(qe.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(qe.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function an(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")?!1:t instanceof qe}function wr(t){if(!Hs(t))return;if(t._pulling){t._pullAgain=!0;return}t._pulling=!0;let o=t._pullAlgorithm();R(o,()=>(t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,wr(t)),null),l=>(ge(t,l),null))}function Hs(t){let a=t._controlledReadableStream;return!Gt(t)||!t._started?!1:!!(at(a)&&zr(a)>0||_a(t)>0)}function sn(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function vt(t){if(!Gt(t))return;let a=t._controlledReadableStream;t._closeRequested=!0,t._queue.length===0&&(sn(t),vr(a))}function Qt(t,a){if(!Gt(t))return;let o=t._controlledReadableStream;if(at(o)&&zr(o)>0)Hn(o,a,!1);else{let l;try{l=t._strategySizeAlgorithm(a)}catch(f){throw ge(t,f),f}try{Xn(t,a,l)}catch(f){throw ge(t,f),f}}wr(t)}function ge(t,a){let o=t._controlledReadableStream;o._state==="readable"&&(et(t),sn(t),Js(o,a))}function _a(t){let a=t._controlledReadableStream._state;return a==="errored"?null:a==="closed"?0:t._strategyHWM-t._queueTotalSize}function Ju(t){return!Hs(t)}function Gt(t){let a=t._controlledReadableStream._state;return!t._closeRequested&&a==="readable"}function Ys(t,a,o,l,f,y,b){a._controlledReadableStream=t,a._queue=void 0,a._queueTotalSize=void 0,et(a),a._started=!1,a._closeRequested=!1,a._pullAgain=!1,a._pulling=!1,a._strategySizeAlgorithm=b,a._strategyHWM=y,a._pullAlgorithm=l,a._cancelAlgorithm=f,t._readableStreamController=a;let S=o();R(h(S),()=>(a._started=!0,wr(a),null),O=>(ge(a,O),null))}function Ku(t,a,o,l){let f=Object.create(qe.prototype),y,b,S;a.start!==void 0?y=()=>a.start(f):y=()=>{},a.pull!==void 0?b=()=>a.pull(f):b=()=>h(void 0),a.cancel!==void 0?S=O=>a.cancel(O):S=()=>h(void 0),Ys(t,f,y,b,S,o,l)}function on(t){return new TypeError(`ReadableStreamDefaultController.prototype.${t} can only be used on a ReadableStreamDefaultController`)}function Xu(t,a){return bt(t._readableStreamController)?tl(t):el(t)}function el(t,a){let o=Ut(t),l=!1,f=!1,y=!1,b=!1,S,O,C,B,W,F=m(ee=>{W=ee});function Se(){return l?(f=!0,h(void 0)):(l=!0,hr(o,{_chunkSteps:ne=>{j(()=>{f=!1;let pe=ne,Ne=ne;y||Qt(C._readableStreamController,pe),b||Qt(B._readableStreamController,Ne),l=!1,f&&Se()})},_closeSteps:()=>{l=!1,y||vt(C._readableStreamController),b||vt(B._readableStreamController),(!y||!b)&&W(void 0)},_errorSteps:()=>{l=!1}}),h(void 0))}function Kt(ee){if(y=!0,S=ee,b){let ne=mr([S,O]),pe=we(t,ne);W(pe)}return F}function it(ee){if(b=!0,O=ee,y){let ne=mr([S,O]),pe=we(t,ne);W(pe)}return F}function Le(){}return C=Sr(Le,Se,Kt),B=Sr(Le,Se,it),g(o._closedPromise,ee=>(ge(C._readableStreamController,ee),ge(B._readableStreamController,ee),(!y||!b)&&W(void 0),null)),[C,B]}function tl(t){let a=Ut(t),o=!1,l=!1,f=!1,y=!1,b=!1,S,O,C,B,W,F=m(P=>{W=P});function Se(P){g(P._closedPromise,L=>(P!==a||(me(C._readableStreamController,L),me(B._readableStreamController,L),(!y||!b)&&W(void 0)),null))}function Kt(){gt(a)&&(Be(a),a=Ut(t),Se(a)),hr(a,{_chunkSteps:L=>{j(()=>{l=!1,f=!1;let U=L,oe=L;if(!y&&!b)try{oe=fs(L)}catch(Xt){me(C._readableStreamController,Xt),me(B._readableStreamController,Xt),W(we(t,Xt));return}y||Vr(C._readableStreamController,U),b||Vr(B._readableStreamController,oe),o=!1,l?Le():f&&ee()})},_closeSteps:()=>{o=!1,y||pr(C._readableStreamController),b||pr(B._readableStreamController),C._readableStreamController._pendingPullIntos.length>0&&Zr(C._readableStreamController,0),B._readableStreamController._pendingPullIntos.length>0&&Zr(B._readableStreamController,0),(!y||!b)&&W(void 0)},_errorSteps:()=>{o=!1}})}function it(P,L){Ke(a)&&(Be(a),a=Es(t),Se(a));let U=L?B:C,oe=L?C:B;Ps(a,P,1,{_chunkSteps:er=>{j(()=>{l=!1,f=!1;let tr=L?b:y;if(L?y:b)tr||Hr(U._readableStreamController,er);else{let ci;try{ci=fs(er)}catch(Ra){me(U._readableStreamController,Ra),me(oe._readableStreamController,Ra),W(we(t,Ra));return}tr||Hr(U._readableStreamController,er),Vr(oe._readableStreamController,ci)}o=!1,l?Le():f&&ee()})},_closeSteps:er=>{o=!1;let tr=L?b:y,pn=L?y:b;tr||pr(U._readableStreamController),pn||pr(oe._readableStreamController),er!==void 0&&(tr||Hr(U._readableStreamController,er),!pn&&oe._readableStreamController._pendingPullIntos.length>0&&Zr(oe._readableStreamController,0)),(!tr||!pn)&&W(void 0)},_errorSteps:()=>{o=!1}})}function Le(){if(o)return l=!0,h(void 0);o=!0;let P=aa(C._readableStreamController);return P===null?Kt():it(P._view,!1),h(void 0)}function ee(){if(o)return f=!0,h(void 0);o=!0;let P=aa(B._readableStreamController);return P===null?Kt():it(P._view,!0),h(void 0)}function ne(P){if(y=!0,S=P,b){let L=mr([S,O]),U=we(t,L);W(U)}return F}function pe(P){if(b=!0,O=P,y){let L=mr([S,O]),U=we(t,L);W(U)}return F}function Ne(){}return C=Gs(Ne,Le,ne),B=Gs(Ne,ee,pe),Se(a),[C,B]}function rl(t){return r(t)&&typeof t.getReader<"u"}function nl(t){return rl(t)?sl(t.getReader()):al(t)}function al(t){let a,o=ds(t,"async"),l=e;function f(){let b;try{b=Qo(o)}catch(O){return p(O)}let S=h(b);return z(S,O=>{if(!r(O))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Go(O))vt(a._readableStreamController);else{let B=Jo(O);Qt(a._readableStreamController,B)}})}function y(b){let S=o.iterator,O;try{O=Mr(S,"return")}catch(W){return p(W)}if(O===void 0)return h(void 0);let C;try{C=H(O,S,[b])}catch(W){return p(W)}let B=h(C);return z(B,W=>{if(!r(W))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return a=Sr(l,f,y,0),a}function sl(t){let a,o=e;function l(){let y;try{y=t.read()}catch(b){return p(b)}return z(y,b=>{if(!r(b))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(b.done)vt(a._readableStreamController);else{let S=b.value;Qt(a._readableStreamController,S)}})}function f(y){try{return h(t.cancel(y))}catch(b){return p(b)}}return a=Sr(o,l,f,0),a}function il(t,a){Ee(t,a);let o=t,l=o?.autoAllocateChunkSize,f=o?.cancel,y=o?.pull,b=o?.start,S=o?.type;return{autoAllocateChunkSize:l===void 0?void 0:Vn(l,`${a} has member 'autoAllocateChunkSize' that`),cancel:f===void 0?void 0:ol(f,o,`${a} has member 'cancel' that`),pull:y===void 0?void 0:ul(y,o,`${a} has member 'pull' that`),start:b===void 0?void 0:ll(b,o,`${a} has member 'start' that`),type:S===void 0?void 0:cl(S,`${a} has member 'type' that`)}}function ol(t,a,o){return he(t,o),l=>J(t,a,[l])}function ul(t,a,o){return he(t,o),l=>J(t,a,[l])}function ll(t,a,o){return he(t,o),l=>H(t,a,[l])}function cl(t,a){if(t=`${t}`,t!=="bytes")throw new TypeError(`${a} '${t}' is not a valid enumeration value for ReadableStreamType`);return t}function dl(t,a){return Ee(t,a),{preventCancel:!!t?.preventCancel}}function Qs(t,a){Ee(t,a);let o=t?.preventAbort,l=t?.preventCancel,f=t?.preventClose,y=t?.signal;return y!==void 0&&fl(y,`${a} has member 'signal' that`),{preventAbort:!!o,preventCancel:!!l,preventClose:!!f,signal:y}}function fl(t,a){if(!wu(t))throw new TypeError(`${a} is not an AbortSignal.`)}function hl(t,a){Ee(t,a);let o=t?.readable;Fn(o,"readable","ReadableWritablePair"),Zn(o,`${a} has member 'readable' that`);let l=t?.writable;return Fn(l,"writable","ReadableWritablePair"),As(l,`${a} has member 'writable' that`),{readable:o,writable:l}}class K{constructor(a={},o={}){a===void 0?a=null:Xa(a,"First parameter");let l=Gr(o,"Second parameter"),f=il(a,"First parameter");if(ga(this),f.type==="bytes"){if(l.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let y=br(l,0);ou(this,f,y)}else{let y=Qr(l),b=br(l,1);Ku(this,f,b,y)}}get locked(){if(!nt(this))throw Rt("locked");return at(this)}cancel(a=void 0){return nt(this)?at(this)?p(new TypeError("Cannot cancel a stream that already has a reader")):we(this,a):p(Rt("cancel"))}getReader(a=void 0){if(!nt(this))throw Rt("getReader");return lu(a,"First parameter").mode===void 0?Ut(this):Es(this)}pipeThrough(a,o={}){if(!nt(this))throw Rt("pipeThrough");Ie(a,1,"pipeThrough");let l=hl(a,"First parameter"),f=Qs(o,"Second parameter");if(at(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ht(l.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let y=Zs(this,l.writable,f.preventClose,f.preventAbort,f.preventCancel,f.signal);return T(y),l.readable}pipeTo(a,o={}){if(!nt(this))return p(Rt("pipeTo"));if(a===void 0)return p("Parameter 1 is required in 'pipeTo'.");if(!Zt(a))return p(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let l;try{l=Qs(o,"Second parameter")}catch(f){return p(f)}return at(this)?p(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ht(a)?p(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Zs(this,a,l.preventClose,l.preventAbort,l.preventCancel,l.signal)}tee(){if(!nt(this))throw Rt("tee");let a=Xu(this);return mr(a)}values(a=void 0){if(!nt(this))throw Rt("values");let o=dl(a,"First parameter");return Ho(this,o.preventCancel)}[Jn](a){return this.values(a)}static from(a){return nl(a)}}Object.defineProperties(K,{from:{enumerable:!0}}),Object.defineProperties(K.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(K.from,"from"),i(K.prototype.cancel,"cancel"),i(K.prototype.getReader,"getReader"),i(K.prototype.pipeThrough,"pipeThrough"),i(K.prototype.pipeTo,"pipeTo"),i(K.prototype.tee,"tee"),i(K.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(K.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(K.prototype,Jn,{value:K.prototype.values,writable:!0,configurable:!0});function Sr(t,a,o,l=1,f=()=>1){let y=Object.create(K.prototype);ga(y);let b=Object.create(qe.prototype);return Ys(y,b,t,a,o,l,f),y}function Gs(t,a,o){let l=Object.create(K.prototype);ga(l);let f=Object.create(We.prototype);return Ts(l,f,t,a,o,0,void 0),l}function ga(t){t._state="readable",t._reader=void 0,t._storedError=void 0,t._disturbed=!1}function nt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")?!1:t instanceof K}function at(t){return t._reader!==void 0}function we(t,a){if(t._disturbed=!0,t._state==="closed")return h(void 0);if(t._state==="errored")return p(t._storedError);vr(t);let o=t._reader;if(o!==void 0&>(o)){let f=o._readIntoRequests;o._readIntoRequests=new M,f.forEach(y=>{y._closeSteps(void 0)})}let l=t._readableStreamController[fr](a);return z(l,e)}function vr(t){t._state="closed";let a=t._reader;if(a!==void 0&&(Ja(a),Ke(a))){let o=a._readRequests;a._readRequests=new M,o.forEach(l=>{l._closeSteps()})}}function Js(t,a){t._state="errored",t._storedError=a;let o=t._reader;o!==void 0&&(Mn(o,a),Ke(o)?ns(o,a):xs(o,a))}function Rt(t){return new TypeError(`ReadableStream.prototype.${t} can only be used on a ReadableStream`)}function Ks(t,a){Ee(t,a);let o=t?.highWaterMark;return Fn(o,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Un(o)}}let Xs=t=>t.byteLength;i(Xs,"size");class un{constructor(a){Ie(a,1,"ByteLengthQueuingStrategy"),a=Ks(a,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=a.highWaterMark}get highWaterMark(){if(!ti(this))throw ei("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ti(this))throw ei("size");return Xs}}Object.defineProperties(un.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(un.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function ei(t){return new TypeError(`ByteLengthQueuingStrategy.prototype.${t} can only be used on a ByteLengthQueuingStrategy`)}function ti(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_byteLengthQueuingStrategyHighWaterMark")?!1:t instanceof un}let ri=()=>1;i(ri,"size");class ln{constructor(a){Ie(a,1,"CountQueuingStrategy"),a=Ks(a,"First parameter"),this._countQueuingStrategyHighWaterMark=a.highWaterMark}get highWaterMark(){if(!ai(this))throw ni("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!ai(this))throw ni("size");return ri}}Object.defineProperties(ln.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ln.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ni(t){return new TypeError(`CountQueuingStrategy.prototype.${t} can only be used on a CountQueuingStrategy`)}function ai(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_countQueuingStrategyHighWaterMark")?!1:t instanceof ln}function ml(t,a){Ee(t,a);let o=t?.cancel,l=t?.flush,f=t?.readableType,y=t?.start,b=t?.transform,S=t?.writableType;return{cancel:o===void 0?void 0:_l(o,t,`${a} has member 'cancel' that`),flush:l===void 0?void 0:pl(l,t,`${a} has member 'flush' that`),readableType:f,start:y===void 0?void 0:yl(y,t,`${a} has member 'start' that`),transform:b===void 0?void 0:bl(b,t,`${a} has member 'transform' that`),writableType:S}}function pl(t,a,o){return he(t,o),l=>J(t,a,[l])}function yl(t,a,o){return he(t,o),l=>H(t,a,[l])}function bl(t,a,o){return he(t,o),(l,f)=>J(t,a,[l,f])}function _l(t,a,o){return he(t,o),l=>J(t,a,[l])}class cn{constructor(a={},o={},l={}){a===void 0&&(a=null);let f=Gr(o,"Second parameter"),y=Gr(l,"Third parameter"),b=ml(a,"First parameter");if(b.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(b.writableType!==void 0)throw new RangeError("Invalid writableType specified");let S=br(y,0),O=Qr(y),C=br(f,1),B=Qr(f),W,F=m(Se=>{W=Se});gl(this,F,C,B,S,O),Sl(this,b),b.start!==void 0?W(b.start(this._transformStreamController)):W(void 0)}get readable(){if(!si(this))throw li("readable");return this._readable}get writable(){if(!si(this))throw li("writable");return this._writable}}Object.defineProperties(cn.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cn.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function gl(t,a,o,l,f,y){function b(){return a}function S(F){return Tl(t,F)}function O(F){return El(t,F)}function C(){return Cl(t)}t._writable=Ru(b,S,C,O,o,l);function B(){return kl(t)}function W(F){return Pl(t,F)}t._readable=Sr(b,B,W,f,y),t._backpressure=void 0,t._backpressureChangePromise=void 0,t._backpressureChangePromise_resolve=void 0,dn(t,!0),t._transformStreamController=void 0}function si(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")?!1:t instanceof cn}function ii(t,a){ge(t._readable._readableStreamController,a),wa(t,a)}function wa(t,a){hn(t._transformStreamController),_r(t._writable._writableStreamController,a),Sa(t)}function Sa(t){t._backpressure&&dn(t,!1)}function dn(t,a){t._backpressureChangePromise!==void 0&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=m(o=>{t._backpressureChangePromise_resolve=o}),t._backpressure=a}class st{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!fn(this))throw mn("desiredSize");let a=this._controlledTransformStream._readable._readableStreamController;return _a(a)}enqueue(a=void 0){if(!fn(this))throw mn("enqueue");oi(this,a)}error(a=void 0){if(!fn(this))throw mn("error");vl(this,a)}terminate(){if(!fn(this))throw mn("terminate");Rl(this)}}Object.defineProperties(st.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(st.prototype.enqueue,"enqueue"),i(st.prototype.error,"error"),i(st.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(st.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function fn(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")?!1:t instanceof st}function wl(t,a,o,l,f){a._controlledTransformStream=t,t._transformStreamController=a,a._transformAlgorithm=o,a._flushAlgorithm=l,a._cancelAlgorithm=f,a._finishPromise=void 0,a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0}function Sl(t,a){let o=Object.create(st.prototype),l,f,y;a.transform!==void 0?l=b=>a.transform(b,o):l=b=>{try{return oi(o,b),h(void 0)}catch(S){return p(S)}},a.flush!==void 0?f=()=>a.flush(o):f=()=>h(void 0),a.cancel!==void 0?y=b=>a.cancel(b):y=()=>h(void 0),wl(t,o,l,f,y)}function hn(t){t._transformAlgorithm=void 0,t._flushAlgorithm=void 0,t._cancelAlgorithm=void 0}function oi(t,a){let o=t._controlledTransformStream,l=o._readable._readableStreamController;if(!Gt(l))throw new TypeError("Readable side is not in a state that permits enqueue");try{Qt(l,a)}catch(y){throw wa(o,y),o._readable._storedError}Ju(l)!==o._backpressure&&dn(o,!0)}function vl(t,a){ii(t._controlledTransformStream,a)}function ui(t,a){let o=t._transformAlgorithm(a);return z(o,void 0,l=>{throw ii(t._controlledTransformStream,l),l})}function Rl(t){let a=t._controlledTransformStream,o=a._readable._readableStreamController;vt(o);let l=new TypeError("TransformStream terminated");wa(a,l)}function Tl(t,a){let o=t._transformStreamController;if(t._backpressure){let l=t._backpressureChangePromise;return z(l,()=>{let f=t._writable;if(f._state==="erroring")throw f._storedError;return ui(o,a)})}return ui(o,a)}function El(t,a){let o=t._transformStreamController;if(o._finishPromise!==void 0)return o._finishPromise;let l=t._readable;o._finishPromise=m((y,b)=>{o._finishPromise_resolve=y,o._finishPromise_reject=b});let f=o._cancelAlgorithm(a);return hn(o),R(f,()=>(l._state==="errored"?Jt(o,l._storedError):(ge(l._readableStreamController,a),va(o)),null),y=>(ge(l._readableStreamController,y),Jt(o,y),null)),o._finishPromise}function Cl(t){let a=t._transformStreamController;if(a._finishPromise!==void 0)return a._finishPromise;let o=t._readable;a._finishPromise=m((f,y)=>{a._finishPromise_resolve=f,a._finishPromise_reject=y});let l=a._flushAlgorithm();return hn(a),R(l,()=>(o._state==="errored"?Jt(a,o._storedError):(vt(o._readableStreamController),va(a)),null),f=>(ge(o._readableStreamController,f),Jt(a,f),null)),a._finishPromise}function kl(t){return dn(t,!1),t._backpressureChangePromise}function Pl(t,a){let o=t._transformStreamController;if(o._finishPromise!==void 0)return o._finishPromise;let l=t._writable;o._finishPromise=m((y,b)=>{o._finishPromise_resolve=y,o._finishPromise_reject=b});let f=o._cancelAlgorithm(a);return hn(o),R(f,()=>(l._state==="errored"?Jt(o,l._storedError):(_r(l._writableStreamController,a),Sa(t),va(o)),null),y=>(_r(l._writableStreamController,y),Sa(t),Jt(o,y),null)),o._finishPromise}function mn(t){return new TypeError(`TransformStreamDefaultController.prototype.${t} can only be used on a TransformStreamDefaultController`)}function va(t){t._finishPromise_resolve!==void 0&&(t._finishPromise_resolve(),t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0)}function Jt(t,a){t._finishPromise_reject!==void 0&&(T(t._finishPromise),t._finishPromise_reject(a),t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0)}function li(t){return new TypeError(`TransformStream.prototype.${t} can only be used on a TransformStream`)}n.ByteLengthQueuingStrategy=un,n.CountQueuingStrategy=ln,n.ReadableByteStreamController=We,n.ReadableStream=K,n.ReadableStreamBYOBReader=tt,n.ReadableStreamBYOBRequest=yt,n.ReadableStreamDefaultController=qe,n.ReadableStreamDefaultReader=Je,n.TransformStream=cn,n.TransformStreamDefaultController=st,n.WritableStream=rt,n.WritableStreamDefaultController=Yt,n.WritableStreamDefaultWriter=je})});var Ri=ze(()=>{"use strict";if(!globalThis.ReadableStream)try{let n=gi(),{emitWarning:e}=n;try{n.emitWarning=()=>{},Object.assign(globalThis,wi()),n.emitWarning=e}catch(r){throw n.emitWarning=e,r}}catch{Object.assign(globalThis,vi())}try{let{Blob:n}=di("buffer");n&&!n.prototype.stream&&(n.prototype.stream=function(r){let s=0,i=this;return new ReadableStream({type:"bytes",async pull(u){let d=await i.slice(s,Math.min(i.size,s+65536)).arrayBuffer();s+=d.byteLength,u.enqueue(new Uint8Array(d)),s===i.size&&u.close()}})})}catch{}});async function*ka(n,e=!0){for(let r of n)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let s=r.byteOffset,i=r.byteOffset+r.byteLength;for(;s!==i;){let u=Math.min(i-s,Ti),c=r.buffer.slice(s,s+u);s+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let s=0,i=r;for(;s!==i.size;){let c=await i.slice(s,Math.min(i.size,s+Ti)).arrayBuffer();s+=c.byteLength,yield new Uint8Array(c)}}}var Id,Ti,Ei,ql,ve,Rr=Z(()=>{"use strict";Id=ot(Ri(),1);Ti=65536;Ei=class Pa{#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let s=new TextEncoder;for(let u of e){let c;ArrayBuffer.isView(u)?c=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)):u instanceof ArrayBuffer?c=new Uint8Array(u.slice(0)):u instanceof Pa?c=u:c=s.encode(`${u}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let s of ka(this.#e,!1))r+=e.decode(s,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let s of ka(this.#e,!1))e.set(s,r),r+=s.length;return e.buffer}stream(){let e=ka(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let s=await e.next();s.done?r.close():r.enqueue(s.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,s=""){let{size:i}=this,u=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-u,0),m=this.#e,h=[],p=0;for(let R of m){if(p>=d)break;let q=ArrayBuffer.isView(R)?R.byteLength:R.size;if(u&&q<=u)u-=q,c-=q;else{let g;ArrayBuffer.isView(R)?(g=R.subarray(u,Math.min(q,c)),p+=g.byteLength):(g=R.slice(u,Math.min(q,c)),p+=g.size),c-=q,h.push(g),u=0}}let k=new Pa([],{type:String(s).toLowerCase()});return k.#r=d,k.#e=h,k}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(Ei.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});ql=Ei,ve=ql});var Ll,Nl,ut,xa=Z(()=>{"use strict";Rr();Ll=class extends ve{#e=0;#t="";constructor(e,r,s={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,s),s===null&&(s={});let i=s.lastModified===void 0?Date.now():Number(s.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof ve&&/^(File)$/.test(e[Symbol.toStringTag])}},Nl=Ll,ut=Nl});function Pi(n,e=ve){var r=`${Ci()}${Ci()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),s=[],i=`--${r}\r
|
|
1
|
+
"use strict";var vcrsdk=(()=>{var Ol=Object.create;var yn=Object.defineProperty;var Bl=Object.getOwnPropertyDescriptor;var Il=Object.getOwnPropertyNames;var Dl=Object.getPrototypeOf,Wl=Object.prototype.hasOwnProperty;var hi=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Z=(n,e)=>()=>(n&&(e=n(n=0)),e);var $e=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),bn=(n,e)=>{for(var r in e)yn(n,r,{get:e[r],enumerable:!0})},mi=(n,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Il(e))!Wl.call(n,i)&&i!==r&&yn(n,i,{get:()=>e[i],enumerable:!(s=Bl(e,i))||s.enumerable});return n};var ot=(n,e,r)=>(r=n!=null?Ol(Dl(n)):{},mi(e||!n||!n.__esModule?yn(r,"default",{value:n,enumerable:!0}):r,n)),jl=n=>mi(yn({},"__esModule",{value:!0}),n);var pi={};bn(pi,{default:()=>Ll});function Ll(n,e){return e=e||{},new Promise(function(r,s){var i=new XMLHttpRequest,u=[],c={},d=function h(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:h,headers:{keys:function(){return u},entries:function(){return u.map(function(p){return[p,i.getResponseHeader(p)]})},get:function(p){return i.getResponseHeader(p)},has:function(p){return i.getResponseHeader(p)!=null}}}};for(var m in i.open(e.method||"get",n,!0),i.onload=function(){i.getAllResponseHeaders().toLowerCase().replace(/^(.+?):/gm,function(h,p){c[p]||u.push(c[p]=p)}),r(d())},i.onerror=s,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(m,e.headers[m]);i.send(e.body||null)})}var yi=Z(()=>{"use strict"});var Ta=$e(()=>{"use strict"});var bi=$e(()=>{"use strict"});var _i=$e(()=>{"use strict"});var Ea=$e(()=>{"use strict"});var Ca=Z(()=>{"use strict"});function ql(n){if(!/^data:/i.test(n))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');n=n.replace(/\r?\n/g,"");let e=n.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=n.substring(5,e).split(";"),s="",i=!1,u=r[0]||"text/plain",c=u;for(let p=1;p<r.length;p++)r[p]==="base64"?i=!0:r[p]&&(c+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(s=r[p].substring(8)));!r[0]&&!s.length&&(c+=";charset=US-ASCII",s="US-ASCII");let d=i?"base64":"ascii",m=unescape(n.substring(e+1)),h=Buffer.from(m,d);return h.type=u,h.typeFull=c,h.charset=s,h}var gi,wi=Z(()=>{"use strict";gi=ql});var _n=Z(()=>{"use strict"});var Si=$e(()=>{"use strict"});var vi=$e(()=>{"use strict"});var Ti=$e((gn,Ri)=>{"use strict";(function(n,e){typeof gn=="object"&&typeof Ri<"u"?e(gn):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.WebStreamsPolyfill={}))})(gn,function(n){"use strict";function e(){}function r(t){return typeof t=="object"&&t!==null||typeof t=="function"}let s=e;function i(t,a){try{Object.defineProperty(t,"name",{value:a,configurable:!0})}catch{}}let u=Promise,c=Promise.prototype.then,d=Promise.reject.bind(u);function m(t){return new u(t)}function h(t){return m(a=>a(t))}function p(t){return d(t)}function k(t,a,o){return c.call(t,a,o)}function R(t,a,o){k(k(t,a,o),void 0,s)}function L(t,a){R(t,a)}function g(t,a){R(t,void 0,a)}function z(t,a,o){return k(t,a,o)}function T(t){k(t,void 0,s)}let j=t=>{if(typeof queueMicrotask=="function")j=queueMicrotask;else{let a=h(void 0);j=o=>k(a,o)}return j(t)};function H(t,a,o){if(typeof t!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,a,o)}function J(t,a,o){try{return h(H(t,a,o))}catch(l){return p(l)}}let $=16384;class M{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(a){let o=this._back,l=o;o._elements.length===$-1&&(l={_elements:[],_next:void 0}),o._elements.push(a),l!==o&&(this._back=l,o._next=l),++this._size}shift(){let a=this._front,o=a,l=this._cursor,f=l+1,y=a._elements,b=y[l];return f===$&&(o=a._next,f=0),--this._size,this._cursor=f,a!==o&&(this._front=o),y[l]=void 0,b}forEach(a){let o=this._cursor,l=this._front,f=l._elements;for(;(o!==f.length||l._next!==void 0)&&!(o===f.length&&(l=l._next,f=l._elements,o=0,f.length===0));)a(f[o]),++o}peek(){let a=this._front,o=this._cursor;return a._elements[o]}}let Y=Symbol("[[AbortSteps]]"),Ge=Symbol("[[ErrorSteps]]"),fr=Symbol("[[CancelSteps]]"),qn=Symbol("[[PullSteps]]"),Nn=Symbol("[[ReleaseSteps]]");function Ja(t,a){t._ownerReadableStream=a,a._reader=t,a._state==="readable"?$n(t):a._state==="closed"?$o(t):Ka(t,a._storedError)}function zn(t,a){let o=t._ownerReadableStream;return Se(o,a)}function Ie(t){let a=t._ownerReadableStream;a._state==="readable"?Mn(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Mo(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),a._readableStreamController[Nn](),a._reader=void 0,t._ownerReadableStream=void 0}function Nr(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function $n(t){t._closedPromise=m((a,o)=>{t._closedPromise_resolve=a,t._closedPromise_reject=o})}function Ka(t,a){$n(t),Mn(t,a)}function $o(t){$n(t),Xa(t)}function Mn(t,a){t._closedPromise_reject!==void 0&&(T(t._closedPromise),t._closedPromise_reject(a),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}function Mo(t,a){Ka(t,a)}function Xa(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}let es=Number.isFinite||function(t){return typeof t=="number"&&isFinite(t)},Fo=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function Uo(t){return typeof t=="object"||typeof t=="function"}function Ce(t,a){if(t!==void 0&&!Uo(t))throw new TypeError(`${a} is not an object.`)}function me(t,a){if(typeof t!="function")throw new TypeError(`${a} is not a function.`)}function Vo(t){return typeof t=="object"&&t!==null||typeof t=="function"}function ts(t,a){if(!Vo(t))throw new TypeError(`${a} is not an object.`)}function De(t,a,o){if(t===void 0)throw new TypeError(`Parameter ${a} is required in '${o}'.`)}function Fn(t,a,o){if(t===void 0)throw new TypeError(`${a} is required in '${o}'.`)}function Un(t){return Number(t)}function rs(t){return t===0?0:t}function Zo(t){return rs(Fo(t))}function Vn(t,a){let l=Number.MAX_SAFE_INTEGER,f=Number(t);if(f=rs(f),!es(f))throw new TypeError(`${a} is not a finite number`);if(f=Zo(f),f<0||f>l)throw new TypeError(`${a} is outside the accepted range of 0 to ${l}, inclusive`);return!es(f)||f===0?0:f}function Zn(t,a){if(!nt(t))throw new TypeError(`${a} is not a ReadableStream.`)}function Ut(t){return new Je(t)}function ns(t,a){t._reader._readRequests.push(a)}function Hn(t,a,o){let f=t._reader._readRequests.shift();o?f._closeSteps():f._chunkSteps(a)}function zr(t){return t._reader._readRequests.length}function as(t){let a=t._reader;return!(a===void 0||!Ke(a))}class Je{constructor(a){if(De(a,1,"ReadableStreamDefaultReader"),Zn(a,"First parameter"),at(a))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Ja(this,a),this._readRequests=new M}get closed(){return Ke(this)?this._closedPromise:p($r("closed"))}cancel(a=void 0){return Ke(this)?this._ownerReadableStream===void 0?p(Nr("cancel")):zn(this,a):p($r("cancel"))}read(){if(!Ke(this))return p($r("read"));if(this._ownerReadableStream===void 0)return p(Nr("read from"));let a,o,l=m((y,b)=>{a=y,o=b});return hr(this,{_chunkSteps:y=>a({value:y,done:!1}),_closeSteps:()=>a({value:void 0,done:!0}),_errorSteps:y=>o(y)}),l}releaseLock(){if(!Ke(this))throw $r("releaseLock");this._ownerReadableStream!==void 0&&Ho(this)}}Object.defineProperties(Je.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Je.prototype.cancel,"cancel"),i(Je.prototype.read,"read"),i(Je.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Je.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Ke(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_readRequests")?!1:t instanceof Je}function hr(t,a){let o=t._ownerReadableStream;o._disturbed=!0,o._state==="closed"?a._closeSteps():o._state==="errored"?a._errorSteps(o._storedError):o._readableStreamController[qn](a)}function Ho(t){Ie(t);let a=new TypeError("Reader was released");ss(t,a)}function ss(t,a){let o=t._readRequests;t._readRequests=new M,o.forEach(l=>{l._errorSteps(a)})}function $r(t){return new TypeError(`ReadableStreamDefaultReader.prototype.${t} can only be used on a ReadableStreamDefaultReader`)}let Yo=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class is{constructor(a,o){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=a,this._preventCancel=o}next(){let a=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?z(this._ongoingPromise,a,a):a(),this._ongoingPromise}return(a){let o=()=>this._returnSteps(a);return this._ongoingPromise?z(this._ongoingPromise,o,o):o()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let a=this._reader,o,l,f=m((b,S)=>{o=b,l=S});return hr(a,{_chunkSteps:b=>{this._ongoingPromise=void 0,j(()=>o({value:b,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Ie(a),o({value:void 0,done:!0})},_errorSteps:b=>{this._ongoingPromise=void 0,this._isFinished=!0,Ie(a),l(b)}}),f}_returnSteps(a){if(this._isFinished)return Promise.resolve({value:a,done:!0});this._isFinished=!0;let o=this._reader;if(!this._preventCancel){let l=zn(o,a);return Ie(o),z(l,()=>({value:a,done:!0}))}return Ie(o),h({value:a,done:!0})}}let os={next(){return us(this)?this._asyncIteratorImpl.next():p(ls("next"))},return(t){return us(this)?this._asyncIteratorImpl.return(t):p(ls("return"))}};Object.setPrototypeOf(os,Yo);function Qo(t,a){let o=Ut(t),l=new is(o,a),f=Object.create(os);return f._asyncIteratorImpl=l,f}function us(t){if(!r(t)||!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl"))return!1;try{return t._asyncIteratorImpl instanceof is}catch{return!1}}function ls(t){return new TypeError(`ReadableStreamAsyncIterator.${t} can only be used on a ReadableSteamAsyncIterator`)}let cs=Number.isNaN||function(t){return t!==t};var Yn,Qn,Gn;function mr(t){return t.slice()}function ds(t,a,o,l,f){new Uint8Array(t).set(new Uint8Array(o,l,f),a)}let We=t=>(typeof t.transfer=="function"?We=a=>a.transfer():typeof structuredClone=="function"?We=a=>structuredClone(a,{transfer:[a]}):We=a=>a,We(t)),Xe=t=>(typeof t.detached=="boolean"?Xe=a=>a.detached:Xe=a=>a.byteLength===0,Xe(t));function fs(t,a,o){if(t.slice)return t.slice(a,o);let l=o-a,f=new ArrayBuffer(l);return ds(f,0,t,a,l),f}function Mr(t,a){let o=t[a];if(o!=null){if(typeof o!="function")throw new TypeError(`${String(a)} is not a function`);return o}}function Go(t){let a={[Symbol.iterator]:()=>t.iterator},o=async function*(){return yield*a}(),l=o.next;return{iterator:o,nextMethod:l,done:!1}}let Jn=(Gn=(Yn=Symbol.asyncIterator)!==null&&Yn!==void 0?Yn:(Qn=Symbol.for)===null||Qn===void 0?void 0:Qn.call(Symbol,"Symbol.asyncIterator"))!==null&&Gn!==void 0?Gn:"@@asyncIterator";function hs(t,a="sync",o){if(o===void 0)if(a==="async"){if(o=Mr(t,Jn),o===void 0){let y=Mr(t,Symbol.iterator),b=hs(t,"sync",y);return Go(b)}}else o=Mr(t,Symbol.iterator);if(o===void 0)throw new TypeError("The object is not iterable");let l=H(o,t,[]);if(!r(l))throw new TypeError("The iterator method must return an object");let f=l.next;return{iterator:l,nextMethod:f,done:!1}}function Jo(t){let a=H(t.nextMethod,t.iterator,[]);if(!r(a))throw new TypeError("The iterator.next() method must return an object");return a}function Ko(t){return!!t.done}function Xo(t){return t.value}function eu(t){return!(typeof t!="number"||cs(t)||t<0)}function ms(t){let a=fs(t.buffer,t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(a)}function Kn(t){let a=t._queue.shift();return t._queueTotalSize-=a.size,t._queueTotalSize<0&&(t._queueTotalSize=0),a.value}function Xn(t,a,o){if(!eu(o)||o===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t._queue.push({value:a,size:o}),t._queueTotalSize+=o}function tu(t){return t._queue.peek().value}function et(t){t._queue=new M,t._queueTotalSize=0}function ps(t){return t===DataView}function ru(t){return ps(t.constructor)}function nu(t){return ps(t)?1:t.BYTES_PER_ELEMENT}class yt{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!ea(this))throw sa("view");return this._view}respond(a){if(!ea(this))throw sa("respond");if(De(a,1,"respond"),a=Vn(a,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Xe(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Zr(this._associatedReadableByteStreamController,a)}respondWithNewView(a){if(!ea(this))throw sa("respondWithNewView");if(De(a,1,"respondWithNewView"),!ArrayBuffer.isView(a))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Xe(a.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Hr(this._associatedReadableByteStreamController,a)}}Object.defineProperties(yt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(yt.prototype.respond,"respond"),i(yt.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class je{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!bt(this))throw yr("byobRequest");return aa(this)}get desiredSize(){if(!bt(this))throw yr("desiredSize");return Es(this)}close(){if(!bt(this))throw yr("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let a=this._controlledReadableByteStream._state;if(a!=="readable")throw new TypeError(`The stream (in ${a} state) is not in the readable state and cannot be closed`);pr(this)}enqueue(a){if(!bt(this))throw yr("enqueue");if(De(a,1,"enqueue"),!ArrayBuffer.isView(a))throw new TypeError("chunk must be an array buffer view");if(a.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(a.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let o=this._controlledReadableByteStream._state;if(o!=="readable")throw new TypeError(`The stream (in ${o} state) is not in the readable state and cannot be enqueued to`);Vr(this,a)}error(a=void 0){if(!bt(this))throw yr("error");pe(this,a)}[fr](a){ys(this),et(this);let o=this._cancelAlgorithm(a);return Ur(this),o}[qn](a){let o=this._controlledReadableByteStream;if(this._queueTotalSize>0){Ts(this,a);return}let l=this._autoAllocateChunkSize;if(l!==void 0){let f;try{f=new ArrayBuffer(l)}catch(b){a._errorSteps(b);return}let y={buffer:f,bufferByteLength:l,byteOffset:0,byteLength:l,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(y)}ns(o,a),_t(this)}[Nn](){if(this._pendingPullIntos.length>0){let a=this._pendingPullIntos.peek();a.readerType="none",this._pendingPullIntos=new M,this._pendingPullIntos.push(a)}}}Object.defineProperties(je.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(je.prototype.close,"close"),i(je.prototype.enqueue,"enqueue"),i(je.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(je.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function bt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")?!1:t instanceof je}function ea(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")?!1:t instanceof yt}function _t(t){if(!uu(t))return;if(t._pulling){t._pullAgain=!0;return}t._pulling=!0;let o=t._pullAlgorithm();R(o,()=>(t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,_t(t)),null),l=>(pe(t,l),null))}function ys(t){ra(t),t._pendingPullIntos=new M}function ta(t,a){let o=!1;t._state==="closed"&&(o=!0);let l=bs(a);a.readerType==="default"?Hn(t,l,o):mu(t,l,o)}function bs(t){let a=t.bytesFilled,o=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,a/o)}function Fr(t,a,o,l){t._queue.push({buffer:a,byteOffset:o,byteLength:l}),t._queueTotalSize+=l}function _s(t,a,o,l){let f;try{f=fs(a,o,o+l)}catch(y){throw pe(t,y),y}Fr(t,f,0,l)}function gs(t,a){a.bytesFilled>0&&_s(t,a.buffer,a.byteOffset,a.bytesFilled),Vt(t)}function ws(t,a){let o=Math.min(t._queueTotalSize,a.byteLength-a.bytesFilled),l=a.bytesFilled+o,f=o,y=!1,b=l%a.elementSize,S=l-b;S>=a.minimumFill&&(f=S-a.bytesFilled,y=!0);let O=t._queue;for(;f>0;){let C=O.peek(),B=Math.min(f,C.byteLength),W=a.byteOffset+a.bytesFilled;ds(a.buffer,W,C.buffer,C.byteOffset,B),C.byteLength===B?O.shift():(C.byteOffset+=B,C.byteLength-=B),t._queueTotalSize-=B,Ss(t,B,a),f-=B}return y}function Ss(t,a,o){o.bytesFilled+=a}function vs(t){t._queueTotalSize===0&&t._closeRequested?(Ur(t),vr(t._controlledReadableByteStream)):_t(t)}function ra(t){t._byobRequest!==null&&(t._byobRequest._associatedReadableByteStreamController=void 0,t._byobRequest._view=null,t._byobRequest=null)}function na(t){for(;t._pendingPullIntos.length>0;){if(t._queueTotalSize===0)return;let a=t._pendingPullIntos.peek();ws(t,a)&&(Vt(t),ta(t._controlledReadableByteStream,a))}}function au(t){let a=t._controlledReadableByteStream._reader;for(;a._readRequests.length>0;){if(t._queueTotalSize===0)return;let o=a._readRequests.shift();Ts(t,o)}}function su(t,a,o,l){let f=t._controlledReadableByteStream,y=a.constructor,b=nu(y),{byteOffset:S,byteLength:O}=a,C=o*b,B;try{B=We(a.buffer)}catch(F){l._errorSteps(F);return}let W={buffer:B,bufferByteLength:B.byteLength,byteOffset:S,byteLength:O,bytesFilled:0,minimumFill:C,elementSize:b,viewConstructor:y,readerType:"byob"};if(t._pendingPullIntos.length>0){t._pendingPullIntos.push(W),Ps(f,l);return}if(f._state==="closed"){let F=new y(W.buffer,W.byteOffset,0);l._closeSteps(F);return}if(t._queueTotalSize>0){if(ws(t,W)){let F=bs(W);vs(t),l._chunkSteps(F);return}if(t._closeRequested){let F=new TypeError("Insufficient bytes to fill elements in the given buffer");pe(t,F),l._errorSteps(F);return}}t._pendingPullIntos.push(W),Ps(f,l),_t(t)}function iu(t,a){a.readerType==="none"&&Vt(t);let o=t._controlledReadableByteStream;if(ia(o))for(;xs(o)>0;){let l=Vt(t);ta(o,l)}}function ou(t,a,o){if(Ss(t,a,o),o.readerType==="none"){gs(t,o),na(t);return}if(o.bytesFilled<o.minimumFill)return;Vt(t);let l=o.bytesFilled%o.elementSize;if(l>0){let f=o.byteOffset+o.bytesFilled;_s(t,o.buffer,f-l,l)}o.bytesFilled-=l,ta(t._controlledReadableByteStream,o),na(t)}function Rs(t,a){let o=t._pendingPullIntos.peek();ra(t),t._controlledReadableByteStream._state==="closed"?iu(t,o):ou(t,a,o),_t(t)}function Vt(t){return t._pendingPullIntos.shift()}function uu(t){let a=t._controlledReadableByteStream;return a._state!=="readable"||t._closeRequested||!t._started?!1:!!(as(a)&&zr(a)>0||ia(a)&&xs(a)>0||Es(t)>0)}function Ur(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function pr(t){let a=t._controlledReadableByteStream;if(!(t._closeRequested||a._state!=="readable")){if(t._queueTotalSize>0){t._closeRequested=!0;return}if(t._pendingPullIntos.length>0){let o=t._pendingPullIntos.peek();if(o.bytesFilled%o.elementSize!==0){let l=new TypeError("Insufficient bytes to fill elements in the given buffer");throw pe(t,l),l}}Ur(t),vr(a)}}function Vr(t,a){let o=t._controlledReadableByteStream;if(t._closeRequested||o._state!=="readable")return;let{buffer:l,byteOffset:f,byteLength:y}=a;if(Xe(l))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let b=We(l);if(t._pendingPullIntos.length>0){let S=t._pendingPullIntos.peek();if(Xe(S.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");ra(t),S.buffer=We(S.buffer),S.readerType==="none"&&gs(t,S)}if(as(o))if(au(t),zr(o)===0)Fr(t,b,f,y);else{t._pendingPullIntos.length>0&&Vt(t);let S=new Uint8Array(b,f,y);Hn(o,S,!1)}else ia(o)?(Fr(t,b,f,y),na(t)):Fr(t,b,f,y);_t(t)}function pe(t,a){let o=t._controlledReadableByteStream;o._state==="readable"&&(ys(t),et(t),Ur(t),Xs(o,a))}function Ts(t,a){let o=t._queue.shift();t._queueTotalSize-=o.byteLength,vs(t);let l=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);a._chunkSteps(l)}function aa(t){if(t._byobRequest===null&&t._pendingPullIntos.length>0){let a=t._pendingPullIntos.peek(),o=new Uint8Array(a.buffer,a.byteOffset+a.bytesFilled,a.byteLength-a.bytesFilled),l=Object.create(yt.prototype);cu(l,t,o),t._byobRequest=l}return t._byobRequest}function Es(t){let a=t._controlledReadableByteStream._state;return a==="errored"?null:a==="closed"?0:t._strategyHWM-t._queueTotalSize}function Zr(t,a){let o=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(a!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(a===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(o.bytesFilled+a>o.byteLength)throw new RangeError("bytesWritten out of range")}o.buffer=We(o.buffer),Rs(t,a)}function Hr(t,a){let o=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(a.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(a.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(o.byteOffset+o.bytesFilled!==a.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(o.bufferByteLength!==a.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(o.bytesFilled+a.byteLength>o.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let f=a.byteLength;o.buffer=We(a.buffer),Rs(t,f)}function Cs(t,a,o,l,f,y,b){a._controlledReadableByteStream=t,a._pullAgain=!1,a._pulling=!1,a._byobRequest=null,a._queue=a._queueTotalSize=void 0,et(a),a._closeRequested=!1,a._started=!1,a._strategyHWM=y,a._pullAlgorithm=l,a._cancelAlgorithm=f,a._autoAllocateChunkSize=b,a._pendingPullIntos=new M,t._readableStreamController=a;let S=o();R(h(S),()=>(a._started=!0,_t(a),null),O=>(pe(a,O),null))}function lu(t,a,o){let l=Object.create(je.prototype),f,y,b;a.start!==void 0?f=()=>a.start(l):f=()=>{},a.pull!==void 0?y=()=>a.pull(l):y=()=>h(void 0),a.cancel!==void 0?b=O=>a.cancel(O):b=()=>h(void 0);let S=a.autoAllocateChunkSize;if(S===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Cs(t,l,f,y,b,o,S)}function cu(t,a,o){t._associatedReadableByteStreamController=a,t._view=o}function sa(t){return new TypeError(`ReadableStreamBYOBRequest.prototype.${t} can only be used on a ReadableStreamBYOBRequest`)}function yr(t){return new TypeError(`ReadableByteStreamController.prototype.${t} can only be used on a ReadableByteStreamController`)}function du(t,a){Ce(t,a);let o=t?.mode;return{mode:o===void 0?void 0:fu(o,`${a} has member 'mode' that`)}}function fu(t,a){if(t=`${t}`,t!=="byob")throw new TypeError(`${a} '${t}' is not a valid enumeration value for ReadableStreamReaderMode`);return t}function hu(t,a){var o;Ce(t,a);let l=(o=t?.min)!==null&&o!==void 0?o:1;return{min:Vn(l,`${a} has member 'min' that`)}}function ks(t){return new tt(t)}function Ps(t,a){t._reader._readIntoRequests.push(a)}function mu(t,a,o){let f=t._reader._readIntoRequests.shift();o?f._closeSteps(a):f._chunkSteps(a)}function xs(t){return t._reader._readIntoRequests.length}function ia(t){let a=t._reader;return!(a===void 0||!gt(a))}class tt{constructor(a){if(De(a,1,"ReadableStreamBYOBReader"),Zn(a,"First parameter"),at(a))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!bt(a._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Ja(this,a),this._readIntoRequests=new M}get closed(){return gt(this)?this._closedPromise:p(Yr("closed"))}cancel(a=void 0){return gt(this)?this._ownerReadableStream===void 0?p(Nr("cancel")):zn(this,a):p(Yr("cancel"))}read(a,o={}){if(!gt(this))return p(Yr("read"));if(!ArrayBuffer.isView(a))return p(new TypeError("view must be an array buffer view"));if(a.byteLength===0)return p(new TypeError("view must have non-zero byteLength"));if(a.buffer.byteLength===0)return p(new TypeError("view's buffer must have non-zero byteLength"));if(Xe(a.buffer))return p(new TypeError("view's buffer has been detached"));let l;try{l=hu(o,"options")}catch(C){return p(C)}let f=l.min;if(f===0)return p(new TypeError("options.min must be greater than 0"));if(ru(a)){if(f>a.byteLength)return p(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(f>a.length)return p(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return p(Nr("read from"));let y,b,S=m((C,B)=>{y=C,b=B});return As(this,a,f,{_chunkSteps:C=>y({value:C,done:!1}),_closeSteps:C=>y({value:C,done:!0}),_errorSteps:C=>b(C)}),S}releaseLock(){if(!gt(this))throw Yr("releaseLock");this._ownerReadableStream!==void 0&&pu(this)}}Object.defineProperties(tt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(tt.prototype.cancel,"cancel"),i(tt.prototype.read,"read"),i(tt.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function gt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")?!1:t instanceof tt}function As(t,a,o,l){let f=t._ownerReadableStream;f._disturbed=!0,f._state==="errored"?l._errorSteps(f._storedError):su(f._readableStreamController,a,o,l)}function pu(t){Ie(t);let a=new TypeError("Reader was released");Os(t,a)}function Os(t,a){let o=t._readIntoRequests;t._readIntoRequests=new M,o.forEach(l=>{l._errorSteps(a)})}function Yr(t){return new TypeError(`ReadableStreamBYOBReader.prototype.${t} can only be used on a ReadableStreamBYOBReader`)}function br(t,a){let{highWaterMark:o}=t;if(o===void 0)return a;if(cs(o)||o<0)throw new RangeError("Invalid highWaterMark");return o}function Qr(t){let{size:a}=t;return a||(()=>1)}function Gr(t,a){Ce(t,a);let o=t?.highWaterMark,l=t?.size;return{highWaterMark:o===void 0?void 0:Un(o),size:l===void 0?void 0:yu(l,`${a} has member 'size' that`)}}function yu(t,a){return me(t,a),o=>Un(t(o))}function bu(t,a){Ce(t,a);let o=t?.abort,l=t?.close,f=t?.start,y=t?.type,b=t?.write;return{abort:o===void 0?void 0:_u(o,t,`${a} has member 'abort' that`),close:l===void 0?void 0:gu(l,t,`${a} has member 'close' that`),start:f===void 0?void 0:wu(f,t,`${a} has member 'start' that`),write:b===void 0?void 0:Su(b,t,`${a} has member 'write' that`),type:y}}function _u(t,a,o){return me(t,o),l=>J(t,a,[l])}function gu(t,a,o){return me(t,o),()=>J(t,a,[])}function wu(t,a,o){return me(t,o),l=>H(t,a,[l])}function Su(t,a,o){return me(t,o),(l,f)=>J(t,a,[l,f])}function Bs(t,a){if(!Zt(t))throw new TypeError(`${a} is not a WritableStream.`)}function vu(t){if(typeof t!="object"||t===null)return!1;try{return typeof t.aborted=="boolean"}catch{return!1}}let Ru=typeof AbortController=="function";function Tu(){if(Ru)return new AbortController}class rt{constructor(a={},o={}){a===void 0?a=null:ts(a,"First parameter");let l=Gr(o,"Second parameter"),f=bu(a,"First parameter");if(Ds(this),f.type!==void 0)throw new RangeError("Invalid type is specified");let b=Qr(l),S=br(l,1);qu(this,f,S,b)}get locked(){if(!Zt(this))throw tn("locked");return Ht(this)}abort(a=void 0){return Zt(this)?Ht(this)?p(new TypeError("Cannot abort a stream that already has a writer")):Jr(this,a):p(tn("abort"))}close(){return Zt(this)?Ht(this)?p(new TypeError("Cannot close a stream that already has a writer")):ke(this)?p(new TypeError("Cannot close an already-closing stream")):Ws(this):p(tn("close"))}getWriter(){if(!Zt(this))throw tn("getWriter");return Is(this)}}Object.defineProperties(rt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(rt.prototype.abort,"abort"),i(rt.prototype.close,"close"),i(rt.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rt.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Is(t){return new Le(t)}function Eu(t,a,o,l,f=1,y=()=>1){let b=Object.create(rt.prototype);Ds(b);let S=Object.create(Yt.prototype);return $s(b,S,t,a,o,l,f,y),b}function Ds(t){t._state="writable",t._storedError=void 0,t._writer=void 0,t._writableStreamController=void 0,t._writeRequests=new M,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function Zt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")?!1:t instanceof rt}function Ht(t){return t._writer!==void 0}function Jr(t,a){var o;if(t._state==="closed"||t._state==="errored")return h(void 0);t._writableStreamController._abortReason=a,(o=t._writableStreamController._abortController)===null||o===void 0||o.abort(a);let l=t._state;if(l==="closed"||l==="errored")return h(void 0);if(t._pendingAbortRequest!==void 0)return t._pendingAbortRequest._promise;let f=!1;l==="erroring"&&(f=!0,a=void 0);let y=m((b,S)=>{t._pendingAbortRequest={_promise:void 0,_resolve:b,_reject:S,_reason:a,_wasAlreadyErroring:f}});return t._pendingAbortRequest._promise=y,f||ua(t,a),y}function Ws(t){let a=t._state;if(a==="closed"||a==="errored")return p(new TypeError(`The stream (in ${a} state) is not in the writable state and cannot be closed`));let o=m((f,y)=>{let b={_resolve:f,_reject:y};t._closeRequest=b}),l=t._writer;return l!==void 0&&t._backpressure&&a==="writable"&&ya(l),Nu(t._writableStreamController),o}function Cu(t){return m((o,l)=>{let f={_resolve:o,_reject:l};t._writeRequests.push(f)})}function oa(t,a){if(t._state==="writable"){ua(t,a);return}la(t)}function ua(t,a){let o=t._writableStreamController;t._state="erroring",t._storedError=a;let l=t._writer;l!==void 0&&Ls(l,a),!Ou(t)&&o._started&&la(t)}function la(t){t._state="errored",t._writableStreamController[Ge]();let a=t._storedError;if(t._writeRequests.forEach(f=>{f._reject(a)}),t._writeRequests=new M,t._pendingAbortRequest===void 0){Kr(t);return}let o=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,o._wasAlreadyErroring){o._reject(a),Kr(t);return}let l=t._writableStreamController[Y](o._reason);R(l,()=>(o._resolve(),Kr(t),null),f=>(o._reject(f),Kr(t),null))}function ku(t){t._inFlightWriteRequest._resolve(void 0),t._inFlightWriteRequest=void 0}function Pu(t,a){t._inFlightWriteRequest._reject(a),t._inFlightWriteRequest=void 0,oa(t,a)}function xu(t){t._inFlightCloseRequest._resolve(void 0),t._inFlightCloseRequest=void 0,t._state==="erroring"&&(t._storedError=void 0,t._pendingAbortRequest!==void 0&&(t._pendingAbortRequest._resolve(),t._pendingAbortRequest=void 0)),t._state="closed";let o=t._writer;o!==void 0&&Vs(o)}function Au(t,a){t._inFlightCloseRequest._reject(a),t._inFlightCloseRequest=void 0,t._pendingAbortRequest!==void 0&&(t._pendingAbortRequest._reject(a),t._pendingAbortRequest=void 0),oa(t,a)}function ke(t){return!(t._closeRequest===void 0&&t._inFlightCloseRequest===void 0)}function Ou(t){return!(t._inFlightWriteRequest===void 0&&t._inFlightCloseRequest===void 0)}function Bu(t){t._inFlightCloseRequest=t._closeRequest,t._closeRequest=void 0}function Iu(t){t._inFlightWriteRequest=t._writeRequests.shift()}function Kr(t){t._closeRequest!==void 0&&(t._closeRequest._reject(t._storedError),t._closeRequest=void 0);let a=t._writer;a!==void 0&&ma(a,t._storedError)}function ca(t,a){let o=t._writer;o!==void 0&&a!==t._backpressure&&(a?Zu(o):ya(o)),t._backpressure=a}class Le{constructor(a){if(De(a,1,"WritableStreamDefaultWriter"),Bs(a,"First parameter"),Ht(a))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=a,a._writer=this;let o=a._state;if(o==="writable")!ke(a)&&a._backpressure?nn(this):Zs(this),rn(this);else if(o==="erroring")pa(this,a._storedError),rn(this);else if(o==="closed")Zs(this),Uu(this);else{let l=a._storedError;pa(this,l),Us(this,l)}}get closed(){return wt(this)?this._closedPromise:p(St("closed"))}get desiredSize(){if(!wt(this))throw St("desiredSize");if(this._ownerWritableStream===void 0)throw gr("desiredSize");return Lu(this)}get ready(){return wt(this)?this._readyPromise:p(St("ready"))}abort(a=void 0){return wt(this)?this._ownerWritableStream===void 0?p(gr("abort")):Du(this,a):p(St("abort"))}close(){if(!wt(this))return p(St("close"));let a=this._ownerWritableStream;return a===void 0?p(gr("close")):ke(a)?p(new TypeError("Cannot close an already-closing stream")):js(this)}releaseLock(){if(!wt(this))throw St("releaseLock");this._ownerWritableStream!==void 0&&qs(this)}write(a=void 0){return wt(this)?this._ownerWritableStream===void 0?p(gr("write to")):Ns(this,a):p(St("write"))}}Object.defineProperties(Le.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Le.prototype.abort,"abort"),i(Le.prototype.close,"close"),i(Le.prototype.releaseLock,"releaseLock"),i(Le.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Le.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function wt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")?!1:t instanceof Le}function Du(t,a){let o=t._ownerWritableStream;return Jr(o,a)}function js(t){let a=t._ownerWritableStream;return Ws(a)}function Wu(t){let a=t._ownerWritableStream,o=a._state;return ke(a)||o==="closed"?h(void 0):o==="errored"?p(a._storedError):js(t)}function ju(t,a){t._closedPromiseState==="pending"?ma(t,a):Vu(t,a)}function Ls(t,a){t._readyPromiseState==="pending"?Hs(t,a):Hu(t,a)}function Lu(t){let a=t._ownerWritableStream,o=a._state;return o==="errored"||o==="erroring"?null:o==="closed"?0:Ms(a._writableStreamController)}function qs(t){let a=t._ownerWritableStream,o=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ls(t,o),ju(t,o),a._writer=void 0,t._ownerWritableStream=void 0}function Ns(t,a){let o=t._ownerWritableStream,l=o._writableStreamController,f=zu(l,a);if(o!==t._ownerWritableStream)return p(gr("write to"));let y=o._state;if(y==="errored")return p(o._storedError);if(ke(o)||y==="closed")return p(new TypeError("The stream is closing or closed and cannot be written to"));if(y==="erroring")return p(o._storedError);let b=Cu(o);return $u(l,a,f),b}let zs={};class Yt{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!da(this))throw ha("abortReason");return this._abortReason}get signal(){if(!da(this))throw ha("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(a=void 0){if(!da(this))throw ha("error");this._controlledWritableStream._state==="writable"&&Fs(this,a)}[Y](a){let o=this._abortAlgorithm(a);return Xr(this),o}[Ge](){et(this)}}Object.defineProperties(Yt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Yt.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function da(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")?!1:t instanceof Yt}function $s(t,a,o,l,f,y,b,S){a._controlledWritableStream=t,t._writableStreamController=a,a._queue=void 0,a._queueTotalSize=void 0,et(a),a._abortReason=void 0,a._abortController=Tu(),a._started=!1,a._strategySizeAlgorithm=S,a._strategyHWM=b,a._writeAlgorithm=l,a._closeAlgorithm=f,a._abortAlgorithm=y;let O=fa(a);ca(t,O);let C=o(),B=h(C);R(B,()=>(a._started=!0,en(a),null),W=>(a._started=!0,oa(t,W),null))}function qu(t,a,o,l){let f=Object.create(Yt.prototype),y,b,S,O;a.start!==void 0?y=()=>a.start(f):y=()=>{},a.write!==void 0?b=C=>a.write(C,f):b=()=>h(void 0),a.close!==void 0?S=()=>a.close():S=()=>h(void 0),a.abort!==void 0?O=C=>a.abort(C):O=()=>h(void 0),$s(t,f,y,b,S,O,o,l)}function Xr(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Nu(t){Xn(t,zs,0),en(t)}function zu(t,a){try{return t._strategySizeAlgorithm(a)}catch(o){return _r(t,o),1}}function Ms(t){return t._strategyHWM-t._queueTotalSize}function $u(t,a,o){try{Xn(t,a,o)}catch(f){_r(t,f);return}let l=t._controlledWritableStream;if(!ke(l)&&l._state==="writable"){let f=fa(t);ca(l,f)}en(t)}function en(t){let a=t._controlledWritableStream;if(!t._started||a._inFlightWriteRequest!==void 0)return;if(a._state==="erroring"){la(a);return}if(t._queue.length===0)return;let l=tu(t);l===zs?Mu(t):Fu(t,l)}function _r(t,a){t._controlledWritableStream._state==="writable"&&Fs(t,a)}function Mu(t){let a=t._controlledWritableStream;Bu(a),Kn(t);let o=t._closeAlgorithm();Xr(t),R(o,()=>(xu(a),null),l=>(Au(a,l),null))}function Fu(t,a){let o=t._controlledWritableStream;Iu(o);let l=t._writeAlgorithm(a);R(l,()=>{ku(o);let f=o._state;if(Kn(t),!ke(o)&&f==="writable"){let y=fa(t);ca(o,y)}return en(t),null},f=>(o._state==="writable"&&Xr(t),Pu(o,f),null))}function fa(t){return Ms(t)<=0}function Fs(t,a){let o=t._controlledWritableStream;Xr(t),ua(o,a)}function tn(t){return new TypeError(`WritableStream.prototype.${t} can only be used on a WritableStream`)}function ha(t){return new TypeError(`WritableStreamDefaultController.prototype.${t} can only be used on a WritableStreamDefaultController`)}function St(t){return new TypeError(`WritableStreamDefaultWriter.prototype.${t} can only be used on a WritableStreamDefaultWriter`)}function gr(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function rn(t){t._closedPromise=m((a,o)=>{t._closedPromise_resolve=a,t._closedPromise_reject=o,t._closedPromiseState="pending"})}function Us(t,a){rn(t),ma(t,a)}function Uu(t){rn(t),Vs(t)}function ma(t,a){t._closedPromise_reject!==void 0&&(T(t._closedPromise),t._closedPromise_reject(a),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="rejected")}function Vu(t,a){Us(t,a)}function Vs(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved")}function nn(t){t._readyPromise=m((a,o)=>{t._readyPromise_resolve=a,t._readyPromise_reject=o}),t._readyPromiseState="pending"}function pa(t,a){nn(t),Hs(t,a)}function Zs(t){nn(t),ya(t)}function Hs(t,a){t._readyPromise_reject!==void 0&&(T(t._readyPromise),t._readyPromise_reject(a),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="rejected")}function Zu(t){nn(t)}function Hu(t,a){pa(t,a)}function ya(t){t._readyPromise_resolve!==void 0&&(t._readyPromise_resolve(void 0),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="fulfilled")}function Yu(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}let ba=Yu();function Qu(t){if(!(typeof t=="function"||typeof t=="object")||t.name!=="DOMException")return!1;try{return new t,!0}catch{return!1}}function Gu(){let t=ba?.DOMException;return Qu(t)?t:void 0}function Ju(){let t=function(o,l){this.message=o||"",this.name=l||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return i(t,"DOMException"),t.prototype=Object.create(Error.prototype),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,configurable:!0}),t}let Ku=Gu()||Ju();function Ys(t,a,o,l,f,y){let b=Ut(t),S=Is(a);t._disturbed=!0;let O=!1,C=h(void 0);return m((B,W)=>{let F;if(y!==void 0){if(F=()=>{let P=y.reason!==void 0?y.reason:new Ku("Aborted","AbortError"),q=[];l||q.push(()=>a._state==="writable"?Jr(a,P):h(void 0)),f||q.push(()=>t._state==="readable"?Se(t,P):h(void 0)),ne(()=>Promise.all(q.map(U=>U())),!0,P)},y.aborted){F();return}y.addEventListener("abort",F)}function ve(){return m((P,q)=>{function U(oe){oe?P():k(Kt(),U,q)}U(!1)})}function Kt(){return O?h(!0):k(S._readyPromise,()=>m((P,q)=>{hr(b,{_chunkSteps:U=>{C=k(Ns(S,U),void 0,e),P(!1)},_closeSteps:()=>P(!0),_errorSteps:q})}))}if(Ne(t,b._closedPromise,P=>(l?ye(!0,P):ne(()=>Jr(a,P),!0,P),null)),Ne(a,S._closedPromise,P=>(f?ye(!0,P):ne(()=>Se(t,P),!0,P),null)),ee(t,b._closedPromise,()=>(o?ye():ne(()=>Wu(S)),null)),ke(a)||a._state==="closed"){let P=new TypeError("the destination writable stream closed before all data could be piped to it");f?ye(!0,P):ne(()=>Se(t,P),!0,P)}T(ve());function it(){let P=C;return k(C,()=>P!==C?it():void 0)}function Ne(P,q,U){P._state==="errored"?U(P._storedError):g(q,U)}function ee(P,q,U){P._state==="closed"?U():L(q,U)}function ne(P,q,U){if(O)return;O=!0,a._state==="writable"&&!ke(a)?L(it(),oe):oe();function oe(){return R(P(),()=>ze(q,U),Xt=>ze(!0,Xt)),null}}function ye(P,q){O||(O=!0,a._state==="writable"&&!ke(a)?L(it(),()=>ze(P,q)):ze(P,q))}function ze(P,q){return qs(S),Ie(b),y!==void 0&&y.removeEventListener("abort",F),P?W(q):B(void 0),null}})}class qe{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!an(this))throw on("desiredSize");return _a(this)}close(){if(!an(this))throw on("close");if(!Gt(this))throw new TypeError("The stream is not in a state that permits close");vt(this)}enqueue(a=void 0){if(!an(this))throw on("enqueue");if(!Gt(this))throw new TypeError("The stream is not in a state that permits enqueue");return Qt(this,a)}error(a=void 0){if(!an(this))throw on("error");we(this,a)}[fr](a){et(this);let o=this._cancelAlgorithm(a);return sn(this),o}[qn](a){let o=this._controlledReadableStream;if(this._queue.length>0){let l=Kn(this);this._closeRequested&&this._queue.length===0?(sn(this),vr(o)):wr(this),a._chunkSteps(l)}else ns(o,a),wr(this)}[Nn](){}}Object.defineProperties(qe.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(qe.prototype.close,"close"),i(qe.prototype.enqueue,"enqueue"),i(qe.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(qe.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function an(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")?!1:t instanceof qe}function wr(t){if(!Qs(t))return;if(t._pulling){t._pullAgain=!0;return}t._pulling=!0;let o=t._pullAlgorithm();R(o,()=>(t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,wr(t)),null),l=>(we(t,l),null))}function Qs(t){let a=t._controlledReadableStream;return!Gt(t)||!t._started?!1:!!(at(a)&&zr(a)>0||_a(t)>0)}function sn(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function vt(t){if(!Gt(t))return;let a=t._controlledReadableStream;t._closeRequested=!0,t._queue.length===0&&(sn(t),vr(a))}function Qt(t,a){if(!Gt(t))return;let o=t._controlledReadableStream;if(at(o)&&zr(o)>0)Hn(o,a,!1);else{let l;try{l=t._strategySizeAlgorithm(a)}catch(f){throw we(t,f),f}try{Xn(t,a,l)}catch(f){throw we(t,f),f}}wr(t)}function we(t,a){let o=t._controlledReadableStream;o._state==="readable"&&(et(t),sn(t),Xs(o,a))}function _a(t){let a=t._controlledReadableStream._state;return a==="errored"?null:a==="closed"?0:t._strategyHWM-t._queueTotalSize}function Xu(t){return!Qs(t)}function Gt(t){let a=t._controlledReadableStream._state;return!t._closeRequested&&a==="readable"}function Gs(t,a,o,l,f,y,b){a._controlledReadableStream=t,a._queue=void 0,a._queueTotalSize=void 0,et(a),a._started=!1,a._closeRequested=!1,a._pullAgain=!1,a._pulling=!1,a._strategySizeAlgorithm=b,a._strategyHWM=y,a._pullAlgorithm=l,a._cancelAlgorithm=f,t._readableStreamController=a;let S=o();R(h(S),()=>(a._started=!0,wr(a),null),O=>(we(a,O),null))}function el(t,a,o,l){let f=Object.create(qe.prototype),y,b,S;a.start!==void 0?y=()=>a.start(f):y=()=>{},a.pull!==void 0?b=()=>a.pull(f):b=()=>h(void 0),a.cancel!==void 0?S=O=>a.cancel(O):S=()=>h(void 0),Gs(t,f,y,b,S,o,l)}function on(t){return new TypeError(`ReadableStreamDefaultController.prototype.${t} can only be used on a ReadableStreamDefaultController`)}function tl(t,a){return bt(t._readableStreamController)?nl(t):rl(t)}function rl(t,a){let o=Ut(t),l=!1,f=!1,y=!1,b=!1,S,O,C,B,W,F=m(ee=>{W=ee});function ve(){return l?(f=!0,h(void 0)):(l=!0,hr(o,{_chunkSteps:ne=>{j(()=>{f=!1;let ye=ne,ze=ne;y||Qt(C._readableStreamController,ye),b||Qt(B._readableStreamController,ze),l=!1,f&&ve()})},_closeSteps:()=>{l=!1,y||vt(C._readableStreamController),b||vt(B._readableStreamController),(!y||!b)&&W(void 0)},_errorSteps:()=>{l=!1}}),h(void 0))}function Kt(ee){if(y=!0,S=ee,b){let ne=mr([S,O]),ye=Se(t,ne);W(ye)}return F}function it(ee){if(b=!0,O=ee,y){let ne=mr([S,O]),ye=Se(t,ne);W(ye)}return F}function Ne(){}return C=Sr(Ne,ve,Kt),B=Sr(Ne,ve,it),g(o._closedPromise,ee=>(we(C._readableStreamController,ee),we(B._readableStreamController,ee),(!y||!b)&&W(void 0),null)),[C,B]}function nl(t){let a=Ut(t),o=!1,l=!1,f=!1,y=!1,b=!1,S,O,C,B,W,F=m(P=>{W=P});function ve(P){g(P._closedPromise,q=>(P!==a||(pe(C._readableStreamController,q),pe(B._readableStreamController,q),(!y||!b)&&W(void 0)),null))}function Kt(){gt(a)&&(Ie(a),a=Ut(t),ve(a)),hr(a,{_chunkSteps:q=>{j(()=>{l=!1,f=!1;let U=q,oe=q;if(!y&&!b)try{oe=ms(q)}catch(Xt){pe(C._readableStreamController,Xt),pe(B._readableStreamController,Xt),W(Se(t,Xt));return}y||Vr(C._readableStreamController,U),b||Vr(B._readableStreamController,oe),o=!1,l?Ne():f&&ee()})},_closeSteps:()=>{o=!1,y||pr(C._readableStreamController),b||pr(B._readableStreamController),C._readableStreamController._pendingPullIntos.length>0&&Zr(C._readableStreamController,0),B._readableStreamController._pendingPullIntos.length>0&&Zr(B._readableStreamController,0),(!y||!b)&&W(void 0)},_errorSteps:()=>{o=!1}})}function it(P,q){Ke(a)&&(Ie(a),a=ks(t),ve(a));let U=q?B:C,oe=q?C:B;As(a,P,1,{_chunkSteps:er=>{j(()=>{l=!1,f=!1;let tr=q?b:y;if(q?y:b)tr||Hr(U._readableStreamController,er);else{let fi;try{fi=ms(er)}catch(Ra){pe(U._readableStreamController,Ra),pe(oe._readableStreamController,Ra),W(Se(t,Ra));return}tr||Hr(U._readableStreamController,er),Vr(oe._readableStreamController,fi)}o=!1,l?Ne():f&&ee()})},_closeSteps:er=>{o=!1;let tr=q?b:y,pn=q?y:b;tr||pr(U._readableStreamController),pn||pr(oe._readableStreamController),er!==void 0&&(tr||Hr(U._readableStreamController,er),!pn&&oe._readableStreamController._pendingPullIntos.length>0&&Zr(oe._readableStreamController,0)),(!tr||!pn)&&W(void 0)},_errorSteps:()=>{o=!1}})}function Ne(){if(o)return l=!0,h(void 0);o=!0;let P=aa(C._readableStreamController);return P===null?Kt():it(P._view,!1),h(void 0)}function ee(){if(o)return f=!0,h(void 0);o=!0;let P=aa(B._readableStreamController);return P===null?Kt():it(P._view,!0),h(void 0)}function ne(P){if(y=!0,S=P,b){let q=mr([S,O]),U=Se(t,q);W(U)}return F}function ye(P){if(b=!0,O=P,y){let q=mr([S,O]),U=Se(t,q);W(U)}return F}function ze(){}return C=Ks(ze,Ne,ne),B=Ks(ze,ee,ye),ve(a),[C,B]}function al(t){return r(t)&&typeof t.getReader<"u"}function sl(t){return al(t)?ol(t.getReader()):il(t)}function il(t){let a,o=hs(t,"async"),l=e;function f(){let b;try{b=Jo(o)}catch(O){return p(O)}let S=h(b);return z(S,O=>{if(!r(O))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Ko(O))vt(a._readableStreamController);else{let B=Xo(O);Qt(a._readableStreamController,B)}})}function y(b){let S=o.iterator,O;try{O=Mr(S,"return")}catch(W){return p(W)}if(O===void 0)return h(void 0);let C;try{C=H(O,S,[b])}catch(W){return p(W)}let B=h(C);return z(B,W=>{if(!r(W))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return a=Sr(l,f,y,0),a}function ol(t){let a,o=e;function l(){let y;try{y=t.read()}catch(b){return p(b)}return z(y,b=>{if(!r(b))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(b.done)vt(a._readableStreamController);else{let S=b.value;Qt(a._readableStreamController,S)}})}function f(y){try{return h(t.cancel(y))}catch(b){return p(b)}}return a=Sr(o,l,f,0),a}function ul(t,a){Ce(t,a);let o=t,l=o?.autoAllocateChunkSize,f=o?.cancel,y=o?.pull,b=o?.start,S=o?.type;return{autoAllocateChunkSize:l===void 0?void 0:Vn(l,`${a} has member 'autoAllocateChunkSize' that`),cancel:f===void 0?void 0:ll(f,o,`${a} has member 'cancel' that`),pull:y===void 0?void 0:cl(y,o,`${a} has member 'pull' that`),start:b===void 0?void 0:dl(b,o,`${a} has member 'start' that`),type:S===void 0?void 0:fl(S,`${a} has member 'type' that`)}}function ll(t,a,o){return me(t,o),l=>J(t,a,[l])}function cl(t,a,o){return me(t,o),l=>J(t,a,[l])}function dl(t,a,o){return me(t,o),l=>H(t,a,[l])}function fl(t,a){if(t=`${t}`,t!=="bytes")throw new TypeError(`${a} '${t}' is not a valid enumeration value for ReadableStreamType`);return t}function hl(t,a){return Ce(t,a),{preventCancel:!!t?.preventCancel}}function Js(t,a){Ce(t,a);let o=t?.preventAbort,l=t?.preventCancel,f=t?.preventClose,y=t?.signal;return y!==void 0&&ml(y,`${a} has member 'signal' that`),{preventAbort:!!o,preventCancel:!!l,preventClose:!!f,signal:y}}function ml(t,a){if(!vu(t))throw new TypeError(`${a} is not an AbortSignal.`)}function pl(t,a){Ce(t,a);let o=t?.readable;Fn(o,"readable","ReadableWritablePair"),Zn(o,`${a} has member 'readable' that`);let l=t?.writable;return Fn(l,"writable","ReadableWritablePair"),Bs(l,`${a} has member 'writable' that`),{readable:o,writable:l}}class K{constructor(a={},o={}){a===void 0?a=null:ts(a,"First parameter");let l=Gr(o,"Second parameter"),f=ul(a,"First parameter");if(ga(this),f.type==="bytes"){if(l.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let y=br(l,0);lu(this,f,y)}else{let y=Qr(l),b=br(l,1);el(this,f,b,y)}}get locked(){if(!nt(this))throw Rt("locked");return at(this)}cancel(a=void 0){return nt(this)?at(this)?p(new TypeError("Cannot cancel a stream that already has a reader")):Se(this,a):p(Rt("cancel"))}getReader(a=void 0){if(!nt(this))throw Rt("getReader");return du(a,"First parameter").mode===void 0?Ut(this):ks(this)}pipeThrough(a,o={}){if(!nt(this))throw Rt("pipeThrough");De(a,1,"pipeThrough");let l=pl(a,"First parameter"),f=Js(o,"Second parameter");if(at(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ht(l.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let y=Ys(this,l.writable,f.preventClose,f.preventAbort,f.preventCancel,f.signal);return T(y),l.readable}pipeTo(a,o={}){if(!nt(this))return p(Rt("pipeTo"));if(a===void 0)return p("Parameter 1 is required in 'pipeTo'.");if(!Zt(a))return p(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let l;try{l=Js(o,"Second parameter")}catch(f){return p(f)}return at(this)?p(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ht(a)?p(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Ys(this,a,l.preventClose,l.preventAbort,l.preventCancel,l.signal)}tee(){if(!nt(this))throw Rt("tee");let a=tl(this);return mr(a)}values(a=void 0){if(!nt(this))throw Rt("values");let o=hl(a,"First parameter");return Qo(this,o.preventCancel)}[Jn](a){return this.values(a)}static from(a){return sl(a)}}Object.defineProperties(K,{from:{enumerable:!0}}),Object.defineProperties(K.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(K.from,"from"),i(K.prototype.cancel,"cancel"),i(K.prototype.getReader,"getReader"),i(K.prototype.pipeThrough,"pipeThrough"),i(K.prototype.pipeTo,"pipeTo"),i(K.prototype.tee,"tee"),i(K.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(K.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(K.prototype,Jn,{value:K.prototype.values,writable:!0,configurable:!0});function Sr(t,a,o,l=1,f=()=>1){let y=Object.create(K.prototype);ga(y);let b=Object.create(qe.prototype);return Gs(y,b,t,a,o,l,f),y}function Ks(t,a,o){let l=Object.create(K.prototype);ga(l);let f=Object.create(je.prototype);return Cs(l,f,t,a,o,0,void 0),l}function ga(t){t._state="readable",t._reader=void 0,t._storedError=void 0,t._disturbed=!1}function nt(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")?!1:t instanceof K}function at(t){return t._reader!==void 0}function Se(t,a){if(t._disturbed=!0,t._state==="closed")return h(void 0);if(t._state==="errored")return p(t._storedError);vr(t);let o=t._reader;if(o!==void 0&>(o)){let f=o._readIntoRequests;o._readIntoRequests=new M,f.forEach(y=>{y._closeSteps(void 0)})}let l=t._readableStreamController[fr](a);return z(l,e)}function vr(t){t._state="closed";let a=t._reader;if(a!==void 0&&(Xa(a),Ke(a))){let o=a._readRequests;a._readRequests=new M,o.forEach(l=>{l._closeSteps()})}}function Xs(t,a){t._state="errored",t._storedError=a;let o=t._reader;o!==void 0&&(Mn(o,a),Ke(o)?ss(o,a):Os(o,a))}function Rt(t){return new TypeError(`ReadableStream.prototype.${t} can only be used on a ReadableStream`)}function ei(t,a){Ce(t,a);let o=t?.highWaterMark;return Fn(o,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Un(o)}}let ti=t=>t.byteLength;i(ti,"size");class un{constructor(a){De(a,1,"ByteLengthQueuingStrategy"),a=ei(a,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=a.highWaterMark}get highWaterMark(){if(!ni(this))throw ri("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ni(this))throw ri("size");return ti}}Object.defineProperties(un.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(un.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function ri(t){return new TypeError(`ByteLengthQueuingStrategy.prototype.${t} can only be used on a ByteLengthQueuingStrategy`)}function ni(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_byteLengthQueuingStrategyHighWaterMark")?!1:t instanceof un}let ai=()=>1;i(ai,"size");class ln{constructor(a){De(a,1,"CountQueuingStrategy"),a=ei(a,"First parameter"),this._countQueuingStrategyHighWaterMark=a.highWaterMark}get highWaterMark(){if(!ii(this))throw si("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!ii(this))throw si("size");return ai}}Object.defineProperties(ln.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ln.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function si(t){return new TypeError(`CountQueuingStrategy.prototype.${t} can only be used on a CountQueuingStrategy`)}function ii(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_countQueuingStrategyHighWaterMark")?!1:t instanceof ln}function yl(t,a){Ce(t,a);let o=t?.cancel,l=t?.flush,f=t?.readableType,y=t?.start,b=t?.transform,S=t?.writableType;return{cancel:o===void 0?void 0:wl(o,t,`${a} has member 'cancel' that`),flush:l===void 0?void 0:bl(l,t,`${a} has member 'flush' that`),readableType:f,start:y===void 0?void 0:_l(y,t,`${a} has member 'start' that`),transform:b===void 0?void 0:gl(b,t,`${a} has member 'transform' that`),writableType:S}}function bl(t,a,o){return me(t,o),l=>J(t,a,[l])}function _l(t,a,o){return me(t,o),l=>H(t,a,[l])}function gl(t,a,o){return me(t,o),(l,f)=>J(t,a,[l,f])}function wl(t,a,o){return me(t,o),l=>J(t,a,[l])}class cn{constructor(a={},o={},l={}){a===void 0&&(a=null);let f=Gr(o,"Second parameter"),y=Gr(l,"Third parameter"),b=yl(a,"First parameter");if(b.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(b.writableType!==void 0)throw new RangeError("Invalid writableType specified");let S=br(y,0),O=Qr(y),C=br(f,1),B=Qr(f),W,F=m(ve=>{W=ve});Sl(this,F,C,B,S,O),Rl(this,b),b.start!==void 0?W(b.start(this._transformStreamController)):W(void 0)}get readable(){if(!oi(this))throw di("readable");return this._readable}get writable(){if(!oi(this))throw di("writable");return this._writable}}Object.defineProperties(cn.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cn.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function Sl(t,a,o,l,f,y){function b(){return a}function S(F){return Cl(t,F)}function O(F){return kl(t,F)}function C(){return Pl(t)}t._writable=Eu(b,S,C,O,o,l);function B(){return xl(t)}function W(F){return Al(t,F)}t._readable=Sr(b,B,W,f,y),t._backpressure=void 0,t._backpressureChangePromise=void 0,t._backpressureChangePromise_resolve=void 0,dn(t,!0),t._transformStreamController=void 0}function oi(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")?!1:t instanceof cn}function ui(t,a){we(t._readable._readableStreamController,a),wa(t,a)}function wa(t,a){hn(t._transformStreamController),_r(t._writable._writableStreamController,a),Sa(t)}function Sa(t){t._backpressure&&dn(t,!1)}function dn(t,a){t._backpressureChangePromise!==void 0&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=m(o=>{t._backpressureChangePromise_resolve=o}),t._backpressure=a}class st{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!fn(this))throw mn("desiredSize");let a=this._controlledTransformStream._readable._readableStreamController;return _a(a)}enqueue(a=void 0){if(!fn(this))throw mn("enqueue");li(this,a)}error(a=void 0){if(!fn(this))throw mn("error");Tl(this,a)}terminate(){if(!fn(this))throw mn("terminate");El(this)}}Object.defineProperties(st.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(st.prototype.enqueue,"enqueue"),i(st.prototype.error,"error"),i(st.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(st.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function fn(t){return!r(t)||!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")?!1:t instanceof st}function vl(t,a,o,l,f){a._controlledTransformStream=t,t._transformStreamController=a,a._transformAlgorithm=o,a._flushAlgorithm=l,a._cancelAlgorithm=f,a._finishPromise=void 0,a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0}function Rl(t,a){let o=Object.create(st.prototype),l,f,y;a.transform!==void 0?l=b=>a.transform(b,o):l=b=>{try{return li(o,b),h(void 0)}catch(S){return p(S)}},a.flush!==void 0?f=()=>a.flush(o):f=()=>h(void 0),a.cancel!==void 0?y=b=>a.cancel(b):y=()=>h(void 0),vl(t,o,l,f,y)}function hn(t){t._transformAlgorithm=void 0,t._flushAlgorithm=void 0,t._cancelAlgorithm=void 0}function li(t,a){let o=t._controlledTransformStream,l=o._readable._readableStreamController;if(!Gt(l))throw new TypeError("Readable side is not in a state that permits enqueue");try{Qt(l,a)}catch(y){throw wa(o,y),o._readable._storedError}Xu(l)!==o._backpressure&&dn(o,!0)}function Tl(t,a){ui(t._controlledTransformStream,a)}function ci(t,a){let o=t._transformAlgorithm(a);return z(o,void 0,l=>{throw ui(t._controlledTransformStream,l),l})}function El(t){let a=t._controlledTransformStream,o=a._readable._readableStreamController;vt(o);let l=new TypeError("TransformStream terminated");wa(a,l)}function Cl(t,a){let o=t._transformStreamController;if(t._backpressure){let l=t._backpressureChangePromise;return z(l,()=>{let f=t._writable;if(f._state==="erroring")throw f._storedError;return ci(o,a)})}return ci(o,a)}function kl(t,a){let o=t._transformStreamController;if(o._finishPromise!==void 0)return o._finishPromise;let l=t._readable;o._finishPromise=m((y,b)=>{o._finishPromise_resolve=y,o._finishPromise_reject=b});let f=o._cancelAlgorithm(a);return hn(o),R(f,()=>(l._state==="errored"?Jt(o,l._storedError):(we(l._readableStreamController,a),va(o)),null),y=>(we(l._readableStreamController,y),Jt(o,y),null)),o._finishPromise}function Pl(t){let a=t._transformStreamController;if(a._finishPromise!==void 0)return a._finishPromise;let o=t._readable;a._finishPromise=m((f,y)=>{a._finishPromise_resolve=f,a._finishPromise_reject=y});let l=a._flushAlgorithm();return hn(a),R(l,()=>(o._state==="errored"?Jt(a,o._storedError):(vt(o._readableStreamController),va(a)),null),f=>(we(o._readableStreamController,f),Jt(a,f),null)),a._finishPromise}function xl(t){return dn(t,!1),t._backpressureChangePromise}function Al(t,a){let o=t._transformStreamController;if(o._finishPromise!==void 0)return o._finishPromise;let l=t._writable;o._finishPromise=m((y,b)=>{o._finishPromise_resolve=y,o._finishPromise_reject=b});let f=o._cancelAlgorithm(a);return hn(o),R(f,()=>(l._state==="errored"?Jt(o,l._storedError):(_r(l._writableStreamController,a),Sa(t),va(o)),null),y=>(_r(l._writableStreamController,y),Sa(t),Jt(o,y),null)),o._finishPromise}function mn(t){return new TypeError(`TransformStreamDefaultController.prototype.${t} can only be used on a TransformStreamDefaultController`)}function va(t){t._finishPromise_resolve!==void 0&&(t._finishPromise_resolve(),t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0)}function Jt(t,a){t._finishPromise_reject!==void 0&&(T(t._finishPromise),t._finishPromise_reject(a),t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0)}function di(t){return new TypeError(`TransformStream.prototype.${t} can only be used on a TransformStream`)}n.ByteLengthQueuingStrategy=un,n.CountQueuingStrategy=ln,n.ReadableByteStreamController=je,n.ReadableStream=K,n.ReadableStreamBYOBReader=tt,n.ReadableStreamBYOBRequest=yt,n.ReadableStreamDefaultController=qe,n.ReadableStreamDefaultReader=Je,n.TransformStream=cn,n.TransformStreamDefaultController=st,n.WritableStream=rt,n.WritableStreamDefaultController=Yt,n.WritableStreamDefaultWriter=Le})});var Ei=$e(()=>{"use strict";if(!globalThis.ReadableStream)try{let n=Si(),{emitWarning:e}=n;try{n.emitWarning=()=>{},Object.assign(globalThis,vi()),n.emitWarning=e}catch(r){throw n.emitWarning=e,r}}catch{Object.assign(globalThis,Ti())}try{let{Blob:n}=hi("buffer");n&&!n.prototype.stream&&(n.prototype.stream=function(r){let s=0,i=this;return new ReadableStream({type:"bytes",async pull(u){let d=await i.slice(s,Math.min(i.size,s+65536)).arrayBuffer();s+=d.byteLength,u.enqueue(new Uint8Array(d)),s===i.size&&u.close()}})})}catch{}});async function*ka(n,e=!0){for(let r of n)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let s=r.byteOffset,i=r.byteOffset+r.byteLength;for(;s!==i;){let u=Math.min(i-s,Ci),c=r.buffer.slice(s,s+u);s+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let s=0,i=r;for(;s!==i.size;){let c=await i.slice(s,Math.min(i.size,s+Ci)).arrayBuffer();s+=c.byteLength,yield new Uint8Array(c)}}}var Dd,Ci,ki,Nl,Re,Rr=Z(()=>{"use strict";Dd=ot(Ei(),1);Ci=65536;ki=class Pa{#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let s=new TextEncoder;for(let u of e){let c;ArrayBuffer.isView(u)?c=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)):u instanceof ArrayBuffer?c=new Uint8Array(u.slice(0)):u instanceof Pa?c=u:c=s.encode(`${u}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let s of ka(this.#e,!1))r+=e.decode(s,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let s of ka(this.#e,!1))e.set(s,r),r+=s.length;return e.buffer}stream(){let e=ka(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let s=await e.next();s.done?r.close():r.enqueue(s.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,s=""){let{size:i}=this,u=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-u,0),m=this.#e,h=[],p=0;for(let R of m){if(p>=d)break;let L=ArrayBuffer.isView(R)?R.byteLength:R.size;if(u&&L<=u)u-=L,c-=L;else{let g;ArrayBuffer.isView(R)?(g=R.subarray(u,Math.min(L,c)),p+=g.byteLength):(g=R.slice(u,Math.min(L,c)),p+=g.size),c-=L,h.push(g),u=0}}let k=new Pa([],{type:String(s).toLowerCase()});return k.#r=d,k.#e=h,k}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(ki.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Nl=ki,Re=Nl});var zl,$l,ut,xa=Z(()=>{"use strict";Rr();zl=class extends Re{#e=0;#t="";constructor(e,r,s={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,s),s===null&&(s={});let i=s.lastModified===void 0?Date.now():Number(s.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof Re&&/^(File)$/.test(e[Symbol.toStringTag])}},$l=zl,ut=$l});function Ai(n,e=Re){var r=`${Pi()}${Pi()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),s=[],i=`--${r}\r
|
|
2
2
|
Content-Disposition: form-data; name="`;return n.forEach((u,c)=>typeof u=="string"?s.push(i+Aa(c)+`"\r
|
|
3
3
|
\r
|
|
4
4
|
${u.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
@@ -7,11 +7,11 @@ ${u.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
|
7
7
|
Content-Type: ${u.type||"application/octet-stream"}\r
|
|
8
8
|
\r
|
|
9
9
|
`,u,`\r
|
|
10
|
-
`)),s.push(`--${r}--`),new e(s,{type:"multipart/form-data; boundary="+r})}var Tr,
|
|
11
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Tt=(n,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${n}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},lt=class{#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Tr](){return"FormData"}[
|
|
12
|
-
--`+e;let r=new Uint8Array(e.length);for(let s=0;s<e.length;s++)r[s]=e.charCodeAt(s),this.boundaryChars[r[s]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=V.START_BOUNDARY}write(e){let r=0,s=e.length,i=this.index,{lookbehind:u,boundary:c,boundaryChars:d,index:m,state:h,flags:p}=this,k=this.boundary.length,R=k-1,q=e.length,g,z,T=$=>{this[$+"Mark"]=r},j=$=>{delete this[$+"Mark"]},H=($,M,Y,Ge)=>{(M===void 0||M!==Y)&&this[$](Ge&&Ge.subarray(M,Y))},J=($,M)=>{let Y=$+"Mark";Y in this&&(M?(H($,this[Y],r,e),delete this[Y]):(H($,this[Y],e.length,e),this[Y]=0))};for(r=0;r<s;r++)switch(g=e[r],h){case V.START_BOUNDARY:if(m===c.length-2){if(g===Cr)p|=ct.LAST_BOUNDARY;else if(g!==Cn)return;m++;break}else if(m-1===c.length-2){if(p&ct.LAST_BOUNDARY&&g===Cr)h=V.END,p=0;else if(!(p&ct.LAST_BOUNDARY)&&g===En)m=0,H("onPartBegin"),h=V.HEADER_FIELD_START;else return;break}g!==c[m+2]&&(m=-2),g===c[m+2]&&m++;break;case V.HEADER_FIELD_START:h=V.HEADER_FIELD,T("onHeaderField"),m=0;case V.HEADER_FIELD:if(g===Cn){j("onHeaderField"),h=V.HEADERS_ALMOST_DONE;break}if(m++,g===Cr)break;if(g===Ul){if(m===1)return;J("onHeaderField",!0),h=V.HEADER_VALUE_START;break}if(z=Hl(g),z<Vl||z>Zl)return;break;case V.HEADER_VALUE_START:if(g===Fl)break;T("onHeaderValue"),h=V.HEADER_VALUE;case V.HEADER_VALUE:g===Cn&&(J("onHeaderValue",!0),H("onHeaderEnd"),h=V.HEADER_VALUE_ALMOST_DONE);break;case V.HEADER_VALUE_ALMOST_DONE:if(g!==En)return;h=V.HEADER_FIELD_START;break;case V.HEADERS_ALMOST_DONE:if(g!==En)return;H("onHeadersEnd"),h=V.PART_DATA_START;break;case V.PART_DATA_START:h=V.PART_DATA,T("onPartData");case V.PART_DATA:if(i=m,m===0){for(r+=R;r<q&&!(e[r]in d);)r+=k;r-=R,g=e[r]}if(m<c.length)c[m]===g?(m===0&&J("onPartData",!0),m++):m=0;else if(m===c.length)m++,g===Cn?p|=ct.PART_BOUNDARY:g===Cr?p|=ct.LAST_BOUNDARY:m=0;else if(m-1===c.length)if(p&ct.PART_BOUNDARY){if(m=0,g===En){p&=~ct.PART_BOUNDARY,H("onPartEnd"),H("onPartBegin"),h=V.HEADER_FIELD_START;break}}else p&ct.LAST_BOUNDARY&&g===Cr?(H("onPartEnd"),h=V.END,p=0):m=0;if(m>0)u[m-1]=g;else if(i>0){let $=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);H("onPartData",0,i,$),i=0,T("onPartData"),r--}break;case V.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}J("onHeaderField"),J("onHeaderValue"),J("onPartData"),this.index=m,this.state=h,this.flags=p}end(){if(this.state===V.HEADER_FIELD_START&&this.index===0||this.state===V.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==V.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});async function ja(n){if(n[ae].disturbed)throw new TypeError(`body used already for: ${n.url}`);if(n[ae].disturbed=!0,n[ae].error)throw n[ae].error;let{body:e}=n;if(e===null)return(void 0).alloc(0);if(!(e instanceof ye.default))return(void 0).alloc(0);let r=[],s=0;try{for await(let i of e){if(n.size>0&&s+i.length>n.size){let u=new te(`content size at ${n.url} over limit: ${n.size}`,"max-size");throw e.destroy(u),u}s+=i.length,r.push(i)}}catch(i){throw i instanceof $e?i:new te(`Invalid response body while trying to fetch ${n.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?(void 0).from(r.join("")):(void 0).concat(r,s)}catch(i){throw new te(`Could not create Buffer from response body for ${n.url}: ${i.message}`,"system",i)}else throw new te(`Premature close of server response while trying to fetch ${n.url}`)}var ye,Gl,ae,Pe,rr,Jl,kn,Hi,Yi,Pn=Z(()=>{"use strict";ye=ot(Ea(),1);_n();Ca();Rr();wn();Oa();Sn();Rn();Gl=(void 0)(ye.default.pipeline),ae=Symbol("Body internals"),Pe=class{constructor(e,{size:r=0}={}){let s=null;e===null?e=null:Ba(e)?e=(void 0).from(e.toString()):Er(e)||(void 0).isBuffer(e)||((void 0).isAnyArrayBuffer(e)?e=(void 0).from(e):ArrayBuffer.isView(e)?e=(void 0).from(e.buffer,e.byteOffset,e.byteLength):e instanceof ye.default||(e instanceof lt?(e=Pi(e),s=e.type.split("=")[1]):e=(void 0).from(String(e))));let i=e;(void 0).isBuffer(e)?i=ye.default.Readable.from(e):Er(e)&&(i=ye.default.Readable.from(e.stream())),this[ae]={body:e,stream:i,boundary:s,disturbed:!1,error:null},this.size=r,e instanceof ye.default&&e.on("error",u=>{let c=u instanceof $e?u:new te(`Invalid response body while trying to fetch ${this.url}: ${u.message}`,"system",u);this[ae].error=c})}get body(){return this[ae].stream}get bodyUsed(){return this[ae].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:s}=await ja(this);return e.slice(r,r+s)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let s=new lt,i=new URLSearchParams(await this.text());for(let[u,c]of i)s.append(u,c);return s}let{toFormData:r}=await Promise.resolve().then(()=>(Zi(),Vi));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[ae].body&&this[ae].body.type||"",r=await this.arrayBuffer();return new ve([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ja(this);return new TextDecoder().decode(e)}buffer(){return ja(this)}};Pe.prototype.buffer=(void 0)(Pe.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Pe.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(void 0)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});rr=(n,e)=>{let r,s,{body:i}=n[ae];if(n.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof ye.default&&typeof i.getBoundary!="function"&&(r=new(void 0)({highWaterMark:e}),s=new(void 0)({highWaterMark:e}),i.pipe(r),i.pipe(s),n[ae].stream=r,i=s),i},Jl=(void 0)(n=>n.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),kn=(n,e)=>n===null?null:typeof n=="string"?"text/plain;charset=UTF-8":Ba(n)?"application/x-www-form-urlencoded;charset=UTF-8":Er(n)?n.type||null:(void 0).isBuffer(n)||(void 0).isAnyArrayBuffer(n)||ArrayBuffer.isView(n)?null:n instanceof lt?`multipart/form-data; boundary=${e[ae].boundary}`:n&&typeof n.getBoundary=="function"?`multipart/form-data;boundary=${Jl(n)}`:n instanceof ye.default?null:"text/plain;charset=UTF-8",Hi=n=>{let{body:e}=n[ae];return e===null?0:Er(e)?e.size:(void 0).isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},Yi=async(n,{body:e})=>{e===null?n.end():await Gl(e,n)}});function Qi(n=[]){return new se(n.reduce((e,r,s,i)=>(s%2===0&&e.push(i.slice(s,s+2)),e),[]).filter(([e,r])=>{try{return xn(e),La(e,String(r)),!0}catch{return!1}}))}var kr,xn,La,se,An=Z(()=>{"use strict";_n();kr=ot(Ta(),1),xn=typeof kr.default.validateHeaderName=="function"?kr.default.validateHeaderName:n=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(n)){let e=new TypeError(`Header name must be a valid HTTP token [${n}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},La=typeof kr.default.validateHeaderValue=="function"?kr.default.validateHeaderValue:(n,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${n}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},se=class n extends URLSearchParams{constructor(e){let r=[];if(e instanceof n){let s=e.raw();for(let[i,u]of Object.entries(s))r.push(...u.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!(void 0).isBoxedPrimitive(e)){let s=e[Symbol.iterator];if(s==null)r.push(...Object.entries(e));else{if(typeof s!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||(void 0).isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([s,i])=>(xn(s),La(s,String(i)),[String(s).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(s,i,u){switch(i){case"append":case"set":return(c,d)=>(xn(c),La(c,String(d)),URLSearchParams.prototype[i].call(s,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(xn(c),URLSearchParams.prototype[i].call(s,String(c).toLowerCase()));case"keys":return()=>(s.sort(),new Set(URLSearchParams.prototype.keys.call(s)).keys());default:return Reflect.get(s,i,u)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let s=r.join(", ");return/^content-encoding$/i.test(e)&&(s=s.toLowerCase()),s}forEach(e,r=void 0){for(let s of this.keys())Reflect.apply(e,r,[this.get(s),s,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let s=this.getAll(r);return r==="host"?e[r]=s[0]:e[r]=s.length>1?s:s[0],e},{})}};Object.defineProperties(se.prototype,["get","entries","forEach","values"].reduce((n,e)=>(n[e]={enumerable:!0},n),{}))});var Kl,Pr,Na=Z(()=>{"use strict";Kl=new Set([301,302,303,307,308]),Pr=n=>Kl.has(n)});var Re,le,Gi=Z(()=>{"use strict";An();Pn();Na();Re=Symbol("Response internals"),le=class n extends Pe{constructor(e=null,r={}){super(e,r);let s=r.status!=null?r.status:200,i=new se(r.headers);if(e!==null&&!i.has("Content-Type")){let u=kn(e,this);u&&i.append("Content-Type",u)}this[Re]={type:"default",url:r.url,status:s,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Re].type}get url(){return this[Re].url||""}get status(){return this[Re].status}get ok(){return this[Re].status>=200&&this[Re].status<300}get redirected(){return this[Re].counter>0}get statusText(){return this[Re].statusText}get headers(){return this[Re].headers}get highWaterMark(){return this[Re].highWaterMark}clone(){return new n(rr(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Pr(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new n(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new n(null,{status:0,statusText:""});return e[Re].type="error",e}static json(e=void 0,r={}){let s=JSON.stringify(e);if(s===void 0)throw new TypeError("data is not JSON serializable");let i=new se(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new n(s,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(le.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Ji=Z(()=>{"use strict"});var Ki,Xi=Z(()=>{"use strict";Ki=n=>{if(n.search)return n.search;let e=n.href.length-1,r=n.hash||(n.href[e]==="#"?"#":"");return n.href[e-r.length]==="?"?"?":""}});var eo=Z(()=>{"use strict"});function to(n,e=!1){return n==null||(n=new URL(n),/^(about|blob|data):$/.test(n.protocol))?"no-referrer":(n.username="",n.password="",n.hash="",e&&(n.pathname="",n.search=""),n)}function so(n){if(!no.has(n))throw new TypeError(`Invalid referrerPolicy: ${n}`);return n}function Xl(n){if(/^(http|ws)s:$/.test(n.protocol))return!0;let e=n.host.replace(/(^\[)|(]$)/g,""),r=(void 0)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:n.host==="localhost"||n.host.endsWith(".localhost")?!1:n.protocol==="file:"}function nr(n){return/^about:(blank|srcdoc)$/.test(n)||n.protocol==="data:"||/^(blob|filesystem):$/.test(n.protocol)?!0:Xl(n)}function io(n,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(n.referrer==="no-referrer"||n.referrerPolicy==="")return null;let s=n.referrerPolicy;if(n.referrer==="about:client")return"no-referrer";let i=n.referrer,u=to(i),c=to(i,!0);u.toString().length>4096&&(u=c),e&&(u=e(u)),r&&(c=r(c));let d=new URL(n.url);switch(s){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return u;case"strict-origin":return nr(u)&&!nr(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return u.origin===d.origin?u:nr(u)&&!nr(d)?"no-referrer":c;case"same-origin":return u.origin===d.origin?u:"no-referrer";case"origin-when-cross-origin":return u.origin===d.origin?u:c;case"no-referrer-when-downgrade":return nr(u)&&!nr(d)?"no-referrer":u;default:throw new TypeError(`Invalid referrerPolicy: ${s}`)}}function oo(n){let e=(n.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let s of e)s&&no.has(s)&&(r=s);return r}var no,ao,za=Z(()=>{"use strict";eo();no=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),ao="strict-origin-when-cross-origin"});var G,xr,ec,dt,co,fo=Z(()=>{"use strict";Ji();_n();An();Pn();Rn();Xi();za();G=Symbol("Request internals"),xr=n=>typeof n=="object"&&typeof n[G]=="object",ec=(void 0)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),dt=class n extends Pe{constructor(e,r={}){let s;if(xr(e)?s=new URL(e.url):(s=new URL(e),e={}),s.username!==""||s.password!=="")throw new TypeError(`${s} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!xr(r)&&"data"in r&&ec(),(r.body!=null||xr(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let u=r.body?r.body:xr(e)&&e.body!==null?rr(e):null;super(u,{size:r.size||e.size||0});let c=new se(r.headers||e.headers||{});if(u!==null&&!c.has("Content-Type")){let h=kn(u,this);h&&c.set("Content-Type",h)}let d=xr(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!xi(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let m=r.referrer==null?e.referrer:r.referrer;if(m==="")m="no-referrer";else if(m){let h=new URL(m);m=/^about:(\/\/)?client$/.test(h)?"client":h}else m=void 0;this[G]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:s,signal:d,referrer:m},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[G].method}get url(){return(void 0)(this[G].parsedURL)}get headers(){return this[G].headers}get redirect(){return this[G].redirect}get signal(){return this[G].signal}get referrer(){if(this[G].referrer==="no-referrer")return"";if(this[G].referrer==="client")return"about:client";if(this[G].referrer)return this[G].referrer.toString()}get referrerPolicy(){return this[G].referrerPolicy}set referrerPolicy(e){this[G].referrerPolicy=so(e)}clone(){return new n(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(dt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});co=n=>{let{parsedURL:e}=n[G],r=new se(n[G].headers);r.has("Accept")||r.set("Accept","*/*");let s=null;if(n.body===null&&/^(post|put)$/i.test(n.method)&&(s="0"),n.body!==null){let d=Hi(n);typeof d=="number"&&!Number.isNaN(d)&&(s=String(d))}s&&r.set("Content-Length",s),n.referrerPolicy===""&&(n.referrerPolicy=ao),n.referrer&&n.referrer!=="no-referrer"?n[G].referrer=io(n):n[G].referrer="no-referrer",n[G].referrer instanceof URL&&r.set("Referer",n.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),n.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=n;typeof i=="function"&&(i=i(e));let u=Ki(e),c={path:e.pathname+u,method:n.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:n.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}}});var Ar,ho=Z(()=>{"use strict";Sn();Ar=class extends $e{constructor(e,r="aborted"){super(e,r)}}});var yo={};bn(yo,{AbortError:()=>Ar,Blob:()=>ve,FetchError:()=>te,File:()=>ut,FormData:()=>lt,Headers:()=>se,Request:()=>dt,Response:()=>le,blobFrom:()=>Ni,blobFromSync:()=>Li,default:()=>$a,fileFrom:()=>zi,fileFromSync:()=>$i,isRedirect:()=>Pr});async function $a(n,e){return new Promise((r,s)=>{let i=new dt(n,e),{parsedURL:u,options:c}=co(i);if(!tc.has(u.protocol))throw new TypeError(`node-fetch cannot load ${n}. URL scheme "${u.protocol.replace(/:$/,"")}" is not supported.`);if(u.protocol==="data:"){let g=bi(i.url),z=new le(g,{headers:{"Content-Type":g.typeFull}});r(z);return}let d=(u.protocol==="https:"?po.default:mo.default).request,{signal:m}=i,h=null,p=()=>{let g=new Ar("The operation was aborted.");s(g),i.body&&i.body instanceof ce.default.Readable&&i.body.destroy(g),!(!h||!h.body)&&h.body.emit("error",g)};if(m&&m.aborted){p();return}let k=()=>{p(),q()},R=d(u.toString(),c);m&&m.addEventListener("abort",k);let q=()=>{R.abort(),m&&m.removeEventListener("abort",k)};R.on("error",g=>{s(new te(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),q()}),rc(R,g=>{h&&h.body&&h.body.destroy(g)}),process.version<"v14"&&R.on("socket",g=>{let z;g.prependListener("end",()=>{z=g._eventsCount}),g.prependListener("close",T=>{if(h&&z<g._eventsCount&&!T){let j=new Error("Premature close");j.code="ERR_STREAM_PREMATURE_CLOSE",h.body.emit("error",j)}})}),R.on("response",g=>{R.setTimeout(0);let z=Qi(g.rawHeaders);if(Pr(g.statusCode)){let $=z.get("Location"),M=null;try{M=$===null?null:new URL($,i.url)}catch{if(i.redirect!=="manual"){s(new te(`uri requested responds with an invalid redirect URL: ${$}`,"invalid-redirect")),q();return}}switch(i.redirect){case"error":s(new te(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),q();return;case"manual":break;case"follow":{if(M===null)break;if(i.counter>=i.follow){s(new te(`maximum redirect reached at: ${i.url}`,"max-redirect")),q();return}let Y={headers:new se(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:rr(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Ai(i.url,M)||!Oi(i.url,M))for(let fr of["authorization","www-authenticate","cookie","cookie2"])Y.headers.delete(fr);if(g.statusCode!==303&&i.body&&e.body instanceof ce.default.Readable){s(new te("Cannot follow redirect with body being a readable stream","unsupported-redirect")),q();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(Y.method="GET",Y.body=void 0,Y.headers.delete("content-length"));let Ge=oo(z);Ge&&(Y.referrerPolicy=Ge),r($a(new dt(M,Y))),q();return}default:return s(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}m&&g.once("end",()=>{m.removeEventListener("abort",k)});let T=(void 0)(g,new(void 0),$=>{$&&s($)});process.version<"v12.10"&&g.on("aborted",k);let j={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:z,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},H=z.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||H===null||g.statusCode===204||g.statusCode===304){h=new le(T,j),r(h);return}let J={flush:kt.default.Z_SYNC_FLUSH,finishFlush:kt.default.Z_SYNC_FLUSH};if(H==="gzip"||H==="x-gzip"){T=(void 0)(T,kt.default.createGunzip(J),$=>{$&&s($)}),h=new le(T,j),r(h);return}if(H==="deflate"||H==="x-deflate"){let $=(void 0)(g,new(void 0),M=>{M&&s(M)});$.once("data",M=>{(M[0]&15)===8?T=(void 0)(T,kt.default.createInflate(),Y=>{Y&&s(Y)}):T=(void 0)(T,kt.default.createInflateRaw(),Y=>{Y&&s(Y)}),h=new le(T,j),r(h)}),$.once("end",()=>{h||(h=new le(T,j),r(h))});return}if(H==="br"){T=(void 0)(T,kt.default.createBrotliDecompress(),$=>{$&&s($)}),h=new le(T,j),r(h);return}h=new le(T,j),r(h)}),Yi(R,i).catch(s)})}function rc(n,e){let r=(void 0).from(`0\r
|
|
10
|
+
`)),s.push(`--${r}--`),new e(s,{type:"multipart/form-data; boundary="+r})}var Tr,Ml,Fl,Pi,Ul,xi,Aa,Tt,lt,wn=Z(()=>{"use strict";Rr();xa();({toStringTag:Tr,iterator:Ml,hasInstance:Fl}=Symbol),Pi=Math.random,Ul="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),xi=(n,e,r)=>(n+="",/^(Blob|File)$/.test(e&&e[Tr])?[(r=r!==void 0?r+"":e[Tr]=="File"?e.name:"blob",n),e.name!==r||e[Tr]=="blob"?new ut([e],r,e):e]:[n,e+""]),Aa=(n,e)=>(e?n:n.replace(/\r?\n|\r/g,`\r
|
|
11
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Tt=(n,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${n}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},lt=class{#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Tr](){return"FormData"}[Ml](){return this.entries()}static[Fl](e){return e&&typeof e=="object"&&e[Tr]==="FormData"&&!Ul.some(r=>typeof e[r]!="function")}append(...e){Tt("append",arguments,2),this.#e.push(xi(...e))}delete(e){Tt("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){Tt("get",arguments,1),e+="";for(var r=this.#e,s=r.length,i=0;i<s;i++)if(r[i][0]===e)return r[i][1];return null}getAll(e,r){return Tt("getAll",arguments,1),r=[],e+="",this.#e.forEach(s=>s[0]===e&&r.push(s[1])),r}has(e){return Tt("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){Tt("forEach",arguments,1);for(var[s,i]of this)e.call(r,i,s,this)}set(...e){Tt("set",arguments,2);var r=[],s=!0;e=xi(...e),this.#e.forEach(i=>{i[0]===e[0]?s&&(s=!r.push(e)):r.push(i)}),s&&r.push(e),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}}});var Me,Sn=Z(()=>{"use strict";Me=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var te,Oa=Z(()=>{"use strict";Sn();te=class extends Me{constructor(e,r,s){super(e,r),s&&(this.code=this.errno=s.code,this.erroredSysCall=s.syscall)}}});var vn,Ba,Er,Oi,Bi,Ii,Rn=Z(()=>{"use strict";vn=Symbol.toStringTag,Ba=n=>typeof n=="object"&&typeof n.append=="function"&&typeof n.delete=="function"&&typeof n.get=="function"&&typeof n.getAll=="function"&&typeof n.has=="function"&&typeof n.set=="function"&&typeof n.sort=="function"&&n[vn]==="URLSearchParams",Er=n=>n&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&typeof n.constructor=="function"&&/^(Blob|File)$/.test(n[vn]),Oi=n=>typeof n=="object"&&(n[vn]==="AbortSignal"||n[vn]==="EventTarget"),Bi=(n,e)=>{let r=new URL(e).hostname,s=new URL(n).hostname;return r===s||r.endsWith(`.${s}`)},Ii=(n,e)=>{let r=new URL(e).protocol,s=new URL(n).protocol;return r===s}});var Di=Z(()=>{"use strict"});var Wi=Z(()=>{"use strict"});var Li=$e((Hd,ji)=>{"use strict";if(!globalThis.DOMException)try{let{MessageChannel:n}=hi("worker_threads"),e=new n().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(n){n.constructor.name==="DOMException"&&(globalThis.DOMException=n.constructor)}ji.exports=globalThis.DOMException});var Ni,Ia,zi,$i,Mi,Fi,Ui,Vi,Tn,Da=Z(()=>{"use strict";Di();Wi();Ni=ot(Li(),1);xa();Rr();({stat:Ia}=void 0),zi=(n,e)=>Ui((void 0)(n),n,e),$i=(n,e)=>Ia(n).then(r=>Ui(r,n,e)),Mi=(n,e)=>Ia(n).then(r=>Vi(r,n,e)),Fi=(n,e)=>Vi((void 0)(n),n,e),Ui=(n,e,r="")=>new Re([new Tn({path:e,size:n.size,lastModified:n.mtimeMs,start:0})],{type:r}),Vi=(n,e,r="")=>new ut([new Tn({path:e,size:n.size,lastModified:n.mtimeMs,start:0})],(void 0)(e),{type:r,lastModified:n.mtimeMs}),Tn=class n{#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new n({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await Ia(this.#e);if(e>this.lastModified)throw new Ni.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(void 0)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var Hi={};bn(Hi,{toFormData:()=>Jl});function Gl(n){let e=n.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",s=r.slice(r.lastIndexOf("\\")+1);return s=s.replace(/%22/g,'"'),s=s.replace(/&#(\d{4});/g,(i,u)=>String.fromCharCode(u)),s}async function Jl(n,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let s=new Wa(r[1]||r[2]),i,u,c,d,m,h,p=[],k=new lt,R=j=>{c+=T.decode(j,{stream:!0})},L=j=>{p.push(j)},g=()=>{let j=new ut(p,h,{type:m});k.append(d,j)},z=()=>{k.append(d,c)},T=new TextDecoder("utf-8");T.decode(),s.onPartBegin=function(){s.onPartData=R,s.onPartEnd=z,i="",u="",c="",d="",m="",h=null,p.length=0},s.onHeaderField=function(j){i+=T.decode(j,{stream:!0})},s.onHeaderValue=function(j){u+=T.decode(j,{stream:!0})},s.onHeaderEnd=function(){if(u+=T.decode(),i=i.toLowerCase(),i==="content-disposition"){let j=u.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);j&&(d=j[2]||j[3]||""),h=Gl(u),h&&(s.onPartData=L,s.onPartEnd=g)}else i==="content-type"&&(m=u);u="",i=""};for await(let j of n)s.write(j);return s.end(),k}var Pe,V,Zi,ct,En,Cn,Vl,Cr,Zl,Hl,Yl,Ql,Ct,Wa,Yi=Z(()=>{"use strict";Da();wn();Pe=0,V={START_BOUNDARY:Pe++,HEADER_FIELD_START:Pe++,HEADER_FIELD:Pe++,HEADER_VALUE_START:Pe++,HEADER_VALUE:Pe++,HEADER_VALUE_ALMOST_DONE:Pe++,HEADERS_ALMOST_DONE:Pe++,PART_DATA_START:Pe++,PART_DATA:Pe++,END:Pe++},Zi=1,ct={PART_BOUNDARY:Zi,LAST_BOUNDARY:Zi*=2},En=10,Cn=13,Vl=32,Cr=45,Zl=58,Hl=97,Yl=122,Ql=n=>n|32,Ct=()=>{},Wa=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=Ct,this.onHeaderField=Ct,this.onHeadersEnd=Ct,this.onHeaderValue=Ct,this.onPartBegin=Ct,this.onPartData=Ct,this.onPartEnd=Ct,this.boundaryChars={},e=`\r
|
|
12
|
+
--`+e;let r=new Uint8Array(e.length);for(let s=0;s<e.length;s++)r[s]=e.charCodeAt(s),this.boundaryChars[r[s]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=V.START_BOUNDARY}write(e){let r=0,s=e.length,i=this.index,{lookbehind:u,boundary:c,boundaryChars:d,index:m,state:h,flags:p}=this,k=this.boundary.length,R=k-1,L=e.length,g,z,T=$=>{this[$+"Mark"]=r},j=$=>{delete this[$+"Mark"]},H=($,M,Y,Ge)=>{(M===void 0||M!==Y)&&this[$](Ge&&Ge.subarray(M,Y))},J=($,M)=>{let Y=$+"Mark";Y in this&&(M?(H($,this[Y],r,e),delete this[Y]):(H($,this[Y],e.length,e),this[Y]=0))};for(r=0;r<s;r++)switch(g=e[r],h){case V.START_BOUNDARY:if(m===c.length-2){if(g===Cr)p|=ct.LAST_BOUNDARY;else if(g!==Cn)return;m++;break}else if(m-1===c.length-2){if(p&ct.LAST_BOUNDARY&&g===Cr)h=V.END,p=0;else if(!(p&ct.LAST_BOUNDARY)&&g===En)m=0,H("onPartBegin"),h=V.HEADER_FIELD_START;else return;break}g!==c[m+2]&&(m=-2),g===c[m+2]&&m++;break;case V.HEADER_FIELD_START:h=V.HEADER_FIELD,T("onHeaderField"),m=0;case V.HEADER_FIELD:if(g===Cn){j("onHeaderField"),h=V.HEADERS_ALMOST_DONE;break}if(m++,g===Cr)break;if(g===Zl){if(m===1)return;J("onHeaderField",!0),h=V.HEADER_VALUE_START;break}if(z=Ql(g),z<Hl||z>Yl)return;break;case V.HEADER_VALUE_START:if(g===Vl)break;T("onHeaderValue"),h=V.HEADER_VALUE;case V.HEADER_VALUE:g===Cn&&(J("onHeaderValue",!0),H("onHeaderEnd"),h=V.HEADER_VALUE_ALMOST_DONE);break;case V.HEADER_VALUE_ALMOST_DONE:if(g!==En)return;h=V.HEADER_FIELD_START;break;case V.HEADERS_ALMOST_DONE:if(g!==En)return;H("onHeadersEnd"),h=V.PART_DATA_START;break;case V.PART_DATA_START:h=V.PART_DATA,T("onPartData");case V.PART_DATA:if(i=m,m===0){for(r+=R;r<L&&!(e[r]in d);)r+=k;r-=R,g=e[r]}if(m<c.length)c[m]===g?(m===0&&J("onPartData",!0),m++):m=0;else if(m===c.length)m++,g===Cn?p|=ct.PART_BOUNDARY:g===Cr?p|=ct.LAST_BOUNDARY:m=0;else if(m-1===c.length)if(p&ct.PART_BOUNDARY){if(m=0,g===En){p&=~ct.PART_BOUNDARY,H("onPartEnd"),H("onPartBegin"),h=V.HEADER_FIELD_START;break}}else p&ct.LAST_BOUNDARY&&g===Cr?(H("onPartEnd"),h=V.END,p=0):m=0;if(m>0)u[m-1]=g;else if(i>0){let $=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);H("onPartData",0,i,$),i=0,T("onPartData"),r--}break;case V.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}J("onHeaderField"),J("onHeaderValue"),J("onPartData"),this.index=m,this.state=h,this.flags=p}end(){if(this.state===V.HEADER_FIELD_START&&this.index===0||this.state===V.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==V.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});async function ja(n){if(n[ae].disturbed)throw new TypeError(`body used already for: ${n.url}`);if(n[ae].disturbed=!0,n[ae].error)throw n[ae].error;let{body:e}=n;if(e===null)return(void 0).alloc(0);if(!(e instanceof be.default))return(void 0).alloc(0);let r=[],s=0;try{for await(let i of e){if(n.size>0&&s+i.length>n.size){let u=new te(`content size at ${n.url} over limit: ${n.size}`,"max-size");throw e.destroy(u),u}s+=i.length,r.push(i)}}catch(i){throw i instanceof Me?i:new te(`Invalid response body while trying to fetch ${n.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?(void 0).from(r.join("")):(void 0).concat(r,s)}catch(i){throw new te(`Could not create Buffer from response body for ${n.url}: ${i.message}`,"system",i)}else throw new te(`Premature close of server response while trying to fetch ${n.url}`)}var be,Kl,ae,xe,rr,Xl,kn,Qi,Gi,Pn=Z(()=>{"use strict";be=ot(Ea(),1);_n();Ca();Rr();wn();Oa();Sn();Rn();Kl=(void 0)(be.default.pipeline),ae=Symbol("Body internals"),xe=class{constructor(e,{size:r=0}={}){let s=null;e===null?e=null:Ba(e)?e=(void 0).from(e.toString()):Er(e)||(void 0).isBuffer(e)||((void 0).isAnyArrayBuffer(e)?e=(void 0).from(e):ArrayBuffer.isView(e)?e=(void 0).from(e.buffer,e.byteOffset,e.byteLength):e instanceof be.default||(e instanceof lt?(e=Ai(e),s=e.type.split("=")[1]):e=(void 0).from(String(e))));let i=e;(void 0).isBuffer(e)?i=be.default.Readable.from(e):Er(e)&&(i=be.default.Readable.from(e.stream())),this[ae]={body:e,stream:i,boundary:s,disturbed:!1,error:null},this.size=r,e instanceof be.default&&e.on("error",u=>{let c=u instanceof Me?u:new te(`Invalid response body while trying to fetch ${this.url}: ${u.message}`,"system",u);this[ae].error=c})}get body(){return this[ae].stream}get bodyUsed(){return this[ae].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:s}=await ja(this);return e.slice(r,r+s)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let s=new lt,i=new URLSearchParams(await this.text());for(let[u,c]of i)s.append(u,c);return s}let{toFormData:r}=await Promise.resolve().then(()=>(Yi(),Hi));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[ae].body&&this[ae].body.type||"",r=await this.arrayBuffer();return new Re([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ja(this);return new TextDecoder().decode(e)}buffer(){return ja(this)}};xe.prototype.buffer=(void 0)(xe.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(xe.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(void 0)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});rr=(n,e)=>{let r,s,{body:i}=n[ae];if(n.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof be.default&&typeof i.getBoundary!="function"&&(r=new(void 0)({highWaterMark:e}),s=new(void 0)({highWaterMark:e}),i.pipe(r),i.pipe(s),n[ae].stream=r,i=s),i},Xl=(void 0)(n=>n.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),kn=(n,e)=>n===null?null:typeof n=="string"?"text/plain;charset=UTF-8":Ba(n)?"application/x-www-form-urlencoded;charset=UTF-8":Er(n)?n.type||null:(void 0).isBuffer(n)||(void 0).isAnyArrayBuffer(n)||ArrayBuffer.isView(n)?null:n instanceof lt?`multipart/form-data; boundary=${e[ae].boundary}`:n&&typeof n.getBoundary=="function"?`multipart/form-data;boundary=${Xl(n)}`:n instanceof be.default?null:"text/plain;charset=UTF-8",Qi=n=>{let{body:e}=n[ae];return e===null?0:Er(e)?e.size:(void 0).isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},Gi=async(n,{body:e})=>{e===null?n.end():await Kl(e,n)}});function Ji(n=[]){return new se(n.reduce((e,r,s,i)=>(s%2===0&&e.push(i.slice(s,s+2)),e),[]).filter(([e,r])=>{try{return xn(e),qa(e,String(r)),!0}catch{return!1}}))}var kr,xn,qa,se,An=Z(()=>{"use strict";_n();kr=ot(Ta(),1),xn=typeof kr.default.validateHeaderName=="function"?kr.default.validateHeaderName:n=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(n)){let e=new TypeError(`Header name must be a valid HTTP token [${n}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},qa=typeof kr.default.validateHeaderValue=="function"?kr.default.validateHeaderValue:(n,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${n}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},se=class n extends URLSearchParams{constructor(e){let r=[];if(e instanceof n){let s=e.raw();for(let[i,u]of Object.entries(s))r.push(...u.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!(void 0).isBoxedPrimitive(e)){let s=e[Symbol.iterator];if(s==null)r.push(...Object.entries(e));else{if(typeof s!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||(void 0).isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([s,i])=>(xn(s),qa(s,String(i)),[String(s).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(s,i,u){switch(i){case"append":case"set":return(c,d)=>(xn(c),qa(c,String(d)),URLSearchParams.prototype[i].call(s,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(xn(c),URLSearchParams.prototype[i].call(s,String(c).toLowerCase()));case"keys":return()=>(s.sort(),new Set(URLSearchParams.prototype.keys.call(s)).keys());default:return Reflect.get(s,i,u)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let s=r.join(", ");return/^content-encoding$/i.test(e)&&(s=s.toLowerCase()),s}forEach(e,r=void 0){for(let s of this.keys())Reflect.apply(e,r,[this.get(s),s,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let s=this.getAll(r);return r==="host"?e[r]=s[0]:e[r]=s.length>1?s:s[0],e},{})}};Object.defineProperties(se.prototype,["get","entries","forEach","values"].reduce((n,e)=>(n[e]={enumerable:!0},n),{}))});var ec,Pr,Na=Z(()=>{"use strict";ec=new Set([301,302,303,307,308]),Pr=n=>ec.has(n)});var Te,le,Ki=Z(()=>{"use strict";An();Pn();Na();Te=Symbol("Response internals"),le=class n extends xe{constructor(e=null,r={}){super(e,r);let s=r.status!=null?r.status:200,i=new se(r.headers);if(e!==null&&!i.has("Content-Type")){let u=kn(e,this);u&&i.append("Content-Type",u)}this[Te]={type:"default",url:r.url,status:s,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Te].type}get url(){return this[Te].url||""}get status(){return this[Te].status}get ok(){return this[Te].status>=200&&this[Te].status<300}get redirected(){return this[Te].counter>0}get statusText(){return this[Te].statusText}get headers(){return this[Te].headers}get highWaterMark(){return this[Te].highWaterMark}clone(){return new n(rr(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Pr(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new n(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new n(null,{status:0,statusText:""});return e[Te].type="error",e}static json(e=void 0,r={}){let s=JSON.stringify(e);if(s===void 0)throw new TypeError("data is not JSON serializable");let i=new se(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new n(s,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(le.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Xi=Z(()=>{"use strict"});var eo,to=Z(()=>{"use strict";eo=n=>{if(n.search)return n.search;let e=n.href.length-1,r=n.hash||(n.href[e]==="#"?"#":"");return n.href[e-r.length]==="?"?"?":""}});var ro=Z(()=>{"use strict"});function no(n,e=!1){return n==null||(n=new URL(n),/^(about|blob|data):$/.test(n.protocol))?"no-referrer":(n.username="",n.password="",n.hash="",e&&(n.pathname="",n.search=""),n)}function oo(n){if(!so.has(n))throw new TypeError(`Invalid referrerPolicy: ${n}`);return n}function tc(n){if(/^(http|ws)s:$/.test(n.protocol))return!0;let e=n.host.replace(/(^\[)|(]$)/g,""),r=(void 0)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:n.host==="localhost"||n.host.endsWith(".localhost")?!1:n.protocol==="file:"}function nr(n){return/^about:(blank|srcdoc)$/.test(n)||n.protocol==="data:"||/^(blob|filesystem):$/.test(n.protocol)?!0:tc(n)}function uo(n,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(n.referrer==="no-referrer"||n.referrerPolicy==="")return null;let s=n.referrerPolicy;if(n.referrer==="about:client")return"no-referrer";let i=n.referrer,u=no(i),c=no(i,!0);u.toString().length>4096&&(u=c),e&&(u=e(u)),r&&(c=r(c));let d=new URL(n.url);switch(s){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return u;case"strict-origin":return nr(u)&&!nr(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return u.origin===d.origin?u:nr(u)&&!nr(d)?"no-referrer":c;case"same-origin":return u.origin===d.origin?u:"no-referrer";case"origin-when-cross-origin":return u.origin===d.origin?u:c;case"no-referrer-when-downgrade":return nr(u)&&!nr(d)?"no-referrer":u;default:throw new TypeError(`Invalid referrerPolicy: ${s}`)}}function lo(n){let e=(n.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let s of e)s&&so.has(s)&&(r=s);return r}var so,io,za=Z(()=>{"use strict";ro();so=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),io="strict-origin-when-cross-origin"});var G,xr,rc,dt,ho,mo=Z(()=>{"use strict";Xi();_n();An();Pn();Rn();to();za();G=Symbol("Request internals"),xr=n=>typeof n=="object"&&typeof n[G]=="object",rc=(void 0)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),dt=class n extends xe{constructor(e,r={}){let s;if(xr(e)?s=new URL(e.url):(s=new URL(e),e={}),s.username!==""||s.password!=="")throw new TypeError(`${s} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!xr(r)&&"data"in r&&rc(),(r.body!=null||xr(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let u=r.body?r.body:xr(e)&&e.body!==null?rr(e):null;super(u,{size:r.size||e.size||0});let c=new se(r.headers||e.headers||{});if(u!==null&&!c.has("Content-Type")){let h=kn(u,this);h&&c.set("Content-Type",h)}let d=xr(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!Oi(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let m=r.referrer==null?e.referrer:r.referrer;if(m==="")m="no-referrer";else if(m){let h=new URL(m);m=/^about:(\/\/)?client$/.test(h)?"client":h}else m=void 0;this[G]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:s,signal:d,referrer:m},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[G].method}get url(){return(void 0)(this[G].parsedURL)}get headers(){return this[G].headers}get redirect(){return this[G].redirect}get signal(){return this[G].signal}get referrer(){if(this[G].referrer==="no-referrer")return"";if(this[G].referrer==="client")return"about:client";if(this[G].referrer)return this[G].referrer.toString()}get referrerPolicy(){return this[G].referrerPolicy}set referrerPolicy(e){this[G].referrerPolicy=oo(e)}clone(){return new n(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(dt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});ho=n=>{let{parsedURL:e}=n[G],r=new se(n[G].headers);r.has("Accept")||r.set("Accept","*/*");let s=null;if(n.body===null&&/^(post|put)$/i.test(n.method)&&(s="0"),n.body!==null){let d=Qi(n);typeof d=="number"&&!Number.isNaN(d)&&(s=String(d))}s&&r.set("Content-Length",s),n.referrerPolicy===""&&(n.referrerPolicy=io),n.referrer&&n.referrer!=="no-referrer"?n[G].referrer=uo(n):n[G].referrer="no-referrer",n[G].referrer instanceof URL&&r.set("Referer",n.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),n.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=n;typeof i=="function"&&(i=i(e));let u=eo(e),c={path:e.pathname+u,method:n.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:n.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}}});var Ar,po=Z(()=>{"use strict";Sn();Ar=class extends Me{constructor(e,r="aborted"){super(e,r)}}});var _o={};bn(_o,{AbortError:()=>Ar,Blob:()=>Re,FetchError:()=>te,File:()=>ut,FormData:()=>lt,Headers:()=>se,Request:()=>dt,Response:()=>le,blobFrom:()=>$i,blobFromSync:()=>zi,default:()=>$a,fileFrom:()=>Mi,fileFromSync:()=>Fi,isRedirect:()=>Pr});async function $a(n,e){return new Promise((r,s)=>{let i=new dt(n,e),{parsedURL:u,options:c}=ho(i);if(!nc.has(u.protocol))throw new TypeError(`node-fetch cannot load ${n}. URL scheme "${u.protocol.replace(/:$/,"")}" is not supported.`);if(u.protocol==="data:"){let g=gi(i.url),z=new le(g,{headers:{"Content-Type":g.typeFull}});r(z);return}let d=(u.protocol==="https:"?bo.default:yo.default).request,{signal:m}=i,h=null,p=()=>{let g=new Ar("The operation was aborted.");s(g),i.body&&i.body instanceof ce.default.Readable&&i.body.destroy(g),!(!h||!h.body)&&h.body.emit("error",g)};if(m&&m.aborted){p();return}let k=()=>{p(),L()},R=d(u.toString(),c);m&&m.addEventListener("abort",k);let L=()=>{R.abort(),m&&m.removeEventListener("abort",k)};R.on("error",g=>{s(new te(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),L()}),ac(R,g=>{h&&h.body&&h.body.destroy(g)}),process.version<"v14"&&R.on("socket",g=>{let z;g.prependListener("end",()=>{z=g._eventsCount}),g.prependListener("close",T=>{if(h&&z<g._eventsCount&&!T){let j=new Error("Premature close");j.code="ERR_STREAM_PREMATURE_CLOSE",h.body.emit("error",j)}})}),R.on("response",g=>{R.setTimeout(0);let z=Ji(g.rawHeaders);if(Pr(g.statusCode)){let $=z.get("Location"),M=null;try{M=$===null?null:new URL($,i.url)}catch{if(i.redirect!=="manual"){s(new te(`uri requested responds with an invalid redirect URL: ${$}`,"invalid-redirect")),L();return}}switch(i.redirect){case"error":s(new te(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),L();return;case"manual":break;case"follow":{if(M===null)break;if(i.counter>=i.follow){s(new te(`maximum redirect reached at: ${i.url}`,"max-redirect")),L();return}let Y={headers:new se(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:rr(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Bi(i.url,M)||!Ii(i.url,M))for(let fr of["authorization","www-authenticate","cookie","cookie2"])Y.headers.delete(fr);if(g.statusCode!==303&&i.body&&e.body instanceof ce.default.Readable){s(new te("Cannot follow redirect with body being a readable stream","unsupported-redirect")),L();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(Y.method="GET",Y.body=void 0,Y.headers.delete("content-length"));let Ge=lo(z);Ge&&(Y.referrerPolicy=Ge),r($a(new dt(M,Y))),L();return}default:return s(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}m&&g.once("end",()=>{m.removeEventListener("abort",k)});let T=(void 0)(g,new(void 0),$=>{$&&s($)});process.version<"v12.10"&&g.on("aborted",k);let j={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:z,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},H=z.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||H===null||g.statusCode===204||g.statusCode===304){h=new le(T,j),r(h);return}let J={flush:kt.default.Z_SYNC_FLUSH,finishFlush:kt.default.Z_SYNC_FLUSH};if(H==="gzip"||H==="x-gzip"){T=(void 0)(T,kt.default.createGunzip(J),$=>{$&&s($)}),h=new le(T,j),r(h);return}if(H==="deflate"||H==="x-deflate"){let $=(void 0)(g,new(void 0),M=>{M&&s(M)});$.once("data",M=>{(M[0]&15)===8?T=(void 0)(T,kt.default.createInflate(),Y=>{Y&&s(Y)}):T=(void 0)(T,kt.default.createInflateRaw(),Y=>{Y&&s(Y)}),h=new le(T,j),r(h)}),$.once("end",()=>{h||(h=new le(T,j),r(h))});return}if(H==="br"){T=(void 0)(T,kt.default.createBrotliDecompress(),$=>{$&&s($)}),h=new le(T,j),r(h);return}h=new le(T,j),r(h)}),Gi(R,i).catch(s)})}function ac(n,e){let r=(void 0).from(`0\r
|
|
13
13
|
\r
|
|
14
|
-
`),s=!1,i=!1,u;n.on("response",c=>{let{headers:d}=c;s=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),n.on("socket",c=>{let d=()=>{if(s&&!i){let h=new Error("Premature close");h.code="ERR_STREAM_PREMATURE_CLOSE",e(h)}},m=h=>{i=(void 0).compare(h.slice(-5),r)===0,!i&&u&&(i=(void 0).compare(u.slice(-3),r.slice(0,3))===0&&(void 0).compare(h.slice(-2),r.slice(3))===0),u=h};c.prependListener("close",d),c.on("data",m),n.on("close",()=>{c.removeListener("close",d),c.removeListener("data",m)})})}var mo,po,kt,ce,tc,bo=Z(()=>{"use strict";mo=ot(Ta(),1),po=ot(pi(),1),kt=ot(yi(),1),ce=ot(Ea(),1);Ca();_i();Pn();Gi();An();fo();Oa();ho();Na();wn();Rn();za();Da();tc=new Set(["data:","http:","https:"])});var yd={};bn(yd,{AVAILABLE_LANGUAGES:()=>pd,VCRClient:()=>Lr,unitsKeys:()=>md});function _o(n){return n&&n.default||n}var If=global.fetch=global.fetch||(typeof process>"u"?function(n,e){return Promise.resolve().then(()=>(mi(),hi)).then(r=>_o(r)(n,e))}:function(n,e){return(typeof n=="string"||n instanceof URL)&&(n=String(n).replace(/^\/\//g,"https://")),Promise.resolve().then(()=>(bo(),yo)).then(r=>_o(r)(n,e))});var nc={withStackTrace:!1},So=(n,e,r=nc)=>{let s=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},i=r.withStackTrace?new Error().stack:void 0;return{data:s,message:n,stack:i}};function On(n,e,r,s){function i(u){return u instanceof r?u:new r(function(c){c(u)})}return new(r||(r=Promise))(function(u,c){function d(p){try{h(s.next(p))}catch(k){c(k)}}function m(p){try{h(s.throw(p))}catch(k){c(k)}}function h(p){p.done?u(p.value):i(p.value).then(d,m)}h((s=s.apply(n,e||[])).next())})}function go(n){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&n[e],s=0;if(r)return r.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(n){return this instanceof Pt?(this.v=n,this):new Pt(n)}function ac(n,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(n,e||[]),i,u=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(R){s[R]&&(i[R]=function(q){return new Promise(function(g,z){u.push([R,q,g,z])>1||d(R,q)})})}function d(R,q){try{m(s[R](q))}catch(g){k(u[0][3],g)}}function m(R){R.value instanceof Pt?Promise.resolve(R.value.v).then(h,p):k(u[0][2],R)}function h(R){d("next",R)}function p(R){d("throw",R)}function k(R,q){R(q),u.shift(),u.length&&d(u[0][0],u[0][1])}}function sc(n){var e,r;return e={},s("next"),s("throw",function(i){throw i}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(i,u){e[i]=n[i]?function(c){return(r=!r)?{value:Pt(n[i](c)),done:i==="return"}:u?u(c):c}:u}}function ic(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],r;return e?e.call(n):(n=typeof go=="function"?go(n):n[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(u){r[u]=n[u]&&function(c){return new Promise(function(d,m){c=n[u](c),i(d,m,c.done,c.value)})}}function i(u,c,d,m){Promise.resolve(m).then(function(h){u({value:h,done:d})},c)}}var Ve=class n{constructor(e){this._promise=e}static fromSafePromise(e){let r=e.then(s=>new Fe(s));return new n(r)}static fromPromise(e,r){let s=e.then(i=>new Fe(i)).catch(i=>new Ue(r(i)));return new n(s)}static fromThrowable(e,r){return(...s)=>new n(On(this,void 0,void 0,function*(){try{return new Fe(yield e(...s))}catch(i){return new Ue(r?r(i):i)}}))}static combine(e){return uc(e)}static combineWithAllErrors(e){return lc(e)}map(e){return new n(this._promise.then(r=>On(this,void 0,void 0,function*(){return r.isErr()?new Ue(r.error):new Fe(yield e(r.value))})))}mapErr(e){return new n(this._promise.then(r=>On(this,void 0,void 0,function*(){return r.isOk()?new Fe(r.value):new Ue(yield e(r.error))})))}andThen(e){return new n(this._promise.then(r=>{if(r.isErr())return new Ue(r.error);let s=e(r.value);return s instanceof n?s._promise:s}))}orElse(e){return new n(this._promise.then(r=>On(this,void 0,void 0,function*(){return r.isErr()?e(r.error):new Fe(r.value)})))}match(e,r){return this._promise.then(s=>s.match(e,r))}unwrapOr(e){return this._promise.then(r=>r.unwrapOr(e))}safeUnwrap(){return ac(this,arguments,function*(){return yield Pt(yield Pt(yield*sc(ic(yield Pt(this._promise.then(r=>r.safeUnwrap()))))))})}then(e,r){return this._promise.then(e,r)}};var wo=n=>new Ve(Promise.resolve(new Ue(n))),Fa=Ve.fromPromise,Wf=Ve.fromSafePromise,jf=Ve.fromThrowable,oc=n=>e=>[...e,n],vo=n=>n.reduce((e,r)=>e.isOk()?r.isErr()?Q(r.error):e.map(oc(r.value)):e,xe([])),uc=n=>Ve.fromSafePromise(Promise.all(n)).andThen(vo),Ro=n=>n.reduce((e,r)=>r.isErr()?e.isErr()?Q([...e.error,r.error]):Q([r.error]):e.isErr()?e:xe([...e.value,r.value]),xe([])),lc=n=>Ve.fromSafePromise(Promise.all(n)).andThen(Ro),Ma;(function(n){function e(i,u){return(...c)=>{try{let d=i(...c);return xe(d)}catch(d){return Q(u?u(d):d)}}}n.fromThrowable=e;function r(i){return vo(i)}n.combine=r;function s(i){return Ro(i)}n.combineWithAllErrors=s})(Ma||(Ma={}));var xe=n=>new Fe(n),Q=n=>new Ue(n);var Fe=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return xe(e(this.value))}mapErr(e){return xe(this.value)}andThen(e){return e(this.value)}orElse(e){return xe(this.value)}asyncAndThen(e){return e(this.value)}asyncMap(e){return Ve.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,r){return e(this.value)}safeUnwrap(){let e=this.value;return function*(){return e}()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw So("Called `_unsafeUnwrapErr` on an Ok",this,e)}},Ue=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return Q(this.error)}mapErr(e){return Q(e(this.error))}andThen(e){return Q(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return wo(this.error)}asyncMap(e){return wo(this.error)}unwrapOr(e){return e}match(e,r){return r(this.error)}safeUnwrap(){let e=this.error;return function*(){throw yield Q(e),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(e){throw So("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}},To=Ma.fromThrowable;async function Eo(n,e,r,s){let i={...r,headers:r?.headers??{}},u={requestOptions:i,url:n},c=await Fa(fetch(n,i),T=>T instanceof Error?Q({type:"fetchError",...u,message:T.message,error:T}):Q({type:"unknownFetchThrow",...u,message:"Unknown fetch error",error:T}));if(c.isErr())return c.error;let d=c.value,m={...u,response:d},h=await Fa(d.text(),T=>T instanceof Error?Q({type:"unknownGetTextError",...m,message:`Can't get response content: ${T.message}`,error:T}):Q({type:"unknownGetTextUnknownError",...m,message:"Can't get response content: unknown error",error:T}));if(h.isErr())return h.error;let p=h.value,k={...m,text:p},R=To(JSON.parse,T=>T instanceof Error?Q({type:"jsonParseError",...k,message:T.message,error:T}):Q({type:"jsonParseUnknownError",...k,message:"Unknown JSON parse error",error:T}))(p);if(R.isErr()){let T=e.safeParse(p);return T.success?xe({...k,data:T.data}):Q({type:"jsonParseError",...k,message:`Can't parse response as JSON: ${R.error.error.message}. Original response: ${p}`,error:R.error.error})}let q=R.value,g;if(s){let T=s.safeParse(q);T.success&&(g=T.data)}if(d.status>=500)return Q({type:"serverError",...k,message:`Server error: ${d.status} ${d.statusText}. ${g?`Data: ${JSON.stringify(g)}`:""}`});if(d.status>=400)return Q({type:"clientError",...k,message:`Error: ${d.status} ${d.statusText}. Response: ${p}`,errorMetadata:g});let z=e.safeParse(q);if(!z.success){let T=z.error.issues.map(j=>`[${j.path.join(".")}] ${j.message}`).join(", ");return Q({type:"payloadParseError",...k,message:`Can't recognize response payload: ${T}`})}return xe({...k,data:z.data})}function Co(n){return async(...e)=>{let r=await n(...e);if(r.isErr()){let{message:s,url:i}=r.error;throw new Error(`${s} (${i})`)}return r.value.data}}var N;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function r(i){throw new Error}n.assertNever=r,n.arrayToEnum=i=>{let u={};for(let c of i)u[c]=c;return u},n.getValidEnumValues=i=>{let u=n.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(let d of u)c[d]=i[d];return n.objectValues(c)},n.objectValues=i=>n.objectKeys(i).map(function(u){return i[u]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let u=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&u.push(c);return u},n.find=(i,u)=>{for(let c of i)if(u(c))return c},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function s(i,u=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(u)}n.joinValues=s,n.jsonStringifyReplacer=(i,u)=>typeof u=="bigint"?u.toString():u})(N||(N={}));var Va;(function(n){n.mergeShapes=(e,r)=>({...e,...r})})(Va||(Va={}));var v=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ft=n=>{switch(typeof n){case"undefined":return v.undefined;case"string":return v.string;case"number":return isNaN(n)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(n)?v.array:n===null?v.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?v.promise:typeof Map<"u"&&n instanceof Map?v.map:typeof Set<"u"&&n instanceof Set?v.set:typeof Date<"u"&&n instanceof Date?v.date:v.object;default:return v.unknown}},_=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),cc=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),de=class n extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(u){return u.message},s={_errors:[]},i=u=>{for(let c of u.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)s._errors.push(r(c));else{let d=s,m=0;for(;m<c.path.length;){let h=c.path[m];m===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(r(c))):d[h]=d[h]||{_errors:[]},d=d[h],m++}}};return i(this),s}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};de.create=n=>new de(n);var ir=(n,e)=>{let r;switch(n.code){case _.invalid_type:n.received===v.undefined?r="Required":r=`Expected ${n.expected}, received ${n.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,N.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${N.joinValues(n.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${N.joinValues(n.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${N.joinValues(n.options)}, received '${n.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:N.assertNever(n.validation):n.validation!=="regex"?r=`Invalid ${n.validation}`:r="Invalid";break;case _.too_small:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:r="Invalid input";break;case _.too_big:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?r=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,N.assertNever(n)}return{message:r}},xo=ir;function dc(n){xo=n}function Bn(){return xo}var In=n=>{let{data:e,path:r,errorMaps:s,issueData:i}=n,u=[...r,...i.path||[]],c={...i,path:u};if(i.message!==void 0)return{...i,path:u,message:i.message};let d="",m=s.filter(h=>!!h).slice().reverse();for(let h of m)d=h(c,{data:e,defaultError:d}).message;return{...i,path:u,message:d}},fc=[];function w(n,e){let r=Bn(),s=In({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,r,r===ir?void 0:ir].filter(i=>!!i)});n.common.issues.push(s)}var X=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let i of r){if(i.status==="aborted")return A;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let i of r){let u=await i.key,c=await i.value;s.push({key:u,value:c})}return n.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let i of r){let{key:u,value:c}=i;if(u.status==="aborted"||c.status==="aborted")return A;u.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),u.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(s[u.value]=c.value)}return{status:e.value,value:s}}},A=Object.freeze({status:"aborted"}),sr=n=>({status:"dirty",value:n}),re=n=>({status:"valid",value:n}),Za=n=>n.status==="aborted",Ha=n=>n.status==="dirty",Dr=n=>n.status==="valid",Wr=n=>typeof Promise<"u"&&n instanceof Promise;function Dn(n,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(n):s?s.value:e.get(n)}function Ao(n,e,r,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,r):i?i.value=r:e.set(n,r),r}var E;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(E||(E={}));var Br,Ir,_e=class{constructor(e,r,s,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ko=(n,e)=>{if(Dr(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new de(n.common.issues);return this._error=r,this._error}}};function I(n){if(!n)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:i}=n;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var m,h;let{message:p}=n;return c.code==="invalid_enum_value"?{message:p??d.defaultError}:typeof d.data>"u"?{message:(m=p??s)!==null&&m!==void 0?m:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=p??r)!==null&&h!==void 0?h:d.defaultError}},description:i}}var D=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ft(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Wr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){var s;let i={common:{issues:[],async:(s=r?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ft(e)},u=this._parseSync({data:e,path:i.path,parent:i});return ko(i,u)}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ft(e)},i=this._parse({data:e,path:s.path,parent:s}),u=await(Wr(i)?i:Promise.resolve(i));return ko(s,u)}refine(e,r){let s=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,u)=>{let c=e(i),d=()=>u.addIssue({code:_.custom,...s(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(m=>m?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,r){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof r=="function"?r(s,i):r),!1))}_refinement(e){return new fe({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return be.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ye.create(this,this._def)}promise(){return pt.create(this,this._def)}or(e){return Wt.create([this,e],this._def)}and(e){return jt.create(this,e,this._def)}transform(e){return new fe({...I(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new $t({...I(this._def),innerType:this,defaultValue:r,typeName:x.ZodDefault})}brand(){return new jr({typeName:x.ZodBranded,type:this,...I(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mt({...I(this._def),innerType:this,catchValue:r,typeName:x.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return qr.create(this,e)}readonly(){return Ft.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},hc=/^c[^\s-]{8,}$/i,mc=/^[0-9a-z]+$/,pc=/^[0-9A-HJKMNP-TV-Z]{26}$/,yc=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bc=/^[a-z0-9_-]{21}$/i,_c=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ua,Sc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vc=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Rc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Oo="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Tc=new RegExp(`^${Oo}$`);function Bo(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ec(n){return new RegExp(`^${Bo(n)}$`)}function Io(n){let e=`${Oo}T${Bo(n)}`,r=[];return r.push(n.local?"Z?":"Z"),n.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Cc(n,e){return!!((e==="v4"||!e)&&Sc.test(n)||(e==="v6"||!e)&&vc.test(n))}var ht=class n extends D{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.string,received:u.parsedType}),A}let s=new X,i;for(let u of this._def.checks)if(u.kind==="min")e.data.length<u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_small,minimum:u.value,type:"string",inclusive:!0,exact:!1,message:u.message}),s.dirty());else if(u.kind==="max")e.data.length>u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_big,maximum:u.value,type:"string",inclusive:!0,exact:!1,message:u.message}),s.dirty());else if(u.kind==="length"){let c=e.data.length>u.value,d=e.data.length<u.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?w(i,{code:_.too_big,maximum:u.value,type:"string",inclusive:!0,exact:!0,message:u.message}):d&&w(i,{code:_.too_small,minimum:u.value,type:"string",inclusive:!0,exact:!0,message:u.message}),s.dirty())}else if(u.kind==="email")gc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"email",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="emoji")Ua||(Ua=new RegExp(wc,"u")),Ua.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"emoji",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="uuid")yc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"uuid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="nanoid")bc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"nanoid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="cuid")hc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cuid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="cuid2")mc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cuid2",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="ulid")pc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"ulid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),w(i,{validation:"url",code:_.invalid_string,message:u.message}),s.dirty()}else u.kind==="regex"?(u.regex.lastIndex=0,u.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"regex",code:_.invalid_string,message:u.message}),s.dirty())):u.kind==="trim"?e.data=e.data.trim():u.kind==="includes"?e.data.includes(u.value,u.position)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:{includes:u.value,position:u.position},message:u.message}),s.dirty()):u.kind==="toLowerCase"?e.data=e.data.toLowerCase():u.kind==="toUpperCase"?e.data=e.data.toUpperCase():u.kind==="startsWith"?e.data.startsWith(u.value)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:{startsWith:u.value},message:u.message}),s.dirty()):u.kind==="endsWith"?e.data.endsWith(u.value)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:{endsWith:u.value},message:u.message}),s.dirty()):u.kind==="datetime"?Io(u).test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:"datetime",message:u.message}),s.dirty()):u.kind==="date"?Tc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:"date",message:u.message}),s.dirty()):u.kind==="time"?Ec(u).test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:"time",message:u.message}),s.dirty()):u.kind==="duration"?_c.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"duration",code:_.invalid_string,message:u.message}),s.dirty()):u.kind==="ip"?Cc(e.data,u.version)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"ip",code:_.invalid_string,message:u.message}),s.dirty()):u.kind==="base64"?Rc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"base64",code:_.invalid_string,message:u.message}),s.dirty()):N.assertNever(u);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(i=>e.test(i),{validation:r,code:_.invalid_string,...E.errToObj(s)})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}datetime(e){var r,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(s=e?.local)!==null&&s!==void 0?s:!1,...E.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...E.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...E.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...E.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...E.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...E.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...E.errToObj(r)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ht.create=n=>{var e;return new ht({checks:[],typeName:x.ZodString,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...I(n)})};function kc(n,e){let r=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=r>s?r:s,u=parseInt(n.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return u%c/Math.pow(10,i)}var xt=class n extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.number,received:u.parsedType}),A}let s,i=new X;for(let u of this._def.checks)u.kind==="int"?N.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:_.invalid_type,expected:"integer",received:"float",message:u.message}),i.dirty()):u.kind==="min"?(u.inclusive?e.data<u.value:e.data<=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_small,minimum:u.value,type:"number",inclusive:u.inclusive,exact:!1,message:u.message}),i.dirty()):u.kind==="max"?(u.inclusive?e.data>u.value:e.data>=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_big,maximum:u.value,type:"number",inclusive:u.inclusive,exact:!1,message:u.message}),i.dirty()):u.kind==="multipleOf"?kc(e.data,u.value)!==0&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.not_multiple_of,multipleOf:u.value,message:u.message}),i.dirty()):u.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:_.not_finite,message:u.message}),i.dirty()):N.assertNever(u);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,s,i){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:E.toString(i)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};xt.create=n=>new xt({checks:[],typeName:x.ZodNumber,coerce:n?.coerce||!1,...I(n)});var At=class n extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==v.bigint){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.bigint,received:u.parsedType}),A}let s,i=new X;for(let u of this._def.checks)u.kind==="min"?(u.inclusive?e.data<u.value:e.data<=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_small,type:"bigint",minimum:u.value,inclusive:u.inclusive,message:u.message}),i.dirty()):u.kind==="max"?(u.inclusive?e.data>u.value:e.data>=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_big,type:"bigint",maximum:u.value,inclusive:u.inclusive,message:u.message}),i.dirty()):u.kind==="multipleOf"?e.data%u.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.not_multiple_of,multipleOf:u.value,message:u.message}),i.dirty()):N.assertNever(u);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,s,i){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:E.toString(i)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};At.create=n=>{var e;return new At({checks:[],typeName:x.ZodBigInt,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...I(n)})};var Ot=class extends D{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.boolean,received:s.parsedType}),A}return re(e.data)}};Ot.create=n=>new Ot({typeName:x.ZodBoolean,coerce:n?.coerce||!1,...I(n)});var Bt=class n extends D{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.date,received:u.parsedType}),A}if(isNaN(e.data.getTime())){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_date}),A}let s=new X,i;for(let u of this._def.checks)u.kind==="min"?e.data.getTime()<u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_small,message:u.message,inclusive:!0,exact:!1,minimum:u.value,type:"date"}),s.dirty()):u.kind==="max"?e.data.getTime()>u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_big,message:u.message,inclusive:!0,exact:!1,maximum:u.value,type:"date"}),s.dirty()):N.assertNever(u);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Bt.create=n=>new Bt({checks:[],coerce:n?.coerce||!1,typeName:x.ZodDate,...I(n)});var or=class extends D{_parse(e){if(this._getType(e)!==v.symbol){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.symbol,received:s.parsedType}),A}return re(e.data)}};or.create=n=>new or({typeName:x.ZodSymbol,...I(n)});var It=class extends D{_parse(e){if(this._getType(e)!==v.undefined){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.undefined,received:s.parsedType}),A}return re(e.data)}};It.create=n=>new It({typeName:x.ZodUndefined,...I(n)});var Dt=class extends D{_parse(e){if(this._getType(e)!==v.null){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.null,received:s.parsedType}),A}return re(e.data)}};Dt.create=n=>new Dt({typeName:x.ZodNull,...I(n)});var mt=class extends D{constructor(){super(...arguments),this._any=!0}_parse(e){return re(e.data)}};mt.create=n=>new mt({typeName:x.ZodAny,...I(n)});var He=class extends D{constructor(){super(...arguments),this._unknown=!0}_parse(e){return re(e.data)}};He.create=n=>new He({typeName:x.ZodUnknown,...I(n)});var Te=class extends D{_parse(e){let r=this._getOrReturnCtx(e);return w(r,{code:_.invalid_type,expected:v.never,received:r.parsedType}),A}};Te.create=n=>new Te({typeName:x.ZodNever,...I(n)});var ur=class extends D{_parse(e){if(this._getType(e)!==v.undefined){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.void,received:s.parsedType}),A}return re(e.data)}};ur.create=n=>new ur({typeName:x.ZodVoid,...I(n)});var Ye=class n extends D{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),i=this._def;if(r.parsedType!==v.array)return w(r,{code:_.invalid_type,expected:v.array,received:r.parsedType}),A;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(c||d)&&(w(r,{code:c?_.too_big:_.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(w(r,{code:_.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(w(r,{code:_.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((c,d)=>i.type._parseAsync(new _e(r,c,r.path,d)))).then(c=>X.mergeArray(s,c));let u=[...r.data].map((c,d)=>i.type._parseSync(new _e(r,c,r.path,d)));return X.mergeArray(s,u)}get element(){return this._def.type}min(e,r){return new n({...this._def,minLength:{value:e,message:E.toString(r)}})}max(e,r){return new n({...this._def,maxLength:{value:e,message:E.toString(r)}})}length(e,r){return new n({...this._def,exactLength:{value:e,message:E.toString(r)}})}nonempty(e){return this.min(1,e)}};Ye.create=(n,e)=>new Ye({type:n,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...I(e)});function ar(n){if(n instanceof ie){let e={};for(let r in n.shape){let s=n.shape[r];e[r]=be.create(ar(s))}return new ie({...n._def,shape:()=>e})}else return n instanceof Ye?new Ye({...n._def,type:ar(n.element)}):n instanceof be?be.create(ar(n.unwrap())):n instanceof Oe?Oe.create(ar(n.unwrap())):n instanceof Ae?Ae.create(n.items.map(e=>ar(e))):n}var ie=class n extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=N.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==v.object){let h=this._getOrReturnCtx(e);return w(h,{code:_.invalid_type,expected:v.object,received:h.parsedType}),A}let{status:s,ctx:i}=this._processInputParams(e),{shape:u,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Te&&this._def.unknownKeys==="strip"))for(let h in i.data)c.includes(h)||d.push(h);let m=[];for(let h of c){let p=u[h],k=i.data[h];m.push({key:{status:"valid",value:h},value:p._parse(new _e(i,k,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Te){let h=this._def.unknownKeys;if(h==="passthrough")for(let p of d)m.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(h==="strict")d.length>0&&(w(i,{code:_.unrecognized_keys,keys:d}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let p of d){let k=i.data[p];m.push({key:{status:"valid",value:p},value:h._parse(new _e(i,k,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let h=[];for(let p of m){let k=await p.key,R=await p.value;h.push({key:k,value:R,alwaysSet:p.alwaysSet})}return h}).then(h=>X.mergeObjectSync(s,h)):X.mergeObjectSync(s,m)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var i,u,c,d;let m=(c=(u=(i=this._def).errorMap)===null||u===void 0?void 0:u.call(i,r,s).message)!==null&&c!==void 0?c:s.defaultError;return r.code==="unrecognized_keys"?{message:(d=E.errToObj(e).message)!==null&&d!==void 0?d:m}:{message:m}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(e){return new n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new n({...this._def,catchall:e})}pick(e){let r={};return N.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new n({...this._def,shape:()=>r})}omit(e){let r={};return N.objectKeys(this.shape).forEach(s=>{e[s]||(r[s]=this.shape[s])}),new n({...this._def,shape:()=>r})}deepPartial(){return ar(this)}partial(e){let r={};return N.objectKeys(this.shape).forEach(s=>{let i=this.shape[s];e&&!e[s]?r[s]=i:r[s]=i.optional()}),new n({...this._def,shape:()=>r})}required(e){let r={};return N.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])r[s]=this.shape[s];else{let u=this.shape[s];for(;u instanceof be;)u=u._def.innerType;r[s]=u}}),new n({...this._def,shape:()=>r})}keyof(){return Do(N.objectKeys(this.shape))}};ie.create=(n,e)=>new ie({shape:()=>n,unknownKeys:"strip",catchall:Te.create(),typeName:x.ZodObject,...I(e)});ie.strictCreate=(n,e)=>new ie({shape:()=>n,unknownKeys:"strict",catchall:Te.create(),typeName:x.ZodObject,...I(e)});ie.lazycreate=(n,e)=>new ie({shape:n,unknownKeys:"strip",catchall:Te.create(),typeName:x.ZodObject,...I(e)});var Wt=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function i(u){for(let d of u)if(d.result.status==="valid")return d.result;for(let d of u)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;let c=u.map(d=>new de(d.ctx.common.issues));return w(r,{code:_.invalid_union,unionErrors:c}),A}if(r.common.async)return Promise.all(s.map(async u=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await u._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let u,c=[];for(let m of s){let h={...r,common:{...r.common,issues:[]},parent:null},p=m._parseSync({data:r.data,path:r.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!u&&(u={result:p,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(u)return r.common.issues.push(...u.ctx.common.issues),u.result;let d=c.map(m=>new de(m));return w(r,{code:_.invalid_union,unionErrors:d}),A}}get options(){return this._def.options}};Wt.create=(n,e)=>new Wt({options:n,typeName:x.ZodUnion,...I(e)});var Ze=n=>n instanceof qt?Ze(n.schema):n instanceof fe?Ze(n.innerType()):n instanceof Lt?[n.value]:n instanceof Nt?n.options:n instanceof zt?N.objectValues(n.enum):n instanceof $t?Ze(n._def.innerType):n instanceof It?[void 0]:n instanceof Dt?[null]:n instanceof be?[void 0,...Ze(n.unwrap())]:n instanceof Oe?[null,...Ze(n.unwrap())]:n instanceof jr||n instanceof Ft?Ze(n.unwrap()):n instanceof Mt?Ze(n._def.innerType):[],Wn=class n extends D{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.object)return w(r,{code:_.invalid_type,expected:v.object,received:r.parsedType}),A;let s=this.discriminator,i=r.data[s],u=this.optionsMap.get(i);return u?r.common.async?u._parseAsync({data:r.data,path:r.path,parent:r}):u._parseSync({data:r.data,path:r.path,parent:r}):(w(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let i=new Map;for(let u of r){let c=Ze(u.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,u)}}return new n({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...I(s)})}};function Ya(n,e){let r=ft(n),s=ft(e);if(n===e)return{valid:!0,data:n};if(r===v.object&&s===v.object){let i=N.objectKeys(e),u=N.objectKeys(n).filter(d=>i.indexOf(d)!==-1),c={...n,...e};for(let d of u){let m=Ya(n[d],e[d]);if(!m.valid)return{valid:!1};c[d]=m.data}return{valid:!0,data:c}}else if(r===v.array&&s===v.array){if(n.length!==e.length)return{valid:!1};let i=[];for(let u=0;u<n.length;u++){let c=n[u],d=e[u],m=Ya(c,d);if(!m.valid)return{valid:!1};i.push(m.data)}return{valid:!0,data:i}}else return r===v.date&&s===v.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var jt=class extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=(u,c)=>{if(Za(u)||Za(c))return A;let d=Ya(u.value,c.value);return d.valid?((Ha(u)||Ha(c))&&r.dirty(),{status:r.value,value:d.data}):(w(s,{code:_.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([u,c])=>i(u,c)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};jt.create=(n,e,r)=>new jt({left:n,right:e,typeName:x.ZodIntersection,...I(r)});var Ae=class n extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.array)return w(s,{code:_.invalid_type,expected:v.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return w(s,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(w(s,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let u=[...s.data].map((c,d)=>{let m=this._def.items[d]||this._def.rest;return m?m._parse(new _e(s,c,s.path,d)):null}).filter(c=>!!c);return s.common.async?Promise.all(u).then(c=>X.mergeArray(r,c)):X.mergeArray(r,u)}get items(){return this._def.items}rest(e){return new n({...this._def,rest:e})}};Ae.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ae({items:n,typeName:x.ZodTuple,rest:null,...I(e)})};var jn=class n extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.object)return w(s,{code:_.invalid_type,expected:v.object,received:s.parsedType}),A;let i=[],u=this._def.keyType,c=this._def.valueType;for(let d in s.data)i.push({key:u._parse(new _e(s,d,s.path,d)),value:c._parse(new _e(s,s.data[d],s.path,d)),alwaysSet:d in s.data});return s.common.async?X.mergeObjectAsync(r,i):X.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof D?new n({keyType:e,valueType:r,typeName:x.ZodRecord,...I(s)}):new n({keyType:ht.create(),valueType:e,typeName:x.ZodRecord,...I(r)})}},lr=class extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.map)return w(s,{code:_.invalid_type,expected:v.map,received:s.parsedType}),A;let i=this._def.keyType,u=this._def.valueType,c=[...s.data.entries()].map(([d,m],h)=>({key:i._parse(new _e(s,d,s.path,[h,"key"])),value:u._parse(new _e(s,m,s.path,[h,"value"]))}));if(s.common.async){let d=new Map;return Promise.resolve().then(async()=>{for(let m of c){let h=await m.key,p=await m.value;if(h.status==="aborted"||p.status==="aborted")return A;(h.status==="dirty"||p.status==="dirty")&&r.dirty(),d.set(h.value,p.value)}return{status:r.value,value:d}})}else{let d=new Map;for(let m of c){let h=m.key,p=m.value;if(h.status==="aborted"||p.status==="aborted")return A;(h.status==="dirty"||p.status==="dirty")&&r.dirty(),d.set(h.value,p.value)}return{status:r.value,value:d}}}};lr.create=(n,e,r)=>new lr({valueType:e,keyType:n,typeName:x.ZodMap,...I(r)});var cr=class n extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.set)return w(s,{code:_.invalid_type,expected:v.set,received:s.parsedType}),A;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(w(s,{code:_.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(w(s,{code:_.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let u=this._def.valueType;function c(m){let h=new Set;for(let p of m){if(p.status==="aborted")return A;p.status==="dirty"&&r.dirty(),h.add(p.value)}return{status:r.value,value:h}}let d=[...s.data.values()].map((m,h)=>u._parse(new _e(s,m,s.path,h)));return s.common.async?Promise.all(d).then(m=>c(m)):c(d)}min(e,r){return new n({...this._def,minSize:{value:e,message:E.toString(r)}})}max(e,r){return new n({...this._def,maxSize:{value:e,message:E.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};cr.create=(n,e)=>new cr({valueType:n,minSize:null,maxSize:null,typeName:x.ZodSet,...I(e)});var qn=class n extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.function)return w(r,{code:_.invalid_type,expected:v.function,received:r.parsedType}),A;function s(d,m){return In({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bn(),ir].filter(h=>!!h),issueData:{code:_.invalid_arguments,argumentsError:m}})}function i(d,m){return In({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bn(),ir].filter(h=>!!h),issueData:{code:_.invalid_return_type,returnTypeError:m}})}let u={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof pt){let d=this;return re(async function(...m){let h=new de([]),p=await d._def.args.parseAsync(m,u).catch(q=>{throw h.addIssue(s(m,q)),h}),k=await Reflect.apply(c,this,p);return await d._def.returns._def.type.parseAsync(k,u).catch(q=>{throw h.addIssue(i(k,q)),h})})}else{let d=this;return re(function(...m){let h=d._def.args.safeParse(m,u);if(!h.success)throw new de([s(m,h.error)]);let p=Reflect.apply(c,this,h.data),k=d._def.returns.safeParse(p,u);if(!k.success)throw new de([i(p,k.error)]);return k.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n({...this._def,args:Ae.create(e).rest(He.create())})}returns(e){return new n({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new n({args:e||Ae.create([]).rest(He.create()),returns:r||He.create(),typeName:x.ZodFunction,...I(s)})}},qt=class extends D{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};qt.create=(n,e)=>new qt({getter:n,typeName:x.ZodLazy,...I(e)});var Lt=class extends D{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return w(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Lt.create=(n,e)=>new Lt({value:n,typeName:x.ZodLiteral,...I(e)});function Do(n,e){return new Nt({values:n,typeName:x.ZodEnum,...I(e)})}var Nt=class n extends D{constructor(){super(...arguments),Br.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return w(r,{expected:N.joinValues(s),received:r.parsedType,code:_.invalid_type}),A}if(Dn(this,Br,"f")||Ao(this,Br,new Set(this._def.values),"f"),!Dn(this,Br,"f").has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return w(r,{received:r.data,code:_.invalid_enum_value,options:s}),A}return re(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return n.create(e,{...this._def,...r})}exclude(e,r=this._def){return n.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};Br=new WeakMap;Nt.create=Do;var zt=class extends D{constructor(){super(...arguments),Ir.set(this,void 0)}_parse(e){let r=N.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==v.string&&s.parsedType!==v.number){let i=N.objectValues(r);return w(s,{expected:N.joinValues(i),received:s.parsedType,code:_.invalid_type}),A}if(Dn(this,Ir,"f")||Ao(this,Ir,new Set(N.getValidEnumValues(this._def.values)),"f"),!Dn(this,Ir,"f").has(e.data)){let i=N.objectValues(r);return w(s,{received:s.data,code:_.invalid_enum_value,options:i}),A}return re(e.data)}get enum(){return this._def.values}};Ir=new WeakMap;zt.create=(n,e)=>new zt({values:n,typeName:x.ZodNativeEnum,...I(e)});var pt=class extends D{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.promise&&r.common.async===!1)return w(r,{code:_.invalid_type,expected:v.promise,received:r.parsedType}),A;let s=r.parsedType===v.promise?r.data:Promise.resolve(r.data);return re(s.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pt.create=(n,e)=>new pt({type:n,typeName:x.ZodPromise,...I(e)});var fe=class extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=this._def.effect||null,u={addIssue:c=>{w(s,c),c.fatal?r.abort():r.dirty()},get path(){return s.path}};if(u.addIssue=u.addIssue.bind(u),i.type==="preprocess"){let c=i.transform(s.data,u);if(s.common.async)return Promise.resolve(c).then(async d=>{if(r.value==="aborted")return A;let m=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return m.status==="aborted"?A:m.status==="dirty"||r.value==="dirty"?sr(m.value):m});{if(r.value==="aborted")return A;let d=this._def.schema._parseSync({data:c,path:s.path,parent:s});return d.status==="aborted"?A:d.status==="dirty"||r.value==="dirty"?sr(d.value):d}}if(i.type==="refinement"){let c=d=>{let m=i.refinement(d,u);if(s.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){let d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?A:(d.status==="dirty"&&r.dirty(),c(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?A:(d.status==="dirty"&&r.dirty(),c(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(s.common.async===!1){let c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Dr(c))return c;let d=i.transform(c.value,u);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>Dr(c)?Promise.resolve(i.transform(c.value,u)).then(d=>({status:r.value,value:d})):c);N.assertNever(i)}};fe.create=(n,e,r)=>new fe({schema:n,typeName:x.ZodEffects,effect:e,...I(r)});fe.createWithPreprocess=(n,e,r)=>new fe({schema:e,effect:{type:"preprocess",transform:n},typeName:x.ZodEffects,...I(r)});var be=class extends D{_parse(e){return this._getType(e)===v.undefined?re(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};be.create=(n,e)=>new be({innerType:n,typeName:x.ZodOptional,...I(e)});var Oe=class extends D{_parse(e){return this._getType(e)===v.null?re(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Oe.create=(n,e)=>new Oe({innerType:n,typeName:x.ZodNullable,...I(e)});var $t=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===v.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};$t.create=(n,e)=>new $t({innerType:n,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...I(e)});var Mt=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Wr(i)?i.then(u=>({status:"valid",value:u.status==="valid"?u.value:this._def.catchValue({get error(){return new de(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new de(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Mt.create=(n,e)=>new Mt({innerType:n,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...I(e)});var dr=class extends D{_parse(e){if(this._getType(e)!==v.nan){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}};dr.create=n=>new dr({typeName:x.ZodNaN,...I(n)});var Pc=Symbol("zod_brand"),jr=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},qr=class n extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let u=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return u.status==="aborted"?A:u.status==="dirty"?(r.dirty(),sr(u.value)):this._def.out._parseAsync({data:u.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?A:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,r){return new n({in:e,out:r,typeName:x.ZodPipeline})}},Ft=class extends D{_parse(e){let r=this._def.innerType._parse(e),s=i=>(Dr(i)&&(i.value=Object.freeze(i.value)),i);return Wr(r)?r.then(i=>s(i)):s(r)}unwrap(){return this._def.innerType}};Ft.create=(n,e)=>new Ft({innerType:n,typeName:x.ZodReadonly,...I(e)});function Wo(n,e={},r){return n?mt.create().superRefine((s,i)=>{var u,c;if(!n(s)){let d=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,m=(c=(u=d.fatal)!==null&&u!==void 0?u:r)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:m})}}):mt.create()}var xc={object:ie.lazycreate},x;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(x||(x={}));var Ac=(n,e={message:`Input not instance of ${n.name}`})=>Wo(r=>r instanceof n,e),jo=ht.create,qo=xt.create,Oc=dr.create,Bc=At.create,Lo=Ot.create,Ic=Bt.create,Dc=or.create,Wc=It.create,jc=Dt.create,qc=mt.create,Lc=He.create,Nc=Te.create,zc=ur.create,$c=Ye.create,Mc=ie.create,Fc=ie.strictCreate,Uc=Wt.create,Vc=Wn.create,Zc=jt.create,Hc=Ae.create,Yc=jn.create,Qc=lr.create,Gc=cr.create,Jc=qn.create,Kc=qt.create,Xc=Lt.create,ed=Nt.create,td=zt.create,rd=pt.create,Po=fe.create,nd=be.create,ad=Oe.create,sd=fe.createWithPreprocess,id=qr.create,od=()=>jo().optional(),ud=()=>qo().optional(),ld=()=>Lo().optional(),cd={string:n=>ht.create({...n,coerce:!0}),number:n=>xt.create({...n,coerce:!0}),boolean:n=>Ot.create({...n,coerce:!0}),bigint:n=>At.create({...n,coerce:!0}),date:n=>Bt.create({...n,coerce:!0})},dd=A,Qe=Object.freeze({__proto__:null,defaultErrorMap:ir,setErrorMap:dc,getErrorMap:Bn,makeIssue:In,EMPTY_PATH:fc,addIssueToContext:w,ParseStatus:X,INVALID:A,DIRTY:sr,OK:re,isAborted:Za,isDirty:Ha,isValid:Dr,isAsync:Wr,get util(){return N},get objectUtil(){return Va},ZodParsedType:v,getParsedType:ft,ZodType:D,datetimeRegex:Io,ZodString:ht,ZodNumber:xt,ZodBigInt:At,ZodBoolean:Ot,ZodDate:Bt,ZodSymbol:or,ZodUndefined:It,ZodNull:Dt,ZodAny:mt,ZodUnknown:He,ZodNever:Te,ZodVoid:ur,ZodArray:Ye,ZodObject:ie,ZodUnion:Wt,ZodDiscriminatedUnion:Wn,ZodIntersection:jt,ZodTuple:Ae,ZodRecord:jn,ZodMap:lr,ZodSet:cr,ZodFunction:qn,ZodLazy:qt,ZodLiteral:Lt,ZodEnum:Nt,ZodNativeEnum:zt,ZodPromise:pt,ZodEffects:fe,ZodTransformer:fe,ZodOptional:be,ZodNullable:Oe,ZodDefault:$t,ZodCatch:Mt,ZodNaN:dr,BRAND:Pc,ZodBranded:jr,ZodPipeline:qr,ZodReadonly:Ft,custom:Wo,Schema:D,ZodSchema:D,late:xc,get ZodFirstPartyTypeKind(){return x},coerce:cd,any:qc,array:$c,bigint:Bc,boolean:Lo,date:Ic,discriminatedUnion:Vc,effect:Po,enum:ed,function:Jc,instanceof:Ac,intersection:Zc,lazy:Kc,literal:Xc,map:Qc,nan:Oc,nativeEnum:td,never:Nc,null:jc,nullable:ad,number:qo,object:Mc,oboolean:ld,onumber:ud,optional:nd,ostring:od,pipeline:id,preprocess:sd,promise:rd,record:Yc,set:Gc,strictObject:Fc,string:jo,symbol:Dc,transformer:Po,tuple:Hc,undefined:Wc,union:Uc,unknown:Lc,void:zc,NEVER:dd,ZodIssueCode:_,quotelessJson:cc,ZodError:de});var fd="https://vcr.am/api/v1",hd=Qe.object({urlId:Qe.string(),saleId:Qe.number(),crn:Qe.string(),srcReceiptId:Qe.number().int(),fiscal:Qe.string()}),Lr=class{constructor(e){this.apiKey=e}async registerSale(e){return await Co(async()=>await Eo(`${fd}/sales`,hd,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)},Qe.object({error:Qe.string()})))()}};var md=["pc","unit","set","box","pack","case","hr","sess","proj","sub","kg","l","m","g","ml","cm","bottle","can","jar","bag","m2","dozen","pair","mm","roll","tube","km","ton","m3","pallet","other"],pd=["hy","ru","en"];return Dl(yd);})();
|
|
14
|
+
`),s=!1,i=!1,u;n.on("response",c=>{let{headers:d}=c;s=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),n.on("socket",c=>{let d=()=>{if(s&&!i){let h=new Error("Premature close");h.code="ERR_STREAM_PREMATURE_CLOSE",e(h)}},m=h=>{i=(void 0).compare(h.slice(-5),r)===0,!i&&u&&(i=(void 0).compare(u.slice(-3),r.slice(0,3))===0&&(void 0).compare(h.slice(-2),r.slice(3))===0),u=h};c.prependListener("close",d),c.on("data",m),n.on("close",()=>{c.removeListener("close",d),c.removeListener("data",m)})})}var yo,bo,kt,ce,nc,go=Z(()=>{"use strict";yo=ot(Ta(),1),bo=ot(bi(),1),kt=ot(_i(),1),ce=ot(Ea(),1);Ca();wi();Pn();Ki();An();mo();Oa();po();Na();wn();Rn();za();Da();nc=new Set(["data:","http:","https:"])});var bd={};bn(bd,{AVAILABLE_LANGUAGES:()=>yd,VCRClient:()=>qr,unitsKeys:()=>pd});function wo(n){return n&&n.default||n}var Df=global.fetch=global.fetch||(typeof process>"u"?function(n,e){return Promise.resolve().then(()=>(yi(),pi)).then(r=>wo(r)(n,e))}:function(n,e){return(typeof n=="string"||n instanceof URL)&&(n=String(n).replace(/^\/\//g,"https://")),Promise.resolve().then(()=>(go(),_o)).then(r=>wo(r)(n,e))});var sc={withStackTrace:!1},Ro=(n,e,r=sc)=>{let s=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},i=r.withStackTrace?new Error().stack:void 0;return{data:s,message:n,stack:i}};function On(n,e,r,s){function i(u){return u instanceof r?u:new r(function(c){c(u)})}return new(r||(r=Promise))(function(u,c){function d(p){try{h(s.next(p))}catch(k){c(k)}}function m(p){try{h(s.throw(p))}catch(k){c(k)}}function h(p){p.done?u(p.value):i(p.value).then(d,m)}h((s=s.apply(n,e||[])).next())})}function So(n){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&n[e],s=0;if(r)return r.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(n){return this instanceof Pt?(this.v=n,this):new Pt(n)}function ic(n,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(n,e||[]),i,u=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(R){s[R]&&(i[R]=function(L){return new Promise(function(g,z){u.push([R,L,g,z])>1||d(R,L)})})}function d(R,L){try{m(s[R](L))}catch(g){k(u[0][3],g)}}function m(R){R.value instanceof Pt?Promise.resolve(R.value.v).then(h,p):k(u[0][2],R)}function h(R){d("next",R)}function p(R){d("throw",R)}function k(R,L){R(L),u.shift(),u.length&&d(u[0][0],u[0][1])}}function oc(n){var e,r;return e={},s("next"),s("throw",function(i){throw i}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(i,u){e[i]=n[i]?function(c){return(r=!r)?{value:Pt(n[i](c)),done:i==="return"}:u?u(c):c}:u}}function uc(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],r;return e?e.call(n):(n=typeof So=="function"?So(n):n[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(u){r[u]=n[u]&&function(c){return new Promise(function(d,m){c=n[u](c),i(d,m,c.done,c.value)})}}function i(u,c,d,m){Promise.resolve(m).then(function(h){u({value:h,done:d})},c)}}var Ze=class n{constructor(e){this._promise=e}static fromSafePromise(e){let r=e.then(s=>new Ue(s));return new n(r)}static fromPromise(e,r){let s=e.then(i=>new Ue(i)).catch(i=>new Ve(r(i)));return new n(s)}static fromThrowable(e,r){return(...s)=>new n(On(this,void 0,void 0,function*(){try{return new Ue(yield e(...s))}catch(i){return new Ve(r?r(i):i)}}))}static combine(e){return cc(e)}static combineWithAllErrors(e){return dc(e)}map(e){return new n(this._promise.then(r=>On(this,void 0,void 0,function*(){return r.isErr()?new Ve(r.error):new Ue(yield e(r.value))})))}mapErr(e){return new n(this._promise.then(r=>On(this,void 0,void 0,function*(){return r.isOk()?new Ue(r.value):new Ve(yield e(r.error))})))}andThen(e){return new n(this._promise.then(r=>{if(r.isErr())return new Ve(r.error);let s=e(r.value);return s instanceof n?s._promise:s}))}orElse(e){return new n(this._promise.then(r=>On(this,void 0,void 0,function*(){return r.isErr()?e(r.error):new Ue(r.value)})))}match(e,r){return this._promise.then(s=>s.match(e,r))}unwrapOr(e){return this._promise.then(r=>r.unwrapOr(e))}safeUnwrap(){return ic(this,arguments,function*(){return yield Pt(yield Pt(yield*oc(uc(yield Pt(this._promise.then(r=>r.safeUnwrap()))))))})}then(e,r){return this._promise.then(e,r)}};var vo=n=>new Ze(Promise.resolve(new Ve(n))),Fa=Ze.fromPromise,jf=Ze.fromSafePromise,Lf=Ze.fromThrowable,lc=n=>e=>[...e,n],To=n=>n.reduce((e,r)=>e.isOk()?r.isErr()?Q(r.error):e.map(lc(r.value)):e,Ae([])),cc=n=>Ze.fromSafePromise(Promise.all(n)).andThen(To),Eo=n=>n.reduce((e,r)=>r.isErr()?e.isErr()?Q([...e.error,r.error]):Q([r.error]):e.isErr()?e:Ae([...e.value,r.value]),Ae([])),dc=n=>Ze.fromSafePromise(Promise.all(n)).andThen(Eo),Ma;(function(n){function e(i,u){return(...c)=>{try{let d=i(...c);return Ae(d)}catch(d){return Q(u?u(d):d)}}}n.fromThrowable=e;function r(i){return To(i)}n.combine=r;function s(i){return Eo(i)}n.combineWithAllErrors=s})(Ma||(Ma={}));var Ae=n=>new Ue(n),Q=n=>new Ve(n);var Ue=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return Ae(e(this.value))}mapErr(e){return Ae(this.value)}andThen(e){return e(this.value)}orElse(e){return Ae(this.value)}asyncAndThen(e){return e(this.value)}asyncMap(e){return Ze.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,r){return e(this.value)}safeUnwrap(){let e=this.value;return function*(){return e}()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Ro("Called `_unsafeUnwrapErr` on an Ok",this,e)}},Ve=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return Q(this.error)}mapErr(e){return Q(e(this.error))}andThen(e){return Q(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return vo(this.error)}asyncMap(e){return vo(this.error)}unwrapOr(e){return e}match(e,r){return r(this.error)}safeUnwrap(){let e=this.error;return function*(){throw yield Q(e),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(e){throw Ro("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}},Co=Ma.fromThrowable;async function Ua(n,e,r,s){let i={...r,headers:r?.headers??{}},u={requestOptions:i,url:n},c=await Fa(fetch(n,i),T=>T instanceof Error?Q({type:"fetchError",...u,message:T.message,error:T}):Q({type:"unknownFetchThrow",...u,message:"Unknown fetch error",error:T}));if(c.isErr())return c.error;let d=c.value,m={...u,response:d},h=await Fa(d.text(),T=>T instanceof Error?Q({type:"unknownGetTextError",...m,message:`Can't get response content: ${T.message}`,error:T}):Q({type:"unknownGetTextUnknownError",...m,message:"Can't get response content: unknown error",error:T}));if(h.isErr())return h.error;let p=h.value,k={...m,text:p},R=Co(JSON.parse,T=>T instanceof Error?Q({type:"jsonParseError",...k,message:T.message,error:T}):Q({type:"jsonParseUnknownError",...k,message:"Unknown JSON parse error",error:T}))(p);if(R.isErr()){let T=e.safeParse(p);return T.success?Ae({...k,data:T.data}):Q({type:"jsonParseError",...k,message:`Can't parse response as JSON: ${R.error.error.message}. Original response: ${p}`,error:R.error.error})}let L=R.value,g;if(s){let T=s.safeParse(L);T.success&&(g=T.data)}if(d.status>=500)return Q({type:"serverError",...k,message:`Server error: ${d.status} ${d.statusText}. ${g?`Data: ${JSON.stringify(g)}`:""}`});if(d.status>=400)return Q({type:"clientError",...k,message:`Error: ${d.status} ${d.statusText}. Response: ${p}`,errorMetadata:g});let z=e.safeParse(L);if(!z.success){let T=z.error.issues.map(j=>`[${j.path.join(".")}] ${j.message}`).join(", ");return Q({type:"payloadParseError",...k,message:`Can't recognize response payload: ${T}`})}return Ae({...k,data:z.data})}function Va(n){return async(...e)=>{let r=await n(...e);if(r.isErr()){let{message:s,url:i}=r.error;throw new Error(`${s} (${i})`)}return r.value.data}}var N;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function r(i){throw new Error}n.assertNever=r,n.arrayToEnum=i=>{let u={};for(let c of i)u[c]=c;return u},n.getValidEnumValues=i=>{let u=n.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(let d of u)c[d]=i[d];return n.objectValues(c)},n.objectValues=i=>n.objectKeys(i).map(function(u){return i[u]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let u=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&u.push(c);return u},n.find=(i,u)=>{for(let c of i)if(u(c))return c},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function s(i,u=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(u)}n.joinValues=s,n.jsonStringifyReplacer=(i,u)=>typeof u=="bigint"?u.toString():u})(N||(N={}));var Ha;(function(n){n.mergeShapes=(e,r)=>({...e,...r})})(Ha||(Ha={}));var v=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ft=n=>{switch(typeof n){case"undefined":return v.undefined;case"string":return v.string;case"number":return isNaN(n)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(n)?v.array:n===null?v.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?v.promise:typeof Map<"u"&&n instanceof Map?v.map:typeof Set<"u"&&n instanceof Set?v.set:typeof Date<"u"&&n instanceof Date?v.date:v.object;default:return v.unknown}},_=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fc=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),de=class n extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(u){return u.message},s={_errors:[]},i=u=>{for(let c of u.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)s._errors.push(r(c));else{let d=s,m=0;for(;m<c.path.length;){let h=c.path[m];m===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(r(c))):d[h]=d[h]||{_errors:[]},d=d[h],m++}}};return i(this),s}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};de.create=n=>new de(n);var ir=(n,e)=>{let r;switch(n.code){case _.invalid_type:n.received===v.undefined?r="Required":r=`Expected ${n.expected}, received ${n.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,N.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${N.joinValues(n.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${N.joinValues(n.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${N.joinValues(n.options)}, received '${n.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:N.assertNever(n.validation):n.validation!=="regex"?r=`Invalid ${n.validation}`:r="Invalid";break;case _.too_small:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:r="Invalid input";break;case _.too_big:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?r=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,N.assertNever(n)}return{message:r}},xo=ir;function hc(n){xo=n}function Bn(){return xo}var In=n=>{let{data:e,path:r,errorMaps:s,issueData:i}=n,u=[...r,...i.path||[]],c={...i,path:u};if(i.message!==void 0)return{...i,path:u,message:i.message};let d="",m=s.filter(h=>!!h).slice().reverse();for(let h of m)d=h(c,{data:e,defaultError:d}).message;return{...i,path:u,message:d}},mc=[];function w(n,e){let r=Bn(),s=In({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,r,r===ir?void 0:ir].filter(i=>!!i)});n.common.issues.push(s)}var X=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let i of r){if(i.status==="aborted")return A;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let i of r){let u=await i.key,c=await i.value;s.push({key:u,value:c})}return n.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let i of r){let{key:u,value:c}=i;if(u.status==="aborted"||c.status==="aborted")return A;u.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),u.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(s[u.value]=c.value)}return{status:e.value,value:s}}},A=Object.freeze({status:"aborted"}),sr=n=>({status:"dirty",value:n}),re=n=>({status:"valid",value:n}),Ya=n=>n.status==="aborted",Qa=n=>n.status==="dirty",Dr=n=>n.status==="valid",Wr=n=>typeof Promise<"u"&&n instanceof Promise;function Dn(n,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(n):s?s.value:e.get(n)}function Ao(n,e,r,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,r):i?i.value=r:e.set(n,r),r}var E;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(E||(E={}));var Br,Ir,ge=class{constructor(e,r,s,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ko=(n,e)=>{if(Dr(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new de(n.common.issues);return this._error=r,this._error}}};function I(n){if(!n)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:i}=n;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var m,h;let{message:p}=n;return c.code==="invalid_enum_value"?{message:p??d.defaultError}:typeof d.data>"u"?{message:(m=p??s)!==null&&m!==void 0?m:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=p??r)!==null&&h!==void 0?h:d.defaultError}},description:i}}var D=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ft(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Wr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){var s;let i={common:{issues:[],async:(s=r?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ft(e)},u=this._parseSync({data:e,path:i.path,parent:i});return ko(i,u)}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ft(e)},i=this._parse({data:e,path:s.path,parent:s}),u=await(Wr(i)?i:Promise.resolve(i));return ko(s,u)}refine(e,r){let s=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,u)=>{let c=e(i),d=()=>u.addIssue({code:_.custom,...s(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(m=>m?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,r){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof r=="function"?r(s,i):r),!1))}_refinement(e){return new fe({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return _e.create(this,this._def)}nullable(){return Be.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qe.create(this,this._def)}promise(){return pt.create(this,this._def)}or(e){return Wt.create([this,e],this._def)}and(e){return jt.create(this,e,this._def)}transform(e){return new fe({...I(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new $t({...I(this._def),innerType:this,defaultValue:r,typeName:x.ZodDefault})}brand(){return new jr({typeName:x.ZodBranded,type:this,...I(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mt({...I(this._def),innerType:this,catchValue:r,typeName:x.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Lr.create(this,e)}readonly(){return Ft.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},pc=/^c[^\s-]{8,}$/i,yc=/^[0-9a-z]+$/,bc=/^[0-9A-HJKMNP-TV-Z]{26}$/,_c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gc=/^[a-z0-9_-]{21}$/i,wc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Za,Rc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tc=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ec=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Oo="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Cc=new RegExp(`^${Oo}$`);function Bo(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function kc(n){return new RegExp(`^${Bo(n)}$`)}function Io(n){let e=`${Oo}T${Bo(n)}`,r=[];return r.push(n.local?"Z?":"Z"),n.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Pc(n,e){return!!((e==="v4"||!e)&&Rc.test(n)||(e==="v6"||!e)&&Tc.test(n))}var ht=class n extends D{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.string,received:u.parsedType}),A}let s=new X,i;for(let u of this._def.checks)if(u.kind==="min")e.data.length<u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_small,minimum:u.value,type:"string",inclusive:!0,exact:!1,message:u.message}),s.dirty());else if(u.kind==="max")e.data.length>u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_big,maximum:u.value,type:"string",inclusive:!0,exact:!1,message:u.message}),s.dirty());else if(u.kind==="length"){let c=e.data.length>u.value,d=e.data.length<u.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?w(i,{code:_.too_big,maximum:u.value,type:"string",inclusive:!0,exact:!0,message:u.message}):d&&w(i,{code:_.too_small,minimum:u.value,type:"string",inclusive:!0,exact:!0,message:u.message}),s.dirty())}else if(u.kind==="email")Sc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"email",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="emoji")Za||(Za=new RegExp(vc,"u")),Za.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"emoji",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="uuid")_c.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"uuid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="nanoid")gc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"nanoid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="cuid")pc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cuid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="cuid2")yc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cuid2",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="ulid")bc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"ulid",code:_.invalid_string,message:u.message}),s.dirty());else if(u.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),w(i,{validation:"url",code:_.invalid_string,message:u.message}),s.dirty()}else u.kind==="regex"?(u.regex.lastIndex=0,u.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"regex",code:_.invalid_string,message:u.message}),s.dirty())):u.kind==="trim"?e.data=e.data.trim():u.kind==="includes"?e.data.includes(u.value,u.position)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:{includes:u.value,position:u.position},message:u.message}),s.dirty()):u.kind==="toLowerCase"?e.data=e.data.toLowerCase():u.kind==="toUpperCase"?e.data=e.data.toUpperCase():u.kind==="startsWith"?e.data.startsWith(u.value)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:{startsWith:u.value},message:u.message}),s.dirty()):u.kind==="endsWith"?e.data.endsWith(u.value)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:{endsWith:u.value},message:u.message}),s.dirty()):u.kind==="datetime"?Io(u).test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:"datetime",message:u.message}),s.dirty()):u.kind==="date"?Cc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:"date",message:u.message}),s.dirty()):u.kind==="time"?kc(u).test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:_.invalid_string,validation:"time",message:u.message}),s.dirty()):u.kind==="duration"?wc.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"duration",code:_.invalid_string,message:u.message}),s.dirty()):u.kind==="ip"?Pc(e.data,u.version)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"ip",code:_.invalid_string,message:u.message}),s.dirty()):u.kind==="base64"?Ec.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"base64",code:_.invalid_string,message:u.message}),s.dirty()):N.assertNever(u);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(i=>e.test(i),{validation:r,code:_.invalid_string,...E.errToObj(s)})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}datetime(e){var r,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(s=e?.local)!==null&&s!==void 0?s:!1,...E.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...E.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...E.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...E.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...E.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...E.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...E.errToObj(r)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ht.create=n=>{var e;return new ht({checks:[],typeName:x.ZodString,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...I(n)})};function xc(n,e){let r=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=r>s?r:s,u=parseInt(n.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return u%c/Math.pow(10,i)}var xt=class n extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.number,received:u.parsedType}),A}let s,i=new X;for(let u of this._def.checks)u.kind==="int"?N.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:_.invalid_type,expected:"integer",received:"float",message:u.message}),i.dirty()):u.kind==="min"?(u.inclusive?e.data<u.value:e.data<=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_small,minimum:u.value,type:"number",inclusive:u.inclusive,exact:!1,message:u.message}),i.dirty()):u.kind==="max"?(u.inclusive?e.data>u.value:e.data>=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_big,maximum:u.value,type:"number",inclusive:u.inclusive,exact:!1,message:u.message}),i.dirty()):u.kind==="multipleOf"?xc(e.data,u.value)!==0&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.not_multiple_of,multipleOf:u.value,message:u.message}),i.dirty()):u.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:_.not_finite,message:u.message}),i.dirty()):N.assertNever(u);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,s,i){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:E.toString(i)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};xt.create=n=>new xt({checks:[],typeName:x.ZodNumber,coerce:n?.coerce||!1,...I(n)});var At=class n extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==v.bigint){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.bigint,received:u.parsedType}),A}let s,i=new X;for(let u of this._def.checks)u.kind==="min"?(u.inclusive?e.data<u.value:e.data<=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_small,type:"bigint",minimum:u.value,inclusive:u.inclusive,message:u.message}),i.dirty()):u.kind==="max"?(u.inclusive?e.data>u.value:e.data>=u.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.too_big,type:"bigint",maximum:u.value,inclusive:u.inclusive,message:u.message}),i.dirty()):u.kind==="multipleOf"?e.data%u.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),w(s,{code:_.not_multiple_of,multipleOf:u.value,message:u.message}),i.dirty()):N.assertNever(u);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,s,i){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:E.toString(i)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};At.create=n=>{var e;return new At({checks:[],typeName:x.ZodBigInt,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...I(n)})};var Ot=class extends D{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.boolean,received:s.parsedType}),A}return re(e.data)}};Ot.create=n=>new Ot({typeName:x.ZodBoolean,coerce:n?.coerce||!1,...I(n)});var Bt=class n extends D{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_type,expected:v.date,received:u.parsedType}),A}if(isNaN(e.data.getTime())){let u=this._getOrReturnCtx(e);return w(u,{code:_.invalid_date}),A}let s=new X,i;for(let u of this._def.checks)u.kind==="min"?e.data.getTime()<u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_small,message:u.message,inclusive:!0,exact:!1,minimum:u.value,type:"date"}),s.dirty()):u.kind==="max"?e.data.getTime()>u.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:_.too_big,message:u.message,inclusive:!0,exact:!1,maximum:u.value,type:"date"}),s.dirty()):N.assertNever(u);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Bt.create=n=>new Bt({checks:[],coerce:n?.coerce||!1,typeName:x.ZodDate,...I(n)});var or=class extends D{_parse(e){if(this._getType(e)!==v.symbol){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.symbol,received:s.parsedType}),A}return re(e.data)}};or.create=n=>new or({typeName:x.ZodSymbol,...I(n)});var It=class extends D{_parse(e){if(this._getType(e)!==v.undefined){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.undefined,received:s.parsedType}),A}return re(e.data)}};It.create=n=>new It({typeName:x.ZodUndefined,...I(n)});var Dt=class extends D{_parse(e){if(this._getType(e)!==v.null){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.null,received:s.parsedType}),A}return re(e.data)}};Dt.create=n=>new Dt({typeName:x.ZodNull,...I(n)});var mt=class extends D{constructor(){super(...arguments),this._any=!0}_parse(e){return re(e.data)}};mt.create=n=>new mt({typeName:x.ZodAny,...I(n)});var Ye=class extends D{constructor(){super(...arguments),this._unknown=!0}_parse(e){return re(e.data)}};Ye.create=n=>new Ye({typeName:x.ZodUnknown,...I(n)});var Ee=class extends D{_parse(e){let r=this._getOrReturnCtx(e);return w(r,{code:_.invalid_type,expected:v.never,received:r.parsedType}),A}};Ee.create=n=>new Ee({typeName:x.ZodNever,...I(n)});var ur=class extends D{_parse(e){if(this._getType(e)!==v.undefined){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.void,received:s.parsedType}),A}return re(e.data)}};ur.create=n=>new ur({typeName:x.ZodVoid,...I(n)});var Qe=class n extends D{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),i=this._def;if(r.parsedType!==v.array)return w(r,{code:_.invalid_type,expected:v.array,received:r.parsedType}),A;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(c||d)&&(w(r,{code:c?_.too_big:_.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(w(r,{code:_.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(w(r,{code:_.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((c,d)=>i.type._parseAsync(new ge(r,c,r.path,d)))).then(c=>X.mergeArray(s,c));let u=[...r.data].map((c,d)=>i.type._parseSync(new ge(r,c,r.path,d)));return X.mergeArray(s,u)}get element(){return this._def.type}min(e,r){return new n({...this._def,minLength:{value:e,message:E.toString(r)}})}max(e,r){return new n({...this._def,maxLength:{value:e,message:E.toString(r)}})}length(e,r){return new n({...this._def,exactLength:{value:e,message:E.toString(r)}})}nonempty(e){return this.min(1,e)}};Qe.create=(n,e)=>new Qe({type:n,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...I(e)});function ar(n){if(n instanceof ie){let e={};for(let r in n.shape){let s=n.shape[r];e[r]=_e.create(ar(s))}return new ie({...n._def,shape:()=>e})}else return n instanceof Qe?new Qe({...n._def,type:ar(n.element)}):n instanceof _e?_e.create(ar(n.unwrap())):n instanceof Be?Be.create(ar(n.unwrap())):n instanceof Oe?Oe.create(n.items.map(e=>ar(e))):n}var ie=class n extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=N.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==v.object){let h=this._getOrReturnCtx(e);return w(h,{code:_.invalid_type,expected:v.object,received:h.parsedType}),A}let{status:s,ctx:i}=this._processInputParams(e),{shape:u,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(let h in i.data)c.includes(h)||d.push(h);let m=[];for(let h of c){let p=u[h],k=i.data[h];m.push({key:{status:"valid",value:h},value:p._parse(new ge(i,k,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Ee){let h=this._def.unknownKeys;if(h==="passthrough")for(let p of d)m.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(h==="strict")d.length>0&&(w(i,{code:_.unrecognized_keys,keys:d}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let p of d){let k=i.data[p];m.push({key:{status:"valid",value:p},value:h._parse(new ge(i,k,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let h=[];for(let p of m){let k=await p.key,R=await p.value;h.push({key:k,value:R,alwaysSet:p.alwaysSet})}return h}).then(h=>X.mergeObjectSync(s,h)):X.mergeObjectSync(s,m)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var i,u,c,d;let m=(c=(u=(i=this._def).errorMap)===null||u===void 0?void 0:u.call(i,r,s).message)!==null&&c!==void 0?c:s.defaultError;return r.code==="unrecognized_keys"?{message:(d=E.errToObj(e).message)!==null&&d!==void 0?d:m}:{message:m}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(e){return new n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new n({...this._def,catchall:e})}pick(e){let r={};return N.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new n({...this._def,shape:()=>r})}omit(e){let r={};return N.objectKeys(this.shape).forEach(s=>{e[s]||(r[s]=this.shape[s])}),new n({...this._def,shape:()=>r})}deepPartial(){return ar(this)}partial(e){let r={};return N.objectKeys(this.shape).forEach(s=>{let i=this.shape[s];e&&!e[s]?r[s]=i:r[s]=i.optional()}),new n({...this._def,shape:()=>r})}required(e){let r={};return N.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])r[s]=this.shape[s];else{let u=this.shape[s];for(;u instanceof _e;)u=u._def.innerType;r[s]=u}}),new n({...this._def,shape:()=>r})}keyof(){return Do(N.objectKeys(this.shape))}};ie.create=(n,e)=>new ie({shape:()=>n,unknownKeys:"strip",catchall:Ee.create(),typeName:x.ZodObject,...I(e)});ie.strictCreate=(n,e)=>new ie({shape:()=>n,unknownKeys:"strict",catchall:Ee.create(),typeName:x.ZodObject,...I(e)});ie.lazycreate=(n,e)=>new ie({shape:n,unknownKeys:"strip",catchall:Ee.create(),typeName:x.ZodObject,...I(e)});var Wt=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function i(u){for(let d of u)if(d.result.status==="valid")return d.result;for(let d of u)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;let c=u.map(d=>new de(d.ctx.common.issues));return w(r,{code:_.invalid_union,unionErrors:c}),A}if(r.common.async)return Promise.all(s.map(async u=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await u._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let u,c=[];for(let m of s){let h={...r,common:{...r.common,issues:[]},parent:null},p=m._parseSync({data:r.data,path:r.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!u&&(u={result:p,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(u)return r.common.issues.push(...u.ctx.common.issues),u.result;let d=c.map(m=>new de(m));return w(r,{code:_.invalid_union,unionErrors:d}),A}}get options(){return this._def.options}};Wt.create=(n,e)=>new Wt({options:n,typeName:x.ZodUnion,...I(e)});var He=n=>n instanceof Lt?He(n.schema):n instanceof fe?He(n.innerType()):n instanceof qt?[n.value]:n instanceof Nt?n.options:n instanceof zt?N.objectValues(n.enum):n instanceof $t?He(n._def.innerType):n instanceof It?[void 0]:n instanceof Dt?[null]:n instanceof _e?[void 0,...He(n.unwrap())]:n instanceof Be?[null,...He(n.unwrap())]:n instanceof jr||n instanceof Ft?He(n.unwrap()):n instanceof Mt?He(n._def.innerType):[],Wn=class n extends D{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.object)return w(r,{code:_.invalid_type,expected:v.object,received:r.parsedType}),A;let s=this.discriminator,i=r.data[s],u=this.optionsMap.get(i);return u?r.common.async?u._parseAsync({data:r.data,path:r.path,parent:r}):u._parseSync({data:r.data,path:r.path,parent:r}):(w(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let i=new Map;for(let u of r){let c=He(u.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,u)}}return new n({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...I(s)})}};function Ga(n,e){let r=ft(n),s=ft(e);if(n===e)return{valid:!0,data:n};if(r===v.object&&s===v.object){let i=N.objectKeys(e),u=N.objectKeys(n).filter(d=>i.indexOf(d)!==-1),c={...n,...e};for(let d of u){let m=Ga(n[d],e[d]);if(!m.valid)return{valid:!1};c[d]=m.data}return{valid:!0,data:c}}else if(r===v.array&&s===v.array){if(n.length!==e.length)return{valid:!1};let i=[];for(let u=0;u<n.length;u++){let c=n[u],d=e[u],m=Ga(c,d);if(!m.valid)return{valid:!1};i.push(m.data)}return{valid:!0,data:i}}else return r===v.date&&s===v.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var jt=class extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=(u,c)=>{if(Ya(u)||Ya(c))return A;let d=Ga(u.value,c.value);return d.valid?((Qa(u)||Qa(c))&&r.dirty(),{status:r.value,value:d.data}):(w(s,{code:_.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([u,c])=>i(u,c)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};jt.create=(n,e,r)=>new jt({left:n,right:e,typeName:x.ZodIntersection,...I(r)});var Oe=class n extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.array)return w(s,{code:_.invalid_type,expected:v.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return w(s,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(w(s,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let u=[...s.data].map((c,d)=>{let m=this._def.items[d]||this._def.rest;return m?m._parse(new ge(s,c,s.path,d)):null}).filter(c=>!!c);return s.common.async?Promise.all(u).then(c=>X.mergeArray(r,c)):X.mergeArray(r,u)}get items(){return this._def.items}rest(e){return new n({...this._def,rest:e})}};Oe.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Oe({items:n,typeName:x.ZodTuple,rest:null,...I(e)})};var jn=class n extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.object)return w(s,{code:_.invalid_type,expected:v.object,received:s.parsedType}),A;let i=[],u=this._def.keyType,c=this._def.valueType;for(let d in s.data)i.push({key:u._parse(new ge(s,d,s.path,d)),value:c._parse(new ge(s,s.data[d],s.path,d)),alwaysSet:d in s.data});return s.common.async?X.mergeObjectAsync(r,i):X.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof D?new n({keyType:e,valueType:r,typeName:x.ZodRecord,...I(s)}):new n({keyType:ht.create(),valueType:e,typeName:x.ZodRecord,...I(r)})}},lr=class extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.map)return w(s,{code:_.invalid_type,expected:v.map,received:s.parsedType}),A;let i=this._def.keyType,u=this._def.valueType,c=[...s.data.entries()].map(([d,m],h)=>({key:i._parse(new ge(s,d,s.path,[h,"key"])),value:u._parse(new ge(s,m,s.path,[h,"value"]))}));if(s.common.async){let d=new Map;return Promise.resolve().then(async()=>{for(let m of c){let h=await m.key,p=await m.value;if(h.status==="aborted"||p.status==="aborted")return A;(h.status==="dirty"||p.status==="dirty")&&r.dirty(),d.set(h.value,p.value)}return{status:r.value,value:d}})}else{let d=new Map;for(let m of c){let h=m.key,p=m.value;if(h.status==="aborted"||p.status==="aborted")return A;(h.status==="dirty"||p.status==="dirty")&&r.dirty(),d.set(h.value,p.value)}return{status:r.value,value:d}}}};lr.create=(n,e,r)=>new lr({valueType:e,keyType:n,typeName:x.ZodMap,...I(r)});var cr=class n extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==v.set)return w(s,{code:_.invalid_type,expected:v.set,received:s.parsedType}),A;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(w(s,{code:_.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(w(s,{code:_.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let u=this._def.valueType;function c(m){let h=new Set;for(let p of m){if(p.status==="aborted")return A;p.status==="dirty"&&r.dirty(),h.add(p.value)}return{status:r.value,value:h}}let d=[...s.data.values()].map((m,h)=>u._parse(new ge(s,m,s.path,h)));return s.common.async?Promise.all(d).then(m=>c(m)):c(d)}min(e,r){return new n({...this._def,minSize:{value:e,message:E.toString(r)}})}max(e,r){return new n({...this._def,maxSize:{value:e,message:E.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};cr.create=(n,e)=>new cr({valueType:n,minSize:null,maxSize:null,typeName:x.ZodSet,...I(e)});var Ln=class n extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.function)return w(r,{code:_.invalid_type,expected:v.function,received:r.parsedType}),A;function s(d,m){return In({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bn(),ir].filter(h=>!!h),issueData:{code:_.invalid_arguments,argumentsError:m}})}function i(d,m){return In({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bn(),ir].filter(h=>!!h),issueData:{code:_.invalid_return_type,returnTypeError:m}})}let u={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof pt){let d=this;return re(async function(...m){let h=new de([]),p=await d._def.args.parseAsync(m,u).catch(L=>{throw h.addIssue(s(m,L)),h}),k=await Reflect.apply(c,this,p);return await d._def.returns._def.type.parseAsync(k,u).catch(L=>{throw h.addIssue(i(k,L)),h})})}else{let d=this;return re(function(...m){let h=d._def.args.safeParse(m,u);if(!h.success)throw new de([s(m,h.error)]);let p=Reflect.apply(c,this,h.data),k=d._def.returns.safeParse(p,u);if(!k.success)throw new de([i(p,k.error)]);return k.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n({...this._def,args:Oe.create(e).rest(Ye.create())})}returns(e){return new n({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new n({args:e||Oe.create([]).rest(Ye.create()),returns:r||Ye.create(),typeName:x.ZodFunction,...I(s)})}},Lt=class extends D{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Lt.create=(n,e)=>new Lt({getter:n,typeName:x.ZodLazy,...I(e)});var qt=class extends D{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return w(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};qt.create=(n,e)=>new qt({value:n,typeName:x.ZodLiteral,...I(e)});function Do(n,e){return new Nt({values:n,typeName:x.ZodEnum,...I(e)})}var Nt=class n extends D{constructor(){super(...arguments),Br.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return w(r,{expected:N.joinValues(s),received:r.parsedType,code:_.invalid_type}),A}if(Dn(this,Br,"f")||Ao(this,Br,new Set(this._def.values),"f"),!Dn(this,Br,"f").has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return w(r,{received:r.data,code:_.invalid_enum_value,options:s}),A}return re(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return n.create(e,{...this._def,...r})}exclude(e,r=this._def){return n.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};Br=new WeakMap;Nt.create=Do;var zt=class extends D{constructor(){super(...arguments),Ir.set(this,void 0)}_parse(e){let r=N.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==v.string&&s.parsedType!==v.number){let i=N.objectValues(r);return w(s,{expected:N.joinValues(i),received:s.parsedType,code:_.invalid_type}),A}if(Dn(this,Ir,"f")||Ao(this,Ir,new Set(N.getValidEnumValues(this._def.values)),"f"),!Dn(this,Ir,"f").has(e.data)){let i=N.objectValues(r);return w(s,{received:s.data,code:_.invalid_enum_value,options:i}),A}return re(e.data)}get enum(){return this._def.values}};Ir=new WeakMap;zt.create=(n,e)=>new zt({values:n,typeName:x.ZodNativeEnum,...I(e)});var pt=class extends D{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.promise&&r.common.async===!1)return w(r,{code:_.invalid_type,expected:v.promise,received:r.parsedType}),A;let s=r.parsedType===v.promise?r.data:Promise.resolve(r.data);return re(s.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pt.create=(n,e)=>new pt({type:n,typeName:x.ZodPromise,...I(e)});var fe=class extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=this._def.effect||null,u={addIssue:c=>{w(s,c),c.fatal?r.abort():r.dirty()},get path(){return s.path}};if(u.addIssue=u.addIssue.bind(u),i.type==="preprocess"){let c=i.transform(s.data,u);if(s.common.async)return Promise.resolve(c).then(async d=>{if(r.value==="aborted")return A;let m=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return m.status==="aborted"?A:m.status==="dirty"||r.value==="dirty"?sr(m.value):m});{if(r.value==="aborted")return A;let d=this._def.schema._parseSync({data:c,path:s.path,parent:s});return d.status==="aborted"?A:d.status==="dirty"||r.value==="dirty"?sr(d.value):d}}if(i.type==="refinement"){let c=d=>{let m=i.refinement(d,u);if(s.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){let d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?A:(d.status==="dirty"&&r.dirty(),c(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?A:(d.status==="dirty"&&r.dirty(),c(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(s.common.async===!1){let c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Dr(c))return c;let d=i.transform(c.value,u);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>Dr(c)?Promise.resolve(i.transform(c.value,u)).then(d=>({status:r.value,value:d})):c);N.assertNever(i)}};fe.create=(n,e,r)=>new fe({schema:n,typeName:x.ZodEffects,effect:e,...I(r)});fe.createWithPreprocess=(n,e,r)=>new fe({schema:e,effect:{type:"preprocess",transform:n},typeName:x.ZodEffects,...I(r)});var _e=class extends D{_parse(e){return this._getType(e)===v.undefined?re(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_e.create=(n,e)=>new _e({innerType:n,typeName:x.ZodOptional,...I(e)});var Be=class extends D{_parse(e){return this._getType(e)===v.null?re(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Be.create=(n,e)=>new Be({innerType:n,typeName:x.ZodNullable,...I(e)});var $t=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===v.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};$t.create=(n,e)=>new $t({innerType:n,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...I(e)});var Mt=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Wr(i)?i.then(u=>({status:"valid",value:u.status==="valid"?u.value:this._def.catchValue({get error(){return new de(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new de(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Mt.create=(n,e)=>new Mt({innerType:n,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...I(e)});var dr=class extends D{_parse(e){if(this._getType(e)!==v.nan){let s=this._getOrReturnCtx(e);return w(s,{code:_.invalid_type,expected:v.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}};dr.create=n=>new dr({typeName:x.ZodNaN,...I(n)});var Ac=Symbol("zod_brand"),jr=class extends D{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},Lr=class n extends D{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let u=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return u.status==="aborted"?A:u.status==="dirty"?(r.dirty(),sr(u.value)):this._def.out._parseAsync({data:u.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?A:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,r){return new n({in:e,out:r,typeName:x.ZodPipeline})}},Ft=class extends D{_parse(e){let r=this._def.innerType._parse(e),s=i=>(Dr(i)&&(i.value=Object.freeze(i.value)),i);return Wr(r)?r.then(i=>s(i)):s(r)}unwrap(){return this._def.innerType}};Ft.create=(n,e)=>new Ft({innerType:n,typeName:x.ZodReadonly,...I(e)});function Wo(n,e={},r){return n?mt.create().superRefine((s,i)=>{var u,c;if(!n(s)){let d=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,m=(c=(u=d.fatal)!==null&&u!==void 0?u:r)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:m})}}):mt.create()}var Oc={object:ie.lazycreate},x;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(x||(x={}));var Bc=(n,e={message:`Input not instance of ${n.name}`})=>Wo(r=>r instanceof n,e),jo=ht.create,Lo=xt.create,Ic=dr.create,Dc=At.create,qo=Ot.create,Wc=Bt.create,jc=or.create,Lc=It.create,qc=Dt.create,Nc=mt.create,zc=Ye.create,$c=Ee.create,Mc=ur.create,Fc=Qe.create,Uc=ie.create,Vc=ie.strictCreate,Zc=Wt.create,Hc=Wn.create,Yc=jt.create,Qc=Oe.create,Gc=jn.create,Jc=lr.create,Kc=cr.create,Xc=Ln.create,ed=Lt.create,td=qt.create,rd=Nt.create,nd=zt.create,ad=pt.create,Po=fe.create,sd=_e.create,id=Be.create,od=fe.createWithPreprocess,ud=Lr.create,ld=()=>jo().optional(),cd=()=>Lo().optional(),dd=()=>qo().optional(),fd={string:n=>ht.create({...n,coerce:!0}),number:n=>xt.create({...n,coerce:!0}),boolean:n=>Ot.create({...n,coerce:!0}),bigint:n=>At.create({...n,coerce:!0}),date:n=>Bt.create({...n,coerce:!0})},hd=A,he=Object.freeze({__proto__:null,defaultErrorMap:ir,setErrorMap:hc,getErrorMap:Bn,makeIssue:In,EMPTY_PATH:mc,addIssueToContext:w,ParseStatus:X,INVALID:A,DIRTY:sr,OK:re,isAborted:Ya,isDirty:Qa,isValid:Dr,isAsync:Wr,get util(){return N},get objectUtil(){return Ha},ZodParsedType:v,getParsedType:ft,ZodType:D,datetimeRegex:Io,ZodString:ht,ZodNumber:xt,ZodBigInt:At,ZodBoolean:Ot,ZodDate:Bt,ZodSymbol:or,ZodUndefined:It,ZodNull:Dt,ZodAny:mt,ZodUnknown:Ye,ZodNever:Ee,ZodVoid:ur,ZodArray:Qe,ZodObject:ie,ZodUnion:Wt,ZodDiscriminatedUnion:Wn,ZodIntersection:jt,ZodTuple:Oe,ZodRecord:jn,ZodMap:lr,ZodSet:cr,ZodFunction:Ln,ZodLazy:Lt,ZodLiteral:qt,ZodEnum:Nt,ZodNativeEnum:zt,ZodPromise:pt,ZodEffects:fe,ZodTransformer:fe,ZodOptional:_e,ZodNullable:Be,ZodDefault:$t,ZodCatch:Mt,ZodNaN:dr,BRAND:Ac,ZodBranded:jr,ZodPipeline:Lr,ZodReadonly:Ft,custom:Wo,Schema:D,ZodSchema:D,late:Oc,get ZodFirstPartyTypeKind(){return x},coerce:fd,any:Nc,array:Fc,bigint:Dc,boolean:qo,date:Wc,discriminatedUnion:Hc,effect:Po,enum:rd,function:Xc,instanceof:Bc,intersection:Yc,lazy:ed,literal:td,map:Jc,nan:Ic,nativeEnum:nd,never:$c,null:qc,nullable:id,number:Lo,object:Uc,oboolean:dd,onumber:cd,optional:sd,ostring:ld,pipeline:ud,preprocess:od,promise:ad,record:Gc,set:Kc,strictObject:Vc,string:jo,symbol:jc,transformer:Po,tuple:Qc,undefined:Lc,union:Zc,unknown:zc,void:Mc,NEVER:hd,ZodIssueCode:_,quotelessJson:fc,ZodError:de});var No="https://vcr.am/api/v1",md=he.object({urlId:he.string(),saleId:he.number(),crn:he.string(),srcReceiptId:he.number().int(),fiscal:he.string()}),zo=he.object({error:he.string()}),qr=class{constructor(e){this.apiKey=e}async registerSale(e){return await Va(async()=>await Ua(`${No}/sales`,md,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)},zo))()}async searchClassifierCategory(e,r,s){let i=new URL(`${No}/searchClassifier`);return i.searchParams.append("query",e),i.searchParams.append("type",r),i.searchParams.append("language",s),await Va(async()=>await Ua(i.toString(),he.array(he.object({code:he.string(),title:he.string()})),{method:"GET",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"}},zo))()}};var pd=["pc","unit","set","box","pack","case","hr","sess","proj","sub","kg","l","m","g","ml","cm","bottle","can","jar","bag","m2","dozen","pair","mm","roll","tube","km","ton","m3","pallet","other"],yd=["hy","ru","en"];return jl(bd);})();
|
|
15
15
|
/*! Bundled license information:
|
|
16
16
|
|
|
17
17
|
web-streams-polyfill/dist/ponyfill.es2018.js:
|