aboutsummaryrefslogtreecommitdiff
path: root/src/js/out/modules/node/stream.js
blob: 57561d4a1a149d371dbae650a7b57aeb6ca96f47 (plain) (blame)
1
2
import{EventEmitter as Pq} from"bun:events_native";import{StringDecoder as Sq} from"node:string_decoder";var cq=function(q){return typeof q==="object"&&q!==null&&q instanceof ReadableStream},dq=function(q,Q){if(typeof q!=="boolean")throw new iq(Q,"boolean",q)};var iq=function(q,Q,X){return new Error(`The argument '${q}' is invalid. Received '${X}' for type '${Q}'`)},nq=function(q,Q,X){return new Error(`The value '${Q}' is invalid for argument '${q}'. Reason: ${X}`)},FQ=function(q,Q){var[X,J,H,K,Z,B,Y]=globalThis[Symbol.for("Bun.lazy")](q),$=[!1],z=function(F,L,j,N){if(L>0){const A=j.subarray(0,L),E=j.subarray(L);if(A.byteLength>0)F.push(A);if(N)F.push(null);return E.byteLength>0?E:void 0}if(N)F.push(null);return j},V=function(F,L,j,N){if(L.byteLength>0)F.push(L);if(N)F.push(null);return j},U=process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE!=="1";const W=new FinalizationRegistry((F)=>F&&Z(F)),G=512;var M=class F extends Q{#q;#Q=1;#X=!1;#J=void 0;#H;#K=!1;#Z=!U;#B;constructor(L,j={}){super(j);if(typeof j.highWaterMark==="number")this.#H=j.highWaterMark;else this.#H=262144;this.#q=L,this.#X=!1,this.#J=void 0,this.#K=!1,this.#B={},W.register(this,this.#q,this.#B)}_read(L){if(Aq&&Nq("NativeReadable._read",this.__id),this.#K){Aq&&Nq("pendingRead is true",this.__id);return}var j=this.#q;if(Aq&&Nq("ptr @ NativeReadable._read",j,this.__id),j===0){this.push(null);return}if(!this.#X)Aq&&Nq("NativeReadable not constructed yet",this.__id),this.#Y(j);return this.#V(this.#$(L),j)}#Y(L){this.#X=!0;const j=J(L,this.#H);if(Aq&&Nq("NativeReadable internal `start` result",j,this.__id),typeof j==="number"&&j>1)this.#Z=!0,Aq&&Nq("NativeReadable resized",this.__id),this.#H=Math.min(this.#H,j);if(Y){const N=Y(L);if(Aq&&Nq("NativeReadable drain result",N,this.__id),(N?.byteLength??0)>0)this.push(N)}}#$(L=this.#H){var j=this.#J;if(Aq&&Nq("chunk @ #getRemainingChunk",j,this.__id),j?.byteLength??0<G){var N=L>G?L:G;this.#J=j=new Buffer(N)}return j}push(L,j){return Aq&&Nq("NativeReadable push -- result, encoding",L,j,this.__id),super.push(...arguments)}#z(L,j,N){if(Aq&&Nq("result, isClosed @ #handleResult",L,N,this.__id),typeof L==="number"){if(L>=this.#H&&!this.#Z&&!N)this.#H*=2,this.#Z=!0;return z(this,L,j,N)}else if(typeof L==="boolean")return this.push(null),j?.byteLength??0>0?j:void 0;else if(ArrayBuffer.isView(L)){if(L.byteLength>=this.#H&&!this.#Z&&!N)this.#H*=2,this.#Z=!0,Aq&&Nq("Resized",this.__id);return V(this,L,j,N)}else throw Aq&&Nq("Unknown result type",L,this.__id),new Error("Invalid result from pull")}#V(L,j){Aq&&Nq("#internalRead()",this.__id),$[0]=!1;var N=X(j,L,$);if(xq(N))return this.#K=!0,N.then((A)=>{this.#K=!1,Aq&&Nq("pending no longerrrrrrrr (result returned from pull)",this.__id),this.#J=this.#z(A,L,$[0])},(A)=>{Aq&&Nq("error from pull",A,this.__id),errorOrDestroy(this,A)});else this.#J=this.#z(N,L,$[0])}_destroy(L,j){var N=this.#q;if(N===0){j(L);return}if(W.unregister(this.#B),this.#q=0,B)B(N,!1);Aq&&Nq("NativeReadable destroyed",this.__id),H(N,L),j(L)}ref(){var L=this.#q;if(L===0)return;if(this.#Q++===0)B(L,!0)}unref(){var L=this.#q;if(L===0)return;if(this.#Q--===1)B(L,!1)}};if(!B)M.prototype.ref=void 0,M.prototype.unref=void 0;return M},jQ=function(q,Q){return LQ[q]||=FQ(q,Q)},NQ=function(q,Q,X){if(!(Q&&typeof Q==="object"&&Q instanceof ReadableStream))return;const J=wq(Q);if(!J){Nq("no native readable stream");return}const{stream:H,data:K}=J;return new(jQ(K,q))(H,X)},{isPromise:xq,isCallable:Dq,direct:wq,Object:Tq}=globalThis[Symbol.for("Bun.lazy")]("primordials");globalThis.__IDS_TO_TRACK=process.env.DEBUG_TRACK_EE?.length?process.env.DEBUG_TRACK_EE.split(","):process.env.DEBUG_STREAMS?.length?process.env.DEBUG_STREAMS.split(","):null;var gq=!!process.env.DEBUG_TRACK_EE,Aq=!!(process.env.DEBUG||process.env.DEBUG_STREAMS||gq),Nq=Aq?globalThis.__IDS_TO_TRACK?(...q)=>{const Q=q[q.length-1];if(!globalThis.__IDS_TO_TRACK.includes(Q))return;console.log(`ID: ${Q}`,...q.slice(0,-1))}:(...q)=>console.log(...q.slice(0,-1)):()=>{},fq=Tq.create,kq=Tq.defineProperty,yq=Tq.getOwnPropertyDescriptor,hq=Tq.getOwnPropertyNames,pq=Tq.getPrototypeOf,uq=Tq.prototype.hasOwnProperty,bq=Tq.setPrototypeOf,mq=(q,Q)=>function X(){return Q||(0,q[hq(q)[0]])((Q={exports:{}}).exports,Q),Q.exports};var Iq=process.nextTick;var lq=Array.isArray,Oq=mq({"node_modules/readable-stream/lib/ours/primordials.js"(q,Q){Q.exports={ArrayIsArray(X){return Array.isArray(X)},ArrayPrototypeIncludes(X,J){return X.includes(J)},ArrayPrototypeIndexOf(X,J){return X.indexOf(J)},ArrayPrototypeJoin(X,J){return X.join(J)},ArrayPrototypeMap(X,J){return X.map(J)},ArrayPrototypePop(X,J){return X.pop(J)},ArrayPrototypePush(X,J){return X.push(J)},ArrayPrototypeSlice(X,J,H){return X.slice(J,H)},Error,FunctionPrototypeCall(X,J,...H){return X.call(J,...H)},FunctionPrototypeSymbolHasInstance(X,J){return Function.prototype[Symbol.hasInstance].call(X,J)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(X,J){return Tq.defineProperties(X,J)},ObjectDefineProperty(X,J,H){return Tq.defineProperty(X,J,H)},ObjectGetOwnPropertyDescriptor(X,J){return Tq.getOwnPropertyDescriptor(X,J)},ObjectKeys(X){return Tq.keys(X)},ObjectSetPrototypeOf(X,J){return Tq.setPrototypeOf(X,J)},Promise,PromisePrototypeCatch(X,J){return X.catch(J)},PromisePrototypeThen(X,J,H){return X.then(J,H)},PromiseReject(X){return Promise.reject(X)},ReflectApply:Reflect.apply,RegExpPrototypeTest(X,J){return X.test(J)},SafeSet:Set,String,StringPrototypeSlice(X,J,H){return X.slice(J,H)},StringPrototypeToLowerCase(X){return X.toLowerCase()},StringPrototypeToUpperCase(X){return X.toUpperCase()},StringPrototypeTrim(X){return X.trim()},Symbol,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(X,J,H){return X.set(J,H)},Uint8Array}}}),_q=mq({"node_modules/readable-stream/lib/ours/util.js"(q,Q){var X=Tq.getPrototypeOf(async function(){}).constructor,J=typeof Blob!=="undefined"?function K(Z){return Z instanceof Blob}:function K(Z){return!1},H=class extends Error{constructor(K){if(!Array.isArray(K))throw new TypeError(`Expected input to be an Array, got ${typeof K}`);let Z="";for(let B=0;B<K.length;B++)Z+=`    ${K[B].stack}
`;super(Z);this.name="AggregateError",this.errors=K}};Q.exports={AggregateError:H,once(K){let Z=!1;return function(...B){if(Z)return;Z=!0,K.apply(this,B)}},createDeferredPromise:function(){let K,Z;return{promise:new Promise((Y,$)=>{K=Y,Z=$}),resolve:K,reject:Z}},promisify(K){return new Promise((Z,B)=>{K((Y,...$)=>{if(Y)return B(Y);return Z(...$)})})},debuglog(){return function(){}},format(K,...Z){return K.replace(/%([sdifj])/g,function(...[B,Y]){const $=Z.shift();if(Y==="f")return $.toFixed(6);else if(Y==="j")return JSON.stringify($);else if(Y==="s"&&typeof $==="object")return`${$.constructor!==Tq?$.constructor.name:""} {}`.trim();else return $.toString()})},inspect(K){switch(typeof K){case"string":if(K.includes("'")){if(!K.includes('"'))return`"${K}"`;else if(!K.includes("`")&&!K.includes("${"))return`\`${K}\``}return`'${K}'`;case"number":if(isNaN(K))return"NaN";else if(Tq.is(K,-0))return String(K);return K;case"bigint":return`${String(K)}n`;case"boolean":case"undefined":return String(K);case"object":return"{}"}},types:{isAsyncFunction(K){return K instanceof X},isArrayBufferView(K){return ArrayBuffer.isView(K)}},isBlob:J},Q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}}),oq=mq({"node_modules/readable-stream/lib/ours/errors.js"(q,Q){var{format:X,inspect:J,AggregateError:H}=_q(),K=globalThis.AggregateError||H,Z=Symbol("kIsNodeError"),B=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Y=/^([A-Z][a-z0-9]*)+$/,$="__node_internal_",z={};function V(j,N){if(!j)throw new z.ERR_INTERNAL_ASSERTION(N)}function U(j){let N="",A=j.length;const E=j[0]==="-"?1:0;for(;A>=E+4;A-=3)N=`_${j.slice(A-3,A)}${N}`;return`${j.slice(0,A)}${N}`}function W(j,N,A){if(typeof N==="function")return V(N.length<=A.length,`Code: ${j}; The provided arguments length (${A.length}) does not match the required ones (${N.length}).`),N(...A);const E=(N.match(/%[dfijoOs]/g)||[]).length;if(V(E===A.length,`Code: ${j}; The provided arguments length (${A.length}) does not match the required ones (${E}).`),A.length===0)return N;return X(N,...A)}function G(j,N,A){if(!A)A=Error;class E extends A{constructor(...I){super(W(j,N,I))}toString(){return`${this.name} [${j}]: ${this.message}`}}Tq.defineProperties(E.prototype,{name:{value:A.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${j}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),E.prototype.code=j,E.prototype[Z]=!0,z[j]=E}function M(j){const N=$+j.name;return Tq.defineProperty(j,"name",{value:N}),j}function F(j,N){if(j&&N&&j!==N){if(Array.isArray(N.errors))return N.errors.push(j),N;const A=new K([N,j],N.message);return A.code=N.code,A}return j||N}var L=class extends Error{constructor(j="The operation was aborted",N=void 0){if(N!==void 0&&typeof N!=="object")throw new z.ERR_INVALID_ARG_TYPE("options","Object",N);super(j,N);this.code="ABORT_ERR",this.name="AbortError"}};G("ERR_ASSERTION","%s",Error),G("ERR_INVALID_ARG_TYPE",(j,N,A)=>{if(V(typeof j==="string","'name' must be a string"),!Array.isArray(N))N=[N];let E="The ";if(j.endsWith(" argument"))E+=`${j} `;else E+=`"${j}" ${j.includes(".")?"property":"argument"} `;E+="must be ";const I=[],T=[],P=[];for(let O of N)if(V(typeof O==="string","All expected entries have to be of type string"),B.includes(O))I.push(O.toLowerCase());else if(Y.test(O))T.push(O);else V(O!=="object",'The value "object" should be written as "Object"'),P.push(O);if(T.length>0){const O=I.indexOf("object");if(O!==-1)I.splice(I,O,1),T.push("Object")}if(I.length>0){switch(I.length){case 1:E+=`of type ${I[0]}`;break;case 2:E+=`one of type ${I[0]} or ${I[1]}`;break;default:{const O=I.pop();E+=`one of type ${I.join(", ")}, or ${O}`}}if(T.length>0||P.length>0)E+=" or "}if(T.length>0){switch(T.length){case 1:E+=`an instance of ${T[0]}`;break;case 2:E+=`an instance of ${T[0]} or ${T[1]}`;break;default:{const O=T.pop();E+=`an instance of ${T.join(", ")}, or ${O}`}}if(P.length>0)E+=" or "}switch(P.length){case 0:break;case 1:if(P[0].toLowerCase()!==P[0])E+="an ";E+=`${P[0]}`;break;case 2:E+=`one of ${P[0]} or ${P[1]}`;break;default:{const O=P.pop();E+=`one of ${P.join(", ")}, or ${O}`}}if(A==null)E+=`. Received ${A}`;else if(typeof A==="function"&&A.name)E+=`. Received function ${A.name}`;else if(typeof A==="object"){var x;if((x=A.constructor)!==null&&x!==void 0&&x.name)E+=`. Received an instance of ${A.constructor.name}`;else{const O=J(A,{depth:-1});E+=`. Received ${O}`}}else{let O=J(A,{colors:!1});if(O.length>25)O=`${O.slice(0,25)}...`;E+=`. Received type ${typeof A} (${O})`}return E},TypeError),G("ERR_INVALID_ARG_VALUE",(j,N,A="is invalid")=>{let E=J(N);if(E.length>128)E=E.slice(0,128)+"...";return`The ${j.includes(".")?"property":"argument"} '${j}' ${A}. Received ${E}`},TypeError),G("ERR_INVALID_RETURN_VALUE",(j,N,A)=>{var E;const I=A!==null&&A!==void 0&&(E=A.constructor)!==null&&E!==void 0&&E.name?`instance of ${A.constructor.name}`:`type ${typeof A}`;return`Expected ${j} to be returned from the "${N}" function but got ${I}.`},TypeError),G("ERR_MISSING_ARGS",(...j)=>{V(j.length>0,"At least one arg needs to be specified");let N;const A=j.length;switch(j=(Array.isArray(j)?j:[j]).map((E)=>`"${E}"`).join(" or "),A){case 1:N+=`The ${j[0]} argument`;break;case 2:N+=`The ${j[0]} and ${j[1]} arguments`;break;default:{const E=j.pop();N+=`The ${j.join(", ")}, and ${E} arguments`}break}return`${N} must be specified`},TypeError),G("ERR_OUT_OF_RANGE",(j,N,A)=>{V(N,'Missing "range" argument');let E;if(Number.isInteger(A)&&Math.abs(A)>4294967296)E=U(String(A));else if(typeof A==="bigint"){if(E=String(A),A>2n**32n||A<-(2n**32n))E=U(E);E+="n"}else E=J(A);return`The value of "${j}" is out of range. It must be ${N}. Received ${E}`},RangeError),G("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),G("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),G("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),G("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),G("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),G("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),G("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),G("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),G("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),G("ERR_STREAM_WRITE_AFTER_END","write after end",Error),G("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Q.exports={AbortError:L,aggregateTwoErrors:M(F),hideStackFrames:M,codes:z}}}),sq=mq({"node_modules/readable-stream/lib/internal/validators.js"(q,Q){var{ArrayIsArray:X,ArrayPrototypeIncludes:J,ArrayPrototypeJoin:H,ArrayPrototypeMap:K,NumberIsInteger:Z,NumberMAX_SAFE_INTEGER:B,NumberMIN_SAFE_INTEGER:Y,NumberParseInt:$,RegExpPrototypeTest:z,String:V,StringPrototypeToUpperCase:U,StringPrototypeTrim:W}=Oq(),{hideStackFrames:G,codes:{ERR_SOCKET_BAD_PORT:M,ERR_INVALID_ARG_TYPE:F,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:j,ERR_UNKNOWN_SIGNAL:N}}=oq(),{normalizeEncoding:A}=_q(),{isAsyncFunction:E,isArrayBufferView:I}=_q().types,T={};function P(i){return i===(i|0)}function x(i){return i===i>>>0}var O=/^[0-7]+$/,_="must be a 32-bit unsigned integer or an octal string";function C(i,n,o){if(typeof i==="undefined")i=o;if(typeof i==="string"){if(!z(O,i))throw new L(n,i,_);i=$(i,8)}return w(i,n,0,4294967295),i}var D=G((i,n,o=Y,s=B)=>{if(typeof i!=="number")throw new F(n,"number",i);if(!Z(i))throw new j(n,"an integer",i);if(i<o||i>s)throw new j(n,`>= ${o} && <= ${s}`,i)}),w=G((i,n,o=-2147483648,s=2147483647)=>{if(typeof i!=="number")throw new F(n,"number",i);if(!P(i)){if(!Z(i))throw new j(n,"an integer",i);throw new j(n,`>= ${o} && <= ${s}`,i)}if(i<o||i>s)throw new j(n,`>= ${o} && <= ${s}`,i)}),v=G((i,n,o)=>{if(typeof i!=="number")throw new F(n,"number",i);if(!x(i)){if(!Z(i))throw new j(n,"an integer",i);throw new j(n,`>= ${o?1:0} && < 4294967296`,i)}if(o&&i===0)throw new j(n,">= 1 && < 4294967296",i)});function R(i,n){if(typeof i!=="string")throw new F(n,"string",i)}function S(i,n){if(typeof i!=="number")throw new F(n,"number",i)}var g=G((i,n,o)=>{if(!J(o,i)){const a="must be one of: "+H(K(o,(r)=>typeof r==="string"?`'${r}'`:V(r)),", ");throw new L(n,i,a)}});function f(i,n){if(typeof i!=="boolean")throw new F(n,"boolean",i)}var k=G((i,n,o)=>{const s=o==null,a=s?!1:o.allowArray,r=s?!1:o.allowFunction;if(!(s?!1:o.nullable)&&i===null||!a&&X(i)||typeof i!=="object"&&(!r||typeof i!=="function"))throw new F(n,"Object",i)}),y=G((i,n,o=0)=>{if(!X(i))throw new F(n,"Array",i);if(i.length<o){const s=`must be longer than ${o}`;throw new L(n,i,s)}});function h(i,n="signal"){if(R(i,n),T[i]===void 0){if(T[U(i)]!==void 0)throw new N(i+" (signals must use all capital letters)");throw new N(i)}}var p=G((i,n="buffer")=>{if(!I(i))throw new F(n,["Buffer","TypedArray","DataView"],i)});function u(i,n){const o=A(n),s=i.length;if(o==="hex"&&s%2!==0)throw new L("encoding",n,`is invalid for data of length ${s}`)}function b(i,n="Port",o=!0){if(typeof i!=="number"&&typeof i!=="string"||typeof i==="string"&&W(i).length===0||+i!==+i>>>0||i>65535||i===0&&!o)throw new M(n,i,o);return i|0}var m=G((i,n)=>{if(i!==void 0&&(i===null||typeof i!=="object"||!("aborted"in i)))throw new F(n,"AbortSignal",i)}),c=G((i,n)=>{if(typeof i!=="function")throw new F(n,"Function",i)}),d=G((i,n)=>{if(typeof i!=="function"||E(i))throw new F(n,"Function",i)}),l=G((i,n)=>{if(i!==void 0)throw new F(n,"undefined",i)});Q.exports={isInt32:P,isUint32:x,parseFileMode:C,validateArray:y,validateBoolean:f,validateBuffer:p,validateEncoding:u,validateFunction:c,validateInt32:w,validateInteger:D,validateNumber:S,validateObject:k,validateOneOf:g,validatePlainFunction:d,validatePort:b,validateSignalName:h,validateString:R,validateUint32:v,validateUndefined:l,validateAbortSignal:m}}}),aq=mq({"node_modules/readable-stream/lib/internal/streams/utils.js"(q,Q){var{Symbol:X,SymbolAsyncIterator:J,SymbolIterator:H}=Oq(),K=X("kDestroyed"),Z=X("kIsErrored"),B=X("kIsReadable"),Y=X("kIsDisturbed");function $(v,R=!1){var S;return!!(v&&typeof v.pipe==="function"&&typeof v.on==="function"&&(!R||typeof v.pause==="function"&&typeof v.resume==="function")&&(!v._writableState||((S=v._readableState)===null||S===void 0?void 0:S.readable)!==!1)&&(!v._writableState||v._readableState))}function z(v){var R;return!!(v&&typeof v.write==="function"&&typeof v.on==="function"&&(!v._readableState||((R=v._writableState)===null||R===void 0?void 0:R.writable)!==!1))}function V(v){return!!(v&&typeof v.pipe==="function"&&v._readableState&&typeof v.on==="function"&&typeof v.write==="function")}function U(v){return v&&(v._readableState||v._writableState||typeof v.write==="function"&&typeof v.on==="function"||typeof v.pipe==="function"&&typeof v.on==="function")}function W(v,R){if(v==null)return!1;if(R===!0)return typeof v[J]==="function";if(R===!1)return typeof v[H]==="function";return typeof v[J]==="function"||typeof v[H]==="function"}function G(v){if(!U(v))return null;const{_writableState:R,_readableState:S}=v,g=R||S;return!!(v.destroyed||v[K]||g!==null&&g!==void 0&&g.destroyed)}function M(v){if(!z(v))return null;if(v.writableEnded===!0)return!0;const R=v._writableState;if(R!==null&&R!==void 0&&R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.ended)!=="boolean")return null;return R.ended}function F(v,R){if(!z(v))return null;if(v.writableFinished===!0)return!0;const S=v._writableState;if(S!==null&&S!==void 0&&S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.finished)!=="boolean")return null;return!!(S.finished||R===!1&&S.ended===!0&&S.length===0)}function L(v){if(!$(v))return null;if(v.readableEnded===!0)return!0;const R=v._readableState;if(!R||R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.ended)!=="boolean")return null;return R.ended}function j(v,R){if(!$(v))return null;const S=v._readableState;if(S!==null&&S!==void 0&&S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.endEmitted)!=="boolean")return null;return!!(S.endEmitted||R===!1&&S.ended===!0&&S.length===0)}function N(v){if(v&&v[B]!=null)return v[B];if(typeof(v===null||v===void 0?void 0:v.readable)!=="boolean")return null;if(G(v))return!1;return $(v)&&v.readable&&!j(v)}function A(v){if(typeof(v===null||v===void 0?void 0:v.writable)!=="boolean")return null;if(G(v))return!1;return z(v)&&v.writable&&!M(v)}function E(v,R){if(!U(v))return null;if(G(v))return!0;if((R===null||R===void 0?void 0:R.readable)!==!1&&N(v))return!1;if((R===null||R===void 0?void 0:R.writable)!==!1&&A(v))return!1;return!0}function I(v){var R,S;if(!U(v))return null;if(v.writableErrored)return v.writableErrored;return(R=(S=v._writableState)===null||S===void 0?void 0:S.errored)!==null&&R!==void 0?R:null}function T(v){var R,S;if(!U(v))return null;if(v.readableErrored)return v.readableErrored;return(R=(S=v._readableState)===null||S===void 0?void 0:S.errored)!==null&&R!==void 0?R:null}function P(v){if(!U(v))return null;if(typeof v.closed==="boolean")return v.closed;const{_writableState:R,_readableState:S}=v;if(typeof(R===null||R===void 0?void 0:R.closed)==="boolean"||typeof(S===null||S===void 0?void 0:S.closed)==="boolean")return(R===null||R===void 0?void 0:R.closed)||(S===null||S===void 0?void 0:S.closed);if(typeof v._closed==="boolean"&&x(v))return v._closed;return null}function x(v){return typeof v._closed==="boolean"&&typeof v._defaultKeepAlive==="boolean"&&typeof v._removedConnection==="boolean"&&typeof v._removedContLen==="boolean"}function O(v){return typeof v._sent100==="boolean"&&x(v)}function _(v){var R;return typeof v._consuming==="boolean"&&typeof v._dumped==="boolean"&&((R=v.req)===null||R===void 0?void 0:R.upgradeOrConnect)===void 0}function C(v){if(!U(v))return null;const{_writableState:R,_readableState:S}=v,g=R||S;return!g&&O(v)||!!(g&&g.autoDestroy&&g.emitClose&&g.closed===!1)}function D(v){var R;return!!(v&&((R=v[Y])!==null&&R!==void 0?R:v.readableDidRead||v.readableAborted))}function w(v){var R,S,g,f,k,y,h,p,u,b;return!!(v&&((R=(S=(g=(f=(k=(y=v[Z])!==null&&y!==void 0?y:v.readableErrored)!==null&&k!==void 0?k:v.writableErrored)!==null&&f!==void 0?f:(h=v._readableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&g!==void 0?g:(p=v._writableState)===null||p===void 0?void 0:p.errorEmitted)!==null&&S!==void 0?S:(u=v._readableState)===null||u===void 0?void 0:u.errored)!==null&&R!==void 0?R:(b=v._writableState)===null||b===void 0?void 0:b.errored))}Q.exports={kDestroyed:K,isDisturbed:D,kIsDisturbed:Y,isErrored:w,kIsErrored:Z,isReadable:N,kIsReadable:B,isClosed:P,isDestroyed:G,isDuplexNodeStream:V,isFinished:E,isIterable:W,isReadableNodeStream:$,isReadableEnded:L,isReadableFinished:j,isReadableErrored:T,isNodeStream:U,isWritable:A,isWritableNodeStream:z,isWritableEnded:M,isWritableFinished:F,isWritableErrored:I,isServerRequest:_,isServerResponse:O,willEmitClose:C}}}),rq=mq({"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(q,Q){var{AbortError:X,codes:J}=oq(),{ERR_INVALID_ARG_TYPE:H,ERR_STREAM_PREMATURE_CLOSE:K}=J,{once:Z}=_q(),{validateAbortSignal:B,validateFunction:Y,validateObject:$}=sq(),{Promise:z}=Oq(),{isClosed:V,isReadable:U,isReadableNodeStream:W,isReadableFinished:G,isReadableErrored:M,isWritable:F,isWritableNodeStream:L,isWritableFinished:j,isWritableErrored:N,isNodeStream:A,willEmitClose:E}=aq();function I(O){return O.setHeader&&typeof O.abort==="function"}var T=()=>{};function P(O,_,C){var D,w;if(arguments.length===2)C=_,_={};else if(_==null)_={};else $(_,"options");Y(C,"callback"),B(_.signal,"options.signal"),C=Z(C);const v=(D=_.readable)!==null&&D!==void 0?D:W(O),R=(w=_.writable)!==null&&w!==void 0?w:L(O);if(!A(O))throw new H("stream","Stream",O);const{_writableState:S,_readableState:g}=O,f=()=>{if(!O.writable)h()};let k=E(O)&&W(O)===v&&L(O)===R,y=j(O,!1);const h=()=>{if(y=!0,O.destroyed)k=!1;if(k&&(!O.readable||v))return;if(!v||p)C.call(O)};let p=G(O,!1);const u=()=>{if(p=!0,O.destroyed)k=!1;if(k&&(!O.writable||R))return;if(!R||y)C.call(O)},b=(i)=>{C.call(O,i)};let m=V(O);const c=()=>{m=!0;const i=N(O)||M(O);if(i&&typeof i!=="boolean")return C.call(O,i);if(v&&!p&&W(O,!0)){if(!G(O,!1))return C.call(O,new K)}if(R&&!y){if(!j(O,!1))return C.call(O,new K)}C.call(O)},d=()=>{O.req.on("finish",h)};if(I(O)){if(O.on("complete",h),!k)O.on("abort",c);if(O.req)d();else O.on("request",d)}else if(R&&!S)O.on("end",f),O.on("close",f);if(!k&&typeof O.aborted==="boolean")O.on("aborted",c);if(O.on("end",u),O.on("finish",h),_.error!==!1)O.on("error",b);if(O.on("close",c),m)Iq(c);else if(S!==null&&S!==void 0&&S.errorEmitted||g!==null&&g!==void 0&&g.errorEmitted){if(!k)Iq(c)}else if(!v&&(!k||U(O))&&(y||F(O)===!1))Iq(c);else if(!R&&(!k||F(O))&&(p||U(O)===!1))Iq(c);else if(g&&O.req&&O.aborted)Iq(c);const l=()=>{if(C=T,O.removeListener("aborted",c),O.removeListener("complete",h),O.removeListener("abort",c),O.removeListener("request",d),O.req)O.req.removeListener("finish",h);O.removeListener("end",f),O.removeListener("close",f),O.removeListener("finish",h),O.removeListener("end",u),O.removeListener("error",b),O.removeListener("close",c)};if(_.signal&&!m){const i=()=>{const n=C;l(),n.call(O,new X(void 0,{cause:_.signal.reason}))};if(_.signal.aborted)Iq(i);else{const n=C;C=Z((...o)=>{_.signal.removeEventListener("abort",i),n.apply(O,o)}),_.signal.addEventListener("abort",i)}}return l}function x(O,_){return new z((C,D)=>{P(O,_,(w)=>{if(w)D(w);else C()})})}Q.exports=P,Q.exports.finished=x}}),tq=mq({"node_modules/readable-stream/lib/internal/streams/operators.js"(q,Q){var{codes:{ERR_INVALID_ARG_TYPE:X,ERR_MISSING_ARGS:J,ERR_OUT_OF_RANGE:H},AbortError:K}=oq(),{validateAbortSignal:Z,validateInteger:B,validateObject:Y}=sq(),$=Oq().Symbol("kWeak"),{finished:z}=rq(),{ArrayPrototypePush:V,MathFloor:U,Number:W,NumberIsNaN:G,Promise:M,PromiseReject:F,PromisePrototypeCatch:L,Symbol:j}=Oq(),N=j("kEmpty"),A=j("kEof");function E(f,k){if(typeof f!=="function")throw new X("fn",["Function","AsyncFunction"],f);if(k!=null)Y(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Z(k.signal,"options.signal");let y=1;if((k===null||k===void 0?void 0:k.concurrency)!=null)y=U(k.concurrency);return B(y,"concurrency",1),async function*h(){var p,u;const b=new AbortController,m=this,c=[],d=b.signal,l={signal:d},i=()=>b.abort();if(k!==null&&k!==void 0&&(p=k.signal)!==null&&p!==void 0&&p.aborted)i();k===null||k===void 0||(u=k.signal)===null||u===void 0||u.addEventListener("abort",i);let n,o,s=!1;function a(){s=!0}async function r(){try{for await(let qq of m){var t;if(s)return;if(d.aborted)throw new K;try{qq=f(qq,l)}catch(Qq){qq=F(Qq)}if(qq===N)continue;if(typeof((t=qq)===null||t===void 0?void 0:t.catch)==="function")qq.catch(a);if(c.push(qq),n)n(),n=null;if(!s&&c.length&&c.length>=y)await new M((Qq)=>{o=Qq})}c.push(A)}catch(qq){const Qq=F(qq);L(Qq,a),c.push(Qq)}finally{var e;if(s=!0,n)n(),n=null;k===null||k===void 0||(e=k.signal)===null||e===void 0||e.removeEventListener("abort",i)}}r();try{while(!0){while(c.length>0){const t=await c[0];if(t===A)return;if(d.aborted)throw new K;if(t!==N)yield t;if(c.shift(),o)o(),o=null}await new M((t)=>{n=t})}}finally{if(b.abort(),s=!0,o)o(),o=null}}.call(this)}function I(f=void 0){if(f!=null)Y(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)Z(f.signal,"options.signal");return async function*k(){let y=0;for await(let p of this){var h;if(f!==null&&f!==void 0&&(h=f.signal)!==null&&h!==void 0&&h.aborted)throw new K({cause:f.signal.reason});yield[y++,p]}}.call(this)}async function T(f,k=void 0){for await(let y of _.call(this,f,k))return!0;return!1}async function P(f,k=void 0){if(typeof f!=="function")throw new X("fn",["Function","AsyncFunction"],f);return!await T.call(this,async(...y)=>{return!await f(...y)},k)}async function x(f,k){for await(let y of _.call(this,f,k))return y;return}async function O(f,k){if(typeof f!=="function")throw new X("fn",["Function","AsyncFunction"],f);async function y(h,p){return await f(h,p),N}for await(let h of E.call(this,y,k));}function _(f,k){if(typeof f!=="function")throw new X("fn",["Function","AsyncFunction"],f);async function y(h,p){if(await f(h,p))return h;return N}return E.call(this,y,k)}var C=class extends J{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}};async function D(f,k,y){var h;if(typeof f!=="function")throw new X("reducer",["Function","AsyncFunction"],f);if(y!=null)Y(y,"options");if((y===null||y===void 0?void 0:y.signal)!=null)Z(y.signal,"options.signal");let p=arguments.length>1;if(y!==null&&y!==void 0&&(h=y.signal)!==null&&h!==void 0&&h.aborted){const d=new K(void 0,{cause:y.signal.reason});throw this.once("error",()=>{}),await z(this.destroy(d)),d}const u=new AbortController,b=u.signal;if(y!==null&&y!==void 0&&y.signal){const d={once:!0,[$]:this};y.signal.addEventListener("abort",()=>u.abort(),d)}let m=!1;try{for await(let d of this){var c;if(m=!0,y!==null&&y!==void 0&&(c=y.signal)!==null&&c!==void 0&&c.aborted)throw new K;if(!p)k=d,p=!0;else k=await f(k,d,{signal:b})}if(!m&&!p)throw new C}finally{u.abort()}return k}async function w(f){if(f!=null)Y(f,"options");if((f===null||f===void 0?void 0:f.signal)!=null)Z(f.signal,"options.signal");const k=[];for await(let h of this){var y;if(f!==null&&f!==void 0&&(y=f.signal)!==null&&y!==void 0&&y.aborted)throw new K(void 0,{cause:f.signal.reason});V(k,h)}return k}function v(f,k){const y=E.call(this,f,k);return async function*h(){for await(let p of y)yield*p}.call(this)}function R(f){if(f=W(f),G(f))return 0;if(f<0)throw new H("number",">= 0",f);return f}function S(f,k=void 0){if(k!=null)Y(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Z(k.signal,"options.signal");return f=R(f),async function*y(){var h;if(k!==null&&k!==void 0&&(h=k.signal)!==null&&h!==void 0&&h.aborted)throw new K;for await(let u of this){var p;if(k!==null&&k!==void 0&&(p=k.signal)!==null&&p!==void 0&&p.aborted)throw new K;if(f--<=0)yield u}}.call(this)}function g(f,k=void 0){if(k!=null)Y(k,"options");if((k===null||k===void 0?void 0:k.signal)!=null)Z(k.signal,"options.signal");return f=R(f),async function*y(){var h;if(k!==null&&k!==void 0&&(h=k.signal)!==null&&h!==void 0&&h.aborted)throw new K;for await(let u of this){var p;if(k!==null&&k!==void 0&&(p=k.signal)!==null&&p!==void 0&&p.aborted)throw new K;if(f-- >0)yield u;else return}}.call(this)}Q.exports.streamReturningOperators={asIndexedPairs:I,drop:S,filter:_,flatMap:v,map:E,take:g},Q.exports.promiseReturningOperators={every:P,forEach:O,reduce:D,toArray:w,some:T,find:x}}}),eq=mq({"node_modules/readable-stream/lib/internal/streams/destroy.js"(q,Q){var{aggregateTwoErrors:X,codes:{ERR_MULTIPLE_CALLBACK:J},AbortError:H}=oq(),{Symbol:K}=Oq(),{kDestroyed:Z,isDestroyed:B,isFinished:Y,isServerRequest:$}=aq(),z="#kDestroy",V="#kConstruct";function U(_,C,D){if(_){if(_.stack,C&&!C.errored)C.errored=_;if(D&&!D.errored)D.errored=_}}function W(_,C){const D=this._readableState,w=this._writableState,v=w||D;if(w&&w.destroyed||D&&D.destroyed){if(typeof C==="function")C();return this}if(U(_,w,D),w)w.destroyed=!0;if(D)D.destroyed=!0;if(!v.constructed)this.once(z,(R)=>{G(this,X(R,_),C)});else G(this,_,C);return this}function G(_,C,D){let w=!1;function v(R){if(w)return;w=!0;const{_readableState:S,_writableState:g}=_;if(U(R,g,S),g)g.closed=!0;if(S)S.closed=!0;if(typeof D==="function")D(R);if(R)Iq(M,_,R);else Iq(F,_)}try{_._destroy(C||null,v)}catch(R){v(R)}}function M(_,C){L(_,C),F(_)}function F(_){const{_readableState:C,_writableState:D}=_;if(D)D.closeEmitted=!0;if(C)C.closeEmitted=!0;if(D&&D.emitClose||C&&C.emitClose)_.emit("close")}function L(_,C){const D=_?._readableState,w=_?._writableState;if(w?.errorEmitted||D?.errorEmitted)return;if(w)w.errorEmitted=!0;if(D)D.errorEmitted=!0;_?.emit?.("error",C)}function j(){const _=this._readableState,C=this._writableState;if(_)_.constructed=!0,_.closed=!1,_.closeEmitted=!1,_.destroyed=!1,_.errored=null,_.errorEmitted=!1,_.reading=!1,_.ended=_.readable===!1,_.endEmitted=_.readable===!1;if(C)C.constructed=!0,C.destroyed=!1,C.closed=!1,C.closeEmitted=!1,C.errored=null,C.errorEmitted=!1,C.finalCalled=!1,C.prefinished=!1,C.ended=C.writable===!1,C.ending=C.writable===!1,C.finished=C.writable===!1}function N(_,C,D){const w=_?._readableState,v=_?._writableState;if(v&&v.destroyed||w&&w.destroyed)return this;if(w&&w.autoDestroy||v&&v.autoDestroy)_.destroy(C);else if(C){if(Error.captureStackTrace(C),v&&!v.errored)v.errored=C;if(w&&!w.errored)w.errored=C;if(D)Iq(L,_,C);else L(_,C)}}function A(_,C){if(typeof _._construct!=="function")return;const{_readableState:D,_writableState:w}=_;if(D)D.constructed=!1;if(w)w.constructed=!1;if(_.once(V,C),_.listenerCount(V)>1)return;Iq(E,_)}function E(_){let C=!1;function D(w){if(C){N(_,w!==null&&w!==void 0?w:new J);return}C=!0;const{_readableState:v,_writableState:R}=_,S=R||v;if(v)v.constructed=!0;if(R)R.constructed=!0;if(S.destroyed)_.emit(z,w);else if(w)N(_,w,!0);else Iq(I,_)}try{_._construct(D)}catch(w){D(w)}}function I(_){_.emit(V)}function T(_){return _&&_.setHeader&&typeof _.abort==="function"}function P(_){_.emit("close")}function x(_,C){_.emit("error",C),Iq(P,_)}function O(_,C){if(!_||B(_))return;if(!C&&!Y(_))C=new H;if($(_))_.socket=null,_.destroy(C);else if(T(_))_.abort();else if(T(_.req))_.req.abort();else if(typeof _.destroy==="function")_.destroy(C);else if(typeof _.close==="function")_.close();else if(C)Iq(x,_);else Iq(P,_);if(!_.destroyed)_[Z]=!0}Q.exports={construct:A,destroyer:O,destroy:W,undestroy:j,errorOrDestroy:N}}}),qQ=mq({"node_modules/readable-stream/lib/internal/streams/legacy.js"(q,Q){var{ArrayIsArray:X,ObjectSetPrototypeOf:J}=Oq();function H(Z){if(!(this instanceof H))return new H(Z);Pq.call(this,Z)}J(H.prototype,Pq.prototype),J(H,Pq),H.prototype.pipe=function(Z,B){const Y=this;function $(F){if(Z.writable&&Z.write(F)===!1&&Y.pause)Y.pause()}Y.on("data",$);function z(){if(Y.readable&&Y.resume)Y.resume()}if(Z.on("drain",z),!Z._isStdio&&(!B||B.end!==!1))Y.on("end",U),Y.on("close",W);let V=!1;function U(){if(V)return;V=!0,Z.end()}function W(){if(V)return;if(V=!0,typeof Z.destroy==="function")Z.destroy()}function G(F){if(M(),Pq.listenerCount(this,"error")===0)this.emit("error",F)}K(Y,"error",G),K(Z,"error",G);function M(){Y.removeListener("data",$),Z.removeListener("drain",z),Y.removeListener("end",U),Y.removeListener("close",W),Y.removeListener("error",G),Z.removeListener("error",G),Y.removeListener("end",M),Y.removeListener("close",M),Z.removeListener("close",M)}return Y.on("end",M),Y.on("close",M),Z.on("close",M),Z.emit("pipe",Y),Z};function K(Z,B,Y){if(typeof Z.prependListener==="function")return Z.prependListener(B,Y);if(!Z._events||!Z._events[B])Z.on(B,Y);else if(X(Z._events[B]))Z._events[B].unshift(Y);else Z._events[B]=[Y,Z._events[B]]}Q.exports={Stream:H,prependListener:K}}}),QQ=mq({"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js"(q,Q){var{AbortError:X,codes:J}=oq(),H=rq(),{ERR_INVALID_ARG_TYPE:K}=J,Z=(Y,$)=>{if(typeof Y!=="object"||!("aborted"in Y))throw new K($,"AbortSignal",Y)};function B(Y){return!!(Y&&typeof Y.pipe==="function")}Q.exports.addAbortSignal=function Y($,z){if(Z($,"signal"),!B(z))throw new K("stream","stream.Stream",z);return Q.exports.addAbortSignalNoValidate($,z)},Q.exports.addAbortSignalNoValidate=function(Y,$){if(typeof Y!=="object"||!("aborted"in Y))return $;const z=()=>{$.destroy(new X(void 0,{cause:Y.reason}))};if(Y.aborted)z();else Y.addEventListener("abort",z),H($,()=>Y.removeEventListener("abort",z));return $}}}),XQ=mq({"node_modules/readable-stream/lib/internal/streams/state.js"(q,Q){var{MathFloor:X,NumberIsInteger:J}=Oq(),{ERR_INVALID_ARG_VALUE:H}=oq().codes;function K(Y,$,z){return Y.highWaterMark!=null?Y.highWaterMark:$?Y[z]:null}function Z(Y){return Y?16:16384}function B(Y,$,z,V){const U=K($,V,z);if(U!=null){if(!J(U)||U<0){const W=V?`options.${z}`:"options.highWaterMark";throw new H(W,U)}return X(U)}return Z(Y.objectMode)}Q.exports={getHighWaterMark:B,getDefaultHighWaterMark:Z}}}),JQ=mq({"node_modules/readable-stream/lib/internal/streams/from.js"(q,Q){var{PromisePrototypeThen:X,SymbolAsyncIterator:J,SymbolIterator:H}=Oq(),{ERR_INVALID_ARG_TYPE:K,ERR_STREAM_NULL_VALUES:Z}=oq().codes;function B(Y,$,z){let V;if(typeof $==="string"||$ instanceof Buffer)return new Y({objectMode:!0,...z,read(){this.push($),this.push(null)}});let U;if($&&$[J])U=!0,V=$[J]();else if($&&$[H])U=!1,V=$[H]();else throw new K("iterable",["Iterable"],$);const W=new Y({objectMode:!0,highWaterMark:1,...z});let G=!1;W._read=function(){if(!G)G=!0,F()},W._destroy=function(L,j){X(M(L),()=>Iq(j,L),(N)=>Iq(j,N||L))};async function M(L){const j=L!==void 0&&L!==null,N=typeof V.throw==="function";if(j&&N){const{value:A,done:E}=await V.throw(L);if(await A,E)return}if(typeof V.return==="function"){const{value:A}=await V.return();await A}}async function F(){for(;;){try{const{value:L,done:j}=U?await V.next():V.next();if(j)W.push(null);else{const N=L&&typeof L.then==="function"?await L:L;if(N===null)throw G=!1,new Z;else if(W.push(N))continue;else G=!1}}catch(L){W.destroy(L)}break}}return W}Q.exports=B}}),HQ,KQ,ZQ=mq({"node_modules/readable-stream/lib/internal/streams/readable.js"(q,Q){var{ArrayPrototypeIndexOf:X,NumberIsInteger:J,NumberIsNaN:H,NumberParseInt:K,ObjectDefineProperties:Z,ObjectKeys:B,ObjectSetPrototypeOf:Y,Promise:$,SafeSet:z,SymbolAsyncIterator:V,Symbol:U}=Oq(),W=globalThis[Symbol.for("Bun.lazy")]("bun:stream").ReadableState,{Stream:G,prependListener:M}=qQ();function F(qq){if(!(this instanceof F))return new F(qq);const Qq=this instanceof Cq();if(this._readableState=new W(qq,this,Qq),qq){const{read:Xq,destroy:Jq,construct:Hq,signal:Kq}=qq;if(typeof Xq==="function")this._read=Xq;if(typeof Jq==="function")this._destroy=Jq;if(typeof Hq==="function")this._construct=Hq;if(Kq&&!Qq)N(Kq,this)}G.call(this,qq),_.construct(this,()=>{if(this._readableState.needReadable)x(this,this._readableState)})}Y(F.prototype,G.prototype),Y(F,G),F.prototype.on=function(qq,Qq){const Xq=G.prototype.on.call(this,qq,Qq),Jq=this._readableState;if(qq==="data")if(Jq.readableListening=this.listenerCount("readable")>0,Jq.flowing!==!1)Aq&&Nq("in flowing mode!",this.__id),this.resume();else Aq&&Nq("in readable mode!",this.__id);else if(qq==="readable"){if(Aq&&Nq("readable listener added!",this.__id),!Jq.endEmitted&&!Jq.readableListening){if(Jq.readableListening=Jq.needReadable=!0,Jq.flowing=!1,Jq.emittedReadable=!1,Aq&&Nq("on readable - state.length, reading, emittedReadable",Jq.length,Jq.reading,Jq.emittedReadable,this.__id),Jq.length)O(this,Jq);else if(!Jq.reading)Iq(l,this)}else if(Jq.endEmitted)Aq&&Nq("end already emitted...",this.__id)}return Xq};class L extends F{#q;#Q;#X;#J;constructor(qq,Qq){const{objectMode:Xq,highWaterMark:Jq,encoding:Hq,signal:Kq}=qq;super({objectMode:Xq,highWaterMark:Jq,encoding:Hq,signal:Kq});this.#X=[],this.#q=void 0,this.#J=Qq,this.#Q=!1}#H(){var qq=this.#X,Qq=0,Xq=qq.length;for(;Qq<Xq;Qq++){const Jq=qq[Qq];if(qq[Qq]=void 0,!this.push(Jq,void 0))return this.#X=qq.slice(Qq+1),!0}if(Xq>0)this.#X=[];return!1}#K(qq){qq.releaseLock(),this.#q=void 0,this.#Q=!0,this.push(null);return}async _read(){Aq&&Nq("ReadableFromWeb _read()",this.__id);var qq=this.#J,Qq=this.#q;if(qq)Qq=this.#q=qq.getReader(),this.#J=void 0;else if(this.#H())return;var Xq;try{do{var Jq=!1,Hq;const Kq=Qq.readMany();if(xq(Kq)){if({done:Jq,value:Hq}=await Kq,this.#Q){this.#X.push(...Hq);return}}else({done:Jq,value:Hq}=Kq);if(Jq){this.#K(Qq);return}if(!this.push(Hq[0])){this.#X=Hq.slice(1);return}for(let Zq=1,Bq=Hq.length;Zq<Bq;Zq++)if(!this.push(Hq[Zq])){this.#X=Hq.slice(Zq+1);return}}while(!this.#Q)}catch(Kq){Xq=Kq}finally{if(Xq)throw Xq}}_destroy(qq,Qq){if(!this.#Q){var Xq=this.#q;if(Xq)this.#q=void 0,Xq.cancel(qq).finally(()=>{this.#Q=!0,Qq(qq)});return}try{Qq(qq)}catch(Jq){globalThis.reportError(Jq)}}}KQ=L;function j(qq,Qq={}){if(!cq(qq))throw new D("readableStream","ReadableStream",qq);g(Qq,"options");const{highWaterMark:Xq,encoding:Jq,objectMode:Hq=!1,signal:Kq}=Qq;if(Jq!==void 0&&!Buffer.isEncoding(Jq))throw new nq(Jq,"options.encoding");return dq(Hq,"options.objectMode"),NQ(F,qq,Qq)||new L({highWaterMark:Xq,encoding:Jq,objectMode:Hq,signal:Kq},qq)}Q.exports=F,HQ=j;var{addAbortSignal:N}=QQ(),A=rq();const{maybeReadMore:E,resume:I,emitReadable:T,onEofChunk:P}=globalThis[Symbol.for("Bun.lazy")]("bun:stream");function x(qq,Qq){process.nextTick(E,qq,Qq)}function O(qq,Qq){Aq&&Nq("NativeReadable - emitReadable",qq.__id),T(qq,Qq)}var _=eq(),{aggregateTwoErrors:C,codes:{ERR_INVALID_ARG_TYPE:D,ERR_METHOD_NOT_IMPLEMENTED:w,ERR_OUT_OF_RANGE:v,ERR_STREAM_PUSH_AFTER_EOF:R,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:S}}=oq(),{validateObject:g}=sq(),f=JQ(),k=()=>{},{errorOrDestroy:y}=_;F.prototype.destroy=_.destroy,F.prototype._undestroy=_.undestroy,F.prototype._destroy=function(qq,Qq){Qq(qq)},F.prototype[Pq.captureRejectionSymbol]=function(qq){this.destroy(qq)},F.prototype.push=function(qq,Qq){return h(this,qq,Qq,!1)},F.prototype.unshift=function(qq,Qq){return h(this,qq,Qq,!0)};function h(qq,Qq,Xq,Jq){Aq&&Nq("readableAddChunk",Qq,qq.__id);const Hq=qq._readableState;let Kq;if(!Hq.objectMode){if(typeof Qq==="string"){if(Xq=Xq||Hq.defaultEncoding,Hq.encoding!==Xq)if(Jq&&Hq.encoding)Qq=Buffer.from(Qq,Xq).toString(Hq.encoding);else Qq=Buffer.from(Qq,Xq),Xq=""}else if(Qq instanceof Buffer)Xq="";else if(G._isUint8Array(Qq)){if(Jq||!Hq.decoder)Qq=G._uint8ArrayToBuffer(Qq);Xq=""}else if(Qq!=null)Kq=new D("chunk",["string","Buffer","Uint8Array"],Qq)}if(Kq)y(qq,Kq);else if(Qq===null)Hq.reading=!1,P(qq,Hq);else if(Hq.objectMode||Qq&&Qq.length>0)if(Jq)if(Hq.endEmitted)y(qq,new S);else if(Hq.destroyed||Hq.errored)return!1;else p(qq,Hq,Qq,!0);else if(Hq.ended)y(qq,new R);else if(Hq.destroyed||Hq.errored)return!1;else if(Hq.reading=!1,Hq.decoder&&!Xq)if(Qq=Hq.decoder.write(Qq),Hq.objectMode||Qq.length!==0)p(qq,Hq,Qq,!1);else x(qq,Hq);else p(qq,Hq,Qq,!1);else if(!Jq)Hq.reading=!1,x(qq,Hq);return!Hq.ended&&(Hq.length<Hq.highWaterMark||Hq.length===0)}function p(qq,Qq,Xq,Jq){if(Aq&&Nq("adding chunk",qq.__id),Aq&&Nq("chunk",Xq.toString(),qq.__id),Qq.flowing&&Qq.length===0&&!Qq.sync&&qq.listenerCount("data")>0){if(Qq.multiAwaitDrain)Qq.awaitDrainWriters.clear();else Qq.awaitDrainWriters=null;Qq.dataEmitted=!0,qq.emit("data",Xq)}else{if(Qq.length+=Qq.objectMode?1:Xq.length,Jq)Qq.buffer.unshift(Xq);else Qq.buffer.push(Xq);if(Aq&&Nq("needReadable @ addChunk",Qq.needReadable,qq.__id),Qq.needReadable)O(qq,Qq)}x(qq,Qq)}F.prototype.isPaused=function(){const qq=this._readableState;return qq.paused===!0||qq.flowing===!1},F.prototype.setEncoding=function(qq){const Qq=new Sq(qq);this._readableState.decoder=Qq,this._readableState.encoding=this._readableState.decoder.encoding;const Xq=this._readableState.buffer;let Jq="";for(let Hq=Xq.length;Hq>0;Hq--)Jq+=Qq.write(Xq.shift());if(Jq!=="")Xq.push(Jq);return this._readableState.length=Jq.length,this};var u=1073741824;function b(qq){if(qq>u)throw new v("size","<= 1GiB",qq);else qq--,qq|=qq>>>1,qq|=qq>>>2,qq|=qq>>>4,qq|=qq>>>8,qq|=qq>>>16,qq++;return qq}function m(qq,Qq){if(qq<=0||Qq.length===0&&Qq.ended)return 0;if(Qq.objectMode)return 1;if(H(qq)){if(Qq.flowing&&Qq.length)return Qq.buffer.first().length;return Qq.length}if(qq<=Qq.length)return qq;return Qq.ended?Qq.length:0}F.prototype.read=function(qq){if(Aq&&Nq("read - n =",qq,this.__id),!J(qq))qq=K(qq,10);const Qq=this._readableState,Xq=qq;if(qq>Qq.highWaterMark)Qq.highWaterMark=b(qq);if(qq!==0)Qq.emittedReadable=!1;if(qq===0&&Qq.needReadable&&((Qq.highWaterMark!==0?Qq.length>=Qq.highWaterMark:Qq.length>0)||Qq.ended)){if(Aq&&Nq("read: emitReadable or endReadable",Qq.length,Qq.ended,this.__id),Qq.length===0&&Qq.ended)s(this);else O(this,Qq);return null}if(qq=m(qq,Qq),qq===0&&Qq.ended){if(Aq&&Nq("read: calling endReadable if length 0 -- length, state.ended",Qq.length,Qq.ended,this.__id),Qq.length===0)s(this);return null}let Jq=Qq.needReadable;if(Aq&&Nq("need readable",Jq,this.__id),Qq.length===0||Qq.length-qq<Qq.highWaterMark)Jq=!0,Aq&&Nq("length less than watermark",Jq,this.__id);if(Qq.ended||Qq.reading||Qq.destroyed||Qq.errored||!Qq.constructed)Aq&&Nq("state.constructed?",Qq.constructed,this.__id),Jq=!1,Aq&&Nq("reading, ended or constructing",Jq,this.__id);else if(Jq){if(Aq&&Nq("do read",this.__id),Qq.reading=!0,Qq.sync=!0,Qq.length===0)Qq.needReadable=!0;try{var Hq=this._read(Qq.highWaterMark);if(xq(Hq)){Aq&&Nq("async _read",this.__id);const Zq=Bun.peek(Hq);if(Aq&&Nq("peeked promise",Zq,this.__id),Zq!==Hq)Hq=Zq}if(xq(Hq)&&Hq?.then&&Dq(Hq.then))Aq&&Nq("async _read result.then setup",this.__id),Hq.then(k,function(Zq){y(this,Zq)})}catch(Zq){y(this,Zq)}if(Qq.sync=!1,!Qq.reading)qq=m(Xq,Qq)}Aq&&Nq("n @ fromList",qq,this.__id);let Kq;if(qq>0)Kq=o(qq,Qq);else Kq=null;if(Aq&&Nq("ret @ read",Kq,this.__id),Kq===null)Qq.needReadable=Qq.length<=Qq.highWaterMark,Aq&&Nq("state.length while ret = null",Qq.length,this.__id),qq=0;else if(Qq.length-=qq,Qq.multiAwaitDrain)Qq.awaitDrainWriters.clear();else Qq.awaitDrainWriters=null;if(Qq.length===0){if(!Qq.ended)Qq.needReadable=!0;if(Xq!==qq&&Qq.ended)s(this)}if(Kq!==null&&!Qq.errorEmitted&&!Qq.closeEmitted)Qq.dataEmitted=!0,this.emit("data",Kq);return Kq},F.prototype._read=function(qq){throw new w("_read()")},F.prototype.pipe=function(qq,Qq){const Xq=this,Jq=this._readableState;if(Jq.pipes.length===1){if(!Jq.multiAwaitDrain)Jq.multiAwaitDrain=!0,Jq.awaitDrainWriters=new z(Jq.awaitDrainWriters?[Jq.awaitDrainWriters]:[])}Jq.pipes.push(qq),Aq&&Nq("pipe count=%d opts=%j",Jq.pipes.length,Qq,Xq.__id);const Kq=(!Qq||Qq.end!==!1)&&qq!==process.stdout&&qq!==process.stderr?Bq:Fq;if(Jq.endEmitted)Iq(Kq);else Xq.once("end",Kq);qq.on("unpipe",Zq);function Zq(Lq,jq){if(Aq&&Nq("onunpipe",Xq.__id),Lq===Xq){if(jq&&jq.hasUnpiped===!1)jq.hasUnpiped=!0,zq()}}function Bq(){Aq&&Nq("onend",Xq.__id),qq.end()}let Yq,$q=!1;function zq(){if(Aq&&Nq("cleanup",Xq.__id),qq.removeListener("close",Gq),qq.removeListener("finish",Mq),Yq)qq.removeListener("drain",Yq);if(qq.removeListener("error",Wq),qq.removeListener("unpipe",Zq),Xq.removeListener("end",Bq),Xq.removeListener("end",Fq),Xq.removeListener("data",Uq),$q=!0,Yq&&Jq.awaitDrainWriters&&(!qq._writableState||qq._writableState.needDrain))Yq()}function Vq(){if(!$q){if(Jq.pipes.length===1&&Jq.pipes[0]===qq)Aq&&Nq("false write response, pause",0,Xq.__id),Jq.awaitDrainWriters=qq,Jq.multiAwaitDrain=!1;else if(Jq.pipes.length>1&&Jq.pipes.includes(qq))Aq&&Nq("false write response, pause",Jq.awaitDrainWriters.size,Xq.__id),Jq.awaitDrainWriters.add(qq);Xq.pause()}if(!Yq)Yq=c(Xq,qq),qq.on("drain",Yq)}Xq.on("data",Uq);function Uq(Lq){Aq&&Nq("ondata",Xq.__id);const jq=qq.write(Lq);if(Aq&&Nq("dest.write",jq,Xq.__id),jq===!1)Vq()}function Wq(Lq){if(Nq("onerror",Lq),Fq(),qq.removeListener("error",Wq),qq.listenerCount("error")===0){const jq=qq._writableState||qq._readableState;if(jq&&!jq.errorEmitted)y(qq,Lq);else qq.emit("error",Lq)}}M(qq,"error",Wq);function Gq(){qq.removeListener("finish",Mq),Fq()}qq.once("close",Gq);function Mq(){Nq("onfinish"),qq.removeListener("close",Gq),Fq()}qq.once("finish",Mq);function Fq(){Nq("unpipe"),Xq.unpipe(qq)}if(qq.emit("pipe",Xq),qq.writableNeedDrain===!0){if(Jq.flowing)Vq()}else if(!Jq.flowing)Nq("pipe resume"),Xq.resume();return qq};function c(qq,Qq){return function Xq(){const Jq=qq._readableState;if(Jq.awaitDrainWriters===Qq)Nq("pipeOnDrain",1),Jq.awaitDrainWriters=null;else if(Jq.multiAwaitDrain)Nq("pipeOnDrain",Jq.awaitDrainWriters.size),Jq.awaitDrainWriters.delete(Qq);if((!Jq.awaitDrainWriters||Jq.awaitDrainWriters.size===0)&&qq.listenerCount("data"))qq.resume()}}F.prototype.unpipe=function(qq){const Qq=this._readableState,Xq={hasUnpiped:!1};if(Qq.pipes.length===0)return this;if(!qq){const Hq=Qq.pipes;Qq.pipes=[],this.pause();for(let Kq=0;Kq<Hq.length;Kq++)Hq[Kq].emit("unpipe",this,{hasUnpiped:!1});return this}const Jq=X(Qq.pipes,qq);if(Jq===-1)return this;if(Qq.pipes.splice(Jq,1),Qq.pipes.length===0)this.pause();return qq.emit("unpipe",this,Xq),this},F.prototype.addListener=F.prototype.on,F.prototype.removeListener=function(qq,Qq){const Xq=G.prototype.removeListener.call(this,qq,Qq);if(qq==="readable")Iq(d,this);return Xq},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(qq){const Qq=G.prototype.removeAllListeners.apply(this,arguments);if(qq==="readable"||qq===void 0)Iq(d,this);return Qq};function d(qq){const Qq=qq._readableState;if(Qq.readableListening=qq.listenerCount("readable")>0,Qq.resumeScheduled&&Qq.paused===!1)Qq.flowing=!0;else if(qq.listenerCount("data")>0)qq.resume();else if(!Qq.readableListening)Qq.flowing=null}function l(qq){Aq&&Nq("on readable nextTick, calling read(0)",qq.__id),qq.read(0)}F.prototype.resume=function(){const qq=this._readableState;if(!qq.flowing)Aq&&Nq("resume",this.__id),qq.flowing=!qq.readableListening,I(this,qq);return qq.paused=!1,this},F.prototype.pause=function(){if(Aq&&Nq("call pause flowing=%j",this._readableState.flowing,this.__id),this._readableState.flowing!==!1)Aq&&Nq("pause",this.__id),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this},F.prototype.wrap=function(qq){let Qq=!1;qq.on("data",(Jq)=>{if(!this.push(Jq)&&qq.pause)Qq=!0,qq.pause()}),qq.on("end",()=>{this.push(null)}),qq.on("error",(Jq)=>{y(this,Jq)}),qq.on("close",()=>{this.destroy()}),qq.on("destroy",()=>{this.destroy()}),this._read=()=>{if(Qq&&qq.resume)Qq=!1,qq.resume()};const Xq=B(qq);for(let Jq=1;Jq<Xq.length;Jq++){const Hq=Xq[Jq];if(this[Hq]===void 0&&typeof qq[Hq]==="function")this[Hq]=qq[Hq].bind(qq)}return this},F.prototype[V]=function(){return i(this)},F.prototype.iterator=function(qq){if(qq!==void 0)g(qq,"options");return i(this,qq)};function i(qq,Qq){if(typeof qq.read!=="function")qq=F.wrap(qq,{objectMode:!0});const Xq=n(qq,Qq);return Xq.stream=qq,Xq}async function*n(qq,Qq){let Xq=k;function Jq(Zq){if(this===qq)Xq(),Xq=k;else Xq=Zq}qq.on("readable",Jq);let Hq;const Kq=A(qq,{writable:!1},(Zq)=>{Hq=Zq?C(Hq,Zq):null,Xq(),Xq=k});try{while(!0){const Zq=qq.destroyed?null:qq.read();if(Zq!==null)yield Zq;else if(Hq)throw Hq;else if(Hq===null)return;else await new $(Jq)}}catch(Zq){throw Hq=C(Hq,Zq),Hq}finally{if((Hq||(Qq===null||Qq===void 0?void 0:Qq.destroyOnReturn)!==!1)&&(Hq===void 0||qq._readableState.autoDestroy))_.destroyer(qq,null);else qq.off("readable",Jq),Kq()}}Z(F.prototype,{readable:{get(){const qq=this._readableState;return!!qq&&qq.readable!==!1&&!qq.destroyed&&!qq.errorEmitted&&!qq.endEmitted},set(qq){if(this._readableState)this._readableState.readable=!!qq}},readableDidRead:{enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{enumerable:!1,get:function(){return this._readableState.flowing},set:function(qq){if(this._readableState)this._readableState.flowing=qq}},readableLength:{enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{get(){return this._readableState?this._readableState.closed:!1}},destroyed:{enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(qq){if(!this._readableState)return;this._readableState.destroyed=qq}},readableEnded:{enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),F._fromList=o;function o(qq,Qq){if(Qq.length===0)return null;let Xq;if(Qq.objectMode)Xq=Qq.buffer.shift();else if(!qq||qq>=Qq.length){if(Qq.decoder)Xq=Qq.buffer.join("");else if(Qq.buffer.length===1)Xq=Qq.buffer.first();else Xq=Qq.buffer.concat(Qq.length);Qq.buffer.clear()}else Xq=Qq.buffer.consume(qq,Qq.decoder);return Xq}function s(qq){const Qq=qq._readableState;if(Aq&&Nq("endEmitted @ endReadable",Qq.endEmitted,qq.__id),!Qq.endEmitted)Qq.ended=!0,Iq(a,Qq,qq)}function a(qq,Qq){if(Aq&&Nq("endReadableNT -- endEmitted, state.length",qq.endEmitted,qq.length,Qq.__id),!qq.errored&&!qq.closeEmitted&&!qq.endEmitted&&qq.length===0){if(qq.endEmitted=!0,Qq.emit("end"),Aq&&Nq("end emitted @ endReadableNT",Qq.__id),Qq.writable&&Qq.allowHalfOpen===!1)Iq(r,Qq);else if(qq.autoDestroy){const Xq=Qq._writableState;if(!Xq||Xq.autoDestroy&&(Xq.finished||Xq.writable===!1))Qq.destroy()}}}function r(qq){if(qq.writable&&!qq.writableEnded&&!qq.destroyed)qq.end()}F.from=function(qq,Qq){return f(F,qq,Qq)};var t={newStreamReadableFromReadableStream:j};function e(){if(t===void 0)t={};return t}F.fromWeb=function(qq,Qq){return e().newStreamReadableFromReadableStream(qq,Qq)},F.toWeb=function(qq){return e().newReadableStreamFromStreamReadable(qq)},F.wrap=function(qq,Qq){var Xq,Jq;return new F({objectMode:(Xq=(Jq=qq.readableObjectMode)!==null&&Jq!==void 0?Jq:qq.objectMode)!==null&&Xq!==void 0?Xq:!0,...Qq,destroy(Hq,Kq){_.destroyer(qq,Hq),Kq(Hq)}}).wrap(qq)}}}),BQ=mq({"node_modules/readable-stream/lib/internal/streams/writable.js"(q,Q){var{ArrayPrototypeSlice:X,Error:J,FunctionPrototypeSymbolHasInstance:H,ObjectDefineProperty:K,ObjectDefineProperties:Z,ObjectSetPrototypeOf:B,StringPrototypeToLowerCase:Y,Symbol:$,SymbolHasInstance:z}=Oq(),V=qQ().Stream,U=eq(),{addAbortSignal:W}=QQ(),{getHighWaterMark:G,getDefaultHighWaterMark:M}=XQ(),{ERR_INVALID_ARG_TYPE:F,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:j,ERR_STREAM_CANNOT_PIPE:N,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:E,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:P}=oq().codes,{errorOrDestroy:x}=U;function O(o={}){const s=this instanceof Cq();if(!s&&!H(O,this))return new O(o);if(this._writableState=new D(o,this,s),o){if(typeof o.write==="function")this._write=o.write;if(typeof o.writev==="function")this._writev=o.writev;if(typeof o.destroy==="function")this._destroy=o.destroy;if(typeof o.final==="function")this._final=o.final;if(typeof o.construct==="function")this._construct=o.construct;if(o.signal)W(o.signal,this)}V.call(this,o),U.construct(this,()=>{const a=this._writableState;if(!a.writing)p(this,a);c(this,a)})}B(O.prototype,V.prototype),B(O,V),Q.exports=O;function _(){}var C=$("kOnFinished");function D(o,s,a){if(typeof a!=="boolean")a=s instanceof Cq();if(this.objectMode=!!(o&&o.objectMode),a)this.objectMode=this.objectMode||!!(o&&o.writableObjectMode);this.highWaterMark=o?G(this,o,"writableHighWaterMark",a):M(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const r=!!(o&&o.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=o&&o.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=f.bind(void 0,s),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,w(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!o||o.emitClose!==!1,this.autoDestroy=!o||o.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function w(o){o.buffered=[],o.bufferedIndex=0,o.allBuffers=!0,o.allNoop=!0}D.prototype.getBuffer=function o(){return X(this.buffered,this.bufferedIndex)},K(D.prototype,"bufferedRequestCount",{get(){return this.buffered.length-this.bufferedIndex}}),K(O,z,{value:function(o){if(H(this,o))return!0;if(this!==O)return!1;return o&&o._writableState instanceof D}}),O.prototype.pipe=function(){x(this,new N)};function v(o,s,a,r){const t=o._writableState;if(typeof a==="function")r=a,a=t.defaultEncoding;else{if(!a)a=t.defaultEncoding;else if(a!=="buffer"&&!Buffer.isEncoding(a))throw new P(a);if(typeof r!=="function")r=_}if(s===null)throw new I;else if(!t.objectMode)if(typeof s==="string"){if(t.decodeStrings!==!1)s=Buffer.from(s,a),a="buffer"}else if(s instanceof Buffer)a="buffer";else if(V._isUint8Array(s))s=V._uint8ArrayToBuffer(s),a="buffer";else throw new F("chunk",["string","Buffer","Uint8Array"],s);let e;if(t.ending)e=new T;else if(t.destroyed)e=new A("write");if(e)return Iq(r,e),x(o,e,!0),e;return t.pendingcb++,R(o,t,s,a,r)}O.prototype.write=function(o,s,a){return v(this,o,s,a)===!0},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){const o=this._writableState;if(o.corked){if(o.corked--,!o.writing)p(this,o)}},O.prototype.setDefaultEncoding=function o(s){if(typeof s==="string")s=Y(s);if(!Buffer.isEncoding(s))throw new P(s);return this._writableState.defaultEncoding=s,this};function R(o,s,a,r,t){const e=s.objectMode?1:a.length;s.length+=e;const qq=s.length<s.highWaterMark;if(!qq)s.needDrain=!0;if(s.writing||s.corked||s.errored||!s.constructed){if(s.buffered.push({chunk:a,encoding:r,callback:t}),s.allBuffers&&r!=="buffer")s.allBuffers=!1;if(s.allNoop&&t!==_)s.allNoop=!1}else s.writelen=e,s.writecb=t,s.writing=!0,s.sync=!0,o._write(a,r,s.onwrite),s.sync=!1;return qq&&!s.errored&&!s.destroyed}function S(o,s,a,r,t,e,qq){if(s.writelen=r,s.writecb=qq,s.writing=!0,s.sync=!0,s.destroyed)s.onwrite(new A("write"));else if(a)o._writev(t,s.onwrite);else o._write(t,e,s.onwrite);s.sync=!1}function g(o,s,a,r){--s.pendingcb,r(a),h(s),x(o,a)}function f(o,s){const a=o._writableState,r=a.sync,t=a.writecb;if(typeof t!=="function"){x(o,new j);return}if(a.writing=!1,a.writecb=null,a.length-=a.writelen,a.writelen=0,s){if(Error.captureStackTrace(s),!a.errored)a.errored=s;if(o._readableState&&!o._readableState.errored)o._readableState.errored=s;if(r)Iq(g,o,a,s,t);else g(o,a,s,t)}else{if(a.buffered.length>a.bufferedIndex)p(o,a);if(r)if(a.afterWriteTickInfo!==null&&a.afterWriteTickInfo.cb===t)a.afterWriteTickInfo.count++;else a.afterWriteTickInfo={count:1,cb:t,stream:o,state:a},Iq(k,a.afterWriteTickInfo);else y(o,a,1,t)}}function k({stream:o,state:s,count:a,cb:r}){return s.afterWriteTickInfo=null,y(o,s,a,r)}function y(o,s,a,r){if(!s.ending&&!o.destroyed&&s.length===0&&s.needDrain)s.needDrain=!1,o.emit("drain");while(a-- >0)s.pendingcb--,r();if(s.destroyed)h(s);c(o,s)}function h(o){if(o.writing)return;for(let t=o.bufferedIndex;t<o.buffered.length;++t){var s;const{chunk:e,callback:qq}=o.buffered[t],Qq=o.objectMode?1:e.length;o.length-=Qq,qq((s=o.errored)!==null&&s!==void 0?s:new A("write"))}const a=o[C].splice(0);for(let t=0;t<a.length;t++){var r;a[t]((r=o.errored)!==null&&r!==void 0?r:new A("end"))}w(o)}function p(o,s){if(s.corked||s.bufferProcessing||s.destroyed||!s.constructed)return;const{buffered:a,bufferedIndex:r,objectMode:t}=s,e=a.length-r;if(!e)return;let qq=r;if(s.bufferProcessing=!0,e>1&&o._writev){s.pendingcb-=e-1;const Qq=s.allNoop?_:(Jq)=>{for(let Hq=qq;Hq<a.length;++Hq)a[Hq].callback(Jq)},Xq=s.allNoop&&qq===0?a:X(a,qq);Xq.allBuffers=s.allBuffers,S(o,s,!0,s.length,Xq,"",Qq),w(s)}else{do{const{chunk:Qq,encoding:Xq,callback:Jq}=a[qq];a[qq++]=null;const Hq=t?1:Qq.length;S(o,s,!1,Hq,Qq,Xq,Jq)}while(qq<a.length&&!s.writing);if(qq===a.length)w(s);else if(qq>256)a.splice(0,qq),s.bufferedIndex=0;else s.bufferedIndex=qq}s.bufferProcessing=!1}O.prototype._write=function(o,s,a){if(this._writev)this._writev([{chunk:o,encoding:s}],a);else throw new L("_write()")},O.prototype._writev=null,O.prototype.end=function(o,s,a,r=!1){const t=this._writableState;if(Aq&&Nq("end",t,this.__id),typeof o==="function")a=o,o=null,s=null;else if(typeof s==="function")a=s,s=null;let e;if(o!==null&&o!==void 0){let qq;if(!r)qq=v(this,o,s);else qq=this.write(o,s);if(qq instanceof J)e=qq}if(t.corked)t.corked=1,this.uncork();if(e)this.emit("error",e);else if(!t.errored&&!t.ending)t.ending=!0,c(this,t,!0),t.ended=!0;else if(t.finished)e=new E("end");else if(t.destroyed)e=new A("end");if(typeof a==="function")if(e||t.finished)Iq(a,e);else t[C].push(a);return this};function u(o,s){var a=o.ending&&!o.destroyed&&o.constructed&&o.length===0&&!o.errored&&o.buffered.length===0&&!o.finished&&!o.writing&&!o.errorEmitted&&!o.closeEmitted;return Nq("needFinish",a,s),a}function b(o,s){let a=!1;function r(t){if(a){x(o,t!==null&&t!==void 0?t:j());return}if(a=!0,s.pendingcb--,t){const e=s[C].splice(0);for(let qq=0;qq<e.length;qq++)e[qq](t);x(o,t,s.sync)}else if(u(s))s.prefinished=!0,o.emit("prefinish"),s.pendingcb++,Iq(d,o,s)}s.sync=!0,s.pendingcb++;try{o._final(r)}catch(t){r(t)}s.sync=!1}function m(o,s){if(!s.prefinished&&!s.finalCalled)if(typeof o._final==="function"&&!s.destroyed)s.finalCalled=!0,b(o,s);else s.prefinished=!0,o.emit("prefinish")}function c(o,s,a){if(Aq&&Nq("finishMaybe -- state, sync",s,a,o.__id),!u(s,o.__id))return;if(m(o,s),s.pendingcb===0){if(a)s.pendingcb++,Iq((r,t)=>{if(u(t))d(r,t);else t.pendingcb--},o,s);else if(u(s))s.pendingcb++,d(o,s)}}function d(o,s){s.pendingcb--,s.finished=!0;const a=s[C].splice(0);for(let r=0;r<a.length;r++)a[r]();if(o.emit("finish"),s.autoDestroy){const r=o._readableState;if(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))o.destroy()}}Z(O.prototype,{closed:{get(){return this._writableState?this._writableState.closed:!1}},destroyed:{get(){return this._writableState?this._writableState.destroyed:!1},set(o){if(this._writableState)this._writableState.destroyed=o}},writable:{get(){const o=this._writableState;return!!o&&o.writable!==!1&&!o.destroyed&&!o.errored&&!o.ending&&!o.ended},set(o){if(this._writableState)this._writableState.writable=!!o}},writableFinished:{get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{get(){const o=this._writableState;if(!o)return!1;return!o.destroyed&&!o.ending&&o.needDrain}},writableHighWaterMark:{get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{get(){return this._writableState?this._writableState.corked:0}},writableLength:{get(){return this._writableState&&this._writableState.length}},errored:{enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var l=U.destroy;O.prototype.destroy=function(o,s){const a=this._writableState;if(!a.destroyed&&(a.bufferedIndex<a.buffered.length||a[C].length))Iq(h,a);return l.call(this,o,s),this},O.prototype._undestroy=U.undestroy,O.prototype._destroy=function(o,s){s(o)},O.prototype[Pq.captureRejectionSymbol]=function(o){this.destroy(o)};var i;function n(){if(i===void 0)i={};return i}O.fromWeb=function(o,s){return n().newStreamWritableFromWritableStream(o,s)},O.toWeb=function(o){return n().newWritableStreamFromStreamWritable(o)}}}),YQ=mq({"node_modules/readable-stream/lib/internal/streams/duplexify.js"(q,Q){var{isReadable:X,isWritable:J,isIterable:H,isNodeStream:K,isReadableNodeStream:Z,isWritableNodeStream:B,isDuplexNodeStream:Y}=aq(),$=rq(),{AbortError:z,codes:{ERR_INVALID_ARG_TYPE:V,ERR_INVALID_RETURN_VALUE:U}}=oq(),{destroyer:W}=eq(),G=Cq(),M=ZQ(),{createDeferredPromise:F}=_q(),L=JQ(),j=typeof Blob!=="undefined"?function T(P){return P instanceof Blob}:function T(P){return!1},{FunctionPrototypeCall:N}=Oq();class A extends G{constructor(T){super(T);if((T===null||T===void 0?void 0:T.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((T===null||T===void 0?void 0:T.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}Q.exports=function T(P,x){if(Y(P))return P;if(Z(P))return I({readable:P});if(B(P))return I({writable:P});if(K(P))return I({writable:!1,readable:!1});if(typeof P==="function"){const{value:_,write:C,final:D,destroy:w}=E(P);if(H(_))return L(A,_,{objectMode:!0,write:C,final:D,destroy:w});const v=_===null||_===void 0?void 0:_.then;if(typeof v==="function"){let R;const S=N(v,_,(g)=>{if(g!=null)throw new U("nully","body",g)},(g)=>{W(R,g)});return R=new A({objectMode:!0,readable:!1,write:C,final(g){D(async()=>{try{await S,Iq(g,null)}catch(f){Iq(g,f)}})},destroy:w})}throw new U("Iterable, AsyncIterable or AsyncFunction",x,_)}if(j(P))return T(P.arrayBuffer());if(H(P))return L(A,P,{objectMode:!0,writable:!1});if(typeof(P===null||P===void 0?void 0:P.writable)==="object"||typeof(P===null||P===void 0?void 0:P.readable)==="object"){const _=P!==null&&P!==void 0&&P.readable?Z(P===null||P===void 0?void 0:P.readable)?P===null||P===void 0?void 0:P.readable:T(P.readable):void 0,C=P!==null&&P!==void 0&&P.writable?B(P===null||P===void 0?void 0:P.writable)?P===null||P===void 0?void 0:P.writable:T(P.writable):void 0;return I({readable:_,writable:C})}const O=P===null||P===void 0?void 0:P.then;if(typeof O==="function"){let _;return N(O,P,(C)=>{if(C!=null)_.push(C);_.push(null)},(C)=>{W(_,C)}),_=new A({objectMode:!0,writable:!1,read(){}})}throw new V(x,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],P)};function E(T){let{promise:P,resolve:x}=F();const O=new AbortController,_=O.signal;return{value:T(async function*(){while(!0){const D=P;P=null;const{chunk:w,done:v,cb:R}=await D;if(Iq(R),v)return;if(_.aborted)throw new z(void 0,{cause:_.reason});({promise:P,resolve:x}=F()),yield w}}(),{signal:_}),write(D,w,v){const R=x;x=null,R({chunk:D,done:!1,cb:v})},final(D){const w=x;x=null,w({done:!0,cb:D})},destroy(D,w){O.abort(),w(D)}}}function I(T){const P=T.readable&&typeof T.readable.read!=="function"?M.wrap(T.readable):T.readable,x=T.writable;let O=!!X(P),_=!!J(x),C,D,w,v,R;function S(g){const f=v;if(v=null,f)f(g);else if(g)R.destroy(g);else if(!O&&!_)R.destroy()}if(R=new A({readableObjectMode:!!(P!==null&&P!==void 0&&P.readableObjectMode),writableObjectMode:!!(x!==null&&x!==void 0&&x.writableObjectMode),readable:O,writable:_}),_)$(x,(g)=>{if(_=!1,g)W(P,g);S(g)}),R._write=function(g,f,k){if(x.write(g,f))k();else C=k},R._final=function(g){x.end(),D=g},x.on("drain",function(){if(C){const g=C;C=null,g()}}),x.on("finish",function(){if(D){const g=D;D=null,g()}});if(O)$(P,(g)=>{if(O=!1,g)W(P,g);S(g)}),P.on("readable",function(){if(w){const g=w;w=null,g()}}),P.on("end",function(){R.push(null)}),R._read=function(){while(!0){const g=P.read();if(g===null){w=R._read;return}if(!R.push(g))return}};return R._destroy=function(g,f){if(!g&&v!==null)g=new z;if(w=null,C=null,D=null,v===null)f(g);else v=f,W(x,g),W(P,g)},R}}}),Cq=mq({"node_modules/readable-stream/lib/internal/streams/duplex.js"(q,Q){var{ObjectDefineProperties:X,ObjectGetOwnPropertyDescriptor:J,ObjectKeys:H,ObjectSetPrototypeOf:K}=Oq(),Z=ZQ();function B(U){if(!(this instanceof B))return new B(U);if(Z.call(this,U),Eq.call(this,U),U){if(this.allowHalfOpen=U.allowHalfOpen!==!1,U.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(U.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}Q.exports=B,K(B.prototype,Z.prototype),K(B,Z);for(var Y in Eq.prototype)if(!B.prototype[Y])B.prototype[Y]=Eq.prototype[Y];X(B.prototype,{writable:J(Eq.prototype,"writable"),writableHighWaterMark:J(Eq.prototype,"writableHighWaterMark"),writableObjectMode:J(Eq.prototype,"writableObjectMode"),writableBuffer:J(Eq.prototype,"writableBuffer"),writableLength:J(Eq.prototype,"writableLength"),writableFinished:J(Eq.prototype,"writableFinished"),writableCorked:J(Eq.prototype,"writableCorked"),writableEnded:J(Eq.prototype,"writableEnded"),writableNeedDrain:J(Eq.prototype,"writableNeedDrain"),destroyed:{get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(U){if(this._readableState&&this._writableState)this._readableState.destroyed=U,this._writableState.destroyed=U}}});var $;function z(){if($===void 0)$={};return $}B.fromWeb=function(U,W){return z().newStreamDuplexFromReadableWritablePair(U,W)},B.toWeb=function(U){return z().newReadableWritablePairFromDuplex(U)};var V;B.from=function(U){if(!V)V=YQ();return V(U,"body")}}}),$Q=mq({"node_modules/readable-stream/lib/internal/streams/transform.js"(q,Q){var{ObjectSetPrototypeOf:X,Symbol:J}=Oq(),{ERR_METHOD_NOT_IMPLEMENTED:H}=oq().codes,K=Cq();function Z(z){if(!(this instanceof Z))return new Z(z);if(K.call(this,z),this._readableState.sync=!1,this[B]=null,z){if(typeof z.transform==="function")this._transform=z.transform;if(typeof z.flush==="function")this._flush=z.flush}this.on("prefinish",$.bind(this))}X(Z.prototype,K.prototype),X(Z,K),Q.exports=Z;var B=J("kCallback");function Y(z){if(typeof this._flush==="function"&&!this.destroyed)this._flush((V,U)=>{if(V){if(z)z(V);else this.destroy(V);return}if(U!=null)this.push(U);if(this.push(null),z)z()});else if(this.push(null),z)z()}function $(){if(this._final!==Y)Y.call(this)}Z.prototype._final=Y,Z.prototype._transform=function(z,V,U){throw new H("_transform()")},Z.prototype._write=function(z,V,U){const W=this._readableState,G=this._writableState,M=W.length;this._transform(z,V,(F,L)=>{if(F){U(F);return}if(L!=null)this.push(L);if(G.ended||M===W.length||W.length<W.highWaterMark||W.highWaterMark===0||W.length===0)U();else this[B]=U})},Z.prototype._read=function(){if(this[B]){const z=this[B];this[B]=null,z()}}}}),zQ=mq({"node_modules/readable-stream/lib/internal/streams/passthrough.js"(q,Q){var{ObjectSetPrototypeOf:X}=Oq(),J=$Q();function H(K){if(!(this instanceof H))return new H(K);J.call(this,K)}X(H.prototype,J.prototype),X(H,J),H.prototype._transform=function(K,Z,B){B(null,K)},Q.exports=H}}),VQ=mq({"node_modules/readable-stream/lib/internal/streams/pipeline.js"(q,Q){var{ArrayIsArray:X,Promise:J,SymbolAsyncIterator:H}=Oq(),K=rq(),{once:Z}=_q(),B=eq(),Y=Cq(),{aggregateTwoErrors:$,codes:{ERR_INVALID_ARG_TYPE:z,ERR_INVALID_RETURN_VALUE:V,ERR_MISSING_ARGS:U,ERR_STREAM_DESTROYED:W},AbortError:G}=oq(),{validateFunction:M,validateAbortSignal:F}=sq(),{isIterable:L,isReadable:j,isReadableNodeStream:N,isNodeStream:A}=aq(),E,I;function T(v,R,S){let g=!1;v.on("close",()=>{g=!0});const f=K(v,{readable:R,writable:S},(k)=>{g=!k});return{destroy:(k)=>{if(g)return;g=!0,B.destroyer(v,k||new W("pipe"))},cleanup:f}}function P(v){return M(v[v.length-1],"streams[stream.length - 1]"),v.pop()}function x(v){if(L(v))return v;else if(N(v))return O(v);throw new z("val",["Readable","Iterable","AsyncIterable"],v)}async function*O(v){if(!I)I=ZQ();yield*I.prototype[H].call(v)}async function _(v,R,S,{end:g}){let f,k=null;const y=(u)=>{if(u)f=u;if(k){const b=k;k=null,b()}},h=()=>new J((u,b)=>{if(f)b(f);else k=()=>{if(f)b(f);else u()}});R.on("drain",y);const p=K(R,{readable:!1},y);try{if(R.writableNeedDrain)await h();for await(let u of v)if(!R.write(u))await h();if(g)R.end();await h(),S()}catch(u){S(f!==u?$(f,u):u)}finally{p(),R.off("drain",y)}}function C(...v){return D(v,Z(P(v)))}function D(v,R,S){if(v.length===1&&X(v[0]))v=v[0];if(v.length<2)throw new U("streams");const g=new AbortController,f=g.signal,k=S===null||S===void 0?void 0:S.signal,y=[];F(k,"options.signal");function h(){d(new G)}k===null||k===void 0||k.addEventListener("abort",h);let p,u;const b=[];let m=0;function c(n){d(n,--m===0)}function d(n,o){if(n&&(!p||p.code==="ERR_STREAM_PREMATURE_CLOSE"))p=n;if(!p&&!o)return;while(b.length)b.shift()(p);if(k===null||k===void 0||k.removeEventListener("abort",h),g.abort(),o){if(!p)y.forEach((s)=>s());Iq(R,p,u)}}let l;for(let n=0;n<v.length;n++){const o=v[n],s=n<v.length-1,a=n>0,r=s||(S===null||S===void 0?void 0:S.end)!==!1,t=n===v.length-1;if(A(o)){let e=function(qq){if(qq&&qq.name!=="AbortError"&&qq.code!=="ERR_STREAM_PREMATURE_CLOSE")c(qq)};if(r){const{destroy:qq,cleanup:Qq}=T(o,s,a);if(b.push(qq),j(o)&&t)y.push(Qq)}if(o.on("error",e),j(o)&&t)y.push(()=>{o.removeListener("error",e)})}if(n===0)if(typeof o==="function"){if(l=o({signal:f}),!L(l))throw new V("Iterable, AsyncIterable or Stream","source",l)}else if(L(o)||N(o))l=o;else l=Y.from(o);else if(typeof o==="function")if(l=x(l),l=o(l,{signal:f}),s){if(!L(l,!0))throw new V("AsyncIterable",`transform[${n-1}]`,l)}else{var i;if(!E)E=zQ();const e=new E({objectMode:!0}),qq=(i=l)===null||i===void 0?void 0:i.then;if(typeof qq==="function")m++,qq.call(l,(Jq)=>{if(u=Jq,Jq!=null)e.write(Jq);if(r)e.end();Iq(c)},(Jq)=>{e.destroy(Jq),Iq(c,Jq)});else if(L(l,!0))m++,_(l,e,c,{end:r});else throw new V("AsyncIterable or Promise","destination",l);l=e;const{destroy:Qq,cleanup:Xq}=T(l,!1,!0);if(b.push(Qq),t)y.push(Xq)}else if(A(o)){if(N(l)){m+=2;const e=w(l,o,c,{end:r});if(j(o)&&t)y.push(e)}else if(L(l))m++,_(l,o,c,{end:r});else throw new z("val",["Readable","Iterable","AsyncIterable"],l);l=o}else l=Y.from(o)}if(f!==null&&f!==void 0&&f.aborted||k!==null&&k!==void 0&&k.aborted)Iq(h);return l}function w(v,R,S,{end:g}){if(v.pipe(R,{end:g}),g)v.once("end",()=>R.end());else S();return K(v,{readable:!0,writable:!1},(f)=>{const k=v._readableState;if(f&&f.code==="ERR_STREAM_PREMATURE_CLOSE"&&k&&k.ended&&!k.errored&&!k.errorEmitted)v.once("end",S).once("error",S);else S(f)}),K(R,{readable:!1,writable:!0},S)}Q.exports={pipelineImpl:D,pipeline:C}}}),UQ=mq({"node_modules/readable-stream/lib/internal/streams/compose.js"(q,Q){var{pipeline:X}=VQ(),J=Cq(),{destroyer:H}=eq(),{isNodeStream:K,isReadable:Z,isWritable:B}=aq(),{AbortError:Y,codes:{ERR_INVALID_ARG_VALUE:$,ERR_MISSING_ARGS:z}}=oq();Q.exports=function V(...U){if(U.length===0)throw new z("streams");if(U.length===1)return J.from(U[0]);const W=[...U];if(typeof U[0]==="function")U[0]=J.from(U[0]);if(typeof U[U.length-1]==="function"){const P=U.length-1;U[P]=J.from(U[P])}for(let P=0;P<U.length;++P){if(!K(U[P]))continue;if(P<U.length-1&&!Z(U[P]))throw new $(`streams[${P}]`,W[P],"must be readable");if(P>0&&!B(U[P]))throw new $(`streams[${P}]`,W[P],"must be writable")}let G,M,F,L,j;function N(P){const x=L;if(L=null,x)x(P);else if(P)j.destroy(P);else if(!T&&!I)j.destroy()}const A=U[0],E=X(U,N),I=!!B(A),T=!!Z(E);if(j=new J({writableObjectMode:!!(A!==null&&A!==void 0&&A.writableObjectMode),readableObjectMode:!!(E!==null&&E!==void 0&&E.writableObjectMode),writable:I,readable:T}),I)j._write=function(P,x,O){if(A.write(P,x))O();else G=O},j._final=function(P){A.end(),M=P},A.on("drain",function(){if(G){const P=G;G=null,P()}}),E.on("finish",function(){if(M){const P=M;M=null,P()}});if(T)E.on("readable",function(){if(F){const P=F;F=null,P()}}),E.on("end",function(){j.push(null)}),j._read=function(){while(!0){const P=E.read();if(P===null){F=j._read;return}if(!j.push(P))return}};return j._destroy=function(P,x){if(!P&&L!==null)P=new Y;if(F=null,G=null,M=null,L===null)x(P);else L=x,H(E,P)},j}}}),WQ=mq({"node_modules/readable-stream/lib/stream/promises.js"(q,Q){var{ArrayPrototypePop:X,Promise:J}=Oq(),{isIterable:H,isNodeStream:K}=aq(),{pipelineImpl:Z}=VQ(),{finished:B}=rq();function Y(...$){return new J((z,V)=>{let U,W;const G=$[$.length-1];if(G&&typeof G==="object"&&!K(G)&&!H(G)){const M=X($);U=M.signal,W=M.end}Z($,(M,F)=>{if(M)V(M);else z(F)},{signal:U,end:W})})}Q.exports={finished:B,pipeline:Y}}}),GQ=mq({"node_modules/readable-stream/lib/stream.js"(q,Q){var{ObjectDefineProperty:X,ObjectKeys:J,ReflectApply:H}=Oq(),{promisify:{custom:K}}=_q(),{streamReturningOperators:Z,promiseReturningOperators:B}=tq(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Y}}=oq(),$=UQ(),{pipeline:z}=VQ(),{destroyer:V}=eq(),U=rq(),W=WQ(),G=aq(),M=Q.exports=qQ().Stream;M.isDisturbed=G.isDisturbed,M.isErrored=G.isErrored,M.isWritable=G.isWritable,M.isReadable=G.isReadable,M.Readable=ZQ();for(let L of J(Z)){let j=function(...A){if(new.target)throw Y();return M.Readable.from(H(N,this,A))};const N=Z[L];X(j,"name",{value:N.name}),X(j,"length",{value:N.length}),X(M.Readable.prototype,L,{value:j,enumerable:!1,configurable:!0,writable:!0})}for(let L of J(B)){let j=function(...A){if(new.target)throw Y();return H(N,this,A)};const N=B[L];X(j,"name",{value:N.name}),X(j,"length",{value:N.length}),X(M.Readable.prototype,L,{value:j,enumerable:!1,configurable:!0,writable:!0})}M.Writable=BQ(),M.Duplex=Cq(),M.Transform=$Q(),M.PassThrough=zQ(),M.pipeline=z;var{addAbortSignal:F}=QQ();M.addAbortSignal=F,M.finished=U,M.destroy=V,M.compose=$,X(M,"promises",{configurable:!0,enumerable:!0,get(){return W}}),X(z,K,{enumerable:!0,get(){return W.pipeline}}),X(U,K,{enumerable:!0,get(){return W.finished}}),M.Stream=M,M._isUint8Array=function L(j){return j instanceof Uint8Array},M._uint8ArrayToBuffer=function L(j){return new Buffer(j.buffer,j.byteOffset,j.byteLength)}}}),MQ=mq({"node_modules/readable-stream/lib/ours/index.js"(q,Q){const X=GQ(),J=WQ(),H=X.Readable.destroy;Q.exports=X,Q.exports._uint8ArrayToBuffer=X._uint8ArrayToBuffer,Q.exports._isUint8Array=X._isUint8Array,Q.exports.isDisturbed=X.isDisturbed,Q.exports.isErrored=X.isErrored,Q.exports.isWritable=X.isWritable,Q.exports.isReadable=X.isReadable,Q.exports.Readable=X.Readable,Q.exports.Writable=X.Writable,Q.exports.Duplex=X.Duplex,Q.exports.Transform=X.Transform,Q.exports.PassThrough=X.PassThrough,Q.exports.addAbortSignal=X.addAbortSignal,Q.exports.finished=X.finished,Q.exports.destroy=X.destroy,Q.exports.destroy=H,Q.exports.pipeline=X.pipeline,Q.exports.compose=X.compose,Q.exports._getNativeReadableStreamPrototype=jQ,Q.exports.NativeWritable=pQ,Tq.defineProperty(X,"promises",{configurable:!0,enumerable:!0,get(){return J}}),Q.exports.Stream=X.Stream,Q.exports.default=Q.exports}}),LQ={0:void 0,1:void 0,2:void 0,3:void 0,4:void 0,5:void 0},Eq=BQ(),pQ=class q extends Eq{#q;#Q;#X=!0;_construct;_destroy;_final;constructor(Q,X={}){super(X);this._construct=this.#J,this._destroy=this.#K,this._final=this.#Z,this.#q=Q}#J(Q){this._writableState.constructed=!0,this.constructed=!0,Q()}#H(){if(typeof this.#q==="object")if(typeof this.#q.write==="function")this.#Q=this.#q;else throw new Error("Invalid FileSink");else this.#Q=Bun.file(this.#q).writer()}write(Q,X,J,H=this.#X){if(!H)return this.#X=!1,super.write(Q,X,J);if(!this.#Q)this.#H();var K=this.#Q,Z=K.write(Q);if(xq(Z))return Z.then(()=>{this.emit("drain"),K.flush(!0)}),!1;if(K.flush(!0),J)J(null,Q.byteLength);return!0}end(Q,X,J,H=this.#X){return super.end(Q,X,J,H)}#K(Q,X){if(this._writableState.destroyed=!0,X)X(Q)}#Z(Q){if(this.#Q)this.#Q.end();if(Q)Q()}ref(){if(!this.#Q)this.#H();this.#Q.ref()}unref(){if(!this.#Q)return;this.#Q.unref()}},AQ=MQ();AQ[Symbol.for("CommonJS")]=0;AQ[Symbol.for("::bunternal::")]={_ReadableFromWeb:HQ,_ReadableFromWebForUndici:KQ};var lQ=AQ,EQ=AQ._uint8ArrayToBuffer,IQ=AQ._isUint8Array,TQ=AQ.isDisturbed,PQ=AQ.isErrored,xQ=AQ.isWritable,OQ=AQ.isReadable,_Q=AQ.Readable,Eq=AQ.Writable,CQ=AQ.Duplex,DQ=AQ.Transform,wQ=AQ.PassThrough,vQ=AQ.addAbortSignal,RQ=AQ.finished,SQ=AQ.destroy,gQ=AQ.pipeline,fQ=AQ.compose,kQ=AQ.Stream,yQ=AQ.eos=rq,hQ=AQ._getNativeReadableStreamPrototype,pQ=AQ.NativeWritable,uQ=kQ.promises;export{uQ as promises,gQ as pipeline,xQ as isWritable,OQ as isReadable,PQ as isErrored,TQ as isDisturbed,RQ as finished,yQ as eos,SQ as destroy,lQ as default,fQ as compose,vQ as addAbortSignal,EQ as _uint8ArrayToBuffer,IQ as _isUint8Array,hQ as _getNativeReadableStreamPrototype,Eq as Writable,DQ as Transform,kQ as Stream,_Q as Readable,wQ as PassThrough,pQ as NativeWritable,CQ as Duplex};