Complete Email Sortierer implementation with Appwrite and Stripe integration
This commit is contained in:
commit
95349af50b
3355 files changed
+644802
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
"use strict";var n=Object.defineProperty;var t=(r,a)=>n(r,"name",{value:a,configurable:!0});var c=Object.defineProperty,e=t((r,a)=>c(r,"name",{value:a,configurable:!0}),"e");function createAgent(){return{agent:void 0,dispatcher:void 0}}t(createAgent,"createAgent"),e(createAgent,"createAgent");function createFetch(){return globalThis.fetch}t(createFetch,"createFetch"),e(createFetch,"createFetch");const fetch=globalThis.fetch;exports.createAgent=createAgent,exports.createFetch=createFetch,exports.fetch=fetch;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var o=Object.defineProperty;var e=(t,c)=>o(t,"name",{value:c,configurable:!0});var i=Object.defineProperty,r=e((t,c)=>i(t,"name",{value:c,configurable:!0}),"e");function a(){return{agent:void 0,dispatcher:void 0}}e(a,"createAgent"),r(a,"createAgent");function n(){return globalThis.fetch}e(n,"createFetch"),r(n,"createFetch");const h=globalThis.fetch;export{a as createAgent,n as createFetch,h as fetch};
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";var u=Object.defineProperty;var o=(e,t)=>u(e,"name",{value:t,configurable:!0});const http=require("node:http"),https=require("node:https"),index=require("./shared/node-fetch-native-with-agent.df7e6bd6.cjs"),nodeFetchNativeWithAgent=require("node-fetch-native-with-agent");require("node:assert"),require("node:net"),require("node:stream"),require("node:buffer"),require("node:util"),require("node:querystring"),require("node:diagnostics_channel"),require("node:events"),require("./shared/node-fetch-native-with-agent.61758d11.cjs"),require("node:tls"),require("node:zlib"),require("node:perf_hooks"),require("node:util/types"),require("node:os"),require("node:url"),require("node:async_hooks"),require("node:console"),require("string_decoder"),require("node:worker_threads");var i=Object.defineProperty,r=o((e,t)=>i(e,"name",{value:t,configurable:!0}),"r");function createAgent(e,t={}){const n={rejectUnauthorized:t.rejectUnauthorized},c=e?.startsWith("https:")?new https.Agent(n):new http.Agent,s=new index.Agent_1({connect:n});return{agent:c,dispatcher:s}}o(createAgent,"createAgent"),r(createAgent,"createAgent");function createFetch(e={}){const t=createAgent(void 0,e);return(n,c)=>nodeFetchNativeWithAgent.fetch(n,{...t,...c})}o(createFetch,"createFetch"),r(createFetch,"createFetch");const fetch=createFetch({});exports.createAgent=createAgent,exports.createFetch=createFetch,exports.fetch=fetch;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var a=Object.defineProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});import{Agent as f}from"node:http";import{Agent as h}from"node:https";import{A as s}from"./shared/node-fetch-native-with-agent.56860586.mjs";import{fetch as g}from"node-fetch-native-with-agent";import"node:assert";import"node:net";import"node:stream";import"node:buffer";import"node:util";import"node:querystring";import"node:diagnostics_channel";import"node:events";import"./shared/node-fetch-native-with-agent.1a4a356d.mjs";import"node:tls";import"node:zlib";import"node:perf_hooks";import"node:util/types";import"node:os";import"node:url";import"node:async_hooks";import"node:console";import"string_decoder";import"node:worker_threads";var u=Object.defineProperty,p=o((t,r)=>u(t,"name",{value:r,configurable:!0}),"r");function m(t,r={}){const e={rejectUnauthorized:r.rejectUnauthorized},i=t?.startsWith("https:")?new h(e):new f,c=new s({connect:e});return{agent:i,dispatcher:c}}o(m,"createAgent"),p(m,"createAgent");function n(t={}){const r=m(void 0,t);return(e,i)=>g(e,{...r,...i})}o(n,"createFetch"),p(n,"createFetch");const A=n({});export{m as createAgent,n as createFetch,A as fetch};
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
"use strict";var y=Object.defineProperty;var c=(R,o)=>y(R,"name",{value:o,configurable:!0});require("node:fs"),require("node:path");const node=require("../node.cjs");require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:buffer"),require("node:util"),require("../shared/node-fetch-native-with-agent.61758d11.cjs"),require("node:url"),require("node:net");let s=0;const S={START_BOUNDARY:s++,HEADER_FIELD_START:s++,HEADER_FIELD:s++,HEADER_VALUE_START:s++,HEADER_VALUE:s++,HEADER_VALUE_ALMOST_DONE:s++,HEADERS_ALMOST_DONE:s++,PART_DATA_START:s++,PART_DATA:s++,END:s++};let f=1;const F={PART_BOUNDARY:f,LAST_BOUNDARY:f*=2},LF=10,CR=13,SPACE=32,HYPHEN=45,COLON=58,A=97,Z=122,lower=c(R=>R|32,"lower"),noop=c(()=>{},"noop"),O=class O{constructor(o){this.index=0,this.flags=0,this.onHeaderEnd=noop,this.onHeaderField=noop,this.onHeadersEnd=noop,this.onHeaderValue=noop,this.onPartBegin=noop,this.onPartData=noop,this.onPartEnd=noop,this.boundaryChars={},o=`\r
|
||||
--`+o;const t=new Uint8Array(o.length);for(let n=0;n<o.length;n++)t[n]=o.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=S.START_BOUNDARY}write(o){let t=0;const n=o.length;let E=this.index,{lookbehind:l,boundary:h,boundaryChars:H,index:e,state:a,flags:d}=this;const b=this.boundary.length,g=b-1,m=o.length;let r,P;const u=c(D=>{this[D+"Mark"]=t},"mark"),i=c(D=>{delete this[D+"Mark"]},"clear"),T=c((D,p,_,N)=>{(p===void 0||p!==_)&&this[D](N&&N.subarray(p,_))},"callback"),L=c((D,p)=>{const _=D+"Mark";_ in this&&(p?(T(D,this[_],t,o),delete this[_]):(T(D,this[_],o.length,o),this[_]=0))},"dataCallback");for(t=0;t<n;t++)switch(r=o[t],a){case S.START_BOUNDARY:if(e===h.length-2){if(r===HYPHEN)d|=F.LAST_BOUNDARY;else if(r!==CR)return;e++;break}else if(e-1===h.length-2){if(d&F.LAST_BOUNDARY&&r===HYPHEN)a=S.END,d=0;else if(!(d&F.LAST_BOUNDARY)&&r===LF)e=0,T("onPartBegin"),a=S.HEADER_FIELD_START;else return;break}r!==h[e+2]&&(e=-2),r===h[e+2]&&e++;break;case S.HEADER_FIELD_START:a=S.HEADER_FIELD,u("onHeaderField"),e=0;case S.HEADER_FIELD:if(r===CR){i("onHeaderField"),a=S.HEADERS_ALMOST_DONE;break}if(e++,r===HYPHEN)break;if(r===COLON){if(e===1)return;L("onHeaderField",!0),a=S.HEADER_VALUE_START;break}if(P=lower(r),P<A||P>Z)return;break;case S.HEADER_VALUE_START:if(r===SPACE)break;u("onHeaderValue"),a=S.HEADER_VALUE;case S.HEADER_VALUE:r===CR&&(L("onHeaderValue",!0),T("onHeaderEnd"),a=S.HEADER_VALUE_ALMOST_DONE);break;case S.HEADER_VALUE_ALMOST_DONE:if(r!==LF)return;a=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(r!==LF)return;T("onHeadersEnd"),a=S.PART_DATA_START;break;case S.PART_DATA_START:a=S.PART_DATA,u("onPartData");case S.PART_DATA:if(E=e,e===0){for(t+=g;t<m&&!(o[t]in H);)t+=b;t-=g,r=o[t]}if(e<h.length)h[e]===r?(e===0&&L("onPartData",!0),e++):e=0;else if(e===h.length)e++,r===CR?d|=F.PART_BOUNDARY:r===HYPHEN?d|=F.LAST_BOUNDARY:e=0;else if(e-1===h.length)if(d&F.PART_BOUNDARY){if(e=0,r===LF){d&=~F.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),a=S.HEADER_FIELD_START;break}}else d&F.LAST_BOUNDARY&&r===HYPHEN?(T("onPartEnd"),a=S.END,d=0):e=0;if(e>0)l[e-1]=r;else if(E>0){const D=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);T("onPartData",0,E,D),E=0,u("onPartData"),t--}break;case S.END:break;default:throw new Error(`Unexpected state entered: ${a}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=e,this.state=a,this.flags=d}end(){if(this.state===S.HEADER_FIELD_START&&this.index===0||this.state===S.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==S.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};c(O,"MultipartParser");let MultipartParser=O;function _fileName(R){const o=R.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!o)return;const t=o[2]||o[3]||"";let n=t.slice(t.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(E,l)=>String.fromCharCode(l)),n}c(_fileName,"_fileName");async function toFormData(R,o){if(!/multipart/i.test(o))throw new TypeError("Failed to fetch");const t=o.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new TypeError("no or bad content-type header, no multipart boundary");const n=new MultipartParser(t[1]||t[2]);let E,l,h,H,e,a;const d=[],b=new node.FormData,g=c(i=>{h+=u.decode(i,{stream:!0})},"onPartData"),m=c(i=>{d.push(i)},"appendToFile"),r=c(()=>{const i=new node.File(d,a,{type:e});b.append(H,i)},"appendFileToFormData"),P=c(()=>{b.append(H,h)},"appendEntryToFormData"),u=new TextDecoder("utf-8");u.decode(),n.onPartBegin=function(){n.onPartData=g,n.onPartEnd=P,E="",l="",h="",H="",e="",a=null,d.length=0},n.onHeaderField=function(i){E+=u.decode(i,{stream:!0})},n.onHeaderValue=function(i){l+=u.decode(i,{stream:!0})},n.onHeaderEnd=function(){if(l+=u.decode(),E=E.toLowerCase(),E==="content-disposition"){const i=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);i&&(H=i[2]||i[3]||""),a=_fileName(l),a&&(n.onPartData=m,n.onPartEnd=r)}else E==="content-type"&&(e=l);l="",E=""};for await(const i of R)n.write(i);return n.end(),b}c(toFormData,"toFormData"),exports.toFormData=toFormData;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
var B=Object.defineProperty;var E=(u,a)=>B(u,"name",{value:a,configurable:!0});import"node:fs";import"node:path";import{FormData as V,File as Y}from"../node.mjs";import"node:http";import"node:https";import"node:zlib";import"node:stream";import"node:buffer";import"node:util";import"../shared/node-fetch-native-with-agent.1a4a356d.mjs";import"node:url";import"node:net";let D=0;const t={START_BOUNDARY:D++,HEADER_FIELD_START:D++,HEADER_FIELD:D++,HEADER_VALUE_START:D++,HEADER_VALUE:D++,HEADER_VALUE_ALMOST_DONE:D++,HEADERS_ALMOST_DONE:D++,PART_DATA_START:D++,PART_DATA:D++,END:D++};let w=1;const R={PART_BOUNDARY:w,LAST_BOUNDARY:w*=2},g=10,N=13,x=32,P=45,C=58,I=97,M=122,$=E(u=>u|32,"lower"),m=E(()=>{},"noop"),F=class F{constructor(a){this.index=0,this.flags=0,this.onHeaderEnd=m,this.onHeaderField=m,this.onHeadersEnd=m,this.onHeaderValue=m,this.onPartBegin=m,this.onPartData=m,this.onPartEnd=m,this.boundaryChars={},a=`\r
|
||||
--`+a;const n=new Uint8Array(a.length);for(let r=0;r<a.length;r++)n[r]=a.charCodeAt(r),this.boundaryChars[n[r]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=t.START_BOUNDARY}write(a){let n=0;const r=a.length;let d=this.index,{lookbehind:l,boundary:c,boundaryChars:p,index:e,state:i,flags:A}=this;const H=this.boundary.length,O=H-1,y=a.length;let o,L;const f=E(h=>{this[h+"Mark"]=n},"mark"),s=E(h=>{delete this[h+"Mark"]},"clear"),T=E((h,S,_,U)=>{(S===void 0||S!==_)&&this[h](U&&U.subarray(S,_))},"callback"),b=E((h,S)=>{const _=h+"Mark";_ in this&&(S?(T(h,this[_],n,a),delete this[_]):(T(h,this[_],a.length,a),this[_]=0))},"dataCallback");for(n=0;n<r;n++)switch(o=a[n],i){case t.START_BOUNDARY:if(e===c.length-2){if(o===P)A|=R.LAST_BOUNDARY;else if(o!==N)return;e++;break}else if(e-1===c.length-2){if(A&R.LAST_BOUNDARY&&o===P)i=t.END,A=0;else if(!(A&R.LAST_BOUNDARY)&&o===g)e=0,T("onPartBegin"),i=t.HEADER_FIELD_START;else return;break}o!==c[e+2]&&(e=-2),o===c[e+2]&&e++;break;case t.HEADER_FIELD_START:i=t.HEADER_FIELD,f("onHeaderField"),e=0;case t.HEADER_FIELD:if(o===N){s("onHeaderField"),i=t.HEADERS_ALMOST_DONE;break}if(e++,o===P)break;if(o===C){if(e===1)return;b("onHeaderField",!0),i=t.HEADER_VALUE_START;break}if(L=$(o),L<I||L>M)return;break;case t.HEADER_VALUE_START:if(o===x)break;f("onHeaderValue"),i=t.HEADER_VALUE;case t.HEADER_VALUE:o===N&&(b("onHeaderValue",!0),T("onHeaderEnd"),i=t.HEADER_VALUE_ALMOST_DONE);break;case t.HEADER_VALUE_ALMOST_DONE:if(o!==g)return;i=t.HEADER_FIELD_START;break;case t.HEADERS_ALMOST_DONE:if(o!==g)return;T("onHeadersEnd"),i=t.PART_DATA_START;break;case t.PART_DATA_START:i=t.PART_DATA,f("onPartData");case t.PART_DATA:if(d=e,e===0){for(n+=O;n<y&&!(a[n]in p);)n+=H;n-=O,o=a[n]}if(e<c.length)c[e]===o?(e===0&&b("onPartData",!0),e++):e=0;else if(e===c.length)e++,o===N?A|=R.PART_BOUNDARY:o===P?A|=R.LAST_BOUNDARY:e=0;else if(e-1===c.length)if(A&R.PART_BOUNDARY){if(e=0,o===g){A&=~R.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),i=t.HEADER_FIELD_START;break}}else A&R.LAST_BOUNDARY&&o===P?(T("onPartEnd"),i=t.END,A=0):e=0;if(e>0)l[e-1]=o;else if(d>0){const h=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);T("onPartData",0,d,h),d=0,f("onPartData"),n--}break;case t.END:break;default:throw new Error(`Unexpected state entered: ${i}`)}b("onHeaderField"),b("onHeaderValue"),b("onPartData"),this.index=e,this.state=i,this.flags=A}end(){if(this.state===t.HEADER_FIELD_START&&this.index===0||this.state===t.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==t.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};E(F,"MultipartParser");let k=F;function v(u){const a=u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!a)return;const n=a[2]||a[3]||"";let r=n.slice(n.lastIndexOf("\\")+1);return r=r.replace(/%22/g,'"'),r=r.replace(/&#(\d{4});/g,(d,l)=>String.fromCharCode(l)),r}E(v,"_fileName");async function Z(u,a){if(!/multipart/i.test(a))throw new TypeError("Failed to fetch");const n=a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");const r=new k(n[1]||n[2]);let d,l,c,p,e,i;const A=[],H=new V,O=E(s=>{c+=f.decode(s,{stream:!0})},"onPartData"),y=E(s=>{A.push(s)},"appendToFile"),o=E(()=>{const s=new Y(A,i,{type:e});H.append(p,s)},"appendFileToFormData"),L=E(()=>{H.append(p,c)},"appendEntryToFormData"),f=new TextDecoder("utf-8");f.decode(),r.onPartBegin=function(){r.onPartData=O,r.onPartEnd=L,d="",l="",c="",p="",e="",i=null,A.length=0},r.onHeaderField=function(s){d+=f.decode(s,{stream:!0})},r.onHeaderValue=function(s){l+=f.decode(s,{stream:!0})},r.onHeaderEnd=function(){if(l+=f.decode(),d=d.toLowerCase(),d==="content-disposition"){const s=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);s&&(p=s[2]||s[3]||""),i=v(l),i&&(r.onPartData=y,r.onPartEnd=o)}else d==="content-type"&&(e=l);l="",d=""};for await(const s of u)r.write(s);return r.end(),H}E(Z,"toFormData");export{Z as toFormData};
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";var i=Object.defineProperty;var l=(r,t)=>i(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0});const node=require("./node.cjs");require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:buffer"),require("node:util"),require("./shared/node-fetch-native-with-agent.61758d11.cjs"),require("node:url"),require("node:net"),require("node:fs"),require("node:path");var s=Object.defineProperty,e=l((r,t)=>s(r,"name",{value:t,configurable:!0}),"e");const o=!!globalThis.process?.env?.FORCE_NODE_FETCH;function p(){return!o&&globalThis.fetch?globalThis.fetch:node.fetch}l(p,"p"),e(p,"_getFetch");const fetch=p(),Blob=!o&&globalThis.Blob||node.Blob,File=!o&&globalThis.File||node.File,FormData=!o&&globalThis.FormData||node.FormData,Headers=!o&&globalThis.Headers||node.Headers,Request=!o&&globalThis.Request||node.Request,Response=!o&&globalThis.Response||node.Response,AbortController=!o&&globalThis.AbortController||node.AbortController;exports.AbortError=node.AbortError,exports.FetchError=node.FetchError,exports.blobFrom=node.blobFrom,exports.blobFromSync=node.blobFromSync,exports.fileFrom=node.fileFrom,exports.fileFromSync=node.fileFromSync,exports.isRedirect=node.isRedirect,exports.AbortController=AbortController,exports.Blob=Blob,exports.File=File,exports.FormData=FormData,exports.Headers=Headers,exports.Request=Request,exports.Response=Response,exports.default=fetch,exports.fetch=fetch;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});import{Blob as i,File as b,FormData as m,Headers as p,Request as n,Response as c,AbortController as h,fetch as F}from"./node.mjs";export{AbortError,FetchError,blobFrom,blobFromSync,fileFrom,fileFromSync,isRedirect}from"./node.mjs";import"node:http";import"node:https";import"node:zlib";import"node:stream";import"node:buffer";import"node:util";import"./shared/node-fetch-native-with-agent.1a4a356d.mjs";import"node:url";import"node:net";import"node:fs";import"node:path";var f=Object.defineProperty,g=t((e,r)=>f(e,"name",{value:r,configurable:!0}),"e");const o=!!globalThis.process?.env?.FORCE_NODE_FETCH;function l(){return!o&&globalThis.fetch?globalThis.fetch:F}t(l,"p"),g(l,"_getFetch");const s=l(),T=!o&&globalThis.Blob||i,R=!o&&globalThis.File||b,u=!o&&globalThis.FormData||m,d=!o&&globalThis.Headers||p,$=!o&&globalThis.Request||n,C=!o&&globalThis.Response||c,A=!o&&globalThis.AbortController||h;export{A as AbortController,T as Blob,R as File,u as FormData,d as Headers,$ as Request,C as Response,s as default,s as fetch};
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const Blob=globalThis.Blob,File=globalThis.File,FormData=globalThis.FormData,Headers=globalThis.Headers,Request=globalThis.Request,Response=globalThis.Response,AbortController=globalThis.AbortController,fetch=globalThis.fetch||(()=>{throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!")});exports.AbortController=AbortController,exports.Blob=Blob,exports.File=File,exports.FormData=FormData,exports.Headers=Headers,exports.Request=Request,exports.Response=Response,exports.default=fetch,exports.fetch=fetch;
|
||||
+1
@@ -0,0 +1 @@
|
||||
const e=globalThis.Blob,o=globalThis.File,a=globalThis.FormData,s=globalThis.Headers,t=globalThis.Request,h=globalThis.Response,i=globalThis.AbortController,l=globalThis.fetch||(()=>{throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!")});export{i as AbortController,e as Blob,o as File,a as FormData,s as Headers,t as Request,h as Response,l as default,l as fetch};
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
"use strict";var ms=Object.defineProperty;var u=(c,l)=>ms(c,"name",{value:l,configurable:!0});var Po=(c,l,d)=>{if(!l.has(c))throw TypeError("Cannot "+d)};var D=(c,l,d)=>(Po(c,l,"read from private field"),d?d.call(c):l.get(c)),ye=(c,l,d)=>{if(l.has(c))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(c):l.set(c,d)},ne=(c,l,d,y)=>(Po(c,l,"write to private field"),y?y.call(c,d):l.set(c,d),d);var Pe,bt,ot,Zt,Ue,mt,yt,gt,oe,_t,Me,xe,St;Object.defineProperty(exports,"__esModule",{value:!0});const http=require("node:http"),https=require("node:https"),zlib=require("node:zlib"),Stream=require("node:stream"),require$$6=require("node:buffer"),require$$0=require("node:util"),_commonjsHelpers=require("./shared/node-fetch-native-with-agent.61758d11.cjs"),require$$1=require("node:url"),require$$4=require("node:net"),node_fs=require("node:fs"),node_path=require("node:path");function _interopDefaultCompat(c){return c&&typeof c=="object"&&"default"in c?c.default:c}u(_interopDefaultCompat,"_interopDefaultCompat");const http__default=_interopDefaultCompat(http),https__default=_interopDefaultCompat(https),zlib__default=_interopDefaultCompat(zlib),Stream__default=_interopDefaultCompat(Stream);function dataUriToBuffer(c){if(!/^data:/i.test(c))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');c=c.replace(/\r?\n/g,"");const l=c.indexOf(",");if(l===-1||l<=4)throw new TypeError("malformed data: URI");const d=c.substring(5,l).split(";");let y="",b=!1;const R=d[0]||"text/plain";let w=R;for(let F=1;F<d.length;F++)d[F]==="base64"?b=!0:d[F]&&(w+=`;${d[F]}`,d[F].indexOf("charset=")===0&&(y=d[F].substring(8)));!d[0]&&!y.length&&(w+=";charset=US-ASCII",y="US-ASCII");const v=b?"base64":"ascii",I=unescape(c.substring(l+1)),B=Buffer.from(I,v);return B.type=R,B.typeFull=w,B.charset=y,B}u(dataUriToBuffer,"dataUriToBuffer");var ponyfill_es2018={exports:{}};/**
|
||||
* @license
|
||||
* web-streams-polyfill v3.3.3
|
||||
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
|
||||
* This code is released under the MIT license.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/var hasRequiredPonyfill_es2018;function requirePonyfill_es2018(){return hasRequiredPonyfill_es2018||(hasRequiredPonyfill_es2018=1,function(c,l){(function(d,y){y(l)})(_commonjsHelpers.commonjsGlobal,function(d){function y(){}u(y,"noop");function b(n){return typeof n=="object"&&n!==null||typeof n=="function"}u(b,"typeIsObject");const R=y;function w(n,o){try{Object.defineProperty(n,"name",{value:o,configurable:!0})}catch{}}u(w,"setFunctionName");const v=Promise,I=Promise.prototype.then,B=Promise.reject.bind(v);function F(n){return new v(n)}u(F,"newPromise");function k(n){return F(o=>o(n))}u(k,"promiseResolvedWith");function T(n){return B(n)}u(T,"promiseRejectedWith");function $(n,o,a){return I.call(n,o,a)}u($,"PerformPromiseThen");function E(n,o,a){$($(n,o,a),void 0,R)}u(E,"uponPromise");function K(n,o){E(n,o)}u(K,"uponFulfillment");function U(n,o){E(n,void 0,o)}u(U,"uponRejection");function N(n,o,a){return $(n,o,a)}u(N,"transformPromiseWith");function J(n){$(n,void 0,R)}u(J,"setPromiseIsHandledToTrue");let ge=u(n=>{if(typeof queueMicrotask=="function")ge=queueMicrotask;else{const o=k(void 0);ge=u(a=>$(o,a),"_queueMicrotask")}return ge(n)},"_queueMicrotask");function M(n,o,a){if(typeof n!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(n,o,a)}u(M,"reflectCall");function H(n,o,a){try{return k(M(n,o,a))}catch(p){return T(p)}}u(H,"promiseCall");const G=16384,Dr=class Dr{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(o){const a=this._back;let p=a;a._elements.length===G-1&&(p={_elements:[],_next:void 0}),a._elements.push(o),p!==a&&(this._back=p,a._next=p),++this._size}shift(){const o=this._front;let a=o;const p=this._cursor;let g=p+1;const _=o._elements,S=_[p];return g===G&&(a=o._next,g=0),--this._size,this._cursor=g,o!==a&&(this._front=a),_[p]=void 0,S}forEach(o){let a=this._cursor,p=this._front,g=p._elements;for(;(a!==g.length||p._next!==void 0)&&!(a===g.length&&(p=p._next,g=p._elements,a=0,g.length===0));)o(g[a]),++a}peek(){const o=this._front,a=this._cursor;return o._elements[a]}};u(Dr,"SimpleQueue");let Q=Dr;const wt=Symbol("[[AbortSteps]]"),un=Symbol("[[ErrorSteps]]"),er=Symbol("[[CancelSteps]]"),tr=Symbol("[[PullSteps]]"),rr=Symbol("[[ReleaseSteps]]");function ln(n,o){n._ownerReadableStream=o,o._reader=n,o._state==="readable"?or(n):o._state==="closed"?vo(n):fn(n,o._storedError)}u(ln,"ReadableStreamReaderGenericInitialize");function nr(n,o){const a=n._ownerReadableStream;return le(a,o)}u(nr,"ReadableStreamReaderGenericCancel");function _e(n){const o=n._ownerReadableStream;o._state==="readable"?ir(n,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Eo(n,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),o._readableStreamController[rr](),o._reader=void 0,n._ownerReadableStream=void 0}u(_e,"ReadableStreamReaderGenericRelease");function Rt(n){return new TypeError("Cannot "+n+" a stream using a released reader")}u(Rt,"readerLockException");function or(n){n._closedPromise=F((o,a)=>{n._closedPromise_resolve=o,n._closedPromise_reject=a})}u(or,"defaultReaderClosedPromiseInitialize");function fn(n,o){or(n),ir(n,o)}u(fn,"defaultReaderClosedPromiseInitializeAsRejected");function vo(n){or(n),cn(n)}u(vo,"defaultReaderClosedPromiseInitializeAsResolved");function ir(n,o){n._closedPromise_reject!==void 0&&(J(n._closedPromise),n._closedPromise_reject(o),n._closedPromise_resolve=void 0,n._closedPromise_reject=void 0)}u(ir,"defaultReaderClosedPromiseReject");function Eo(n,o){fn(n,o)}u(Eo,"defaultReaderClosedPromiseResetToRejected");function cn(n){n._closedPromise_resolve!==void 0&&(n._closedPromise_resolve(void 0),n._closedPromise_resolve=void 0,n._closedPromise_reject=void 0)}u(cn,"defaultReaderClosedPromiseResolve");const dn=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Ao=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};function Bo(n){return typeof n=="object"||typeof n=="function"}u(Bo,"isDictionary");function ce(n,o){if(n!==void 0&&!Bo(n))throw new TypeError(`${o} is not an object.`)}u(ce,"assertDictionary");function ee(n,o){if(typeof n!="function")throw new TypeError(`${o} is not a function.`)}u(ee,"assertFunction");function qo(n){return typeof n=="object"&&n!==null||typeof n=="function"}u(qo,"isObject");function hn(n,o){if(!qo(n))throw new TypeError(`${o} is not an object.`)}u(hn,"assertObject");function Se(n,o,a){if(n===void 0)throw new TypeError(`Parameter ${o} is required in '${a}'.`)}u(Se,"assertRequiredArgument");function sr(n,o,a){if(n===void 0)throw new TypeError(`${o} is required in '${a}'.`)}u(sr,"assertRequiredField");function ar(n){return Number(n)}u(ar,"convertUnrestrictedDouble");function pn(n){return n===0?0:n}u(pn,"censorNegativeZero");function ko(n){return pn(Ao(n))}u(ko,"integerPart");function ur(n,o)Line truncated
|
||||
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e$1"),x=u((c,l,d)=>{if(l.length<d)throw new TypeError(`Failed to execute '${c}' on 'FormData': ${d} arguments required, but only ${l.length} present.`)},"x");const FormData=(_t=class{constructor(...l){ye(this,oe,[]);if(l.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[t$1](){return"FormData"}[i](){return this.entries()}static[h](l){return l&&typeof l=="object"&&l[t$1]==="FormData"&&!m.some(d=>typeof l[d]!="function")}append(...l){x("append",arguments,2),D(this,oe).push(f(...l))}delete(l){x("delete",arguments,1),l+="",ne(this,oe,D(this,oe).filter(([d])=>d!==l))}get(l){x("get",arguments,1),l+="";for(var d=D(this,oe),y=d.length,b=0;b<y;b++)if(d[b][0]===l)return d[b][1];return null}getAll(l,d){return x("getAll",arguments,1),d=[],l+="",D(this,oe).forEach(y=>y[0]===l&&d.push(y[1])),d}has(l){return x("has",arguments,1),l+="",D(this,oe).some(d=>d[0]===l)}forEach(l,d){x("forEach",arguments,1);for(var[y,b]of this)l.call(d,b,y,this)}set(...l){x("set",arguments,2);var d=[],y=!0;l=f(...l),D(this,oe).forEach(b=>{b[0]===l[0]?y&&(y=!d.push(l)):d.push(b)}),y&&d.push(l),ne(this,oe,d)}*entries(){yield*D(this,oe)}*keys(){for(var[l]of this)yield l}*values(){for(var[,l]of this)yield l}},oe=new WeakMap,u(_t,"FormData"),_t);function formDataToBlob(c,l=r$1){var d=`${r()}${r()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),y=[],b=`--${d}\r
|
||||
Content-Disposition: form-data; name="`;return c.forEach((R,w)=>typeof R=="string"?y.push(b+e$1(w)+`"\r
|
||||
\r
|
||||
${R.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
||||
`)}\r
|
||||
`):y.push(b+e$1(w)+`"; filename="${e$1(R.name,1)}"\r
|
||||
Content-Type: ${R.type||"application/octet-stream"}\r
|
||||
\r
|
||||
`,R,`\r
|
||||
`)),y.push(`--${d}--`),new l(y,{type:"multipart/form-data; boundary="+d})}u(formDataToBlob,"formDataToBlob");const rn=class rn extends Error{constructor(l,d){super(l),Error.captureStackTrace(this,this.constructor),this.type=d}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};u(rn,"FetchBaseError");let FetchBaseError=rn;const nn=class nn extends FetchBaseError{constructor(l,d,y){super(l,d),y&&(this.code=this.errno=y.code,this.erroredSysCall=y.syscall)}};u(nn,"FetchError");let FetchError=nn;const NAME=Symbol.toStringTag,isURLSearchParameters=u(c=>typeof c=="object"&&typeof c.append=="function"&&typeof c.delete=="function"&&typeof c.get=="function"&&typeof c.getAll=="function"&&typeof c.has=="function"&&typeof c.set=="function"&&typeof c.sort=="function"&&c[NAME]==="URLSearchParams","isURLSearchParameters"),isBlob=u(c=>c&&typeof c=="object"&&typeof c.arrayBuffer=="function"&&typeof c.type=="string"&&typeof c.stream=="function"&&typeof c.constructor=="function"&&/^(Blob|File)$/.test(c[NAME]),"isBlob"),isAbortSignal=u(c=>typeof c=="object"&&(c[NAME]==="AbortSignal"||c[NAME]==="EventTarget"),"isAbortSignal"),isDomainOrSubdomain=u((c,l)=>{const d=new URL(l).hostname,y=new URL(c).hostname;return d===y||d.endsWith(`.${y}`)},"isDomainOrSubdomain"),isSameProtocol=u((c,l)=>{const d=new URL(l).protocol,y=new URL(c).protocol;return d===y},"isSameProtocol"),pipeline=require$$0.promisify(Stream__default.pipeline),INTERNALS$2=Symbol("Body internals"),on=class on{constructor(l,{size:d=0}={}){let y=null;l===null?l=null:isURLSearchParameters(l)?l=require$$6.Buffer.from(l.toString()):isBlob(l)||require$$6.Buffer.isBuffer(l)||(require$$0.types.isAnyArrayBuffer(l)?l=require$$6.Buffer.from(l):ArrayBuffer.isView(l)?l=require$$6.Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof Stream__default||(l instanceof FormData?(l=formDataToBlob(l),y=l.type.split("=")[1]):l=require$$6.Buffer.from(String(l))));let b=l;require$$6.Buffer.isBuffer(l)?b=Stream__default.Readable.from(l):isBlob(l)&&(b=Stream__default.Readable.from(l.stream())),this[INTERNALS$2]={body:l,stream:b,boundary:y,disturbed:!1,error:null},this.size=d,l instanceof Stream__default&&l.on("error",R=>{const w=R instanceof FetchBaseError?R:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${R.message}`,"system",R);this[INTERNALS$2].error=w})}get body(){return this[INTERNALS$2].stream}get bodyUsed(){return this[INTERNALS$2].disturbed}async arrayBuffer(){const{buffer:l,byteOffset:d,byteLength:y}=await consumeBody(this);return l.slice(d,d+y)}async formData(){const l=this.headers.get("content-type");if(l.startsWith("application/x-www-form-urlencoded")){const y=new FormData,b=new URLSearchParams(await this.text());for(const[R,w]of b)y.append(R,w);return y}const{toFormData:d}=await import("./chunks/multipart-parser.cjs");return d(this.body,l)}async blob(){const l=this.headers&&this.headers.get("content-type")||this[INTERNALS$2].body&&this[INTERNALS$2].body.type||"",d=await this.arrayBuffer();return new r$1([d],{type:l})}async json(){const l=await this.text();return JSON.parse(l)}async text(){const l=await consumeBody(this);return new TextDecoder().decode(l)}buffer(){return consumeBody(this)}};u(on,"Body");let Body=on;Body.prototype.buffer=require$$0.deprecate(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:require$$0.deprecate(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function consumeBody(c){if(c[INTERNALS$2].disturbed)throw new TypeError(`body used already for: ${c.url}`);if(c[INTERNALS$2].disturbed=!0,c[INTERNALS$2].error)throw c[INTERNALS$2].error;const{body:l}=c;if(l===null||!(l instanceof Stream__default))return require$$6.Buffer.alloc(0);const d=[];let y=0;try{for await(const b of l){if(c.size>0&&y+b.length>c.size){const R=new FetchError(`content size at ${c.url} over limit: ${c.size}`,"max-size");throw l.destroy(R),R}y+=b.length,d.push(b)}}catch(b){throw b instanceof FetchBaseError?b:new FetchError(`Invalid response body while trying to fetch ${c.url}: ${b.message}`,"system",b)}if(l.readableEnded===!0||l._readableState.ended===!0)try{return d.every(b=>typeof b=="string")?require$$6.Buffer.from(d.join("")):require$$6.Buffer.concat(d,y)}catch(b){throw new FetchError(`Could not create Buffer from response body for ${c.url}: ${b.message}`,"system",b)}else throw new FetchError(`Premature close of server response while trying to fetch ${c.url}`)}u(consumeBody,"consumeBody");const clone=u((c,l)=>{let d,y,{body:b}=c[INTERNALS$2];if(c.bodyUsed)throw new Error("cannot clone body after it is used");return b instanceof Stream__default&&typeof b.getBounda
Line truncated
|
||||
\r
|
||||
`);let y=!1,b=!1,R;c.on("response",w=>{const{headers:v}=w;y=v["transfer-encoding"]==="chunked"&&!v["content-length"]}),c.on("socket",w=>{const v=u(()=>{if(y&&!b){const B=new Error("Premature close");B.code="ERR_STREAM_PREMATURE_CLOSE",l(B)}},"onSocketClose"),I=u(B=>{b=require$$6.Buffer.compare(B.slice(-5),d)===0,!b&&R&&(b=require$$6.Buffer.compare(R.slice(-3),d.slice(0,3))===0&&require$$6.Buffer.compare(B.slice(-2),d.slice(3))===0),R=B},"onData");w.prependListener("close",v),w.on("data",I),c.on("close",()=>{w.removeListener("close",v),w.removeListener("data",I)})})}u(fixResponseChunkedTransferBadEnding,"fixResponseChunkedTransferBadEnding");const privateData=new WeakMap,wrappers=new WeakMap;function pd(c){const l=privateData.get(c);return console.assert(l!=null,"'this' is expected an Event object, but got",c),l}u(pd,"pd");function setCancelFlag(c){if(c.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",c.passiveListener);return}c.event.cancelable&&(c.canceled=!0,typeof c.event.preventDefault=="function"&&c.event.preventDefault())}u(setCancelFlag,"setCancelFlag");function Event(c,l){privateData.set(this,{eventTarget:c,event:l,eventPhase:2,currentTarget:c,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:l.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const d=Object.keys(l);for(let y=0;y<d.length;++y){const b=d[y];b in this||Object.defineProperty(this,b,defineRedirectDescriptor(b))}}u(Event,"Event"),Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const c=pd(this).currentTarget;return c==null?[]:[c]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const c=pd(this);c.stopped=!0,typeof c.event.stopPropagation=="function"&&c.event.stopPropagation()},stopImmediatePropagation(){const c=pd(this);c.stopped=!0,c.immediateStopped=!0,typeof c.event.stopImmediatePropagation=="function"&&c.event.stopImmediatePropagation()},get bubbles(){return!!pd(this).event.bubbles},get cancelable(){return!!pd(this).event.cancelable},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return!!pd(this).event.composed},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(c){if(!c)return;const l=pd(this);l.stopped=!0,typeof l.event.cancelBubble=="boolean"&&(l.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(c){c||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));function defineRedirectDescriptor(c){return{get(){return pd(this).event[c]},set(l){pd(this).event[c]=l},configurable:!0,enumerable:!0}}u(defineRedirectDescriptor,"defineRedirectDescriptor");function defineCallDescriptor(c){return{value(){const l=pd(this).event;return l[c].apply(l,arguments)},configurable:!0,enumerable:!0}}u(defineCallDescriptor,"defineCallDescriptor");function defineWrapper(c,l){const d=Object.keys(l);if(d.length===0)return c;function y(b,R){c.call(this,b,R)}u(y,"CustomEvent"),y.prototype=Object.create(c.prototype,{constructor:{value:y,configurable:!0,writable:!0}});for(let b=0;b<d.length;++b){const R=d[b];if(!(R in c.prototype)){const v=typeof Object.getOwnPropertyDescriptor(l,R).value=="function";Object.defineProperty(y.prototype,R,v?defineCallDescriptor(R):defineRedirectDescriptor(R))}}return y}u(defineWrapper,"defineWrapper");function getWrapper(c){if(c==null||c===Object.prototype)return Event;let l=wrappers.get(c);return l==null&&(l=defineWrapper(getWrapper(Object.getPrototypeOf(c)),c),wrappers.set(c,l)),l}u(getWrapper,"getWrapper");function wrapEvent(c,l){const d=getWrapper(Object.getPrototypeOf(l));return new d(c,l)}u(wrapEvent,"wrapEvent");function isStopped(c){return pd(c).immediateStopped}u(isStopped,"isStopped");function setEventPhase(c,l){pd(c).eventPhase=l}u(setEventPhase,"setEventPhase");function setCurrentTarget(c,l){pd(c).currentTarget=l}u(setCurrentTarget,"setCurrentTarget");function setPassiveListener(c,l){pd(c).passiveListener=l}u(setPassiveListener,"setPassiveListener");const listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;function isObject(c){return c!==null&&typeof c=="object"}u(isObject,"isObject");function getListeners(c){const l=listenersMap.get(c);if(l==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return l}u(getListeners,"getListeners");function defineEventAttr
Line truncated
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
var As=Object.defineProperty;var n=(i,o)=>As(i,"name",{value:o,configurable:!0});var fi=(i,o,a)=>{if(!o.has(i))throw TypeError("Cannot "+a)};var O=(i,o,a)=>(fi(i,o,"read from private field"),a?a.call(i):o.get(i)),be=(i,o,a)=>{if(o.has(i))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(i):o.set(i,a)},X=(i,o,a,u)=>(fi(i,o,"write to private field"),u?u.call(i,a):o.set(i,a),a);var ve,kt,bt,Cr,Ve,Wt,qt,Ot,ee,zt,Ne,He,It;import vt from"node:http";import Bs from"node:https";import st from"node:zlib";import me,{PassThrough as cr,pipeline as lt}from"node:stream";import{Buffer as M}from"node:buffer";import{types as dr,promisify as ks,deprecate as hr}from"node:util";import{c as Wn,g as Ws}from"./shared/node-fetch-native-with-agent.1a4a356d.mjs";import{format as qs}from"node:url";import{isIP as Os}from"node:net";import{statSync as ci,createReadStream as zs,promises as Is}from"node:fs";import{basename as Fs}from"node:path";function js(i){if(!/^data:/i.test(i))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');i=i.replace(/\r?\n/g,"");const o=i.indexOf(",");if(o===-1||o<=4)throw new TypeError("malformed data: URI");const a=i.substring(5,o).split(";");let u="",l=!1;const p=a[0]||"text/plain";let h=p;for(let E=1;E<a.length;E++)a[E]==="base64"?l=!0:a[E]&&(h+=`;${a[E]}`,a[E].indexOf("charset=")===0&&(u=a[E].substring(8)));!a[0]&&!u.length&&(h+=";charset=US-ASCII",u="US-ASCII");const g=l?"base64":"ascii",A=unescape(i.substring(o+1)),w=Buffer.from(A,g);return w.type=p,w.typeFull=h,w.charset=u,w}n(js,"dataUriToBuffer");var pr={exports:{}};/**
|
||||
* @license
|
||||
* web-streams-polyfill v3.3.3
|
||||
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
|
||||
* This code is released under the MIT license.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/var di;function Ls(){return di||(di=1,function(i,o){(function(a,u){u(o)})(Wn,function(a){function u(){}n(u,"noop");function l(e){return typeof e=="object"&&e!==null||typeof e=="function"}n(l,"typeIsObject");const p=u;function h(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}n(h,"setFunctionName");const g=Promise,A=Promise.prototype.then,w=Promise.reject.bind(g);function E(e){return new g(e)}n(E,"newPromise");function T(e){return E(t=>t(e))}n(T,"promiseResolvedWith");function b(e){return w(e)}n(b,"promiseRejectedWith");function q(e,t,r){return A.call(e,t,r)}n(q,"PerformPromiseThen");function _(e,t,r){q(q(e,t,r),void 0,p)}n(_,"uponPromise");function V(e,t){_(e,t)}n(V,"uponFulfillment");function I(e,t){_(e,void 0,t)}n(I,"uponRejection");function F(e,t,r){return q(e,t,r)}n(F,"transformPromiseWith");function Q(e){q(e,void 0,p)}n(Q,"setPromiseIsHandledToTrue");let ge=n(e=>{if(typeof queueMicrotask=="function")ge=queueMicrotask;else{const t=T(void 0);ge=n(r=>q(t,r),"_queueMicrotask")}return ge(e)},"_queueMicrotask");function z(e,t,r){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}n(z,"reflectCall");function j(e,t,r){try{return T(z(e,t,r))}catch(s){return b(s)}}n(j,"promiseCall");const U=16384,bn=class bn{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(t){const r=this._back;let s=r;r._elements.length===U-1&&(s={_elements:[],_next:void 0}),r._elements.push(t),s!==r&&(this._back=s,r._next=s),++this._size}shift(){const t=this._front;let r=t;const s=this._cursor;let f=s+1;const c=t._elements,d=c[s];return f===U&&(r=t._next,f=0),--this._size,this._cursor=f,t!==r&&(this._front=r),c[s]=void 0,d}forEach(t){let r=this._cursor,s=this._front,f=s._elements;for(;(r!==f.length||s._next!==void 0)&&!(r===f.length&&(s=s._next,f=s._elements,r=0,f.length===0));)t(f[r]),++r}peek(){const t=this._front,r=this._cursor;return t._elements[r]}};n(bn,"SimpleQueue");let D=bn;const Ft=Symbol("[[AbortSteps]]"),Qn=Symbol("[[ErrorSteps]]"),Ar=Symbol("[[CancelSteps]]"),Br=Symbol("[[PullSteps]]"),kr=Symbol("[[ReleaseSteps]]");function Yn(e,t){e._ownerReadableStream=t,t._reader=e,t._state==="readable"?qr(e):t._state==="closed"?Li(e):Gn(e,t._storedError)}n(Yn,"ReadableStreamReaderGenericInitialize");function Wr(e,t){const r=e._ownerReadableStream;return ie(r,t)}n(Wr,"ReadableStreamReaderGenericCancel");function _e(e){const t=e._ownerReadableStream;t._state==="readable"?Or(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):$i(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._readableStreamController[kr](),t._reader=void 0,e._ownerReadableStream=void 0}n(_e,"ReadableStreamReaderGenericRelease");function jt(e){return new TypeError("Cannot "+e+" a stream using a released reader")}n(jt,"readerLockException");function qr(e){e._closedPromise=E((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r})}n(qr,"defaultReaderClosedPromiseInitialize");function Gn(e,t){qr(e),Or(e,t)}n(Gn,"defaultReaderClosedPromiseInitializeAsRejected");function Li(e){qr(e),Zn(e)}n(Li,"defaultReaderClosedPromiseInitializeAsResolved");function Or(e,t){e._closedPromise_reject!==void 0&&(Q(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}n(Or,"defaultReaderClosedPromiseReject");function $i(e,t){Gn(e,t)}n($i,"defaultReaderClosedPromiseResetToRejected");function Zn(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}n(Zn,"defaultReaderClosedPromiseResolve");const Kn=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Di=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function Mi(e){return typeof e=="object"||typeof e=="function"}n(Mi,"isDictionary");function ue(e,t){if(e!==void 0&&!Mi(e))throw new TypeError(`${t} is not an object.`)}n(ue,"assertDictionary");function Z(e,t){if(typeof e!="function")throw new TypeError(`${t} is not a function.`)}n(Z,"assertFunction");function Ui(e){return typeof e=="object"&&e!==null||typeof e=="function"}n(Ui,"isObject");function Jn(e,t){if(!Ui(e))throw new TypeError(`${t} is not an object.`)}n(Jn,"assertObject");function Se(e,t,r){if(e===void 0)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}n(Se,"assertRequiredArgument");function zr(e,t,r){if(e===void 0)throw new TypeError(`${t} is required in '${r}'.`)}n(zr,"assertRequiredField");function Ir(e){return Number(e)}n(Ir,"convertUnrestrictedDouble");function Xn(e){return e===0?0:e}n(Xn,"censorNegativeZero");function xi(e){return Xn(Di(e))}n(xi,"integerPart");function Fr(e,t){const s=Number.MAX_SAFE_INTEGER;let f=Number(e);if(f=Xn(f),!Kn(f))throw new TypeError(`${t} is not a finite number`);if(f=Line truncated
|
||||
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e$1"),Me=n((i,o,a)=>{if(o.length<a)throw new TypeError(`Failed to execute '${i}' on 'FormData': ${a} arguments required, but only ${o.length} present.`)},"x");const br=(zt=class{constructor(...o){be(this,ee,[]);if(o.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Et](){return"FormData"}[xs](){return this.entries()}static[Ns](o){return o&&typeof o=="object"&&o[Et]==="FormData"&&!Hs.some(a=>typeof o[a]!="function")}append(...o){Me("append",arguments,2),O(this,ee).push(mi(...o))}delete(o){Me("delete",arguments,1),o+="",X(this,ee,O(this,ee).filter(([a])=>a!==o))}get(o){Me("get",arguments,1),o+="";for(var a=O(this,ee),u=a.length,l=0;l<u;l++)if(a[l][0]===o)return a[l][1];return null}getAll(o,a){return Me("getAll",arguments,1),a=[],o+="",O(this,ee).forEach(u=>u[0]===o&&a.push(u[1])),a}has(o){return Me("has",arguments,1),o+="",O(this,ee).some(a=>a[0]===o)}forEach(o,a){Me("forEach",arguments,1);for(var[u,l]of this)o.call(a,l,u,this)}set(...o){Me("set",arguments,2);var a=[],u=!0;o=mi(...o),O(this,ee).forEach(l=>{l[0]===o[0]?u&&(u=!a.push(o)):a.push(l)}),u&&a.push(o),X(this,ee,a)}*entries(){yield*O(this,ee)}*keys(){for(var[o]of this)yield o}*values(){for(var[,o]of this)yield o}},ee=new WeakMap,n(zt,"FormData"),zt);function Vs(i,o=ut){var a=`${bi()}${bi()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),u=[],l=`--${a}\r
|
||||
Content-Disposition: form-data; name="`;return i.forEach((p,h)=>typeof p=="string"?u.push(l+zn(h)+`"\r
|
||||
\r
|
||||
${p.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
||||
`)}\r
|
||||
`):u.push(l+zn(h)+`"; filename="${zn(p.name,1)}"\r
|
||||
Content-Type: ${p.type||"application/octet-stream"}\r
|
||||
\r
|
||||
`,p,`\r
|
||||
`)),u.push(`--${a}--`),new o(u,{type:"multipart/form-data; boundary="+a})}n(Vs,"formDataToBlob");const Un=class Un extends Error{constructor(o,a){super(o),Error.captureStackTrace(this,this.constructor),this.type=a}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};n(Un,"FetchBaseError");let ft=Un;const xn=class xn extends ft{constructor(o,a,u){super(o,a),u&&(this.code=this.errno=u.code,this.erroredSysCall=u.syscall)}};n(xn,"FetchError");let G=xn;const mr=Symbol.toStringTag,yi=n(i=>typeof i=="object"&&typeof i.append=="function"&&typeof i.delete=="function"&&typeof i.get=="function"&&typeof i.getAll=="function"&&typeof i.has=="function"&&typeof i.set=="function"&&typeof i.sort=="function"&&i[mr]==="URLSearchParams","isURLSearchParameters"),yr=n(i=>i&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&typeof i.constructor=="function"&&/^(Blob|File)$/.test(i[mr]),"isBlob"),Qs=n(i=>typeof i=="object"&&(i[mr]==="AbortSignal"||i[mr]==="EventTarget"),"isAbortSignal"),Ys=n((i,o)=>{const a=new URL(o).hostname,u=new URL(i).hostname;return a===u||a.endsWith(`.${u}`)},"isDomainOrSubdomain"),Gs=n((i,o)=>{const a=new URL(o).protocol,u=new URL(i).protocol;return a===u},"isSameProtocol"),Zs=ks(me.pipeline),H=Symbol("Body internals"),Nn=class Nn{constructor(o,{size:a=0}={}){let u=null;o===null?o=null:yi(o)?o=M.from(o.toString()):yr(o)||M.isBuffer(o)||(dr.isAnyArrayBuffer(o)?o=M.from(o):ArrayBuffer.isView(o)?o=M.from(o.buffer,o.byteOffset,o.byteLength):o instanceof me||(o instanceof br?(o=Vs(o),u=o.type.split("=")[1]):o=M.from(String(o))));let l=o;M.isBuffer(o)?l=me.Readable.from(o):yr(o)&&(l=me.Readable.from(o.stream())),this[H]={body:o,stream:l,boundary:u,disturbed:!1,error:null},this.size=a,o instanceof me&&o.on("error",p=>{const h=p instanceof ft?p:new G(`Invalid response body while trying to fetch ${this.url}: ${p.message}`,"system",p);this[H].error=h})}get body(){return this[H].stream}get bodyUsed(){return this[H].disturbed}async arrayBuffer(){const{buffer:o,byteOffset:a,byteLength:u}=await In(this);return o.slice(a,a+u)}async formData(){const o=this.headers.get("content-type");if(o.startsWith("application/x-www-form-urlencoded")){const u=new br,l=new URLSearchParams(await this.text());for(const[p,h]of l)u.append(p,h);return u}const{toFormData:a}=await import("./chunks/multipart-parser.mjs");return a(this.body,o)}async blob(){const o=this.headers&&this.headers.get("content-type")||this[H].body&&this[H].body.type||"",a=await this.arrayBuffer();return new ut([a],{type:o})}async json(){const o=await this.text();return JSON.parse(o)}async text(){const o=await In(this);return new TextDecoder().decode(o)}buffer(){return In(this)}};n(Nn,"Body");let Ue=Nn;Ue.prototype.buffer=hr(Ue.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(Ue.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:hr(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function In(i){if(i[H].disturbed)throw new TypeError(`body used already for: ${i.url}`);if(i[H].disturbed=!0,i[H].error)throw i[H].error;const{body:o}=i;if(o===null)return M.alloc(0);if(!(o instanceof me))return M.alloc(0);const a=[];let u=0;try{for await(const l of o){if(i.size>0&&u+l.length>i.size){const p=new G(`content size at ${i.url} over limit: ${i.size}`,"max-size");throw o.destroy(p),p}u+=l.length,a.push(l)}}catch(l){throw l instanceof ft?l:new G(`Invalid response body while trying to fetch ${i.url}: ${l.message}`,"system",l)}if(o.readableEnded===!0||o._readableState.ended===!0)try{return a.every(l=>typeof l=="string")?M.from(a.join("")):M.concat(a,u)}catch(l){throw new G(`Could not create Buffer from response body for ${i.url}: ${l.message}`,"system",l)}else throw new G(`Premature close of server response while trying to fetch ${i.url}`)}n(In,"consumeBody");const Fn=n((i,o)=>{let a,u,{body:l}=i[H];if(i.bodyUsed)throw new Error("cannot clone body after it is used");return l instanceof me&&typeof l.getBoundary!="function"&&(a=new cr({highWaterMark:o}),u=new cr({highWaterMark:o}),l.pipe(a),l.pipe(u),i[H].stream=a,l=u),l},"clone"),Ks=hr(i=>i.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),gi=n((i,o)=>i===null?null:typeof i=="string"?"text/plain;charset=UTF-8":yi(i)?"application/x-www-form-urlencoded;charset=UTF-8":yr(i)?i.type||null:M.isBuffer(i)||dr.isAnyArrayBuffer(i)||ArrayBuffer.isView(i)?null:i instanceof br?`multipart/form-data; boundary=${o[H].boundary}`:i&&typeof i.getBoundary=="function"?`multipart/form-data;boundary=${Ks(i)}`:i instanceof me?null:"text/plain;charset=UTF-8","extr
Line truncated
|
||||
\r
|
||||
`);let u=!1,l=!1,p;i.on("response",h=>{const{headers:g}=h;u=g["transfer-encoding"]==="chunked"&&!g["content-length"]}),i.on("socket",h=>{const g=n(()=>{if(u&&!l){const w=new Error("Premature close");w.code="ERR_STREAM_PREMATURE_CLOSE",o(w)}},"onSocketClose"),A=n(w=>{l=M.compare(w.slice(-5),a)===0,!l&&p&&(l=M.compare(p.slice(-3),a.slice(0,3))===0&&M.compare(w.slice(-2),a.slice(3))===0),p=w},"onData");h.prependListener("close",g),h.on("data",A),i.on("close",()=>{h.removeListener("close",g),h.removeListener("data",A)})})}n(yl,"fixResponseChunkedTransferBadEnding");const Ci=new WeakMap,Dn=new WeakMap;function W(i){const o=Ci.get(i);return console.assert(o!=null,"'this' is expected an Event object, but got",i),o}n(W,"pd");function Pi(i){if(i.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",i.passiveListener);return}i.event.cancelable&&(i.canceled=!0,typeof i.event.preventDefault=="function"&&i.event.preventDefault())}n(Pi,"setCancelFlag");function ht(i,o){Ci.set(this,{eventTarget:i,event:o,eventPhase:2,currentTarget:i,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:o.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const a=Object.keys(o);for(let u=0;u<a.length;++u){const l=a[u];l in this||Object.defineProperty(this,l,vi(l))}}n(ht,"Event"),ht.prototype={get type(){return W(this).event.type},get target(){return W(this).eventTarget},get currentTarget(){return W(this).currentTarget},composedPath(){const i=W(this).currentTarget;return i==null?[]:[i]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return W(this).eventPhase},stopPropagation(){const i=W(this);i.stopped=!0,typeof i.event.stopPropagation=="function"&&i.event.stopPropagation()},stopImmediatePropagation(){const i=W(this);i.stopped=!0,i.immediateStopped=!0,typeof i.event.stopImmediatePropagation=="function"&&i.event.stopImmediatePropagation()},get bubbles(){return!!W(this).event.bubbles},get cancelable(){return!!W(this).event.cancelable},preventDefault(){Pi(W(this))},get defaultPrevented(){return W(this).canceled},get composed(){return!!W(this).event.composed},get timeStamp(){return W(this).timeStamp},get srcElement(){return W(this).eventTarget},get cancelBubble(){return W(this).stopped},set cancelBubble(i){if(!i)return;const o=W(this);o.stopped=!0,typeof o.event.cancelBubble=="boolean"&&(o.event.cancelBubble=!0)},get returnValue(){return!W(this).canceled},set returnValue(i){i||Pi(W(this))},initEvent(){}},Object.defineProperty(ht.prototype,"constructor",{value:ht,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(ht.prototype,window.Event.prototype),Dn.set(window.Event.prototype,ht));function vi(i){return{get(){return W(this).event[i]},set(o){W(this).event[i]=o},configurable:!0,enumerable:!0}}n(vi,"defineRedirectDescriptor");function gl(i){return{value(){const o=W(this).event;return o[i].apply(o,arguments)},configurable:!0,enumerable:!0}}n(gl,"defineCallDescriptor");function _l(i,o){const a=Object.keys(o);if(a.length===0)return i;function u(l,p){i.call(this,l,p)}n(u,"CustomEvent"),u.prototype=Object.create(i.prototype,{constructor:{value:u,configurable:!0,writable:!0}});for(let l=0;l<a.length;++l){const p=a[l];if(!(p in i.prototype)){const g=typeof Object.getOwnPropertyDescriptor(o,p).value=="function";Object.defineProperty(u.prototype,p,g?gl(p):vi(p))}}return u}n(_l,"defineWrapper");function Ei(i){if(i==null||i===Object.prototype)return ht;let o=Dn.get(i);return o==null&&(o=_l(Ei(Object.getPrototypeOf(i)),i),Dn.set(i,o)),o}n(Ei,"getWrapper");function Sl(i,o){const a=Ei(Object.getPrototypeOf(o));return new a(i,o)}n(Sl,"wrapEvent");function wl(i){return W(i).immediateStopped}n(wl,"isStopped");function Rl(i,o){W(i).eventPhase=o}n(Rl,"setEventPhase");function Tl(i,o){W(i).currentTarget=o}n(Tl,"setCurrentTarget");function Ai(i,o){W(i).passiveListener=o}n(Ai,"setPassiveListener");const Bi=new WeakMap,ki=1,Wi=2,wr=3;function Rr(i){return i!==null&&typeof i=="object"}n(Rr,"isObject");function Bt(i){const o=Bi.get(i);if(o==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return o}n(Bt,"getListeners");function Cl(i){return{get(){let a=Bt(this).get(i);for(;a!=null;){if(a.listenerType===wr)return a.listener;a=a.next}return null},set(o){typeof o!="function"&&!Rr(o)&&(o=null);const a=Bt(this);let u=null,l=a.get(i);for(;l!=null;)l.listenerType===wr?u!==null?u.next=l.next:l.next!==null?a.set(i,l.next):a.delete(i):u=l,l=l.next;if(o!==null){const p={listener:o,listenerType:wr,passive:!1,once:!1,next:null};u===null?a.set(i,p):u.next=p}},configurable:!0,enumerable:!0}}n(Cl,"defineEventAttributeDescriptor");function qi(i,o){Object.defineProperty(i,`on${o}`,Cl(o))}n(qi,"defineEventAttribute");function Oi(i){function o(){Pe.call(this)}n(o
Line truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";var n=Object.defineProperty;var i=(r,o)=>n(r,"name",{value:o,configurable:!0});const node=require("./node.cjs");require("node:fs"),require("node:path"),require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:buffer"),require("node:util"),require("./shared/node-fetch-native-with-agent.61758d11.cjs"),require("node:url"),require("node:net");var t=Object.defineProperty,a=i((r,o)=>t(r,"name",{value:o,configurable:!0}),"a");function e(r,o){if(!(r in globalThis))try{globalThis[r]=o}catch{}}i(e,"e"),a(e,"polyfill"),e("fetch",node.fetch),e("Blob",node.Blob),e("File",node.File),e("FormData",node.FormData),e("Headers",node.Headers),e("Request",node.Request),e("Response",node.Response),e("AbortController",node.AbortController);
|
||||
+1
@@ -0,0 +1 @@
|
||||
var i=Object.defineProperty;var e=(r,t)=>i(r,"name",{value:t,configurable:!0});import{fetch as l,Blob as a,File as m,FormData as p,Headers as s,Request as n,Response as b,AbortController as f}from"./node.mjs";import"node:fs";import"node:path";import"node:http";import"node:https";import"node:zlib";import"node:stream";import"node:buffer";import"node:util";import"./shared/node-fetch-native-with-agent.1a4a356d.mjs";import"node:url";import"node:net";var c=Object.defineProperty,h=e((r,t)=>c(r,"name",{value:t,configurable:!0}),"a");function o(r,t){if(!(r in globalThis))try{globalThis[r]=t}catch{}}e(o,"e"),h(o,"polyfill"),o("fetch",l),o("Blob",a),o("File",m),o("FormData",p),o("Headers",s),o("Request",n),o("Response",b),o("AbortController",f);
|
||||
+1
@@ -0,0 +1 @@
|
||||
"use strict";var o=Object.defineProperty;var t=(c,a)=>o(c,"name",{value:a,configurable:!0});var r=Object.defineProperty,e=t((c,a)=>r(c,"name",{value:a,configurable:!0}),"e");function createProxy(){return{agent:void 0,dispatcher:void 0}}t(createProxy,"createProxy"),e(createProxy,"createProxy");function createFetch(){return globalThis.fetch}t(createFetch,"createFetch"),e(createFetch,"createFetch");const fetch=globalThis.fetch;exports.createFetch=createFetch,exports.createProxy=createProxy,exports.fetch=fetch;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var n=Object.defineProperty;var e=(t,r)=>n(t,"name",{value:r,configurable:!0});var i=Object.defineProperty,c=e((t,r)=>i(t,"name",{value:r,configurable:!0}),"e");function a(){return{agent:void 0,dispatcher:void 0}}e(a,"createProxy"),c(a,"createProxy");function o(){return globalThis.fetch}e(o,"createFetch"),c(o,"createFetch");const h=globalThis.fetch;export{o as createFetch,a as createProxy,h as fetch};
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";var z=Object.defineProperty;var p=(r,e)=>z(r,"name",{value:e,configurable:!0});var M,I;const http$1=require("node:http"),https$1=require("node:https"),require$$1$4=require("node:url"),index=require("./shared/node-fetch-native-with-agent.df7e6bd6.cjs"),_commonjsHelpers=require("./shared/node-fetch-native-with-agent.61758d11.cjs"),require$$0$1=require("net"),require$$0=require("http"),require$$1=require("https"),require$$1$3=require("tls"),require$$1$1=require("tty"),require$$1$2=require("util"),require$$0$2=require("os"),require$$3=require("events"),require$$5=require("url"),require$$2=require("assert"),nodeFetchNativeWithAgent=require("node-fetch-native-with-agent");require("node:assert"),require("node:net"),require("node:stream"),require("node:buffer"),require("node:util"),require("node:querystring"),require("node:diagnostics_channel"),require("node:events"),require("node:tls"),require("node:zlib"),require("node:perf_hooks"),require("node:util/types"),require("node:os"),require("node:async_hooks"),require("node:console"),require("string_decoder"),require("node:worker_threads");function _interopDefaultCompat(r){return r&&typeof r=="object"&&"default"in r?r.default:r}p(_interopDefaultCompat,"_interopDefaultCompat");function _interopNamespaceCompat(r){if(r&&typeof r=="object"&&"default"in r)return r;const e=Object.create(null);if(r)for(const o in r)e[o]=r[o];return e.default=r,e}p(_interopNamespaceCompat,"_interopNamespaceCompat");const http__namespace=_interopNamespaceCompat(http$1),https__namespace=_interopNamespaceCompat(https$1),require$$0__default$1=_interopDefaultCompat(require$$0$1),require$$0__default=_interopDefaultCompat(require$$0),require$$1__default=_interopDefaultCompat(require$$1),require$$1__default$3=_interopDefaultCompat(require$$1$3),require$$1__default$1=_interopDefaultCompat(require$$1$1),require$$1__default$2=_interopDefaultCompat(require$$1$2),require$$0__default$2=_interopDefaultCompat(require$$0$2),require$$3__default=_interopDefaultCompat(require$$3),require$$5__default=_interopDefaultCompat(require$$5),require$$2__default=_interopDefaultCompat(require$$2);var dist$2={},helpers={},__createBinding$2=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__createBinding||(Object.create?function(r,e,o,t){t===void 0&&(t=o);var l=Object.getOwnPropertyDescriptor(e,o);(!l||("get"in l?!e.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(r,t,l)}:function(r,e,o,t){t===void 0&&(t=o),r[t]=e[o]}),__setModuleDefault$2=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar$2=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&__createBinding$2(e,r,o);return __setModuleDefault$2(e,r),e};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.req=helpers.json=helpers.toBuffer=void 0;const http=__importStar$2(require$$0__default),https=__importStar$2(require$$1__default);async function toBuffer(r){let e=0;const o=[];for await(const t of r)e+=t.length,o.push(t);return Buffer.concat(o,e)}p(toBuffer,"toBuffer"),helpers.toBuffer=toBuffer;async function json(r){const o=(await toBuffer(r)).toString("utf8");try{return JSON.parse(o)}catch(t){const l=t;throw l.message+=` (input: ${o})`,l}}p(json,"json"),helpers.json=json;function req(r,e={}){const t=((typeof r=="string"?r:r.href).startsWith("https:")?https:http).request(r,e),l=new Promise((m,w)=>{t.once("response",m).once("error",w).end()});return t.then=l.then.bind(l),t}p(req,"req"),helpers.req=req,function(r){var e=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__createBinding||(Object.create?function(c,n,f,_){_===void 0&&(_=f);var v=Object.getOwnPropertyDescriptor(n,f);(!v||("get"in v?!n.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return n[f]}}),Object.defineProperty(c,_,v)}:function(c,n,f,_){_===void 0&&(_=f),c[_]=n[f]}),o=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__setModuleDefault||(Object.create?function(c,n){Object.defineProperty(c,"default",{enumerable:!0,value:n})}:function(c,n){c.default=n}),t=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importStar||function(c){if(c&&c.__esModule)return c;var n={};if(c!=null)for(var f in c)f!=="default"&&Object.prototype.hasOwnProperty.call(c,f)&&e(n,c,f);return o(n,c),n},l=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__exportStar||function(c,n){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(n,f)&&e(n,c,f)};Object.defineProperty(r,"__esModule",{value:!0}),r.Agent=void 0;const m=t(require$$0__default$1),w=t(require$$0__default),$=require$$1__default;l(helpers,r);const y=Symbol("AgeLine truncated
|
||||
`).some(_=>_.indexOf("(https.js:")!==-1||_.indexOf("node:https:")!==-1)}incrementSockets(n){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[n]||(this.sockets[n]=[]);const f=new m.Socket({writable:!1});return this.sockets[n].push(f),this.totalSocketCount++,f}decrementSockets(n,f){if(!this.sockets[n]||f===null)return;const _=this.sockets[n],v=_.indexOf(f);v!==-1&&(_.splice(v,1),this.totalSocketCount--,_.length===0&&delete this.sockets[n])}getName(n){return(typeof n.secureEndpoint=="boolean"?n.secureEndpoint:this.isSecureEndpoint(n))?$.Agent.prototype.getName.call(this,n):super.getName(n)}createSocket(n,f,_){const v={...f,secureEndpoint:this.isSecureEndpoint(f)},F=this.getName(v),x=this.incrementSockets(F);Promise.resolve().then(()=>this.connect(n,v)).then(j=>{if(this.decrementSockets(F,x),j instanceof w.Agent)return j.addRequest(n,v);this[y].currentSocket=j,super.createSocket(n,f,_)},j=>{this.decrementSockets(F,x),_(j)})}createConnection(){const n=this[y].currentSocket;if(this[y].currentSocket=void 0,!n)throw new Error("No socket was returned in the `connect()` function");return n}get defaultPort(){return this[y].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(n){this[y]&&(this[y].defaultPort=n)}get protocol(){return this[y].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(n){this[y]&&(this[y].protocol=n)}};p(C,"Agent");let b=C;r.Agent=b}(dist$2);var dist$1={},src={exports:{}},browser={exports:{}},ms,hasRequiredMs;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var r=1e3,e=r*60,o=e*60,t=o*24,l=t*7,m=t*365.25;ms=p(function(C,c){c=c||{};var n=typeof C;if(n==="string"&&C.length>0)return w(C);if(n==="number"&&isFinite(C))return c.long?y(C):$(C);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(C))},"ms");function w(C){if(C=String(C),!(C.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(C);if(c){var n=parseFloat(c[1]),f=(c[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return n*m;case"weeks":case"week":case"w":return n*l;case"days":case"day":case"d":return n*t;case"hours":case"hour":case"hrs":case"hr":case"h":return n*o;case"minutes":case"minute":case"mins":case"min":case"m":return n*e;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}p(w,"parse");function $(C){var c=Math.abs(C);return c>=t?Math.round(C/t)+"d":c>=o?Math.round(C/o)+"h":c>=e?Math.round(C/e)+"m":c>=r?Math.round(C/r)+"s":C+"ms"}p($,"fmtShort");function y(C){var c=Math.abs(C);return c>=t?b(C,c,t,"day"):c>=o?b(C,c,o,"hour"):c>=e?b(C,c,e,"minute"):c>=r?b(C,c,r,"second"):C+" ms"}p(y,"fmtLong");function b(C,c,n,f){var _=c>=n*1.5;return Math.round(C/n)+" "+f+(_?"s":"")}return p(b,"plural"),ms}p(requireMs,"requireMs");var common,hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;function r(e){t.debug=t,t.default=t,t.coerce=b,t.disable=w,t.enable=m,t.enabled=$,t.humanize=requireMs(),t.destroy=C,Object.keys(e).forEach(c=>{t[c]=e[c]}),t.names=[],t.skips=[],t.formatters={};function o(c){let n=0;for(let f=0;f<c.length;f++)n=(n<<5)-n+c.charCodeAt(f),n|=0;return t.colors[Math.abs(n)%t.colors.length]}p(o,"selectColor"),t.selectColor=o;function t(c){let n,f=null,_,v;function F(...x){if(!F.enabled)return;const j=F,R=Number(new Date),q=R-(n||R);j.diff=q,j.prev=n,j.curr=R,n=R,x[0]=t.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let S=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(A,k)=>{if(A==="%%")return"%";S++;const B=t.formatters[k];if(typeof B=="function"){const U=x[S];A=B.call(j,U),x.splice(S,1),S--}return A}),t.formatArgs.call(j,x),(j.log||t.log).apply(j,x)}return p(F,"debug"),F.namespace=c,F.useColors=t.useColors(),F.color=t.selectColor(c),F.extend=l,F.destroy=t.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(_!==t.namespaces&&(_=t.namespaces,v=t.enabled(c)),v),set:x=>{f=x}}),typeof t.init=="function"&&t.init(F),F}p(t,"createDebug");function l(c,n){const f=t(this.namespace+(typeof n>"u"?":":n)+c);return f.log=this.log,f}p(l,"extend");function m(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let n;const f=(typeof c=="string"?c:"").split(/[\s,]+/),_=f.length;for(n=0;n<_;n++)f[n]&&(c=f[n].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.slice(1)+"$")):t.names.push(new RegExp("^"+c+"$")))}p(m,"enable");function w(){const c=[...t.names.map(y),...t.skips.map(y).map(n=>"-"+n)].join(",");return t.enable(""),c}p(w,"disable");function $(c){if(c[c.length-1]==="*")return!0;let n,f;for(n=0,f=t.skips.length;n<f;n++)if(t.skips[n].test(c))return!1;for(n=0,f=t.names.length;n<f;n++)if(t.names[n].test(c))return!0;return!1}p($,"enabled");function y(c){return c.toString().substring(2,c.toString().length-2).replace(/\.Line truncated
|
||||
`).join(`
|
||||
`+x),n.push(F+"m+"+r.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=w()+f+" "+n[0]}p(m,"formatArgs");function w(){return e.inspectOpts.hideDate?"":new Date().toISOString()+" "}p(w,"getDate");function $(...n){return process.stderr.write(t.format(...n)+`
|
||||
`)}p($,"log");function y(n){n?process.env.DEBUG=n:delete process.env.DEBUG}p(y,"save");function b(){return process.env.DEBUG}p(b,"load");function C(n){n.inspectOpts={};const f=Object.keys(e.inspectOpts);for(let _=0;_<f.length;_++)n.inspectOpts[f[_]]=e.inspectOpts[f[_]]}p(C,"init"),r.exports=requireCommon()(e);const{formatters:c}=r.exports;c.o=function(n){return this.inspectOpts.colors=this.useColors,t.inspect(n,this.inspectOpts).split(`
|
||||
`).map(f=>f.trim()).join(" ")},c.O=function(n){return this.inspectOpts.colors=this.useColors,t.inspect(n,this.inspectOpts)}}(node,node.exports)),node.exports}p(requireNode,"requireNode"),typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?src.exports=requireBrowser():src.exports=requireNode();var srcExports=src.exports,__createBinding$1=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__createBinding||(Object.create?function(r,e,o,t){t===void 0&&(t=o);var l=Object.getOwnPropertyDescriptor(e,o);(!l||("get"in l?!e.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(r,t,l)}:function(r,e,o,t){t===void 0&&(t=o),r[t]=e[o]}),__setModuleDefault$1=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar$1=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&__createBinding$1(e,r,o);return __setModuleDefault$1(e,r),e},__importDefault$2=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dist$1,"__esModule",{value:!0});var HttpProxyAgent_1=dist$1.HttpProxyAgent=void 0;const net$1=__importStar$1(require$$0__default$1),tls$1=__importStar$1(require$$1__default$3),debug_1$2=__importDefault$2(srcExports),events_1=require$$3__default,agent_base_1$1=dist$2,url_1$1=require$$5__default,debug$2=(0,debug_1$2.default)("http-proxy-agent"),N=class N extends agent_base_1$1.Agent{constructor(e,o){super(o),this.proxy=typeof e=="string"?new url_1$1.URL(e):e,this.proxyHeaders=o?.headers??{},debug$2("Creating new HttpProxyAgent instance: %o",this.proxy.href);const t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),l=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...o?omit$1(o,"headers"):null,host:t,port:l}}addRequest(e,o){e._header=null,this.setRequestProps(e,o),super.addRequest(e,o)}setRequestProps(e,o){const{proxy:t}=this,l=o.secureEndpoint?"https:":"http:",m=e.getHeader("host")||"localhost",w=`${l}//${m}`,$=new url_1$1.URL(e.path,w);o.port!==80&&($.port=String(o.port)),e.path=String($);const y=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(t.username||t.password){const b=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;y["Proxy-Authorization"]=`Basic ${Buffer.from(b).toString("base64")}`}y["Proxy-Connection"]||(y["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const b of Object.keys(y)){const C=y[b];C&&e.setHeader(b,C)}}async connect(e,o){e._header=null,e.path.includes("://")||this.setRequestProps(e,o);let t,l;debug$2("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(debug$2("Patching connection write() output buffer with updated header"),t=e.outputData[0].data,l=t.indexOf(`\r
|
||||
\r
|
||||
`)+4,e.outputData[0].data=e._header+t.substring(l),debug$2("Output buffer: %o",e.outputData[0].data));let m;return this.proxy.protocol==="https:"?(debug$2("Creating `tls.Socket`: %o",this.connectOpts),m=tls$1.connect(this.connectOpts)):(debug$2("Creating `net.Socket`: %o",this.connectOpts),m=net$1.connect(this.connectOpts)),await(0,events_1.once)(m,"connect"),m}};p(N,"HttpProxyAgent");let HttpProxyAgent=N;HttpProxyAgent.protocols=["http","https"],HttpProxyAgent_1=dist$1.HttpProxyAgent=HttpProxyAgent;function omit$1(r,...e){const o={};let t;for(t in r)e.includes(t)||(o[t]=r[t]);return o}p(omit$1,"omit$1");var dist={},parseProxyResponse$1={},__importDefault$1=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(parseProxyResponse$1,"__esModule",{value:!0}),parseProxyResponse$1.parseProxyResponse=void 0;const debug_1$1=__importDefault$1(srcExports),debug$1=(0,debug_1$1.default)("https-proxy-agent:parse-proxy-response");function parseProxyResponse(r){return new Promise((e,o)=>{let t=0;const l=[];function m(){const C=r.read();C?b(C):r.once("readable",m)}p(m,"read");function w(){r.removeListener("end",$),r.removeListener("error",y),r.removeListener("readable",m)}p(w,"cleanup");function $(){w(),debug$1("onend"),o(new Error("Proxy connection ended before receiving CONNECT response"))}p($,"onend");function y(C){w(),debug$1("onerror %o",C),o(C)}p(y,"onerror");function b(C){l.push(C),t+=C.length;const c=Buffer.concat(l,t),n=c.indexOf(`\r
|
||||
\r
|
||||
`);if(n===-1){debug$1("have not received end of HTTP headers yet..."),m();return}const f=c.slice(0,n).toString("ascii").split(`\r
|
||||
`),_=f.shift();if(!_)return r.destroy(),o(new Error("No header received from proxy CONNECT response"));const v=_.split(" "),F=+v[1],x=v.slice(2).join(" "),j={};for(const R of f){if(!R)continue;const q=R.indexOf(":");if(q===-1)return r.destroy(),o(new Error(`Invalid header from proxy CONNECT response: "${R}"`));const S=R.slice(0,q).toLowerCase(),G=R.slice(q+1).trimStart(),A=j[S];typeof A=="string"?j[S]=[A,G]:Array.isArray(A)?A.push(G):j[S]=G}debug$1("got proxy server response: %o %o",_,j),w(),e({connect:{statusCode:F,statusText:x,headers:j},buffered:c})}p(b,"ondata"),r.on("error",y),r.on("end",$),m()})}p(parseProxyResponse,"parseProxyResponse"),parseProxyResponse$1.parseProxyResponse=parseProxyResponse;var __createBinding=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__createBinding||(Object.create?function(r,e,o,t){t===void 0&&(t=o);var l=Object.getOwnPropertyDescriptor(e,o);(!l||("get"in l?!e.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(r,t,l)}:function(r,e,o,t){t===void 0&&(t=o),r[t]=e[o]}),__setModuleDefault=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&__createBinding(e,r,o);return __setModuleDefault(e,r),e},__importDefault=_commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dist,"__esModule",{value:!0});var HttpsProxyAgent_1=dist.HttpsProxyAgent=void 0;const net=__importStar(require$$0__default$1),tls=__importStar(require$$1__default$3),assert_1=__importDefault(require$$2__default),debug_1=__importDefault(srcExports),agent_base_1=dist$2,url_1=require$$5__default,parse_proxy_response_1=parseProxyResponse$1,debug=(0,debug_1.default)("https-proxy-agent"),D=class D extends agent_base_1.Agent{constructor(e,o){super(o),this.options={path:void 0},this.proxy=typeof e=="string"?new url_1.URL(e):e,this.proxyHeaders=o?.headers??{},debug("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),l=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...o?omit(o,"headers"):null,host:t,port:l}}async connect(e,o){const{proxy:t}=this;if(!o.host)throw new TypeError('No "host" provided');let l;if(t.protocol==="https:"){debug("Creating `tls.Socket`: %o",this.connectOpts);const n=this.connectOpts.servername||this.connectOpts.host;l=tls.connect({...this.connectOpts,servername:n&&net.isIP(n)?void 0:n})}else debug("Creating `net.Socket`: %o",this.connectOpts),l=net.connect(this.connectOpts);const m=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},w=net.isIPv6(o.host)?`[${o.host}]`:o.host;let $=`CONNECT ${w}:${o.port} HTTP/1.1\r
|
||||
`;if(t.username||t.password){const n=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;m["Proxy-Authorization"]=`Basic ${Buffer.from(n).toString("base64")}`}m.Host=`${w}:${o.port}`,m["Proxy-Connection"]||(m["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const n of Object.keys(m))$+=`${n}: ${m[n]}\r
|
||||
`;const y=(0,parse_proxy_response_1.parseProxyResponse)(l);l.write(`${$}\r
|
||||
`);const{connect:b,buffered:C}=await y;if(e.emit("proxyConnect",b),this.emit("proxyConnect",b,e),b.statusCode===200){if(e.once("socket",resume),o.secureEndpoint){debug("Upgrading socket connection to TLS");const n=o.servername||o.host;return tls.connect({...omit(o,"host","path","port"),socket:l,servername:net.isIP(n)?void 0:n})}return l}l.destroy();const c=new net.Socket({writable:!1});return c.readable=!0,e.once("socket",n=>{debug("Replaying proxy buffer for failed request"),(0,assert_1.default)(n.listenerCount("data")>0),n.push(C),n.push(null)}),c}};p(D,"HttpsProxyAgent");let HttpsProxyAgent=D;HttpsProxyAgent.protocols=["http","https"],HttpsProxyAgent_1=dist.HttpsProxyAgent=HttpsProxyAgent;function resume(r){r.resume()}p(resume,"resume");function omit(r,...e){const o={};let t;for(t in r)e.includes(t)||(o[t]=r[t]);return o}p(omit,"omit");var d=Object.defineProperty,O=p((r,e,o)=>e in r?d(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,"O"),s=p((r,e)=>d(r,"name",{value:e,configurable:!0}),"s"),i=p((r,e,o)=>(O(r,typeof e!="symbol"?e+"":e,o),o),"i");function H(...r){process.env.DEBUG&&console.debug("[node-fetch-native] [proxy]",...r)}p(H,"H"),s(H,"debug");function P(r,e){if(!e)return!1;for(const o of e)if(o===r||o[0]==="."&&r.endsWith(o.slice(1)))return!0;return!1}p(P,"P"),s(P,"bypassProxy");const g=(M=class extends index.ProxyAgent_1{constructor(e){super(e),this._options=e,i(this,"_agent"),this._agent=new index.Agent_1}dispatch(e,o){const t=new require$$1$4.URL(e.origin).hostname;return P(t,this._options.noProxy)?(H(`Bypassing proxy for: ${t}`),this._agent.dispatch(e,o)):super.dispatch(e,o)}},p(M,"g"),M);s(g,"UndiciProxyAgent");let h=g;const T=["http","https"],E={http:[HttpProxyAgent_1,HttpsProxyAgent_1],https:[HttpProxyAgent_1,HttpsProxyAgent_1]};function L(r){return T.includes(r)}p(L,"L"),s(L,"isValidProtocol");const u=(I=class extends dist$2.Agent{constructor(e){super({}),this._options=e,i(this,"cache",new Map),i(this,"httpAgent"),i(this,"httpsAgent"),this.httpAgent=new http__namespace.Agent({}),this.httpsAgent=new https__namespace.Agent({})}connect(e,o){const t=e.getHeader("upgrade")==="websocket",l=o.secureEndpoint?t?"wss:":"https:":t?"ws:":"http:",m=e.getHeader("host");if(P(m,this._options.noProxy))return o.secureEndpoint?this.httpsAgent:this.httpAgent;const w=`${l}+${this._options.uri}`;let $=this.cache.get(w);if(!$){const y=new require$$1$4.URL(this._options.uri).protocol.replace(":","");if(!L(y))throw new Error(`Unsupported protocol for proxy URL: ${this._options.uri}`);const b=E[y][o.secureEndpoint||t?1:0];$=new b(this._options.uri,this._options),this.cache.set(w,$)}return $}destroy(){for(const e of this.cache.values())e.destroy();super.destroy()}},p(I,"u"),I);s(u,"NodeProxyAgent");let a=u;function createProxy(r={}){const e=r.url||process.env.https_proxy||process.env.http_proxy||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;if(!e)return{agent:void 0,dispatcher:void 0};const o=r.noProxy||process.env.no_proxy||process.env.NO_PROXY,t=typeof o=="string"?o.split(","):o,l=new a({uri:e,noProxy:t}),m=new h({uri:e,noProxy:t});return{agent:l,dispatcher:m}}p(createProxy,"createProxy"),s(createProxy,"createProxy");function createFetch(r={}){const e=createProxy(r);return(o,t)=>nodeFetchNativeWithAgent.fetch(o,{...e,...t})}p(createFetch,"createFetch"),s(createFetch,"createFetch");const fetch=createFetch({});exports.createFetch=createFetch,exports.createProxy=createProxy,exports.fetch=fetch;
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
var t=Object.defineProperty;var o=(e,l)=>t(e,"name",{value:l,configurable:!0});var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(f,"getDefaultExportFromCjs");export{n as c,f as g};
|
||||
Generated
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
var Ui=Object.defineProperty;var Zg=(e,A,t)=>A in e?Ui(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var o=(e,A)=>Ui(e,"name",{value:A,configurable:!0});var WA=(e,A,t)=>(Zg(e,typeof A!="symbol"?A+"":A,t),t),Os=(e,A,t)=>{if(!A.has(e))throw TypeError("Cannot "+t)},bi=(e,A)=>{if(Object(A)!==A)throw TypeError('Cannot use the "in" operator on this value');return e.has(A)},p=(e,A,t)=>(Os(e,A,"read from private field"),t?t.call(e):A.get(e)),hA=(e,A,t)=>{if(A.has(e))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(e):A.set(e,t)},BA=(e,A,t,s)=>(Os(e,A,"write to private field"),s?s.call(e,t):A.set(e,t),t);var HA=(e,A,t)=>(Os(e,A,"access private method"),t);var or,ir,Qr,Er,gr,Br,Cr,Ir,ar,cr,hr,lr,ur,dr,fr,Dr,yr,Rr,wr,kr,Nr,Fr,Lt,pr,Sr,Ur,br,mr,Lr,Mr,Yr,Jr,Gr,Tr,Vs,Wg,Hr,Mt,Vr;import RA from"node:assert";import Ps from"node:net";import Pr from"node:http";import ue from"node:stream";import de from"node:buffer";import PA from"node:util";import Xg from"node:querystring";import Kg from"node:diagnostics_channel";import Zr from"node:events";import{c as mi}from"./node-fetch-native-with-agent.1a4a356d.mjs";import zg from"node:tls";import Li from"node:zlib";import jg from"node:perf_hooks";import Mi from"node:util/types";import $g from"node:os";import _g from"node:url";import Tt from"node:async_hooks";import"node:console";import AB from"string_decoder";import eB from"node:worker_threads";var LA={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams")};let MA=(or=class extends Error{constructor(A){super(A),this.name="UndiciError",this.code="UND_ERR"}},o(or,"UndiciError"),or),tB=(ir=class extends MA{constructor(A){super(A),this.name="ConnectTimeoutError",this.message=A||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}},o(ir,"ConnectTimeoutError"),ir),rB=(Qr=class extends MA{constructor(A){super(A),this.name="HeadersTimeoutError",this.message=A||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}},o(Qr,"HeadersTimeoutError"),Qr),sB=(Er=class extends MA{constructor(A){super(A),this.name="HeadersOverflowError",this.message=A||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}},o(Er,"HeadersOverflowError"),Er),nB=(gr=class extends MA{constructor(A){super(A),this.name="BodyTimeoutError",this.message=A||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}},o(gr,"BodyTimeoutError"),gr),oB=(Br=class extends MA{constructor(A,t,s,r){super(A),this.name="ResponseStatusCodeError",this.message=A||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=r,this.status=t,this.statusCode=t,this.headers=s}},o(Br,"ResponseStatusCodeError"),Br),iB=(Cr=class extends MA{constructor(A){super(A),this.name="InvalidArgumentError",this.message=A||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}},o(Cr,"InvalidArgumentError"),Cr),QB=(Ir=class extends MA{constructor(A){super(A),this.name="InLine truncated
|
||||
`))}o(N,"isValidHeaderValue");function u(y,Y){const{headersList:W}=Y,j=(W.get("referrer-policy",!0)??"").split(",");let sA="";if(j.length>0)for(let R=j.length;R!==0;R--){const O=j[R-1].trim();if(s.has(O)){sA=O;break}}sA!==""&&(y.referrerPolicy=sA)}o(u,"setRequestReferrerPolicyOnRedirect");function b(){return"allowed"}o(b,"crossOriginResourcePolicyCheck");function m(){return"success"}o(m,"corsCheck");function T(){return"success"}o(T,"TAOCheck");function v(y){let Y=null;Y=y.mode,y.headersList.set("sec-fetch-mode",Y,!0)}o(v,"appendFetchMetadata");function Z(y){let Y=y.origin;if(y.responseTainting==="cors"||y.mode==="websocket")Y&&y.headersList.append("origin",Y,!0);else if(y.method!=="GET"&&y.method!=="HEAD"){switch(y.referrerPolicy){case"no-referrer":Y=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":y.origin&&Yt(y.origin)&&!Yt(D(y))&&(Y=null);break;case"same-origin":YA(y,D(y))||(Y=null);break}Y&&y.headersList.append("origin",Y,!0)}}o(Z,"appendRequestOriginHeader");function P(y,Y){return y}o(P,"coarsenTime");function AA(y,Y,W){return!y?.startTime||y.startTime<Y?{domainLookupStartTime:Y,domainLookupEndTime:Y,connectionStartTime:Y,connectionEndTime:Y,secureConnectionStartTime:Y,ALPNNegotiatedProtocol:y?.ALPNNegotiatedProtocol}:{domainLookupStartTime:P(y.domainLookupStartTime),domainLookupEndTime:P(y.domainLookupEndTime),connectionStartTime:P(y.connectionStartTime),connectionEndTime:P(y.connectionEndTime),secureConnectionStartTime:P(y.secureConnectionStartTime),ALPNNegotiatedProtocol:y.ALPNNegotiatedProtocol}}o(AA,"clampAndCoarsenConnectionTimingInfo");function K(y){return P(I.now())}o(K,"coarsenedSharedCurrentTime");function tA(y){return{startTime:y.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:y.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}o(tA,"createOpaqueTimingInfo");function uA(){return{referrerPolicy:"strict-origin-when-cross-origin"}}o(uA,"makePolicyContainer");function X(y){return{referrerPolicy:y.referrerPolicy}}o(X,"clonePolicyContainer");function $(y){const Y=y.referrerPolicy;L(Y);let W=null;if(y.referrer==="client"){const H=n();if(!H||H.origin==="null")return"no-referrer";W=new URL(H)}else y.referrer instanceof URL&&(W=y.referrer);let j=V(W);const sA=V(W,!0);j.toString().length>4096&&(j=sA);const R=YA(y,j),O=q(j)&&!q(y.url);switch(Y){case"origin":return sA??V(W,!0);case"unsafe-url":return j;case"same-origin":return R?sA:"no-referrer";case"origin-when-cross-origin":return R?j:sA;case"strict-origin-when-cross-origin":{const H=D(y);return YA(j,H)?j:q(j)&&!q(H)?"no-referrer":sA}case"strict-origin":case"no-referrer-when-downgrade":default:return O?"no-referrer":sA}}o($,"determineRequestsReferrer");function V(y,Y){return L(y instanceof URL),y=new URL(y),y.protocol==="file:"||y.protocol==="about:"||y.protocol==="blank:"?"no-referrer":(y.username="",y.password="",y.hash="",Y&&(y.pathname="",y.search=""),y)}o(V,"stripURLForReferrer");function q(y){if(!(y instanceof URL))return!1;if(y.href==="about:blank"||y.href==="about:srcdoc"||y.protocol==="data:"||y.protocol==="file:")return!0;return Y(y.origin);function Y(W){if(W==null||W==="null")return!1;const j=new URL(W);return!!(j.protocol==="https:"||j.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(j.hostname)||j.hostname==="localhost"||j.hostname.includes("localhost.")||j.hostname.endsWith(".localhost"))}}o(q,"isURLPotentiallyTrustworthy");function z(y,Y){if(k===void 0)return!0;const W=QA(Y);if(W==="no metadata"||W.length===0)return!0;const j=CA(W),sA=IA(W,j);for(const R of sA){const O=R.algo,H=R.hash;let J=k.createHash(O).update(y).digest("base64");if(J[J.length-1]==="="&&(J[J.length-2]==="="?J=J.slice(0,-2):J=J.slice(0,-1)),nA(J,H))return!0}return!1}o(z,"bytesMatch");const rA=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function QA(y){const Y=[];let W=!0;for(const j of y.split(" ")){W=!1;const sA=rA.exec(j);if(sA===null||sA.groups===void 0||sA.groups.algo===void 0)continue;const R=sA.groups.algo.toLowerCase();S.includes(R)&&Y.push(sA.groups)}return W===!0?"no metadata":Y}o(QA,"parseMetadata");function CA(y){let Y=y[0].algo;if(Y[3]==="5")return Y;for(let W=1;W<y.length;++W){const j=y[W];if(j.algo[3]==="5"){Y="sha512";break}else{if(Y[3]==="3")continue;j.algo[3]==="3"&&(Y="sha384")}}return Y}o(CA,"getStrongestMetadata");function IA(y,Y){if(y.length===1)return y;let W=0;for(let j=0;j<y.length;++j)y[j].algo===Y&&(y[W++]=y[j]);return y.length=W,y}o(IA,"filterMetadataListByAlgorithm");function nA(y,Y){if(y.length!==Y.length)return!1;for(let W=0;W<y.length;++W)if(y[W]!==Y[W]){if(y[W]==="+"&&Y[W]==="-"||y[W]==="/"&&Y[W]==="_")continue;return!1}return!0}o(nA,"compareBase64Mixed");function eA(y){}o(eA,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function YA(y,Y){retur
Line truncated
|
||||
`);function l(g){for(let d=0;d<g.length;++d)if(g.charCodeAt(d)&-128)return!1;return!0}o(l,"isAsciiString");function S(g){const d=g.length;if(d<27||d>70)return!1;for(let F=0;F<d;++F){const N=g.charCodeAt(F);if(!(N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||N===39||N===45||N===95))return!1}return!0}o(S,"validateBoundary");function k(g,d="utf-8",F=!1){return F?g=e(g):(C(A(g)),g=g.replace(/\r\n?|\r?\n/g,`\r
|
||||
`)),C(Buffer.isEncoding(d)),g=g.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Buffer.from(g,d)}o(k,"escapeFormDataName");function w(g,d){C(d!=="failure"&&d.essence==="multipart/form-data");const F=d.parameters.get("boundary");if(F===void 0)return"failure";const N=Buffer.from(`--${F}`,"utf8"),u=[],b={position:0};for(g[0]===13&&g[1]===10&&(b.position+=2);;){if(g.subarray(b.position,b.position+N.length).equals(N))b.position+=N.length;else return"failure";if(b.position===g.length-2&&G(g,L,b)||b.position===g.length-4&&G(g,c,b))return u;if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;const m=U(g,b);if(m==="failure")return"failure";let{name:T,filename:v,contentType:Z,encoding:P}=m;b.position+=2;let AA;{const tA=g.indexOf(N.subarray(2),b.position);if(tA===-1)return"failure";AA=g.subarray(b.position,tA-4),b.position+=AA.length,P==="base64"&&(AA=Buffer.from(AA.toString(),"base64"))}if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;let K;v!==null?(Z??(Z="text/plain"),l(Z)||(Z=""),K=new a([AA],v,{type:Z})):K=s(Buffer.from(AA)),C(A(T)),C(typeof K=="string"&&A(K)||i(K)),u.push(Q(T,K,v))}}o(w,"multipartFormDataParser");function U(g,d){let F=null,N=null,u=null,b=null;for(;;){if(g[d.position]===13&&g[d.position+1]===10)return F===null?"failure":{name:F,filename:N,contentType:u,encoding:b};let m=B(T=>T!==10&&T!==13&&T!==58,g,d);if(m=D(m,!0,!0,T=>T===9||T===32),!r.test(m.toString())||g[d.position]!==58)return"failure";switch(d.position++,B(T=>T===32||T===9,g,d),t(m)){case"content-disposition":{if(F=N=null,!G(g,f,d)||(d.position+=17,F=M(g,d),F===null))return"failure";if(G(g,h,d)){let T=d.position+h.length;if(g[T]===42&&(d.position+=1,T+=1),g[T]!==61||g[T+1]!==34||(d.position+=12,N=M(g,d),N===null))return"failure"}break}case"content-type":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),u=n(T);break}case"content-transfer-encoding":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),b=n(T);break}default:B(T=>T!==10&&T!==13,g,d)}if(g[d.position]!==13&&g[d.position+1]!==10)return"failure";d.position+=2}}o(U,"parseMultipartFormDataHeaders");function M(g,d){C(g[d.position-1]===34);let F=B(N=>N!==10&&N!==13&&N!==34,g,d);return g[d.position]!==34?null:(d.position++,F=new TextDecoder().decode(F).replace(/%0A/ig,`
|
||||
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),F)}o(M,"parseMultipartFormDataName");function B(g,d,F){let N=F.position;for(;N<d.length&&g(d[N]);)++N;return d.subarray(F.position,F.position=N)}o(B,"collectASequenceOfBytes");function D(g,d,F,N){let u=0,b=g.length-1;if(d)for(;u<g.length&&N(g[u]);)u++;if(F)for(;b>0&&N(g[b]);)b--;return u===0&&b===g.length-1?g:g.subarray(u,b+1)}o(D,"removeChars");function G(g,d,F){if(g.length<d.length)return!1;for(let N=0;N<d.length;N++)if(d[N]!==g[F.position+N])return!1;return!0}return o(G,"bufferStartsWith"),Rn={multipartFormDataParser:w,validateBoundary:S,escapeFormDataName:k},Rn}o(HC,"requireFormdataParser");var wn,hQ;function ns(){if(hQ)return wn;hQ=1;const e=aA,{ReadableStreamFrom:A,isBlobLike:t,isReadableStreamLike:s,readableStreamClose:r,createDeferredPromise:n,fullyReadBody:i,extractMimeType:E,utf8DecodeBytes:Q}=Ee(),{FormData:C}=ss(),{kState:I}=Te(),{webidl:a}=vA(),{Blob:f}=de,h=RA,{isErrored:L}=aA,{isArrayBuffer:c}=Mi,{serializeAMimeType:l}=_A(),{multipartFormDataParser:S}=HC(),k=new TextEncoder;function w(u,b=!1){let m=null;u instanceof ReadableStream?m=u:t(u)?m=u.stream():m=new ReadableStream({async pull(K){const tA=typeof v=="string"?k.encode(v):v;tA.byteLength&&K.enqueue(tA),queueMicrotask(()=>r(K))},start(){},type:"bytes"}),h(s(m));let T=null,v=null,Z=null,P=null;if(typeof u=="string")v=u,P="text/plain;charset=UTF-8";else if(u instanceof URLSearchParams)v=u.toString(),P="application/x-www-form-urlencoded;charset=UTF-8";else if(c(u))v=new Uint8Array(u.slice());else if(ArrayBuffer.isView(u))v=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength));else if(e.isFormDataLike(u)){const K=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`,tA=`--${K}\r
|
||||
Content-Disposition: form-data`;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const uA=o(rA=>rA.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),X=o(rA=>rA.replace(/\r?\n|\r/g,`\r
|
||||
`),"normalizeLinefeeds"),$=[],V=new Uint8Array([13,10]);Z=0;let q=!1;for(const[rA,QA]of u)if(typeof QA=="string"){const CA=k.encode(tA+`; name="${uA(X(rA))}"\r
|
||||
\r
|
||||
${X(QA)}\r
|
||||
`);$.push(CA),Z+=CA.byteLength}else{const CA=k.encode(`${tA}; name="${uA(X(rA))}"`+(QA.name?`; filename="${uA(QA.name)}"`:"")+`\r
|
||||
Content-Type: ${QA.type||"application/octet-stream"}\r
|
||||
\r
|
||||
`);$.push(CA,QA,V),typeof QA.size=="number"?Z+=CA.byteLength+QA.size+V.byteLength:q=!0}const z=k.encode(`--${K}--`);$.push(z),Z+=z.byteLength,q&&(Z=null),v=u,T=o(async function*(){for(const rA of $)rA.stream?yield*rA.stream():yield rA},"action"),P=`multipart/form-data; boundary=${K}`}else if(t(u))v=u,Z=u.size,u.type&&(P=u.type);else if(typeof u[Symbol.asyncIterator]=="function"){if(b)throw new TypeError("keepalive");if(e.isDisturbed(u)||u.locked)throw new TypeError("Response body object should not be disturbed or locked");m=u instanceof ReadableStream?u:A(u)}if((typeof v=="string"||e.isBuffer(v))&&(Z=Buffer.byteLength(v)),T!=null){let K;m=new ReadableStream({async start(){K=T(u)[Symbol.asyncIterator]()},async pull(tA){const{value:uA,done:X}=await K.next();if(X)queueMicrotask(()=>{tA.close(),tA.byobRequest?.respond(0)});else if(!L(m)){const $=new Uint8Array(uA);$.byteLength&&tA.enqueue($)}return tA.desiredSize>0},async cancel(tA){await K.return()},type:"bytes"})}return[{stream:m,source:v,length:Z},P]}o(w,"extractBody");function U(u,b=!1){return u instanceof ReadableStream&&(h(!e.isDisturbed(u),"The body has already been consumed."),h(!u.locked,"The stream is locked.")),w(u,b)}o(U,"safelyExtractBody");function M(u){const[b,m]=u.stream.tee();return u.stream=b,{stream:m,length:u.length,source:u.source}}o(M,"cloneBody");function B(u){if(u.aborted)throw new DOMException("The operation was aborted.","AbortError")}o(B,"throwIfAborted");function D(u){return{blob(){return g(this,m=>{let T=N(this);return T===null?T="":T&&(T=l(T)),new f([m],{type:T})},u)},arrayBuffer(){return g(this,m=>new Uint8Array(m).buffer,u)},text(){return g(this,Q,u)},json(){return g(this,F,u)},formData(){return g(this,m=>{const T=N(this);if(T!==null)switch(T.essence){case"multipart/form-data":{const v=S(m,T);if(v==="failure")throw new TypeError("Failed to parse body as FormData.");const Z=new C;return Z[I]=v,Z}case"application/x-www-form-urlencoded":{const v=new URLSearchParams(m.toString()),Z=new C;for(const[P,AA]of v)Z.append(P,AA);return Z}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},u)}}}o(D,"bodyMixinMethods");function G(u){Object.assign(u.prototype,D(u))}o(G,"mixinBody");async function g(u,b,m){if(a.brandCheck(u,m),B(u[I]),d(u[I].body))throw new TypeError("Body is unusable");const T=n(),v=o(P=>T.reject(P),"errorSteps"),Z=o(P=>{try{T.resolve(b(P))}catch(AA){v(AA)}},"successSteps");return u[I].body==null?(Z(new Uint8Array),T.promise):(await i(u[I].body,Z,v),T.promise)}o(g,"consumeBody");function d(u){return u!=null&&(u.stream.locked||e.isDisturbed(u.stream))}o(d,"bodyUnusable");function F(u){return JSON.parse(Q(u))}o(F,"parseJSONFromBytes");function N(u){const b=u[I].headersList,m=E(b);return m==="failure"?null:m}return o(N,"bodyMimeType"),wn={extractBody:w,safelyExtractBody:U,cloneBody:M,mixinBody:G},wn}o(ns,"requireBody");const iA=RA,EA=aA,{channels:lQ}=Vt,kn=JC,{RequestContentLengthMismatchError:At,ResponseContentLengthMismatchError:VC,RequestAbortedError:uQ,HeadersTimeoutError:vC,HeadersOverflowError:xC,SocketError:os,InformationalError:ut,BodyTimeoutError:WC,HTTPParserError:qC,ResponseExceededMaxSizeError:OC}=kA,{kUrl:dQ,kReset:ZA,kClient:Nn,kParser:FA,kBlocking:xt,kRunning:xA,kPending:PC,kSize:fQ,kWriting:He,kQueue:ge,kNoRef:Wt,kKeepAliveDefaultTimeout:ZC,kHostHeader:XC,kPendingIdx:KC,kRunningIdx:se,kError:ne,kPipelining:is,kSocket:dt,kKeepAliveTimeoutValue:Qs,kMaxHeadersSize:Fn,kKeepAliveMaxTimeout:zC,kKeepAliveTimeoutThreshold:jC,kHeadersTimeout:$C,kBodyTimeout:_C,kStrictContentLength:pn,kMaxRequests:DQ,kCounter:AI,kMaxResponseSize:eI,kOnError:tI,kResume:Ve,kHTTPContext:yQ}=LA,De=rQ,rI=Buffer.alloc(0),Es=Buffer[Symbol.species],gs=EA.addListener,sI=EA.removeAllListeners;let Sn;async function nI(){const e=process.env.JEST_WORKER_ID?nQ():void 0;let A;try{A=await WebAssembly.compile(TC())}catch{A=await WebAssembly.compile(e||nQ())}return await WebAssembly.instantiate(A,{env:{wasm_on_url:(t,s,r)=>0,wasm_on_status:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onStatus(new Es(ye.buffer,n,r))||0},wasm_on_message_begin:t=>(iA.strictEqual(GA.ptr,t),GA.onMessageBegin()||0),wasm_on_header_field:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onHeaderField(new Es(ye.buffer,n,r))||0},wasm_on_header_value:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onHeaderValue(new Es(ye.buffer,n,r))||0},wasm_on_headers_complete:(t,s,r,n)=>(iA.strictEqual(GA.ptr,t),GA.onHeadersComplete(s,!!r,!!n)||0),wasm_on_body:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onBody(new Es(ye.buffer,n,r))||0},wasm_on_message_complete:t=>(iA.strictEqual(GA.ptr,t),GA.onMessageComplete()||0)}})}o(nI,"lazyllhttp");let Un=null,bn=nI();bn.catch();let GA=null,ye=null,Bs=0,Re=null;const ft=1,Cs=2,mn=3,ai=class ai{constructor(A,t,{exports:s}){iA(Number.isFinite(A[Fn])&&A[Fn]>0),this.llhttp=s,this.ptr=this.llhttp.llhttp
Line truncated
|
||||
`;if(typeof r=="string"?c+=`host: ${r}\r
|
||||
`:c+=e[XC],n?c+=`connection: upgrade\r
|
||||
upgrade: ${n}\r
|
||||
`:e[is]&&!h[ZA]?c+=`connection: keep-alive\r
|
||||
`:c+=`connection: close\r
|
||||
`,Array.isArray(C))for(let l=0;l<C.length;l+=2){const S=C[l+0],k=C[l+1];if(Array.isArray(k))for(let w=0;w<k.length;w++)c+=`${S}: ${k[w]}\r
|
||||
`;else c+=`${S}: ${k}\r
|
||||
`}return lQ.sendHeaders.hasSubscribers&&lQ.sendHeaders.publish({request:A,headers:c,socket:h}),!Q||f===0?RQ({abort:L,body:null,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isBuffer(Q)?RQ({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isBlobLike(Q)?typeof Q.stream=="function"?wQ({abort:L,body:Q.stream(),client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):CI({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isStream(Q)?BI({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isIterable(Q)?wQ({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):iA(!1),!0}o(gI,"writeH1");function BI({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){iA(n!==0||t[xA]===0,"stream body cannot be pipelined");let Q=!1;const C=new Is({abort:e,socket:r,request:s,contentLength:n,client:t,expectsPayload:E,header:i}),I=o(function(L){if(!Q)try{!C.write(L)&&this.pause&&this.pause()}catch(c){EA.destroy(this,c)}},"onData"),a=o(function(){Q||A.resume&&A.resume()},"onDrain"),f=o(function(){if(queueMicrotask(()=>{A.removeListener("error",h)}),!Q){const L=new uQ;queueMicrotask(()=>h(L))}},"onClose"),h=o(function(L){if(!Q){if(Q=!0,iA(r.destroyed||r[He]&&t[xA]<=1),r.off("drain",a).off("error",h),A.removeListener("data",I).removeListener("end",h).removeListener("close",f),!L)try{C.end()}catch(c){L=c}C.destroy(L),L&&(L.code!=="UND_ERR_INFO"||L.message!=="reset")?EA.destroy(A,L):EA.destroy(A)}},"onFinished");A.on("data",I).on("end",h).on("error",h).on("close",f),A.resume&&A.resume(),r.on("drain",a).on("error",h),A.errorEmitted??A.errored?setImmediate(()=>h(A.errored)):(A.endEmitted??A.readableEnded)&&setImmediate(()=>h(null)),(A.closeEmitted??A.closed)&&setImmediate(f)}o(BI,"writeStream$1");async function RQ({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){try{A?EA.isBuffer(A)&&(iA(n===A.byteLength,"buffer body must have content length"),r.cork(),r.write(`${i}content-length: ${n}\r
|
||||
\r
|
||||
`,"latin1"),r.write(A),r.uncork(),s.onBodySent(A),E||(r[ZA]=!0)):n===0?r.write(`${i}content-length: 0\r
|
||||
\r
|
||||
`,"latin1"):(iA(n===null,"no body must not have content length"),r.write(`${i}\r
|
||||
`,"latin1")),s.onRequestSent(),t[Ve]()}catch(Q){e(Q)}}o(RQ,"writeBuffer");async function CI({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){iA(n===A.size,"blob body must have content length");try{if(n!=null&&n!==A.size)throw new At;const Q=Buffer.from(await A.arrayBuffer());r.cork(),r.write(`${i}content-length: ${n}\r
|
||||
\r
|
||||
`,"latin1"),r.write(Q),r.uncork(),s.onBodySent(Q),s.onRequestSent(),E||(r[ZA]=!0),t[Ve]()}catch(Q){e(Q)}}o(CI,"writeBlob$1");async function wQ({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){iA(n!==0||t[xA]===0,"iterator body cannot be pipelined");let Q=null;function C(){if(Q){const f=Q;Q=null,f()}}o(C,"onDrain");const I=o(()=>new Promise((f,h)=>{iA(Q===null),r[ne]?h(r[ne]):Q=f}),"waitForDrain");r.on("close",C).on("drain",C);const a=new Is({abort:e,socket:r,request:s,contentLength:n,client:t,expectsPayload:E,header:i});try{for await(const f of A){if(r[ne])throw r[ne];a.write(f)||await I()}a.end()}catch(f){a.destroy(f)}finally{r.off("close",C).off("drain",C)}}o(wQ,"writeIterable$1");const ci=class ci{constructor({abort:A,socket:t,request:s,contentLength:r,client:n,expectsPayload:i,header:E}){this.socket=t,this.request=s,this.contentLength=r,this.client=n,this.bytesWritten=0,this.expectsPayload=i,this.header=E,this.abort=A,t[He]=!0}write(A){const{socket:t,request:s,contentLength:r,client:n,bytesWritten:i,expectsPayload:E,header:Q}=this;if(t[ne])throw t[ne];if(t.destroyed)return!1;const C=Buffer.byteLength(A);if(!C)return!0;if(r!==null&&i+C>r){if(n[pn])throw new At;process.emitWarning(new At)}t.cork(),i===0&&(E||(t[ZA]=!0),r===null?t.write(`${Q}transfer-encoding: chunked\r
|
||||
`,"latin1"):t.write(`${Q}content-length: ${r}\r
|
||||
\r
|
||||
`,"latin1")),r===null&&t.write(`\r
|
||||
${C.toString(16)}\r
|
||||
`,"latin1"),this.bytesWritten+=C;const I=t.write(A);return t.uncork(),s.onBodySent(A),I||t[FA].timeout&&t[FA].timeoutType===ft&&t[FA].timeout.refresh&&t[FA].timeout.refresh(),I}end(){const{socket:A,contentLength:t,client:s,bytesWritten:r,expectsPayload:n,header:i,request:E}=this;if(E.onRequestSent(),A[He]=!1,A[ne])throw A[ne];if(!A.destroyed){if(r===0?n?A.write(`${i}content-length: 0\r
|
||||
\r
|
||||
`,"latin1"):A.write(`${i}\r
|
||||
`,"latin1"):t===null&&A.write(`\r
|
||||
0\r
|
||||
\r
|
||||
`,"latin1"),t!==null&&r!==t){if(s[pn])throw new At;process.emitWarning(new At)}A[FA].timeout&&A[FA].timeoutType===ft&&A[FA].timeout.refresh&&A[FA].timeout.refresh(),s[Ve]()}}destroy(A){const{socket:t,client:s,abort:r}=this;t[He]=!1,A&&(iA(s[xA]<=1,"pipeline should only contain this request"),r(A))}};o(ci,"AsyncWriter");let Is=ci;var II=iI;const Be=RA,{pipeline:aI}=ue,cA=aA,{RequestContentLengthMismatchError:Mn,RequestAbortedError:kQ,SocketError:Yn,InformationalError:as}=kA,{kUrl:Jn,kReset:cI,kClient:Dt,kRunning:Gn,kPending:hI,kQueue:lI,kPendingIdx:uI,kRunningIdx:NQ,kError:be,kSocket:XA,kStrictContentLength:dI,kOnError:cs,kMaxConcurrentStreams:fI,kHTTP2Session:ve,kResume:FQ}=LA,KA=Symbol("open streams");let pQ=!1,hs;try{hs=require("node:http2")}catch{hs={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY:DI,HTTP2_HEADER_METHOD:yI,HTTP2_HEADER_PATH:RI,HTTP2_HEADER_SCHEME:wI,HTTP2_HEADER_CONTENT_LENGTH:kI,HTTP2_HEADER_EXPECT:NI,HTTP2_HEADER_STATUS:FI}}=hs;function pI(e){const A=[];for(const[t,s]of Object.entries(e))if(Array.isArray(s))for(const r of s)A.push(Buffer.from(t),Buffer.from(r));else A.push(Buffer.from(t),Buffer.from(s));return A}o(pI,"parseH2Headers");async function SI(e,A){e[XA]=A,pQ||(pQ=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));const t=hs.connect(e[Jn],{createConnection:()=>A,peerMaxConcurrentStreams:e[fI]});t[KA]=0,t[Dt]=e,t[XA]=A,cA.addListener(t,"error",UI),cA.addListener(t,"frameError",bI),cA.addListener(t,"end",mI),cA.addListener(t,"goaway",LI),cA.addListener(t,"close",function(){const{[Dt]:r}=this,n=this[XA][be]||new Yn("closed",cA.getSocketInfo(this));r[XA]=null,r[ve]=null,Be(r[hI]===0);const i=r[lI].splice(r[NQ]);for(let E=0;E<i.length;E++){const Q=i[E];cA.errorRequest(r,Q,n)}r[uI]=r[NQ],Be(r[Gn]===0),r.emit("disconnect",r[Jn],[r],n),r[FQ]()}),t.unref(),e[ve]=t,A[ve]=t,cA.addListener(A,"error",function(r){Be(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[be]=r,this[Dt][cs](r)}),cA.addListener(A,"end",function(){cA.destroy(this,new Yn("other side closed",cA.getSocketInfo(this)))});let s=!1;return A.on("close",()=>{s=!0}),{version:"h2",defaultPipelining:1/0,write(...r){YI(e,...r)},resume(){},destroy(r,n){t.destroy(r),s?queueMicrotask(n):A.destroy(r).on("close",n)},get destroyed(){return A.destroyed},busy(){return!1}}}o(SI,"connectH2$1");function UI(e){Be(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[XA][be]=e,this[Dt][cs](e)}o(UI,"onHttp2SessionError");function bI(e,A,t){if(t===0){const s=new as(`HTTP/2: "frameError" received - type ${e}, code ${A}`);this[XA][be]=s,this[Dt][cs](s)}}o(bI,"onHttp2FrameError");function mI(){const e=new Yn("other side closed",cA.getSocketInfo(this[XA]));this.destroy(e),cA.destroy(this[XA],e)}o(mI,"onHttp2SessionEnd");function LI(e){const A=new as(`HTTP/2: "GOAWAY" frame received with code ${e}`);this[XA][be]=A,this[Dt][cs](A),this.unref(),this.destroy(),cA.destroy(this[XA],A)}o(LI,"onHTTP2GoAway");function MI(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}o(MI,"shouldSendContentLength");function YI(e,A){const t=e[ve],{body:s,method:r,path:n,host:i,upgrade:E,expectContinue:Q,signal:C,headers:I}=A;if(E)return cA.errorRequest(e,A,new Error("Upgrade not supported for H2")),!1;if(A.aborted)return!1;const a={};for(let w=0;w<I.length;w+=2){const U=I[w+0],M=I[w+1];if(Array.isArray(M))for(let B=0;B<M.length;B++)a[U]?a[U]+=`,${M[B]}`:a[U]=M[B];else a[U]=M}let f;const{hostname:h,port:L}=e[Jn];a[DI]=i||`${h}${L?`:${L}`:""}`,a[yI]=r;try{A.onConnect(w=>{A.aborted||A.completed||(w=w||new kQ,f!=null&&(cA.destroy(f,w),t[KA]-=1,t[KA]===0&&t.unref()),cA.errorRequest(e,A,w))})}catch(w){cA.errorRequest(e,A,w)}if(r==="CONNECT")return t.ref(),f=t.request(a,{endStream:!1,signal:C}),f.id&&!f.pending?(A.onUpgrade(null,null,f),++t[KA]):f.once("ready",()=>{A.onUpgrade(null,null,f),++t[KA]}),f.once("close",()=>{t[KA]-=1,t[KA]===0&&t.unref()}),!0;a[RI]=n,a[wI]="https";const c=r==="PUT"||r==="POST"||r==="PATCH";s&&typeof s.read=="function"&&s.read(0);let l=cA.bodyLength(s);if(l==null&&(l=A.contentLength),(l===0||!c)&&(l=null),MI(r)&&l>0&&A.contentLength!=null&&A.contentLength!==l){if(e[dI])return cA.errorRequest(e,A,new Mn),!1;process.emitWarning(new Mn)}l!=null&&(Be(s,"no body must not have content length"),a[kI]=`${l}`),t.ref();const S=r==="GET"||r==="HEAD"||s===null;return Q?(a[NI]="100-continue",f=t.request(a,{endStream:S,signal:C}),f.once("continue",k)):(f=t.request(a,{endStream:S,signal:C}),k()),++t[KA],f.once("response",w=>{const{[FI]:U,...M}=w;if(A.onResponseStarted(),A.aborted||A.completed){const B=new kQ;cA.errorRequest(e,A,B),cA.destroy(f,B);return}A.onHeaders(Number(U),pI(M),f.resume.bind(f),"")===!1&&f.pause(),f.on("data",B=>{A.onData(B)===!1&&f.pause()})}),f.once("end",()=>{if(f.state?.state==null||f.state.state<6){A.onComplete([]);return}t[KA]-=1,t[KA]===0&&t.unref();const w=new as("HTTP/2: stream half-closed (remote)");cA.errorRequest(e,A,w),cA.destroy(f,w)}),f.once("close",()=>{
Line truncated
|
||||
`,this[ga]=Q??3e5,this[Ea]=r??3e5,this[Ba]=k??!0,this[Ca]=U,this[Vn]=B,this[Oe]=null,this[la]=G>-1?G:-1,this[da]=F??100,this[UA]=null,this[Ce]=[],this[Le]=0,this[Ie]=0,this[zt]=u=>vn(this,u),this[ua]=u=>TQ(this,u)}get pipelining(){return this[us]}set pipelining(A){this[us]=A,this[zt](!0)}get[Pt](){return this[Ce].length-this[Ie]}get[Ot](){return this[Ie]-this[Le]}get[Zt](){return this[Ce].length-this[Le]}get[ta](){return!!this[UA]&&!this[Rt]&&!this[UA].destroyed}get[Hn](){return!!(this[UA]?.busy(null)||this[Zt]>=(GQ(this)||1)||this[Pt]>0)}[ea](A){HQ(this),this.once("connect",A)}[ha](A,t){const s=A.origin||this[ke].origin,r=new KI(s,A,t);return this[Ce].push(r),this[et]||(xe.bodyLength(r.body)==null&&xe.isIterable(r.body)?(this[et]=1,queueMicrotask(()=>vn(this))):this[zt](!0)),this[et]&&this[qe]!==2&&this[Hn]&&(this[qe]=2),this[qe]<2}async[aa](){return new Promise(A=>{this[Zt]?this[Oe]=A:A(null)})}async[ca](A){return new Promise(t=>{const s=this[Ce].splice(this[Ie]);for(let n=0;n<s.length;n++){const i=s[n];xe.errorRequest(this,i,A)}const r=o(()=>{this[Oe]&&(this[Oe](),this[Oe]=null),t(null)},"callback");this[UA]?(this[UA].destroy(A,r),this[UA]=null):queueMicrotask(r),this[zt]()})}},o(Lr,"Client"),Lr);const Ra=mQ;function TQ(e,A){if(e[Ot]===0&&A.code!=="UND_ERR_INFO"&&A.code!=="UND_ERR_SOCKET"){me(e[Ie]===e[Le]);const t=e[Ce].splice(e[Le]);for(let s=0;s<t.length;s++){const r=t[s];xe.errorRequest(e,r,A)}me(e[Zt]===0)}}o(TQ,"onError");async function HQ(e){me(!e[Rt]),me(!e[UA]);let{host:A,hostname:t,protocol:s,port:r}=e[ke];if(t[0]==="["){const n=t.indexOf("]");me(n!==-1);const i=t.substring(1,n);me(LQ.isIP(i)),t=i}e[Rt]=!0,yt.beforeConnect.hasSubscribers&&yt.beforeConnect.publish({connectParams:{host:A,hostname:t,protocol:s,port:r,version:e[UA]?.version,servername:e[We],localAddress:e[Kt]},connector:e[Xt]});try{const n=await new Promise((i,E)=>{e[Xt]({host:A,hostname:t,protocol:s,port:r,servername:e[We],localAddress:e[Kt]},(Q,C)=>{Q?E(Q):i(C)})});if(e.destroyed){xe.destroy(n.on("error",()=>{}),new $I);return}me(n);try{e[UA]=n.alpnProtocol==="h2"?await Da(e,n):await fa(e,n)}catch(i){throw n.destroy().on("error",()=>{}),i}e[Rt]=!1,n[Ia]=0,n[Vn]=e[Vn],n[Aa]=e,n[sa]=null,yt.connected.hasSubscribers&&yt.connected.publish({connectParams:{host:A,hostname:t,protocol:s,port:r,version:e[UA]?.version,servername:e[We],localAddress:e[Kt]},connector:e[Xt],socket:n}),e.emit("connect",e[ke],[e])}catch(n){if(e.destroyed)return;if(e[Rt]=!1,yt.connectError.hasSubscribers&&yt.connectError.publish({connectParams:{host:A,hostname:t,protocol:s,port:r,version:e[UA]?.version,servername:e[We],localAddress:e[Kt]},connector:e[Xt],error:n}),n.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(me(e[Ot]===0);e[Pt]>0&&e[Ce][e[Ie]].servername===e[We];){const i=e[Ce][e[Ie]++];xe.errorRequest(e,i,n)}else TQ(e,n);e.emit("connectionError",e[ke],[e],n)}e[zt]()}o(HQ,"connect$1");function VQ(e){e[qe]=0,e.emit("drain",e[ke],[e])}o(VQ,"emitDrain");function vn(e,A){e[et]!==2&&(e[et]=2,wa(e,A),e[et]=0,e[Le]>256&&(e[Ce].splice(0,e[Le]),e[Ie]-=e[Le],e[Le]=0))}o(vn,"resume");function wa(e,A){for(;;){if(e.destroyed){me(e[Pt]===0);return}if(e[Oe]&&!e[Zt]){e[Oe](),e[Oe]=null;return}if(e[UA]&&e[UA].resume(),e[Hn])e[qe]=2;else if(e[qe]===2){A?(e[qe]=1,queueMicrotask(()=>VQ(e))):VQ(e);continue}if(e[Pt]===0||e[Ot]>=(GQ(e)||1))return;const t=e[Ce][e[Ie]];if(e[ke].protocol==="https:"&&e[We]!==t.servername){if(e[Ot]>0)return;e[We]=t.servername,e[UA]?.destroy(new jI("servername changed"),()=>{e[UA]=null,vn(e)})}if(e[Rt])return;if(!e[UA]){HQ(e);return}if(e[UA].destroyed||e[UA].busy(t))return;!t.aborted&&e[UA].write(t)?e[Ie]++:e[Ce].splice(e[Ie],1)}}o(wa,"_resume");var xn=ya;const vQ=2048,Wn=vQ-1,li=class li{constructor(){this.bottom=0,this.top=0,this.list=new Array(vQ),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&Wn)===this.bottom}push(A){this.list[this.top]=A,this.top=this.top+1&Wn}shift(){const A=this.list[this.bottom];return A===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&Wn,A)}};o(li,"FixedCircularBuffer");let ds=li;var ka=(Mr=class{constructor(){this.head=this.tail=new ds}isEmpty(){return this.head.isEmpty()}push(A){this.head.isFull()&&(this.head=this.head.next=new ds),this.head.push(A)}shift(){const A=this.tail,t=A.shift();return A.isEmpty()&&A.next!==null&&(this.tail=A.next),t}},o(Mr,"FixedQueue"),Mr);const{kFree:Na,kConnected:Fa,kPending:pa,kQueued:Sa,kRunning:Ua,kSize:ba}=LA,tt=Symbol("pool");let ma=(Yr=class{constructor(A){this[tt]=A}get connected(){return this[tt][Fa]}get free(){return this[tt][Na]}get pending(){return this[tt][pa]}get queued(){return this[tt][Sa]}get running(){return this[tt][Ua]}get size(){return this[tt][ba]}},o(Yr,"PoolStats"),Yr);var La=ma;const Ma=As,Ya=ka,{kConnected:qn,kSize:xQ,kRunning:WQ,kPending:qQ,kQueued:jt,kBusy:Ja,kFree:Ga,kUrl:Ta,kClose:Ha,kDestroy:Va,kDispatch:va}=LA,xa=La,zA=Symbol("clients"),qA=Symbol("needDrain"),$t=Symbol("queue"),On=Symbol("closed resolve"),Pn=Symbol
Line truncated
|
||||
${l}`;break;case"retry":A(l)&&(h[c]=l);break;case"id":t(l)&&(h[c]=l);break;case"event":l.length>0&&(h[c]=l);break}}processEvent(f){f.retry&&A(f.retry)&&(this.state.reconnectionTime=parseInt(f.retry,10)),f.id&&t(f.id)&&(this.state.lastEventId=f.id),f.data!==void 0&&this.push({type:f.event||"message",options:{data:f.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};o(C,"EventSourceStream");let Q=C;return si={EventSourceStream:Q},si}o(Bl,"requireEventsourceStream");var ni,xg;function Cl(){var U,M,B,D,G,g,d,F,ii,u,Qi;if(xg)return ni;xg=1;const{pipeline:e}=ue,{fetching:A}=Ms(),{makeRequest:t}=rr(),{getGlobalOrigin:s}=lt(),{webidl:r}=vA(),{EventSourceStream:n}=Bl(),{parseMIMEType:i}=_A(),{MessageEvent:E}=Ys(),{isNetworkError:Q}=Ls(),{delay:C}=Vg(),{kEnumerableProperty:I}=aA;let a=!1;const f=3e3,h=0,L=1,c=2,l="anonymous",S="use-credentials",m=class m extends EventTarget{constructor(Z,P={}){super();hA(this,F);hA(this,u);hA(this,U,{open:null,error:null,message:null});hA(this,M,null);hA(this,B,!1);hA(this,D,h);hA(this,G,null);hA(this,g,null);hA(this,d,null);r.argumentLengthCheck(arguments,1,{header:"EventSource constructor"}),a||(a=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),Z=r.converters.USVString(Z),P=r.converters.EventSourceInitDict(P),BA(this,d,{origin:s(),policyContainer:{referrerPolicy:"no-referrer"},lastEventId:"",reconnectionTime:f});let AA;try{AA=new URL(Z,p(this,d).origin),p(this,d).origin=AA.origin}catch(uA){throw new DOMException(uA,"SyntaxError")}BA(this,M,AA.href);let K=l;P.withCredentials&&(K=S,BA(this,B,!0));const tA={redirect:"follow",keepalive:!0,mode:"cors",credentials:K==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};tA.client=p(this,d),tA.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],tA.cache="no-store",tA.initiator="other",tA.urlList=[new URL(p(this,M))],BA(this,G,t(tA)),HA(this,F,ii).call(this)}get readyState(){return p(this,D)}get url(){return p(this,M)}get withCredentials(){return p(this,B)}close(){r.brandCheck(this,m),p(this,D)!==c&&(BA(this,D,c),clearTimeout(p(this,d).reconnectionTimer),p(this,g).abort(),p(this,G)&&BA(this,G,null))}get onopen(){return p(this,U).open}set onopen(Z){p(this,U).open&&this.removeEventListener("open",p(this,U).open),typeof Z=="function"?(p(this,U).open=Z,this.addEventListener("open",Z)):p(this,U).open=null}get onmessage(){return p(this,U).message}set onmessage(Z){p(this,U).message&&this.removeEventListener("message",p(this,U).message),typeof Z=="function"?(p(this,U).message=Z,this.addEventListener("message",Z)):p(this,U).message=null}get onerror(){return p(this,U).error}set onerror(Z){p(this,U).error&&this.removeEventListener("error",p(this,U).error),typeof Z=="function"?(p(this,U).error=Z,this.addEventListener("error",Z)):p(this,U).error=null}};U=new WeakMap,M=new WeakMap,B=new WeakMap,D=new WeakMap,G=new WeakMap,g=new WeakMap,d=new WeakMap,F=new WeakSet,ii=o(function(){if(p(this,D)===c)return;BA(this,D,h);const Z={request:p(this,G)},P=o(AA=>{Q(AA)&&(this.dispatchEvent(new Event("error")),this.close()),HA(this,u,Qi).call(this)},"processEventSourceEndOfBody");Z.processResponseEndOfBody=P,Z.processResponse=AA=>{if(Q(AA))if(AA.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{HA(this,u,Qi).call(this);return}const K=AA.headersList.get("content-type",!0),tA=K!==null?i(K):"failure",uA=tA!=="failure"&&tA.essence==="text/event-stream";if(AA.status!==200||uA===!1){this.close(),this.dispatchEvent(new Event("error"));return}BA(this,D,L),this.dispatchEvent(new Event("open")),p(this,d).origin=AA.urlList[AA.urlList.length-1].origin;const X=new n({eventSourceSettings:p(this,d),push:$=>{this.dispatchEvent(new E($.type,$.options))}});e(AA.body.stream,X,$=>{$?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},BA(this,g,A(Z))},"#connect"),u=new WeakSet,Qi=o(async function(){p(this,D)!==c&&(BA(this,D,h),this.dispatchEvent(new Event("error")),await C(p(this,d).reconnectionTime),p(this,D)===h&&(p(this,d).lastEventId!==""&&p(this,G).headersList.set("last-event-id",p(this,d).lastEventId,!0),HA(this,F,ii).call(this)))},"#reconnect"),o(m,"EventSource");let k=m;const w={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:L,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:c,writable:!1}};return Object.defineProperties(k,w),Object.defineProperties(k.prototype,w),Object.defineProperties(k.prototype,{close:I,onerror:I,onmessage:I,onopen:I,readyState:I,url:I,withCredentials:I}),r.converters.EventSourceInitDict=r.dictionaryConverter([{key:"withCredentials",converter:r.converters.boolean,defaultValue:!1}]),ni={EventSource:k,defaultReconnectionTime:f},ni}o(Cl,"requireEventsource");const Il=_i,al=Ao,cl=Nc,hl=kA,Gs=aA,{InvalidArgumentError:Ts}=hl,bt=wt,{getGloba
Line truncated
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
"use strict";var l=Object.defineProperty;var o=(e,t)=>l(e,"name",{value:t,configurable:!0});var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(getDefaultExportFromCjs,"getDefaultExportFromCjs"),exports.commonjsGlobal=commonjsGlobal,exports.getDefaultExportFromCjs=getDefaultExportFromCjs;
|
||||
Generated
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
"use strict";var Dt=Object.defineProperty;var Ft=(e,A,t)=>A in e?Dt(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var o=(e,A)=>Dt(e,"name",{value:A,configurable:!0});var NA=(e,A,t)=>(Ft(e,typeof A!="symbol"?A+"":A,t),t),ze=(e,A,t)=>{if(!A.has(e))throw TypeError("Cannot "+t)},yt=(e,A)=>{if(Object(A)!==A)throw TypeError('Cannot use the "in" operator on this value');return e.has(A)},p=(e,A,t)=>(ze(e,A,"read from private field"),t?t.call(e):A.get(e)),CA=(e,A,t)=>{if(A.has(e))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(e):A.set(e,t)},EA=(e,A,t,n)=>(ze(e,A,"write to private field"),n?n.call(e,t):A.set(e,t),t);var kA=(e,A,t)=>(ze(e,A,"access private method"),t);var ne,se,oe,ie,Qe,Ee,ge,Be,Ce,Ie,ae,ce,he,le,ue,de,fe,De,ye,Re,we,ke,_A,Ne,Fe,pe,Se,Ue,be,me,Le,Me,Ye,Je,Oe,Rt,Ge,Ae,Te;const require$$0=require("node:assert"),require$$4=require("node:net"),http$1=require("node:http"),Stream=require("node:stream"),require$$6=require("node:buffer"),require$$0$1=require("node:util"),require$$8=require("node:querystring"),require$$0$2=require("node:diagnostics_channel"),require$$0$3=require("node:events"),_commonjsHelpers=require("./node-fetch-native-with-agent.61758d11.cjs"),require$$4$1=require("node:tls"),zlib=require("node:zlib"),require$$5=require("node:perf_hooks"),require$$8$1=require("node:util/types"),require$$0$4=require("node:os"),require$$1=require("node:url"),require$$5$1=require("node:async_hooks");require("node:console");const require$$5$2=require("string_decoder"),require$$2=require("node:worker_threads");function _interopDefaultCompat(e){return e&&typeof e=="object"&&"default"in e?e.default:e}o(_interopDefaultCompat,"_interopDefaultCompat");const require$$0__default=_interopDefaultCompat(require$$0),require$$4__default=_interopDefaultCompat(require$$4),http__default=_interopDefaultCompat(http$1),Stream__default=_interopDefaultCompat(Stream),require$$6__default=_interopDefaultCompat(require$$6),require$$0__default$1=_interopDefaultCompat(require$$0$1),require$$8__default=_interopDefaultCompat(require$$8),require$$0__default$2=_interopDefaultCompat(require$$0$2),require$$0__default$3=_interopDefaultCompat(require$$0$3),require$$4__default$1=_interopDefaultCompat(require$$4$1),zlib__default=_interopDefaultCompat(zlib),require$$5__default=_interopDefaultCompat(require$$5),require$$8__default$1=_interopDefaultCompat(require$$8$1),require$$0__default$4=_interopDefaultCompat(require$$0$4),require$$1__default=_interopDefaultCompat(require$$1),require$$5__default$1=_interopDefaultCompat(require$$5$1),require$$5__default$2=_interopDefaultCompat(require$$5$2),require$$2__default=_interopDefaultCompat(require$$2);var symbols$4={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams")};let UndiciError$1=(ne=class extends Error{constructor(A){super(A),this.name="UndiciError",this.code="UND_ERR"}},o(ne,"UndiciErrorLine truncated
|
||||
`))}o(N,"isValidHeaderValue");function u(y,Y){const{headersList:W}=Y,j=(W.get("referrer-policy",!0)??"").split(",");let nA="";if(j.length>0)for(let R=j.length;R!==0;R--){const O=j[R-1].trim();if(n.has(O)){nA=O;break}}nA!==""&&(y.referrerPolicy=nA)}o(u,"setRequestReferrerPolicyOnRedirect");function b(){return"allowed"}o(b,"crossOriginResourcePolicyCheck");function m(){return"success"}o(m,"corsCheck");function T(){return"success"}o(T,"TAOCheck");function v(y){let Y=null;Y=y.mode,y.headersList.set("sec-fetch-mode",Y,!0)}o(v,"appendFetchMetadata");function Z(y){let Y=y.origin;if(y.responseTainting==="cors"||y.mode==="websocket")Y&&y.headersList.append("origin",Y,!0);else if(y.method!=="GET"&&y.method!=="HEAD"){switch(y.referrerPolicy){case"no-referrer":Y=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":y.origin&&ee(y.origin)&&!ee(D(y))&&(Y=null);break;case"same-origin":yA(y,D(y))||(Y=null);break}Y&&y.headersList.append("origin",Y,!0)}}o(Z,"appendRequestOriginHeader");function P(y,Y){return y}o(P,"coarsenTime");function AA(y,Y,W){return!y?.startTime||y.startTime<Y?{domainLookupStartTime:Y,domainLookupEndTime:Y,connectionStartTime:Y,connectionEndTime:Y,secureConnectionStartTime:Y,ALPNNegotiatedProtocol:y?.ALPNNegotiatedProtocol}:{domainLookupStartTime:P(y.domainLookupStartTime),domainLookupEndTime:P(y.domainLookupEndTime),connectionStartTime:P(y.connectionStartTime),connectionEndTime:P(y.connectionEndTime),secureConnectionStartTime:P(y.secureConnectionStartTime),ALPNNegotiatedProtocol:y.ALPNNegotiatedProtocol}}o(AA,"clampAndCoarsenConnectionTimingInfo");function K(y){return P(I.now())}o(K,"coarsenedSharedCurrentTime");function tA(y){return{startTime:y.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:y.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}o(tA,"createOpaqueTimingInfo");function aA(){return{referrerPolicy:"strict-origin-when-cross-origin"}}o(aA,"makePolicyContainer");function X(y){return{referrerPolicy:y.referrerPolicy}}o(X,"clonePolicyContainer");function $(y){const Y=y.referrerPolicy;L(Y);let W=null;if(y.referrer==="client"){const H=s();if(!H||H.origin==="null")return"no-referrer";W=new URL(H)}else y.referrer instanceof URL&&(W=y.referrer);let j=V(W);const nA=V(W,!0);j.toString().length>4096&&(j=nA);const R=yA(y,j),O=q(j)&&!q(y.url);switch(Y){case"origin":return nA??V(W,!0);case"unsafe-url":return j;case"same-origin":return R?nA:"no-referrer";case"origin-when-cross-origin":return R?j:nA;case"strict-origin-when-cross-origin":{const H=D(y);return yA(j,H)?j:q(j)&&!q(H)?"no-referrer":nA}case"strict-origin":case"no-referrer-when-downgrade":default:return O?"no-referrer":nA}}o($,"determineRequestsReferrer");function V(y,Y){return L(y instanceof URL),y=new URL(y),y.protocol==="file:"||y.protocol==="about:"||y.protocol==="blank:"?"no-referrer":(y.username="",y.password="",y.hash="",Y&&(y.pathname="",y.search=""),y)}o(V,"stripURLForReferrer");function q(y){if(!(y instanceof URL))return!1;if(y.href==="about:blank"||y.href==="about:srcdoc"||y.protocol==="data:"||y.protocol==="file:")return!0;return Y(y.origin);function Y(W){if(W==null||W==="null")return!1;const j=new URL(W);return!!(j.protocol==="https:"||j.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(j.hostname)||j.hostname==="localhost"||j.hostname.includes("localhost.")||j.hostname.endsWith(".localhost"))}}o(q,"isURLPotentiallyTrustworthy");function z(y,Y){if(k===void 0)return!0;const W=iA(Y);if(W==="no metadata"||W.length===0)return!0;const j=gA(W),nA=BA(W,j);for(const R of nA){const O=R.algo,H=R.hash;let J=k.createHash(O).update(y).digest("base64");if(J[J.length-1]==="="&&(J[J.length-2]==="="?J=J.slice(0,-2):J=J.slice(0,-1)),sA(J,H))return!0}return!1}o(z,"bytesMatch");const rA=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function iA(y){const Y=[];let W=!0;for(const j of y.split(" ")){W=!1;const nA=rA.exec(j);if(nA===null||nA.groups===void 0||nA.groups.algo===void 0)continue;const R=nA.groups.algo.toLowerCase();S.includes(R)&&Y.push(nA.groups)}return W===!0?"no metadata":Y}o(iA,"parseMetadata");function gA(y){let Y=y[0].algo;if(Y[3]==="5")return Y;for(let W=1;W<y.length;++W){const j=y[W];if(j.algo[3]==="5"){Y="sha512";break}else{if(Y[3]==="3")continue;j.algo[3]==="3"&&(Y="sha384")}}return Y}o(gA,"getStrongestMetadata");function BA(y,Y){if(y.length===1)return y;let W=0;for(let j=0;j<y.length;++j)y[j].algo===Y&&(y[W++]=y[j]);return y.length=W,y}o(BA,"filterMetadataListByAlgorithm");function sA(y,Y){if(y.length!==Y.length)return!1;for(let W=0;W<y.length;++W)if(y[W]!==Y[W]){if(y[W]==="+"&&Y[W]==="-"||y[W]==="/"&&Y[W]==="_")continue;return!1}return!0}o(sA,"compareBase64Mixed");function eA(y){}o(eA,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function yA(y,Y){retur
Line truncated
|
||||
`);function l(g){for(let d=0;d<g.length;++d)if(g.charCodeAt(d)&-128)return!1;return!0}o(l,"isAsciiString");function S(g){const d=g.length;if(d<27||d>70)return!1;for(let F=0;F<d;++F){const N=g.charCodeAt(F);if(!(N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||N===39||N===45||N===95))return!1}return!0}o(S,"validateBoundary");function k(g,d="utf-8",F=!1){return F?g=e(g):(C(A(g)),g=g.replace(/\r\n?|\r?\n/g,`\r
|
||||
`)),C(Buffer.isEncoding(d)),g=g.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Buffer.from(g,d)}o(k,"escapeFormDataName");function w(g,d){C(d!=="failure"&&d.essence==="multipart/form-data");const F=d.parameters.get("boundary");if(F===void 0)return"failure";const N=Buffer.from(`--${F}`,"utf8"),u=[],b={position:0};for(g[0]===13&&g[1]===10&&(b.position+=2);;){if(g.subarray(b.position,b.position+N.length).equals(N))b.position+=N.length;else return"failure";if(b.position===g.length-2&&G(g,L,b)||b.position===g.length-4&&G(g,c,b))return u;if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;const m=U(g,b);if(m==="failure")return"failure";let{name:T,filename:v,contentType:Z,encoding:P}=m;b.position+=2;let AA;{const tA=g.indexOf(N.subarray(2),b.position);if(tA===-1)return"failure";AA=g.subarray(b.position,tA-4),b.position+=AA.length,P==="base64"&&(AA=Buffer.from(AA.toString(),"base64"))}if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;let K;v!==null?(Z??(Z="text/plain"),l(Z)||(Z=""),K=new a([AA],v,{type:Z})):K=n(Buffer.from(AA)),C(A(T)),C(typeof K=="string"&&A(K)||i(K)),u.push(Q(T,K,v))}}o(w,"multipartFormDataParser");function U(g,d){let F=null,N=null,u=null,b=null;for(;;){if(g[d.position]===13&&g[d.position+1]===10)return F===null?"failure":{name:F,filename:N,contentType:u,encoding:b};let m=B(T=>T!==10&&T!==13&&T!==58,g,d);if(m=D(m,!0,!0,T=>T===9||T===32),!r.test(m.toString())||g[d.position]!==58)return"failure";switch(d.position++,B(T=>T===32||T===9,g,d),t(m)){case"content-disposition":{if(F=N=null,!G(g,f,d)||(d.position+=17,F=M(g,d),F===null))return"failure";if(G(g,h,d)){let T=d.position+h.length;if(g[T]===42&&(d.position+=1,T+=1),g[T]!==61||g[T+1]!==34||(d.position+=12,N=M(g,d),N===null))return"failure"}break}case"content-type":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),u=s(T);break}case"content-transfer-encoding":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),b=s(T);break}default:B(T=>T!==10&&T!==13,g,d)}if(g[d.position]!==13&&g[d.position+1]!==10)return"failure";d.position+=2}}o(U,"parseMultipartFormDataHeaders");function M(g,d){C(g[d.position-1]===34);let F=B(N=>N!==10&&N!==13&&N!==34,g,d);return g[d.position]!==34?null:(d.position++,F=new TextDecoder().decode(F).replace(/%0A/ig,`
|
||||
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),F)}o(M,"parseMultipartFormDataName");function B(g,d,F){let N=F.position;for(;N<d.length&&g(d[N]);)++N;return d.subarray(F.position,F.position=N)}o(B,"collectASequenceOfBytes");function D(g,d,F,N){let u=0,b=g.length-1;if(d)for(;u<g.length&&N(g[u]);)u++;if(F)for(;b>0&&N(g[b]);)b--;return u===0&&b===g.length-1?g:g.subarray(u,b+1)}o(D,"removeChars");function G(g,d,F){if(g.length<d.length)return!1;for(let N=0;N<d.length;N++)if(d[N]!==g[F.position+N])return!1;return!0}return o(G,"bufferStartsWith"),formdataParser={multipartFormDataParser:w,validateBoundary:S,escapeFormDataName:k},formdataParser}o(requireFormdataParser,"requireFormdataParser");var body,hasRequiredBody;function requireBody(){if(hasRequiredBody)return body;hasRequiredBody=1;const e=util$m,{ReadableStreamFrom:A,isBlobLike:t,isReadableStreamLike:n,readableStreamClose:r,createDeferredPromise:s,fullyReadBody:i,extractMimeType:E,utf8DecodeBytes:Q}=requireUtil$5(),{FormData:C}=requireFormdata(),{kState:I}=requireSymbols$3(),{webidl:a}=requireWebidl(),{Blob:f}=require$$6__default,h=require$$0__default,{isErrored:L}=util$m,{isArrayBuffer:c}=require$$8__default$1,{serializeAMimeType:l}=requireDataUrl(),{multipartFormDataParser:S}=requireFormdataParser(),k=new TextEncoder;function w(u,b=!1){let m=null;u instanceof ReadableStream?m=u:t(u)?m=u.stream():m=new ReadableStream({async pull(K){const tA=typeof v=="string"?k.encode(v):v;tA.byteLength&&K.enqueue(tA),queueMicrotask(()=>r(K))},start(){},type:"bytes"}),h(n(m));let T=null,v=null,Z=null,P=null;if(typeof u=="string")v=u,P="text/plain;charset=UTF-8";else if(u instanceof URLSearchParams)v=u.toString(),P="application/x-www-form-urlencoded;charset=UTF-8";else if(c(u))v=new Uint8Array(u.slice());else if(ArrayBuffer.isView(u))v=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength));else if(e.isFormDataLike(u)){const K=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`,tA=`--${K}\r
|
||||
Content-Disposition: form-data`;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const aA=o(rA=>rA.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),X=o(rA=>rA.replace(/\r?\n|\r/g,`\r
|
||||
`),"normalizeLinefeeds"),$=[],V=new Uint8Array([13,10]);Z=0;let q=!1;for(const[rA,iA]of u)if(typeof iA=="string"){const gA=k.encode(tA+`; name="${aA(X(rA))}"\r
|
||||
\r
|
||||
${X(iA)}\r
|
||||
`);$.push(gA),Z+=gA.byteLength}else{const gA=k.encode(`${tA}; name="${aA(X(rA))}"`+(iA.name?`; filename="${aA(iA.name)}"`:"")+`\r
|
||||
Content-Type: ${iA.type||"application/octet-stream"}\r
|
||||
\r
|
||||
`);$.push(gA,iA,V),typeof iA.size=="number"?Z+=gA.byteLength+iA.size+V.byteLength:q=!0}const z=k.encode(`--${K}--`);$.push(z),Z+=z.byteLength,q&&(Z=null),v=u,T=o(async function*(){for(const rA of $)rA.stream?yield*rA.stream():yield rA},"action"),P=`multipart/form-data; boundary=${K}`}else if(t(u))v=u,Z=u.size,u.type&&(P=u.type);else if(typeof u[Symbol.asyncIterator]=="function"){if(b)throw new TypeError("keepalive");if(e.isDisturbed(u)||u.locked)throw new TypeError("Response body object should not be disturbed or locked");m=u instanceof ReadableStream?u:A(u)}if((typeof v=="string"||e.isBuffer(v))&&(Z=Buffer.byteLength(v)),T!=null){let K;m=new ReadableStream({async start(){K=T(u)[Symbol.asyncIterator]()},async pull(tA){const{value:aA,done:X}=await K.next();if(X)queueMicrotask(()=>{tA.close(),tA.byobRequest?.respond(0)});else if(!L(m)){const $=new Uint8Array(aA);$.byteLength&&tA.enqueue($)}return tA.desiredSize>0},async cancel(tA){await K.return()},type:"bytes"})}return[{stream:m,source:v,length:Z},P]}o(w,"extractBody");function U(u,b=!1){return u instanceof ReadableStream&&(h(!e.isDisturbed(u),"The body has already been consumed."),h(!u.locked,"The stream is locked.")),w(u,b)}o(U,"safelyExtractBody");function M(u){const[b,m]=u.stream.tee();return u.stream=b,{stream:m,length:u.length,source:u.source}}o(M,"cloneBody");function B(u){if(u.aborted)throw new DOMException("The operation was aborted.","AbortError")}o(B,"throwIfAborted");function D(u){return{blob(){return g(this,m=>{let T=N(this);return T===null?T="":T&&(T=l(T)),new f([m],{type:T})},u)},arrayBuffer(){return g(this,m=>new Uint8Array(m).buffer,u)},text(){return g(this,Q,u)},json(){return g(this,F,u)},formData(){return g(this,m=>{const T=N(this);if(T!==null)switch(T.essence){case"multipart/form-data":{const v=S(m,T);if(v==="failure")throw new TypeError("Failed to parse body as FormData.");const Z=new C;return Z[I]=v,Z}case"application/x-www-form-urlencoded":{const v=new URLSearchParams(m.toString()),Z=new C;for(const[P,AA]of v)Z.append(P,AA);return Z}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},u)}}}o(D,"bodyMixinMethods");function G(u){Object.assign(u.prototype,D(u))}o(G,"mixinBody");async function g(u,b,m){if(a.brandCheck(u,m),B(u[I]),d(u[I].body))throw new TypeError("Body is unusable");const T=s(),v=o(P=>T.reject(P),"errorSteps"),Z=o(P=>{try{T.resolve(b(P))}catch(AA){v(AA)}},"successSteps");return u[I].body==null?(Z(new Uint8Array),T.promise):(await i(u[I].body,Z,v),T.promise)}o(g,"consumeBody");function d(u){return u!=null&&(u.stream.locked||e.isDisturbed(u.stream))}o(d,"bodyUnusable");function F(u){return JSON.parse(Q(u))}o(F,"parseJSONFromBytes");function N(u){const b=u[I].headersList,m=E(b);return m==="failure"?null:m}return o(N,"bodyMimeType"),body={extractBody:w,safelyExtractBody:U,cloneBody:M,mixinBody:G},body}o(requireBody,"requireBody");const assert$a=require$$0__default,util$i=util$m,{channels:channels$1}=diagnostics,timers=timers$1,{RequestContentLengthMismatchError:RequestContentLengthMismatchError$1,ResponseContentLengthMismatchError,RequestAbortedError:RequestAbortedError$5,HeadersTimeoutError,HeadersOverflowError,SocketError:SocketError$3,InformationalError:InformationalError$2,BodyTimeoutError,HTTPParserError,ResponseExceededMaxSizeError}=errors$1,{kUrl:kUrl$4,kReset:kReset$1,kClient:kClient$3,kParser,kBlocking,kRunning:kRunning$5,kPending:kPending$4,kSize:kSize$4,kWriting,kQueue:kQueue$3,kNoRef,kKeepAliveDefaultTimeout:kKeepAliveDefaultTimeout$1,kHostHeader:kHostHeader$1,kPendingIdx:kPendingIdx$2,kRunningIdx:kRunningIdx$2,kError:kError$2,kPipelining:kPipelining$1,kSocket:kSocket$1,kKeepAliveTimeoutValue:kKeepAliveTimeoutValue$1,kMaxHeadersSize:kMaxHeadersSize$1,kKeepAliveMaxTimeout:kKeepAliveMaxTimeout$1,kKeepAliveTimeoutThreshold:kKeepAliveTimeoutThreshold$1,kHeadersTimeout:kHeadersTimeout$1,kBodyTimeout:kBodyTimeout$1,kStrictContentLength:kStrictContentLength$2,kMaxRequests:kMaxRequests$1,kCounter:kCounter$1,kMaxResponseSize:kMaxResponseSize$1,kOnError:kOnError$2,kResume:kResume$3,kHTTPContext:kHTTPContext$1}=symbols$4,constants$2=constants$4,EMPTY_BUF=Buffer.alloc(0),FastBuffer=Buffer[Symbol.species],addListener=util$i.addListener,removeAllListeners=util$i.removeAllListeners;let extractBody;async function lazyllhttp(){const e=process.env.JEST_WORKER_ID?requireLlhttpWasm():void 0;let A;try{A=await WebAssembly.compile(requireLlhttp_simdWasm())}catch{A=await WebAssembly.compile(e||requireLlhttpWasm())}return await WebAssembly.instantiate(A,{env:{wasm_on_url:(t,n,r)=>0,wasm_on_status:(t,n,r)=>{assert$a.strictEqual(currentParser.ptr,t);const s=n-currentBufferPtr+currentBufferRef.byteOffset;return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer,s,r))||0},wasm_on_message_begin:t=>(assert$a.strictEqual(currentParser.ptr,t),currentParser.onMessageBegin()||0),wasm_on_header_field:(t,n,r)=>{assert$a.strictEqual(currentParser.ptr,t);const s=n-currentBufferPtr
Line truncated
|
||||
`;if(typeof r=="string"?c+=`host: ${r}\r
|
||||
`:c+=e[kHostHeader$1],s?c+=`connection: upgrade\r
|
||||
upgrade: ${s}\r
|
||||
`:e[kPipelining$1]&&!h[kReset$1]?c+=`connection: keep-alive\r
|
||||
`:c+=`connection: close\r
|
||||
`,Array.isArray(C))for(let l=0;l<C.length;l+=2){const S=C[l+0],k=C[l+1];if(Array.isArray(k))for(let w=0;w<k.length;w++)c+=`${S}: ${k[w]}\r
|
||||
`;else c+=`${S}: ${k}\r
|
||||
`}return channels$1.sendHeaders.hasSubscribers&&channels$1.sendHeaders.publish({request:A,headers:c,socket:h}),!Q||f===0?writeBuffer({abort:L,body:null,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isBuffer(Q)?writeBuffer({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isBlobLike(Q)?typeof Q.stream=="function"?writeIterable$1({abort:L,body:Q.stream(),client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):writeBlob$1({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isStream(Q)?writeStream$1({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isIterable(Q)?writeIterable$1({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):assert$a(!1),!0}o(writeH1,"writeH1");function writeStream$1({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){assert$a(s!==0||t[kRunning$5]===0,"stream body cannot be pipelined");let Q=!1;const C=new AsyncWriter({abort:e,socket:r,request:n,contentLength:s,client:t,expectsPayload:E,header:i}),I=o(function(L){if(!Q)try{!C.write(L)&&this.pause&&this.pause()}catch(c){util$i.destroy(this,c)}},"onData"),a=o(function(){Q||A.resume&&A.resume()},"onDrain"),f=o(function(){if(queueMicrotask(()=>{A.removeListener("error",h)}),!Q){const L=new RequestAbortedError$5;queueMicrotask(()=>h(L))}},"onClose"),h=o(function(L){if(!Q){if(Q=!0,assert$a(r.destroyed||r[kWriting]&&t[kRunning$5]<=1),r.off("drain",a).off("error",h),A.removeListener("data",I).removeListener("end",h).removeListener("close",f),!L)try{C.end()}catch(c){L=c}C.destroy(L),L&&(L.code!=="UND_ERR_INFO"||L.message!=="reset")?util$i.destroy(A,L):util$i.destroy(A)}},"onFinished");A.on("data",I).on("end",h).on("error",h).on("close",f),A.resume&&A.resume(),r.on("drain",a).on("error",h),A.errorEmitted??A.errored?setImmediate(()=>h(A.errored)):(A.endEmitted??A.readableEnded)&&setImmediate(()=>h(null)),(A.closeEmitted??A.closed)&&setImmediate(f)}o(writeStream$1,"writeStream$1");async function writeBuffer({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){try{A?util$i.isBuffer(A)&&(assert$a(s===A.byteLength,"buffer body must have content length"),r.cork(),r.write(`${i}content-length: ${s}\r
|
||||
\r
|
||||
`,"latin1"),r.write(A),r.uncork(),n.onBodySent(A),E||(r[kReset$1]=!0)):s===0?r.write(`${i}content-length: 0\r
|
||||
\r
|
||||
`,"latin1"):(assert$a(s===null,"no body must not have content length"),r.write(`${i}\r
|
||||
`,"latin1")),n.onRequestSent(),t[kResume$3]()}catch(Q){e(Q)}}o(writeBuffer,"writeBuffer");async function writeBlob$1({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){assert$a(s===A.size,"blob body must have content length");try{if(s!=null&&s!==A.size)throw new RequestContentLengthMismatchError$1;const Q=Buffer.from(await A.arrayBuffer());r.cork(),r.write(`${i}content-length: ${s}\r
|
||||
\r
|
||||
`,"latin1"),r.write(Q),r.uncork(),n.onBodySent(Q),n.onRequestSent(),E||(r[kReset$1]=!0),t[kResume$3]()}catch(Q){e(Q)}}o(writeBlob$1,"writeBlob$1");async function writeIterable$1({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){assert$a(s!==0||t[kRunning$5]===0,"iterator body cannot be pipelined");let Q=null;function C(){if(Q){const f=Q;Q=null,f()}}o(C,"onDrain");const I=o(()=>new Promise((f,h)=>{assert$a(Q===null),r[kError$2]?h(r[kError$2]):Q=f}),"waitForDrain");r.on("close",C).on("drain",C);const a=new AsyncWriter({abort:e,socket:r,request:n,contentLength:s,client:t,expectsPayload:E,header:i});try{for await(const f of A){if(r[kError$2])throw r[kError$2];a.write(f)||await I()}a.end()}catch(f){a.destroy(f)}finally{r.off("close",C).off("drain",C)}}o(writeIterable$1,"writeIterable$1");const ot=class ot{constructor({abort:A,socket:t,request:n,contentLength:r,client:s,expectsPayload:i,header:E}){this.socket=t,this.request=n,this.contentLength=r,this.client=s,this.bytesWritten=0,this.expectsPayload=i,this.header=E,this.abort=A,t[kWriting]=!0}write(A){const{socket:t,request:n,contentLength:r,client:s,bytesWritten:i,expectsPayload:E,header:Q}=this;if(t[kError$2])throw t[kError$2];if(t.destroyed)return!1;const C=Buffer.byteLength(A);if(!C)return!0;if(r!==null&&i+C>r){if(s[kStrictContentLength$2])throw new RequestContentLengthMismatchError$1;process.emitWarning(new RequestContentLengthMismatchError$1)}t.cork(),i===0&&(E||(t[kReset$1]=!0),r===null?t.write(`${Q}transfer-encoding: chunked\r
|
||||
`,"latin1"):t.write(`${Q}content-length: ${r}\r
|
||||
\r
|
||||
`,"latin1")),r===null&&t.write(`\r
|
||||
${C.toString(16)}\r
|
||||
`,"latin1"),this.bytesWritten+=C;const I=t.write(A);return t.uncork(),n.onBodySent(A),I||t[kParser].timeout&&t[kParser].timeoutType===TIMEOUT_HEADERS&&t[kParser].timeout.refresh&&t[kParser].timeout.refresh(),I}end(){const{socket:A,contentLength:t,client:n,bytesWritten:r,expectsPayload:s,header:i,request:E}=this;if(E.onRequestSent(),A[kWriting]=!1,A[kError$2])throw A[kError$2];if(!A.destroyed){if(r===0?s?A.write(`${i}content-length: 0\r
|
||||
\r
|
||||
`,"latin1"):A.write(`${i}\r
|
||||
`,"latin1"):t===null&&A.write(`\r
|
||||
0\r
|
||||
\r
|
||||
`,"latin1"),t!==null&&r!==t){if(n[kStrictContentLength$2])throw new RequestContentLengthMismatchError$1;process.emitWarning(new RequestContentLengthMismatchError$1)}A[kParser].timeout&&A[kParser].timeoutType===TIMEOUT_HEADERS&&A[kParser].timeout.refresh&&A[kParser].timeout.refresh(),n[kResume$3]()}}destroy(A){const{socket:t,client:n,abort:r}=this;t[kWriting]=!1,A&&(assert$a(n[kRunning$5]<=1,"pipeline should only contain this request"),r(A))}};o(ot,"AsyncWriter");let AsyncWriter=ot;var clientH1=connectH1$1;const assert$9=require$$0__default,{pipeline:pipeline$1}=Stream__default,util$h=util$m,{RequestContentLengthMismatchError,RequestAbortedError:RequestAbortedError$4,SocketError:SocketError$2,InformationalError:InformationalError$1}=errors$1,{kUrl:kUrl$3,kReset,kClient:kClient$2,kRunning:kRunning$4,kPending:kPending$3,kQueue:kQueue$2,kPendingIdx:kPendingIdx$1,kRunningIdx:kRunningIdx$1,kError:kError$1,kSocket,kStrictContentLength:kStrictContentLength$1,kOnError:kOnError$1,kMaxConcurrentStreams:kMaxConcurrentStreams$1,kHTTP2Session,kResume:kResume$2}=symbols$4,kOpenStreams=Symbol("open streams");let h2ExperimentalWarned=!1,http2;try{http2=require("node:http2")}catch{http2={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY,HTTP2_HEADER_METHOD,HTTP2_HEADER_PATH,HTTP2_HEADER_SCHEME,HTTP2_HEADER_CONTENT_LENGTH,HTTP2_HEADER_EXPECT,HTTP2_HEADER_STATUS}}=http2;function parseH2Headers(e){const A=[];for(const[t,n]of Object.entries(e))if(Array.isArray(n))for(const r of n)A.push(Buffer.from(t),Buffer.from(r));else A.push(Buffer.from(t),Buffer.from(n));return A}o(parseH2Headers,"parseH2Headers");async function connectH2$1(e,A){e[kSocket]=A,h2ExperimentalWarned||(h2ExperimentalWarned=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));const t=http2.connect(e[kUrl$3],{createConnection:()=>A,peerMaxConcurrentStreams:e[kMaxConcurrentStreams$1]});t[kOpenStreams]=0,t[kClient$2]=e,t[kSocket]=A,util$h.addListener(t,"error",onHttp2SessionError),util$h.addListener(t,"frameError",onHttp2FrameError),util$h.addListener(t,"end",onHttp2SessionEnd),util$h.addListener(t,"goaway",onHTTP2GoAway),util$h.addListener(t,"close",function(){const{[kClient$2]:r}=this,s=this[kSocket][kError$1]||new SocketError$2("closed",util$h.getSocketInfo(this));r[kSocket]=null,r[kHTTP2Session]=null,assert$9(r[kPending$3]===0);const i=r[kQueue$2].splice(r[kRunningIdx$1]);for(let E=0;E<i.length;E++){const Q=i[E];util$h.errorRequest(r,Q,s)}r[kPendingIdx$1]=r[kRunningIdx$1],assert$9(r[kRunning$4]===0),r.emit("disconnect",r[kUrl$3],[r],s),r[kResume$2]()}),t.unref(),e[kHTTP2Session]=t,A[kHTTP2Session]=t,util$h.addListener(A,"error",function(r){assert$9(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[kError$1]=r,this[kClient$2][kOnError$1](r)}),util$h.addListener(A,"end",function(){util$h.destroy(this,new SocketError$2("other side closed",util$h.getSocketInfo(this)))});let n=!1;return A.on("close",()=>{n=!0}),{version:"h2",defaultPipelining:1/0,write(...r){writeH2(e,...r)},resume(){},destroy(r,s){t.destroy(r),n?queueMicrotask(s):A.destroy(r).on("close",s)},get destroyed(){return A.destroyed},busy(){return!1}}}o(connectH2$1,"connectH2$1");function onHttp2SessionError(e){assert$9(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[kSocket][kError$1]=e,this[kClient$2][kOnError$1](e)}o(onHttp2SessionError,"onHttp2SessionError");function onHttp2FrameError(e,A,t){if(t===0){const n=new InformationalError$1(`HTTP/2: "frameError" received - type ${e}, code ${A}`);this[kSocket][kError$1]=n,this[kClient$2][kOnError$1](n)}}o(onHttp2FrameError,"onHttp2FrameError");function onHttp2SessionEnd(){const e=new SocketError$2("other side closed",util$h.getSocketInfo(this[kSocket]));this.destroy(e),util$h.destroy(this[kSocket],e)}o(onHttp2SessionEnd,"onHttp2SessionEnd");function onHTTP2GoAway(e){const A=new InformationalError$1(`HTTP/2: "GOAWAY" frame received with code ${e}`);this[kSocket][kError$1]=A,this[kClient$2][kOnError$1](A),this.unref(),this.destroy(),util$h.destroy(this[kSocket],A)}o(onHTTP2GoAway,"onHTTP2GoAway");function shouldSendContentLength(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}o(shouldSendContentLength,"shouldSendContentLength");function writeH2(e,A){const t=e[kHTTP2Session],{body:n,method:r,path:s,host:i,upgrade:E,expectContinue:Q,signal:C,headers:I}=A;if(E)return util$h.errorRequest(e,A,new Error("Upgrade not supported for H2")),!1;if(A.aborted)return!1;const a={};for(let w=0;w<I.length;w+=2){const U=I[w+0],M=I[w+1];if(Array.isArray(M))for(let B=0;B<M.length;B++)a[U]?a[U]+=`,${M[B]}`:a[U]=M[B];else a[U]=M}let f;const{hostname:h,port:L}=e[kUrl$3];a[HTTP2_HEADER_AUTHORITY]=i||`${h}${L?`:${L}`:""}`,a[HTTP2_HEADER_METHOD]=r;try{A.onConnect(w=>{A.aborted||A.completed||(w=w||new RequestAbortedError$4,f!=null&&(util$h.destroy(f,w),t[kOpenStreams]-=1,t[kOpenStreams]===0&&t.unref()),util$h.errorRequest(e,A,w))})}catch(w){util$h.errorRequest(e,A,w)}if(r==="CONNECT")return t.ref(),f=t.request
Line truncated
|
||||
`,this[kBodyTimeout]=Q??3e5,this[kHeadersTimeout]=r??3e5,this[kStrictContentLength]=k??!0,this[kMaxRedirections$1]=U,this[kMaxRequests]=B,this[kClosedResolve$1]=null,this[kMaxResponseSize]=G>-1?G:-1,this[kMaxConcurrentStreams]=F??100,this[kHTTPContext]=null,this[kQueue$1]=[],this[kRunningIdx]=0,this[kPendingIdx]=0,this[kResume$1]=u=>resume(this,u),this[kOnError]=u=>onError(this,u)}get pipelining(){return this[kPipelining]}set pipelining(A){this[kPipelining]=A,this[kResume$1](!0)}get[kPending$2](){return this[kQueue$1].length-this[kPendingIdx]}get[kRunning$3](){return this[kPendingIdx]-this[kRunningIdx]}get[kSize$3](){return this[kQueue$1].length-this[kRunningIdx]}get[kConnected$4](){return!!this[kHTTPContext]&&!this[kConnecting]&&!this[kHTTPContext].destroyed}get[kBusy$1](){return!!(this[kHTTPContext]?.busy(null)||this[kSize$3]>=(getPipelining(this)||1)||this[kPending$2]>0)}[kConnect](A){connect$1(this),this.once("connect",A)}[kDispatch$2](A,t){const n=A.origin||this[kUrl$2].origin,r=new Request(n,A,t);return this[kQueue$1].push(r),this[kResuming]||(util$f.bodyLength(r.body)==null&&util$f.isIterable(r.body)?(this[kResuming]=1,queueMicrotask(()=>resume(this))):this[kResume$1](!0)),this[kResuming]&&this[kNeedDrain$2]!==2&&this[kBusy$1]&&(this[kNeedDrain$2]=2),this[kNeedDrain$2]<2}async[kClose$5](){return new Promise(A=>{this[kSize$3]?this[kClosedResolve$1]=A:A(null)})}async[kDestroy$3](A){return new Promise(t=>{const n=this[kQueue$1].splice(this[kPendingIdx]);for(let s=0;s<n.length;s++){const i=n[s];util$f.errorRequest(this,i,A)}const r=o(()=>{this[kClosedResolve$1]&&(this[kClosedResolve$1](),this[kClosedResolve$1]=null),t(null)},"callback");this[kHTTPContext]?(this[kHTTPContext].destroy(A,r),this[kHTTPContext]=null):queueMicrotask(r),this[kResume$1]()})}},o(be,"Client"),be);const createRedirectInterceptor$1=redirectInterceptor;function onError(e,A){if(e[kRunning$3]===0&&A.code!=="UND_ERR_INFO"&&A.code!=="UND_ERR_SOCKET"){assert$7(e[kPendingIdx]===e[kRunningIdx]);const t=e[kQueue$1].splice(e[kRunningIdx]);for(let n=0;n<t.length;n++){const r=t[n];util$f.errorRequest(e,r,A)}assert$7(e[kSize$3]===0)}}o(onError,"onError");async function connect$1(e){assert$7(!e[kConnecting]),assert$7(!e[kHTTPContext]);let{host:A,hostname:t,protocol:n,port:r}=e[kUrl$2];if(t[0]==="["){const s=t.indexOf("]");assert$7(s!==-1);const i=t.substring(1,s);assert$7(net.isIP(i)),t=i}e[kConnecting]=!0,channels.beforeConnect.hasSubscribers&&channels.beforeConnect.publish({connectParams:{host:A,hostname:t,protocol:n,port:r,version:e[kHTTPContext]?.version,servername:e[kServerName],localAddress:e[kLocalAddress]},connector:e[kConnector]});try{const s=await new Promise((i,E)=>{e[kConnector]({host:A,hostname:t,protocol:n,port:r,servername:e[kServerName],localAddress:e[kLocalAddress]},(Q,C)=>{Q?E(Q):i(C)})});if(e.destroyed){util$f.destroy(s.on("error",()=>{}),new ClientDestroyedError);return}assert$7(s);try{e[kHTTPContext]=s.alpnProtocol==="h2"?await connectH2(e,s):await connectH1(e,s)}catch(i){throw s.destroy().on("error",()=>{}),i}e[kConnecting]=!1,s[kCounter]=0,s[kMaxRequests]=e[kMaxRequests],s[kClient$1]=e,s[kError]=null,channels.connected.hasSubscribers&&channels.connected.publish({connectParams:{host:A,hostname:t,protocol:n,port:r,version:e[kHTTPContext]?.version,servername:e[kServerName],localAddress:e[kLocalAddress]},connector:e[kConnector],socket:s}),e.emit("connect",e[kUrl$2],[e])}catch(s){if(e.destroyed)return;if(e[kConnecting]=!1,channels.connectError.hasSubscribers&&channels.connectError.publish({connectParams:{host:A,hostname:t,protocol:n,port:r,version:e[kHTTPContext]?.version,servername:e[kServerName],localAddress:e[kLocalAddress]},connector:e[kConnector],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(assert$7(e[kRunning$3]===0);e[kPending$2]>0&&e[kQueue$1][e[kPendingIdx]].servername===e[kServerName];){const i=e[kQueue$1][e[kPendingIdx]++];util$f.errorRequest(e,i,s)}else onError(e,s);e.emit("connectionError",e[kUrl$2],[e],s)}e[kResume$1]()}o(connect$1,"connect$1");function emitDrain(e){e[kNeedDrain$2]=0,e.emit("drain",e[kUrl$2],[e])}o(emitDrain,"emitDrain");function resume(e,A){e[kResuming]!==2&&(e[kResuming]=2,_resume(e,A),e[kResuming]=0,e[kRunningIdx]>256&&(e[kQueue$1].splice(0,e[kRunningIdx]),e[kPendingIdx]-=e[kRunningIdx],e[kRunningIdx]=0))}o(resume,"resume");function _resume(e,A){for(;;){if(e.destroyed){assert$7(e[kPending$2]===0);return}if(e[kClosedResolve$1]&&!e[kSize$3]){e[kClosedResolve$1](),e[kClosedResolve$1]=null;return}if(e[kHTTPContext]&&e[kHTTPContext].resume(),e[kBusy$1])e[kNeedDrain$2]=2;else if(e[kNeedDrain$2]===2){A?(e[kNeedDrain$2]=1,queueMicrotask(()=>emitDrain(e))):emitDrain(e);continue}if(e[kPending$2]===0||e[kRunning$3]>=(getPipelining(e)||1))return;const t=e[kQueue$1][e[kPendingIdx]];if(e[kUrl$2].protocol==="https:"&&e[kServerName]!==t.servername){if(e[kRunning$3]>0)return;e[kServerName]=t.servername,e[kHTTPContext]?.destroy(new InformationalError("servername changed"),()=>{e[kHTTPContext]=null,resum
Line truncated
|
||||
${l}`;break;case"retry":A(l)&&(h[c]=l);break;case"id":t(l)&&(h[c]=l);break;case"event":l.length>0&&(h[c]=l);break}}processEvent(f){f.retry&&A(f.retry)&&(this.state.reconnectionTime=parseInt(f.retry,10)),f.id&&t(f.id)&&(this.state.lastEventId=f.id),f.data!==void 0&&this.push({type:f.event||"message",options:{data:f.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};o(C,"EventSourceStream");let Q=C;return eventsourceStream={EventSourceStream:Q},eventsourceStream}o(requireEventsourceStream,"requireEventsourceStream");var eventsource,hasRequiredEventsource;function requireEventsource(){var U,M,B,D,G,g,d,F,$e,u,_e;if(hasRequiredEventsource)return eventsource;hasRequiredEventsource=1;const{pipeline:e}=Stream__default,{fetching:A}=requireFetch(),{makeRequest:t}=requireRequest(),{getGlobalOrigin:n}=requireGlobal(),{webidl:r}=requireWebidl(),{EventSourceStream:s}=requireEventsourceStream(),{parseMIMEType:i}=requireDataUrl(),{MessageEvent:E}=requireEvents(),{isNetworkError:Q}=requireResponse(),{delay:C}=requireUtil(),{kEnumerableProperty:I}=util$m;let a=!1;const f=3e3,h=0,L=1,c=2,l="anonymous",S="use-credentials",m=class m extends EventTarget{constructor(Z,P={}){super();CA(this,F);CA(this,u);CA(this,U,{open:null,error:null,message:null});CA(this,M,null);CA(this,B,!1);CA(this,D,h);CA(this,G,null);CA(this,g,null);CA(this,d,null);r.argumentLengthCheck(arguments,1,{header:"EventSource constructor"}),a||(a=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),Z=r.converters.USVString(Z),P=r.converters.EventSourceInitDict(P),EA(this,d,{origin:n(),policyContainer:{referrerPolicy:"no-referrer"},lastEventId:"",reconnectionTime:f});let AA;try{AA=new URL(Z,p(this,d).origin),p(this,d).origin=AA.origin}catch(aA){throw new DOMException(aA,"SyntaxError")}EA(this,M,AA.href);let K=l;P.withCredentials&&(K=S,EA(this,B,!0));const tA={redirect:"follow",keepalive:!0,mode:"cors",credentials:K==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};tA.client=p(this,d),tA.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],tA.cache="no-store",tA.initiator="other",tA.urlList=[new URL(p(this,M))],EA(this,G,t(tA)),kA(this,F,$e).call(this)}get readyState(){return p(this,D)}get url(){return p(this,M)}get withCredentials(){return p(this,B)}close(){r.brandCheck(this,m),p(this,D)!==c&&(EA(this,D,c),clearTimeout(p(this,d).reconnectionTimer),p(this,g).abort(),p(this,G)&&EA(this,G,null))}get onopen(){return p(this,U).open}set onopen(Z){p(this,U).open&&this.removeEventListener("open",p(this,U).open),typeof Z=="function"?(p(this,U).open=Z,this.addEventListener("open",Z)):p(this,U).open=null}get onmessage(){return p(this,U).message}set onmessage(Z){p(this,U).message&&this.removeEventListener("message",p(this,U).message),typeof Z=="function"?(p(this,U).message=Z,this.addEventListener("message",Z)):p(this,U).message=null}get onerror(){return p(this,U).error}set onerror(Z){p(this,U).error&&this.removeEventListener("error",p(this,U).error),typeof Z=="function"?(p(this,U).error=Z,this.addEventListener("error",Z)):p(this,U).error=null}};U=new WeakMap,M=new WeakMap,B=new WeakMap,D=new WeakMap,G=new WeakMap,g=new WeakMap,d=new WeakMap,F=new WeakSet,$e=o(function(){if(p(this,D)===c)return;EA(this,D,h);const Z={request:p(this,G)},P=o(AA=>{Q(AA)&&(this.dispatchEvent(new Event("error")),this.close()),kA(this,u,_e).call(this)},"processEventSourceEndOfBody");Z.processResponseEndOfBody=P,Z.processResponse=AA=>{if(Q(AA))if(AA.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{kA(this,u,_e).call(this);return}const K=AA.headersList.get("content-type",!0),tA=K!==null?i(K):"failure",aA=tA!=="failure"&&tA.essence==="text/event-stream";if(AA.status!==200||aA===!1){this.close(),this.dispatchEvent(new Event("error"));return}EA(this,D,L),this.dispatchEvent(new Event("open")),p(this,d).origin=AA.urlList[AA.urlList.length-1].origin;const X=new s({eventSourceSettings:p(this,d),push:$=>{this.dispatchEvent(new E($.type,$.options))}});e(AA.body.stream,X,$=>{$?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},EA(this,g,A(Z))},"#connect"),u=new WeakSet,_e=o(async function(){p(this,D)!==c&&(EA(this,D,h),this.dispatchEvent(new Event("error")),await C(p(this,d).reconnectionTime),p(this,D)===h&&(p(this,d).lastEventId!==""&&p(this,G).headersList.set("last-event-id",p(this,d).lastEventId,!0),kA(this,F,$e).call(this)))},"#reconnect"),o(m,"EventSource");let k=m;const w={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:L,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:c,writable:!1}};return Object.defineProperties(k,w),Object.defineProperties(k.prototype,w),Object.defineProperties(k.prototype,{close:I,onerror:I,onmessage:I,onopen:I,readyState:I,url:I,withCredentials:I}),r.converte
Line truncated
|
||||
Reference in new issue
Block a user