UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

8 lines 1.21 MB
"use strict";var qu=Object.create,pC=Object.defineProperty,Vu=Object.getOwnPropertyDescriptor,Wu=Object.getOwnPropertyNames,Zu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty,Xu=(I,A)=>()=>(I&&(A=I(I=0)),A),K=(I,A)=>()=>(A||I((A={exports:{}}).exports,A),A.exports),lE=(I,A)=>{for(var e in A)pC(I,e,{get:A[e],enumerable:!0})},wE=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of Wu(A))!_u.call(I,C)&&C!==e&&pC(I,C,{get:()=>A[C],enumerable:!(g=Vu(A,C))||g.enumerable});return I},fE=(I,A,e)=>(e=I!=null?qu(Zu(I)):{},wE(A||!I||!I.__esModule?pC(e,"default",{value:I,enumerable:!0}):e,I)),PA=I=>wE(pC({},"__esModule",{value:!0}),I),mE=K((qp,GE)=>{"use strict";var FC=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,zu=Object.getOwnPropertyNames,$u=Object.prototype.hasOwnProperty,SC=(I,A)=>FC(I,"name",{value:A,configurable:!0}),Ac=(I,A)=>{for(var e in A)FC(I,e,{get:A[e],enumerable:!0})},ec=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of zu(A))!$u.call(I,C)&&C!==e&&FC(I,C,{get:()=>A[C],enumerable:!(g=ju(A,C))||g.enumerable});return I},gc=I=>ec(FC({},"__esModule",{value:!0}),I),dE={};Ac(dE,{AlgorithmId:()=>SE,EndpointURLScheme:()=>FE,FieldPosition:()=>RE,HttpApiKeyAuthLocation:()=>pE,HttpAuthLocation:()=>yE,IniSectionType:()=>kE,RequestHandlerProtocol:()=>ME,SMITHY_CONTEXT_KEY:()=>ic,getDefaultClientConfiguration:()=>tc,resolveDefaultRuntimeConfig:()=>Bc}),GE.exports=gc(dE);var yE=(I=>(I.HEADER="header",I.QUERY="query",I))(yE||{}),pE=(I=>(I.HEADER="header",I.QUERY="query",I))(pE||{}),FE=(I=>(I.HTTP="http",I.HTTPS="https",I))(FE||{}),SE=(I=>(I.MD5="md5",I.CRC32="crc32",I.CRC32C="crc32c",I.SHA1="sha1",I.SHA256="sha256",I))(SE||{}),Ic=SC(I=>{let A=[];return I.sha256!==void 0&&A.push({algorithmId:()=>"sha256",checksumConstructor:()=>I.sha256}),I.md5!=null&&A.push({algorithmId:()=>"md5",checksumConstructor:()=>I.md5}),{_checksumAlgorithms:A,addChecksumAlgorithm(e){this._checksumAlgorithms.push(e)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),Cc=SC(I=>{let A={};return I.checksumAlgorithms().forEach(e=>{A[e.algorithmId()]=e.checksumConstructor()}),A},"resolveChecksumRuntimeConfig"),tc=SC(I=>({...Ic(I)}),"getDefaultClientConfiguration"),Bc=SC(I=>({...Cc(I)}),"resolveDefaultRuntimeConfig"),RE=(I=>(I[I.HEADER=0]="HEADER",I[I.TRAILER=1]="TRAILER",I))(RE||{}),ic="__smithy_context",kE=(I=>(I.PROFILE="profile",I.SSO_SESSION="sso-session",I.SERVICES="services",I))(kE||{}),ME=(I=>(I.HTTP_0_9="http/0.9",I.HTTP_1_0="http/1.0",I.TDS_8_0="tds/8.0",I))(ME||{})}),xE=K((_p,vE)=>{"use strict";var RC=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,Ec=Object.getOwnPropertyNames,sc=Object.prototype.hasOwnProperty,Sg=(I,A)=>RC(I,"name",{value:A,configurable:!0}),rc=(I,A)=>{for(var e in A)RC(I,e,{get:A[e],enumerable:!0})},oc=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of Ec(A))!sc.call(I,C)&&C!==e&&RC(I,C,{get:()=>A[C],enumerable:!(g=Qc(A,C))||g.enumerable});return I},nc=I=>oc(RC({},"__esModule",{value:!0}),I),NE={};rc(NE,{Field:()=>cc,Fields:()=>Dc,HttpRequest:()=>hc,HttpResponse:()=>lc,IHttpRequest:()=>UE.HttpRequest,getHttpHandlerExtensionConfiguration:()=>ac,isValidHostname:()=>YE,resolveHttpHandlerRuntimeConfig:()=>uc}),vE.exports=nc(NE);var ac=Sg(I=>{let A=I.httpHandler;return{setHttpHandler(e){A=e},httpHandler(){return A},updateHttpClientConfig(e,g){A.updateHttpClientConfig(e,g)},httpHandlerConfigs(){return A.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),uc=Sg(I=>({httpHandler:I.httpHandler()}),"resolveHttpHandlerRuntimeConfig"),UE=mE(),LE=class{constructor({name:A,kind:e=UE.FieldPosition.HEADER,values:g=[]}){this.name=A,this.kind=e,this.values=g}add(A){this.values.push(A)}set(A){this.values=A}remove(A){this.values=this.values.filter(e=>e!==A)}toString(){return this.values.map(A=>A.includes(",")||A.includes(" ")?`"${A}"`:A).join(", ")}get(){return this.values}};Sg(LE,"Field");var cc=LE,JE=class{constructor({fields:A=[],encoding:e="utf-8"}){this.entries={},A.forEach(this.setField.bind(this)),this.encoding=e}setField(A){this.entries[A.name.toLowerCase()]=A}getField(A){return this.entries[A.toLowerCase()]}removeField(A){delete this.entries[A.toLowerCase()]}getByType(A){return Object.values(this.entries).filter(e=>e.kind===A)}};Sg(JE,"Fields");var Dc=JE,KE=class wB{constructor(A){this.method=A.method||"GET",this.hostname=A.hostname||"localhost",this.port=A.port,this.query=A.query||{},this.headers=A.headers||{},this.body=A.body,this.protocol=A.protocol?A.protocol.slice(-1)!==":"?`${A.protocol}:`:A.protocol:"https:",this.path=A.path?A.path.charAt(0)!=="/"?`/${A.path}`:A.path:"/",this.username=A.username,this.password=A.password,this.fragment=A.fragment}static clone(A){let e=new wB({...A,headers:{...A.headers}});return e.query&&(e.query=HE(e.query)),e}static isInstance(A){if(!A)return!1;let e=A;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query=="object"&&typeof e.headers=="object"}clone(){return wB.clone(this)}};Sg(KE,"HttpRequest");var hc=KE;function HE(I){return Object.keys(I).reduce((A,e)=>{let g=I[e];return{...A,[e]:Array.isArray(g)?[...g]:g}},{})}Sg(HE,"cloneQuery");var bE=class{constructor(A){this.statusCode=A.statusCode,this.reason=A.reason,this.headers=A.headers||{},this.body=A.body}static isInstance(A){if(!A)return!1;let e=A;return typeof e.statusCode=="number"&&typeof e.headers=="object"}};Sg(bE,"HttpResponse");var lc=bE;function YE(I){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(I)}Sg(YE,"isValidHostname")}),qE=K((Xp,OE)=>{"use strict";var kC=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,fc=Object.getOwnPropertyNames,dc=Object.prototype.hasOwnProperty,fB=(I,A)=>kC(I,"name",{value:A,configurable:!0}),yc=(I,A)=>{for(var e in A)kC(I,e,{get:A[e],enumerable:!0})},pc=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of fc(A))!dc.call(I,C)&&C!==e&&kC(I,C,{get:()=>A[C],enumerable:!(g=wc(A,C))||g.enumerable});return I},Fc=I=>pc(kC({},"__esModule",{value:!0}),I),TE={};yc(TE,{escapeUri:()=>PE,escapeUriPath:()=>Rc}),OE.exports=Fc(TE);var PE=fB(I=>encodeURIComponent(I).replace(/[!'()*]/g,Sc),"escapeUri"),Sc=fB(I=>`%${I.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Rc=fB(I=>I.split("/").map(PE).join("/"),"escapeUriPath")}),_E=K((jp,ZE)=>{"use strict";var MC=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,Mc=Object.getOwnPropertyNames,Gc=Object.prototype.hasOwnProperty,mc=(I,A)=>MC(I,"name",{value:A,configurable:!0}),Nc=(I,A)=>{for(var e in A)MC(I,e,{get:A[e],enumerable:!0})},Uc=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of Mc(A))!Gc.call(I,C)&&C!==e&&MC(I,C,{get:()=>A[C],enumerable:!(g=kc(A,C))||g.enumerable});return I},Lc=I=>Uc(MC({},"__esModule",{value:!0}),I),VE={};Nc(VE,{buildQueryString:()=>WE}),ZE.exports=Lc(VE);var dB=qE();function WE(I){let A=[];for(let e of Object.keys(I).sort()){let g=I[e];if(e=(0,dB.escapeUri)(e),Array.isArray(g))for(let C=0,t=g.length;C<t;C++)A.push(`${e}=${(0,dB.escapeUri)(g[C])}`);else{let C=e;(g||typeof g=="string")&&(C+=`=${(0,dB.escapeUri)(g)}`),A.push(C)}}return A.join("&")}mc(WE,"buildQueryString")}),us=K((eF,as)=>{"use strict";var Jc=Object.create,ZI=Object.defineProperty,Kc=Object.getOwnPropertyDescriptor,Hc=Object.getOwnPropertyNames,bc=Object.getPrototypeOf,Yc=Object.prototype.hasOwnProperty,mA=(I,A)=>ZI(I,"name",{value:A,configurable:!0}),vc=(I,A)=>{for(var e in A)ZI(I,e,{get:A[e],enumerable:!0})},As=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of Hc(A))!Yc.call(I,C)&&C!==e&&ZI(I,C,{get:()=>A[C],enumerable:!(g=Kc(A,C))||g.enumerable});return I},xc=(I,A,e)=>(e=I!=null?Jc(bc(I)):{},As(A||!I||!I.__esModule?ZI(e,"default",{value:I,enumerable:!0}):e,I)),Tc=I=>As(ZI({},"__esModule",{value:!0}),I),es={};vc(es,{DEFAULT_REQUEST_TIMEOUT:()=>Zc,NodeHttp2Handler:()=>$c,NodeHttpHandler:()=>_c,streamCollector:()=>eD}),as.exports=Tc(es);var gs=xE(),Is=_E(),yB=require("http"),pB=require("https"),Pc=["ECONNRESET","EPIPE","ETIMEDOUT"],Cs=mA(I=>{let A={};for(let e of Object.keys(I)){let g=I[e];A[e]=Array.isArray(g)?g.join(","):g}return A},"getTransformedHeaders"),fe={setTimeout:(I,A)=>setTimeout(I,A),clearTimeout:I=>clearTimeout(I)},XE=1e3,Oc=mA((I,A,e=0)=>{if(!e)return-1;let g=mA(C=>{let t=fe.setTimeout(()=>{I.destroy(),A(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-C),Q=mA(c=>{c?.connecting?c.on("connect",()=>{fe.clearTimeout(t)}):fe.clearTimeout(t)},"doWithSocket");I.socket?Q(I.socket):I.on("socket",Q)},"registerTimeout");return e<2e3?(g(0),0):fe.setTimeout(g.bind(null,XE),XE)},"setConnectionTimeout"),qc=3e3,Vc=mA((I,{keepAlive:A,keepAliveMsecs:e},g=qc)=>{if(A!==!0)return-1;let C=mA(()=>{I.socket?I.socket.setKeepAlive(A,e||0):I.on("socket",t=>{t.setKeepAlive(A,e||0)})},"registerListener");return g===0?(C(),0):fe.setTimeout(C,g)},"setSocketKeepAlive"),jE=3e3,Wc=mA((I,A,e=0)=>{let g=mA(C=>{let t=e-C,Q=mA(()=>{I.destroy(),A(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))},"onTimeout");I.socket?I.socket.setTimeout(t,Q):I.setTimeout(t,Q)},"registerTimeout");return 0<e&&e<6e3?(g(0),0):fe.setTimeout(g.bind(null,e===0?0:jE),jE)},"setSocketTimeout"),ts=require("stream"),zE=1e3;async function SB(I,A,e=zE){let g=A.headers??{},C=g.Expect||g.expect,t=-1,Q=!0;C==="100-continue"&&(Q=await Promise.race([new Promise(c=>{t=Number(fe.setTimeout(c,Math.max(zE,e)))}),new Promise(c=>{I.on("continue",()=>{fe.clearTimeout(t),c(!0)}),I.on("response",()=>{fe.clearTimeout(t),c(!1)}),I.on("error",()=>{fe.clearTimeout(t),c(!1)})})])),Q&&Bs(I,A.body)}mA(SB,"writeRequestBody");function Bs(I,A){if(A instanceof ts.Readable){A.pipe(I);return}if(A){if(Buffer.isBuffer(A)||typeof A=="string"){I.end(A);return}let e=A;if(typeof e=="object"&&e.buffer&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number"){I.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}I.end(Buffer.from(A));return}I.end()}mA(Bs,"writeBody");var Zc=0,is=class FB{constructor(A){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,g)=>{typeof A=="function"?A().then(C=>{e(this.resolveDefaultConfig(C))}).catch(g):e(this.resolveDefaultConfig(A))})}static create(A){return typeof A?.handle=="function"?A:new FB(A)}static checkSocketUsage(A,e,g=console){var C,t,Q;let{sockets:c,requests:u,maxSockets:D}=A;if(typeof D!="number"||D===1/0||Date.now()-15e3<e)return e;if(c&&u)for(let a in c){let s=((C=c[a])==null?void 0:C.length)??0,B=((t=u[a])==null?void 0:t.length)??0;if(s>=D&&B>=2*D)return(Q=g?.warn)==null||Q.call(g,`@smithy/node-http-handler:WARN - socket usage at capacity=${s} and ${B} additional requests are enqueued. See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}resolveDefaultConfig(A){let{requestTimeout:e,connectionTimeout:g,socketTimeout:C,httpAgent:t,httpsAgent:Q}=A||{},c=!0,u=50;return{connectionTimeout:g,requestTimeout:e??C,httpAgent:t instanceof yB.Agent||typeof t?.destroy=="function"?t:new yB.Agent({keepAlive:c,maxSockets:u,...t}),httpsAgent:Q instanceof pB.Agent||typeof Q?.destroy=="function"?Q:new pB.Agent({keepAlive:c,maxSockets:u,...Q}),logger:console}}destroy(){var A,e,g,C;(e=(A=this.config)==null?void 0:A.httpAgent)==null||e.destroy(),(C=(g=this.config)==null?void 0:g.httpsAgent)==null||C.destroy()}async handle(A,{abortSignal:e}={}){return this.config||(this.config=await this.configProvider),new Promise((g,C)=>{let t,Q=[],c=mA(async F=>{await t,Q.forEach(fe.clearTimeout),g(F)},"resolve"),u=mA(async F=>{await t,Q.forEach(fe.clearTimeout),C(F)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e?.aborted){let F=new Error("Request aborted");F.name="AbortError",u(F);return}let D=A.protocol==="https:",o=D?this.config.httpsAgent:this.config.httpAgent;Q.push(fe.setTimeout(()=>{this.socketWarningTimestamp=FB.checkSocketUsage(o,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2e3)+(this.config.connectionTimeout??1e3)));let a=(0,Is.buildQueryString)(A.query||{}),s;if(A.username!=null||A.password!=null){let F=A.username??"",R=A.password??"";s=`${F}:${R}`}let B=A.path;a&&(B+=`?${a}`),A.fragment&&(B+=`#${A.fragment}`);let i=A.hostname??"";i[0]==="["&&i.endsWith("]")?i=A.hostname.slice(1,-1):i=A.hostname;let E={headers:A.headers,host:i,method:A.method,path:B,port:A.port,agent:o,auth:s},h=(D?pB.request:yB.request)(E,F=>{let R=new gs.HttpResponse({statusCode:F.statusCode||-1,reason:F.statusMessage,headers:Cs(F.headers),body:F});c({response:R})});if(h.on("error",F=>{Pc.includes(F.code)?u(Object.assign(F,{name:"TimeoutError"})):u(F)}),e){let F=mA(()=>{h.destroy();let R=new Error("Request aborted");R.name="AbortError",u(R)},"onAbort");if(typeof e.addEventListener=="function"){let R=e;R.addEventListener("abort",F,{once:!0}),h.once("close",()=>R.removeEventListener("abort",F))}else e.onabort=F}Q.push(Oc(h,u,this.config.connectionTimeout)),Q.push(Wc(h,u,this.config.requestTimeout));let f=E.agent;typeof f=="object"&&"keepAlive"in f&&Q.push(Vc(h,{keepAlive:f.keepAlive,keepAliveMsecs:f.keepAliveMsecs})),t=SB(h,A,this.config.requestTimeout).catch(F=>(Q.forEach(fe.clearTimeout),C(F)))})}updateHttpClientConfig(A,e){this.config=void 0,this.configProvider=this.configProvider.then(g=>({...g,[A]:e}))}httpHandlerConfigs(){return this.config??{}}};mA(is,"NodeHttpHandler");var _c=is,$E=require("http2"),Xc=xc(require("http2")),Qs=class{constructor(A){this.sessions=[],this.sessions=A??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(A){this.sessions.push(A)}contains(A){return this.sessions.includes(A)}remove(A){this.sessions=this.sessions.filter(e=>e!==A)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(A){for(let e of this.sessions)e===A&&(e.destroyed||e.destroy())}};mA(Qs,"NodeHttp2ConnectionPool");var jc=Qs,Es=class{constructor(A){if(this.sessionCache=new Map,this.config=A,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(A,e){let g=this.getUrlString(A),C=this.sessionCache.get(g);if(C){let u=C.poll();if(u&&!this.config.disableConcurrency)return u}let t=Xc.default.connect(g);this.config.maxConcurrency&&t.settings({maxConcurrentStreams:this.config.maxConcurrency},u=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+A.destination.toString())}),t.unref();let Q=mA(()=>{t.destroy(),this.deleteSession(g,t)},"destroySessionCb");t.on("goaway",Q),t.on("error",Q),t.on("frameError",Q),t.on("close",()=>this.deleteSession(g,t)),e.requestTimeout&&t.setTimeout(e.requestTimeout,Q);let c=this.sessionCache.get(g)||new jc;return c.offerLast(t),this.sessionCache.set(g,c),t}deleteSession(A,e){let g=this.sessionCache.get(A);g&&g.contains(e)&&(g.remove(e),this.sessionCache.set(A,g))}release(A,e){var g;let C=this.getUrlString(A);(g=this.sessionCache.get(C))==null||g.offerLast(e)}destroy(){for(let[A,e]of this.sessionCache){for(let g of e)g.destroyed||g.destroy(),e.remove(g);this.sessionCache.delete(A)}}setMaxConcurrentStreams(A){if(A&&A<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=A}setDisableConcurrentStreams(A){this.config.disableConcurrency=A}getUrlString(A){return A.destination.toString()}};mA(Es,"NodeHttp2ConnectionManager");var zc=Es,ss=class rs{constructor(A){this.metadata={handlerProtocol:"h2"},this.connectionManager=new zc({}),this.configProvider=new Promise((e,g)=>{typeof A=="function"?A().then(C=>{e(C||{})}).catch(g):e(A||{})})}static create(A){return typeof A?.handle=="function"?A:new rs(A)}destroy(){this.connectionManager.destroy()}async handle(A,{abortSignal:e}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));let{requestTimeout:g,disableConcurrentStreams:C}=this.config;return new Promise((t,Q)=>{var c;let u=!1,D,o=mA(async x=>{await D,t(x)},"resolve"),a=mA(async x=>{await D,Q(x)},"reject");if(e?.aborted){u=!0;let x=new Error("Request aborted");x.name="AbortError",a(x);return}let{hostname:s,method:B,port:i,protocol:E,query:r}=A,h="";if(A.username!=null||A.password!=null){let x=A.username??"",eA=A.password??"";h=`${x}:${eA}@`}let f=`${E}//${h}${s}${i?`:${i}`:""}`,F={destination:new URL(f)},R=this.connectionManager.lease(F,{requestTimeout:(c=this.config)==null?void 0:c.sessionTimeout,disableConcurrentStreams:C||!1}),M=mA(x=>{C&&this.destroySession(R),u=!0,a(x)},"rejectWithDestroy"),N=(0,Is.buildQueryString)(r||{}),U=A.path;N&&(U+=`?${N}`),A.fragment&&(U+=`#${A.fragment}`);let P=R.request({...A.headers,[$E.constants.HTTP2_HEADER_PATH]:U,[$E.constants.HTTP2_HEADER_METHOD]:B});if(R.ref(),P.on("response",x=>{let eA=new gs.HttpResponse({statusCode:x[":status"]||-1,headers:Cs(x),body:P});u=!0,o({response:eA}),C&&(R.close(),this.connectionManager.deleteSession(f,R))}),g&&P.setTimeout(g,()=>{P.close();let x=new Error(`Stream timed out because of no activity for ${g} ms`);x.name="TimeoutError",M(x)}),e){let x=mA(()=>{P.close();let eA=new Error("Request aborted");eA.name="AbortError",M(eA)},"onAbort");if(typeof e.addEventListener=="function"){let eA=e;eA.addEventListener("abort",x,{once:!0}),P.once("close",()=>eA.removeEventListener("abort",x))}else e.onabort=x}P.on("frameError",(x,eA,AA)=>{M(new Error(`Frame type id ${x} in stream id ${AA} has failed with code ${eA}.`))}),P.on("error",M),P.on("aborted",()=>{M(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${P.rstCode}.`))}),P.on("close",()=>{R.unref(),C&&R.destroy(),u||M(new Error("Unexpected error: http2 request did not get a response"))}),D=SB(P,A,g)})}updateHttpClientConfig(A,e){this.config=void 0,this.configProvider=this.configProvider.then(g=>({...g,[A]:e}))}httpHandlerConfigs(){return this.config??{}}destroySession(A){A.destroyed||A.destroy()}};mA(ss,"NodeHttp2Handler");var $c=ss,os=class extends ts.Writable{constructor(){super(...arguments),this.bufferedBytes=[]}_write(A,e,g){this.bufferedBytes.push(A),g()}};mA(os,"Collector");var AD=os,eD=mA(I=>gD(I)?ns(I):new Promise((A,e)=>{let g=new AD;I.pipe(g),I.on("error",C=>{g.end(),e(C)}),g.on("error",e),g.on("finish",function(){let C=new Uint8Array(Buffer.concat(this.bufferedBytes));A(C)})}),"streamCollector"),gD=mA(I=>typeof ReadableStream=="function"&&I instanceof ReadableStream,"isReadableStreamInstance");async function ns(I){let A=[],e=I.getReader(),g=!1,C=0;for(;!g;){let{done:c,value:u}=await e.read();u&&(A.push(u),C+=u.length),g=c}let t=new Uint8Array(C),Q=0;for(let c of A)t.set(c,Q),Q+=c.length;return t}mA(ns,"collectReadableStream")}),ws=K((CF,ls)=>{"use strict";var _I=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ID=typeof AbortController=="function",GC=ID?AbortController:class{constructor(){this.signal=new cs}abort(A=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||A,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},CD=typeof AbortSignal=="function",tD=typeof GC.AbortSignal=="function",cs=CD?AbortSignal:tD?GC.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(A){A.type==="abort"&&(this.aborted=!0,this.onabort(A),this._listeners.forEach(e=>e(A),this))}onabort(){}addEventListener(A,e){A==="abort"&&this._listeners.push(e)}removeEventListener(A,e){A==="abort"&&(this._listeners=this._listeners.filter(g=>g!==e))}},GB=new Set,RB=(I,A)=>{let e=`LRU_CACHE_OPTION_${I}`;mC(e)&&mB(e,`${I} option`,`options.${A}`,II)},kB=(I,A)=>{let e=`LRU_CACHE_METHOD_${I}`;if(mC(e)){let{prototype:g}=II,{get:C}=Object.getOwnPropertyDescriptor(g,I);mB(e,`${I} method`,`cache.${A}()`,C)}},BD=(I,A)=>{let e=`LRU_CACHE_PROPERTY_${I}`;if(mC(e)){let{prototype:g}=II,{get:C}=Object.getOwnPropertyDescriptor(g,I);mB(e,`${I} property`,`cache.${A}`,C)}},Ds=(...I)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...I):console.error(...I)},mC=I=>!GB.has(I),mB=(I,A,e,g)=>{GB.add(I);let C=`The ${A} is deprecated. Please use ${e} instead.`;Ds(C,"DeprecationWarning",I,g)},Rg=I=>I&&I===Math.floor(I)&&I>0&&isFinite(I),hs=I=>Rg(I)?I<=Math.pow(2,8)?Uint8Array:I<=Math.pow(2,16)?Uint16Array:I<=Math.pow(2,32)?Uint32Array:I<=Number.MAX_SAFE_INTEGER?gI:null:null,gI=class extends Array{constructor(A){super(A),this.fill(0)}},MB=class{constructor(A){if(A===0)return[];let e=hs(A);this.heap=new e(A),this.length=0}push(A){this.heap[this.length++]=A}pop(){return this.heap[--this.length]}},II=class I{constructor(A={}){let{max:e=0,ttl:g,ttlResolution:C=1,ttlAutopurge:t,updateAgeOnGet:Q,updateAgeOnHas:c,allowStale:u,dispose:D,disposeAfter:o,noDisposeOnSet:a,noUpdateTTL:s,maxSize:B=0,maxEntrySize:i=0,sizeCalculation:E,fetchMethod:r,fetchContext:h,noDeleteOnFetchRejection:f,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:M,ignoreFetchAbort:N}=A,{length:U,maxAge:P,stale:x}=A instanceof I?{}:A;if(e!==0&&!Rg(e))throw new TypeError("max option must be a nonnegative integer");let eA=e?hs(e):Array;if(!eA)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=B,this.maxEntrySize=i||this.maxSize,this.sizeCalculation=E||U,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=r||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=h,!this.fetchMethod&&h!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new eA(e),this.prev=new eA(e),this.head=0,this.tail=0,this.free=new MB(e),this.initialFill=1,this.size=0,typeof D=="function"&&(this.dispose=D),typeof o=="function"?(this.disposeAfter=o,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!a,this.noUpdateTTL=!!s,this.noDeleteOnFetchRejection=!!f,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.maxSize!==0&&!Rg(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Rg(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!x,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!Q,this.updateAgeOnHas=!!c,this.ttlResolution=Rg(C)||C===0?C:1,this.ttlAutopurge=!!t,this.ttl=g||P||0,this.ttl){if(!Rg(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let AA="LRU_CACHE_UNBOUNDED";mC(AA)&&(GB.add(AA),Ds("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",AA,I))}x&&RB("stale","allowStale"),P&&RB("maxAge","ttl"),U&&RB("length","sizeCalculation")}getRemainingTTL(A){return this.has(A,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new gI(this.max),this.starts=new gI(this.max),this.setItemTTL=(g,C,t=_I.now())=>{if(this.starts[g]=C!==0?t:0,this.ttls[g]=C,C!==0&&this.ttlAutopurge){let Q=setTimeout(()=>{this.isStale(g)&&this.delete(this.keyList[g])},C+1);Q.unref&&Q.unref()}},this.updateItemAge=g=>{this.starts[g]=this.ttls[g]!==0?_I.now():0},this.statusTTL=(g,C)=>{g&&(g.ttl=this.ttls[C],g.start=this.starts[C],g.now=A||e(),g.remainingTTL=g.now+g.ttl-g.start)};let A=0,e=()=>{let g=_I.now();if(this.ttlResolution>0){A=g;let C=setTimeout(()=>A=0,this.ttlResolution);C.unref&&C.unref()}return g};this.getRemainingTTL=g=>{let C=this.keyMap.get(g);return C===void 0?0:this.ttls[C]===0||this.starts[C]===0?1/0:this.starts[C]+this.ttls[C]-(A||e())},this.isStale=g=>this.ttls[g]!==0&&this.starts[g]!==0&&(A||e())-this.starts[g]>this.ttls[g]}updateItemAge(A){}statusTTL(A,e){}setItemTTL(A,e,g){}isStale(A){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new gI(this.max),this.removeItemSize=A=>{this.calculatedSize-=this.sizes[A],this.sizes[A]=0},this.requireSize=(A,e,g,C)=>{if(this.isBackgroundFetch(e))return 0;if(!Rg(g))if(C){if(typeof C!="function")throw new TypeError("sizeCalculation must be a function");if(g=C(e,A),!Rg(g))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return g},this.addItemSize=(A,e,g)=>{if(this.sizes[A]=e,this.maxSize){let C=this.maxSize-this.sizes[A];for(;this.calculatedSize>C;)this.evict(!0)}this.calculatedSize+=this.sizes[A],g&&(g.entrySize=e,g.totalCalculatedSize=this.calculatedSize)}}removeItemSize(A){}addItemSize(A,e){}requireSize(A,e,g,C){if(g||C)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:A=this.allowStale}={}){if(this.size)for(let e=this.tail;!(!this.isValidIndex(e)||((A||!this.isStale(e))&&(yield e),e===this.head));)e=this.prev[e]}*rindexes({allowStale:A=this.allowStale}={}){if(this.size)for(let e=this.head;!(!this.isValidIndex(e)||((A||!this.isStale(e))&&(yield e),e===this.tail));)e=this.next[e]}isValidIndex(A){return A!==void 0&&this.keyMap.get(this.keyList[A])===A}*entries(){for(let A of this.indexes())this.valList[A]!==void 0&&this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield[this.keyList[A],this.valList[A]])}*rentries(){for(let A of this.rindexes())this.valList[A]!==void 0&&this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield[this.keyList[A],this.valList[A]])}*keys(){for(let A of this.indexes())this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.keyList[A])}*rkeys(){for(let A of this.rindexes())this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.keyList[A])}*values(){for(let A of this.indexes())this.valList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.valList[A])}*rvalues(){for(let A of this.rindexes())this.valList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.valList[A])}[Symbol.iterator](){return this.entries()}find(A,e){for(let g of this.indexes()){let C=this.valList[g],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;if(t!==void 0&&A(t,this.keyList[g],this))return this.get(this.keyList[g],e)}}forEach(A,e=this){for(let g of this.indexes()){let C=this.valList[g],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;t!==void 0&&A.call(e,t,this.keyList[g],this)}}rforEach(A,e=this){for(let g of this.rindexes()){let C=this.valList[g],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;t!==void 0&&A.call(e,t,this.keyList[g],this)}}get prune(){return kB("prune","purgeStale"),this.purgeStale}purgeStale(){let A=!1;for(let e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),A=!0);return A}dump(){let A=[];for(let e of this.indexes({allowStale:!0})){let g=this.keyList[e],C=this.valList[e],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;if(t===void 0)continue;let Q={value:t};if(this.ttls){Q.ttl=this.ttls[e];let c=_I.now()-this.starts[e];Q.start=Math.floor(Date.now()-c)}this.sizes&&(Q.size=this.sizes[e]),A.unshift([g,Q])}return A}load(A){this.clear();for(let[e,g]of A){if(g.start){let C=Date.now()-g.start;g.start=_I.now()-C}this.set(e,g.value,g)}}dispose(A,e,g){}set(A,e,{ttl:g=this.ttl,start:C,noDisposeOnSet:t=this.noDisposeOnSet,size:Q=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:D}={}){if(Q=this.requireSize(A,e,Q,c),this.maxEntrySize&&Q>this.maxEntrySize)return D&&(D.set="miss",D.maxEntrySizeExceeded=!0),this.delete(A),this;let o=this.size===0?void 0:this.keyMap.get(A);if(o===void 0)o=this.newIndex(),this.keyList[o]=A,this.valList[o]=e,this.keyMap.set(A,o),this.next[this.tail]=o,this.prev[o]=this.tail,this.tail=o,this.size++,this.addItemSize(o,Q,D),D&&(D.set="add"),u=!1;else{this.moveToTail(o);let a=this.valList[o];if(e!==a){if(this.isBackgroundFetch(a)?a.__abortController.abort(new Error("replaced")):t||(this.dispose(a,A,"set"),this.disposeAfter&&this.disposed.push([a,A,"set"])),this.removeItemSize(o),this.valList[o]=e,this.addItemSize(o,Q,D),D){D.set="replace";let s=a&&this.isBackgroundFetch(a)?a.__staleWhileFetching:a;s!==void 0&&(D.oldValue=s)}}else D&&(D.set="update")}if(g!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(o,g,C),this.statusTTL(D,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let A=this.valList[this.head];return this.evict(!0),A}}evict(A){let e=this.head,g=this.keyList[e],C=this.valList[e];return this.isBackgroundFetch(C)?C.__abortController.abort(new Error("evicted")):(this.dispose(C,g,"evict"),this.disposeAfter&&this.disposed.push([C,g,"evict"])),this.removeItemSize(e),A&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(g),this.size--,e}has(A,{updateAgeOnHas:e=this.updateAgeOnHas,status:g}={}){let C=this.keyMap.get(A);if(C!==void 0)if(this.isStale(C))g&&(g.has="stale",this.statusTTL(g,C));else return e&&this.updateItemAge(C),g&&(g.has="hit"),this.statusTTL(g,C),!0;else g&&(g.has="miss");return!1}peek(A,{allowStale:e=this.allowStale}={}){let g=this.keyMap.get(A);if(g!==void 0&&(e||!this.isStale(g))){let C=this.valList[g];return this.isBackgroundFetch(C)?C.__staleWhileFetching:C}}backgroundFetch(A,e,g,C){let t=e===void 0?void 0:this.valList[e];if(this.isBackgroundFetch(t))return t;let Q=new GC;g.signal&&g.signal.addEventListener("abort",()=>Q.abort(g.signal.reason));let c={signal:Q.signal,options:g,context:C},u=(B,i=!1)=>{let{aborted:E}=Q.signal,r=g.ignoreFetchAbort&&B!==void 0;return g.status&&(E&&!i?(g.status.fetchAborted=!0,g.status.fetchError=Q.signal.reason,r&&(g.status.fetchAbortIgnored=!0)):g.status.fetchResolved=!0),E&&!r&&!i?o(Q.signal.reason):(this.valList[e]===s&&(B===void 0?s.__staleWhileFetching?this.valList[e]=s.__staleWhileFetching:this.delete(A):(g.status&&(g.status.fetchUpdated=!0),this.set(A,B,c.options))),B)},D=B=>(g.status&&(g.status.fetchRejected=!0,g.status.fetchError=B),o(B)),o=B=>{let{aborted:i}=Q.signal,E=i&&g.allowStaleOnFetchAbort,r=E||g.allowStaleOnFetchRejection,h=r||g.noDeleteOnFetchRejection;if(this.valList[e]===s&&(!h||s.__staleWhileFetching===void 0?this.delete(A):E||(this.valList[e]=s.__staleWhileFetching)),r)return g.status&&s.__staleWhileFetching!==void 0&&(g.status.returnedStale=!0),s.__staleWhileFetching;if(s.__returned===s)throw B},a=(B,i)=>{this.fetchMethod(A,t,c).then(E=>B(E),i),Q.signal.addEventListener("abort",()=>{(!g.ignoreFetchAbort||g.allowStaleOnFetchAbort)&&(B(),g.allowStaleOnFetchAbort&&(B=E=>u(E,!0)))})};g.status&&(g.status.fetchDispatched=!0);let s=new Promise(a).then(u,D);return s.__abortController=Q,s.__staleWhileFetching=t,s.__returned=null,e===void 0?(this.set(A,s,{...c.options,status:void 0}),e=this.keyMap.get(A)):this.valList[e]=s,s}isBackgroundFetch(A){return A&&typeof A=="object"&&typeof A.then=="function"&&Object.prototype.hasOwnProperty.call(A,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(A,"__returned")&&(A.__returned===A||A.__returned===null)}async fetch(A,{allowStale:e=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,ttl:t=this.ttl,noDisposeOnSet:Q=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:D=this.noUpdateTTL,noDeleteOnFetchRejection:o=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:a=this.allowStaleOnFetchRejection,ignoreFetchAbort:s=this.ignoreFetchAbort,allowStaleOnFetchAbort:B=this.allowStaleOnFetchAbort,fetchContext:i=this.fetchContext,forceRefresh:E=!1,status:r,signal:h}={}){if(!this.fetchMethod)return r&&(r.fetch="get"),this.get(A,{allowStale:e,updateAgeOnGet:g,noDeleteOnStaleGet:C,status:r});let f={allowStale:e,updateAgeOnGet:g,noDeleteOnStaleGet:C,ttl:t,noDisposeOnSet:Q,size:c,sizeCalculation:u,noUpdateTTL:D,noDeleteOnFetchRejection:o,allowStaleOnFetchRejection:a,allowStaleOnFetchAbort:B,ignoreFetchAbort:s,status:r,signal:h},F=this.keyMap.get(A);if(F===void 0){r&&(r.fetch="miss");let R=this.backgroundFetch(A,F,f,i);return R.__returned=R}else{let R=this.valList[F];if(this.isBackgroundFetch(R)){let x=e&&R.__staleWhileFetching!==void 0;return r&&(r.fetch="inflight",x&&(r.returnedStale=!0)),x?R.__staleWhileFetching:R.__returned=R}let M=this.isStale(F);if(!E&&!M)return r&&(r.fetch="hit"),this.moveToTail(F),g&&this.updateItemAge(F),this.statusTTL(r,F),R;let N=this.backgroundFetch(A,F,f,i),U=N.__staleWhileFetching!==void 0,P=U&&e;return r&&(r.fetch=U&&M?"stale":"refresh",P&&M&&(r.returnedStale=!0)),P?N.__staleWhileFetching:N.__returned=N}}get(A,{allowStale:e=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,status:t}={}){let Q=this.keyMap.get(A);if(Q!==void 0){let c=this.valList[Q],u=this.isBackgroundFetch(c);return this.statusTTL(t,Q),this.isStale(Q)?(t&&(t.get="stale"),u?(t&&(t.returnedStale=e&&c.__staleWhileFetching!==void 0),e?c.__staleWhileFetching:void 0):(C||this.delete(A),t&&(t.returnedStale=e),e?c:void 0)):(t&&(t.get="hit"),u?c.__staleWhileFetching:(this.moveToTail(Q),g&&this.updateItemAge(Q),c))}else t&&(t.get="miss")}connect(A,e){this.prev[e]=A,this.next[A]=e}moveToTail(A){A!==this.tail&&(A===this.head?this.head=this.next[A]:this.connect(this.prev[A],this.next[A]),this.connect(this.tail,A),this.tail=A)}get del(){return kB("del","delete"),this.delete}delete(A){let e=!1;if(this.size!==0){let g=this.keyMap.get(A);if(g!==void 0)if(e=!0,this.size===1)this.clear();else{this.removeItemSize(g);let C=this.valList[g];this.isBackgroundFetch(C)?C.__abortController.abort(new Error("deleted")):(this.dispose(C,A,"delete"),this.disposeAfter&&this.disposed.push([C,A,"delete"])),this.keyMap.delete(A),this.keyList[g]=null,this.valList[g]=null,g===this.tail?this.tail=this.prev[g]:g===this.head?this.head=this.next[g]:(this.next[this.prev[g]]=this.next[g],this.prev[this.next[g]]=this.prev[g]),this.size--,this.free.push(g)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(let A of this.rindexes({allowStale:!0})){let e=this.valList[A];if(this.isBackgroundFetch(e))e.__abortController.abort(new Error("deleted"));else{let g=this.keyList[A];this.dispose(e,g,"delete"),this.disposeAfter&&this.disposed.push([e,g,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return kB("reset","clear"),this.clear}get length(){return BD("length","size"),this.size}static get AbortController(){return GC}static get AbortSignal(){return cs}};ls.exports=II}),ys=K(de=>{"use strict";var iD=de&&de.__createBinding||(Object.create?function(I,A,e,g){g===void 0&&(g=e);var C=Object.getOwnPropertyDescriptor(A,e);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(I,g,C)}:function(I,A,e,g){g===void 0&&(g=e),I[g]=A[e]}),QD=de&&de.__setModuleDefault||(Object.create?function(I,A){Object.defineProperty(I,"default",{enumerable:!0,value:A})}:function(I,A){I.default=A}),fs=de&&de.__importStar||function(I){if(I&&I.__esModule)return I;var A={};if(I!=null)for(var e in I)e!=="default"&&Object.prototype.hasOwnProperty.call(I,e)&&iD(A,I,e);return QD(A,I),A};Object.defineProperty(de,"__esModule",{value:!0}),de.req=de.json=de.toBuffer=void 0;var ED=fs(require("http")),sD=fs(require("https"));async function ds(I){let A=0,e=[];for await(let g of I)A+=g.length,e.push(g);return Buffer.concat(e,A)}de.toBuffer=ds;async function rD(I){let e=(await ds(I)).toString("utf8");try{return JSON.parse(e)}catch(g){let C=g;throw C.message+=` (input: ${e})`,C}}de.json=rD;function oD(I,A={}){let g=((typeof I=="string"?I:I.href).startsWith("https:")?sD:ED).request(I,A),C=new Promise((t,Q)=>{g.once("response",t).once("error",Q).end()});return g.then=C.then.bind(C),g}de.req=oD}),CI=K(Re=>{"use strict";var Fs=Re&&Re.__createBinding||(Object.create?function(I,A,e,g){g===void 0&&(g=e);var C=Object.getOwnPropertyDescriptor(A,e);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(I,g,C)}:function(I,A,e,g){g===void 0&&(g=e),I[g]=A[e]}),nD=Re&&Re.__setModuleDefault||(Object.create?function(I,A){Object.defineProperty(I,"default",{enumerable:!0,value:A})}:function(I,A){I.default=A}),Ss=Re&&Re.__importStar||function(I){if(I&&I.__esModule)return I;var A={};if(I!=null)for(var e in I)e!=="default"&&Object.prototype.hasOwnProperty.call(I,e)&&Fs(A,I,e);return nD(A,I),A},aD=Re&&Re.__exportStar||function(I,A){for(var e in I)e!=="default"&&!Object.prototype.hasOwnProperty.call(A,e)&&Fs(A,I,e)};Object.defineProperty(Re,"__esModule",{value:!0}),Re.Agent=void 0;var uD=Ss(require("net")),ps=Ss(require("http")),cD=require("https");aD(ys(),Re);var gg=Symbol("AgentBaseInternalState"),NB=class extends ps.Agent{constructor(A){super(A),this[gg]={}}isSecureEndpoint(A){if(A){if(typeof A.secureEndpoint=="boolean")return A.secureEndpoint;if(typeof A.protocol=="string")return A.protocol==="https:"}let{stack:e}=new Error;return typeof e!="string"?!1:e.split(` `).some(g=>g.indexOf("(https.js:")!==-1||g.indexOf("node:https:")!==-1)}incrementSockets(A){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[A]||(this.sockets[A]=[]);let e=new uD.Socket({writable:!1});return this.sockets[A].push(e),this.totalSocketCount++,e}decrementSockets(A,e){if(!this.sockets[A]||e===null)return;let g=this.sockets[A],C=g.indexOf(e);C!==-1&&(g.splice(C,1),this.totalSocketCount--,g.length===0&&delete this.sockets[A])}getName(A){return this.isSecureEndpoint(A)?cD.Agent.prototype.getName.call(this,A):super.getName(A)}createSocket(A,e,g){let C={...e,secureEndpoint:this.isSecureEndpoint(e)},t=this.getName(C),Q=this.incrementSockets(t);Promise.resolve().then(()=>this.connect(A,C)).then(c=>{if(this.decrementSockets(t,Q),c instanceof ps.Agent)try{return c.addRequest(A,C)}catch(u){return g(u)}this[gg].currentSocket=c,super.createSocket(A,e,g)},c=>{this.decrementSockets(t,Q),g(c)})}createConnection(){let A=this[gg].currentSocket;if(this[gg].currentSocket=void 0,!A)throw new Error("No socket was returned in the `connect()` function");return A}get defaultPort(){return this[gg].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(A){this[gg]&&(this[gg].defaultPort=A)}get protocol(){return this[gg].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(A){this[gg]&&(this[gg].protocol=A)}};Re.Agent=NB}),ks=K((iF,Rs)=>{"use strict";var tI=1e3,BI=tI*60,iI=BI*60,Og=iI*24,DD=Og*7,hD=Og*365.25;Rs.exports=function(I,A){A=A||{};var e=typeof I;if(e==="string"&&I.length>0)return lD(I);if(e==="number"&&isFinite(I))return A.long?fD(I):wD(I);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(I))};function lD(I){if(I=String(I),!(I.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(I);if(A){var e=parseFloat(A[1]),g=(A[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return e*hD;case"weeks":case"week":case"w":return e*DD;case"days":case"day":case"d":return e*Og;case"hours":case"hour":case"hrs":case"hr":case"h":return e*iI;case"minutes":case"minute":case"mins":case"min":case"m":return e*BI;case"seconds":case"second":case"secs":case"sec":case"s":return e*tI;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function wD(I){var A=Math.abs(I);return A>=Og?Math.round(I/Og)+"d":A>=iI?Math.round(I/iI)+"h":A>=BI?Math.round(I/BI)+"m":A>=tI?Math.round(I/tI)+"s":I+"ms"}function fD(I){var A=Math.abs(I);return A>=Og?NC(I,A,Og,"day"):A>=iI?NC(I,A,iI,"hour"):A>=BI?NC(I,A,BI,"minute"):A>=tI?NC(I,A,tI,"second"):I+" ms"}function NC(I,A,e,g){var C=A>=e*1.5;return Math.round(I/e)+" "+g+(C?"s":"")}}),UB=K((QF,Ms)=>{"use strict";function dD(I){e.debug=e,e.default=e,e.coerce=u,e.disable=Q,e.enable=C,e.enabled=c,e.humanize=ks(),e.destroy=D,Object.keys(I).forEach(o=>{e[o]=I[o]}),e.names=[],e.skips=[],e.formatters={};function A(o){let a=0;for(let s=0;s<o.length;s++)a=(a<<5)-a+o.charCodeAt(s),a|=0;return e.colors[Math.abs(a)%e.colors.length]}e.selectColor=A;function e(o){let a,s=null,B,i;function E(...r){if(!E.enabled)return;let h=E,f=Number(new Date),F=f-(a||f);h.diff=F,h.prev=a,h.curr=f,a=f,r[0]=e.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let R=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";R++;let P=e.formatters[U];if(typeof P=="function"){let x=r[R];N=P.call(h,x),r.splice(R,1),R--}return N}),e.formatArgs.call(h,r),(h.log||e.log).apply(h,r)}return E.namespace=o,E.useColors=e.useColors(),E.color=e.selectColor(o),E.extend=g,E.destroy=e.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>s!==null?s:(B!==e.namespaces&&(B=e.namespaces,i=e.enabled(o)),i),set:r=>{s=r}}),typeof e.init=="function"&&e.init(E),E}function g(o,a){let s=e(this.namespace+(typeof a>"u"?":":a)+o);return s.log=this.log,s}function C(o){e.save(o),e.namespaces=o,e.names=[],e.skips=[];let a=(typeof o=="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let s of a)s[0]==="-"?e.skips.push(s.slice(1)):e.names.push(s)}function t(o,a){let s=0,B=0,i=-1,E=0;for(;s<o.length;)if(B<a.length&&(a[B]===o[s]||a[B]==="*"))a[B]==="*"?(i=B,E=s,B++):(s++,B++);else if(i!==-1)B=i+1,E++,s=E;else return!1;for(;B<a.length&&a[B]==="*";)B++;return B===a.length}function Q(){let o=[...e.names,...e.skips.map(a=>"-"+a)].join(",");return e.enable(""),o}function c(o){for(let a of e.skips)if(t(o,a))return!1;for(let a of e.names)if(t(o,a))return!0;return!1}function u(o){return o instanceof Error?o.stack||o.message:o}function D(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}Ms.exports=dD}),Gs=K((ye,UC)=>{"use strict";ye.formatArgs=pD,ye.save=FD,ye.load=SD,ye.useColors=yD,ye.storage=RD(),ye.destroy=(()=>{let I=!1;return()=>{I||(I=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),ye.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function yD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let I;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(I=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(I[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function pD(I){if(I[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+I[0]+(this.useColors?"%c ":" ")+"+"+UC.exports.humanize(this.diff),!this.useColors)return;let A="color: "+this.color;I.splice(1,0,A,"color: inherit");let e=0,g=0;I[0].replace(/%[a-zA-Z%]/g,C=>{C!=="%%"&&(e++,C==="%c"&&(g=e))}),I.splice(g,0,A)}ye.log=console.debug||console.log||(()=>{});function FD(I){try{I?ye.storage.setItem("debug",I):ye.storage.removeItem("debug")}catch{}}function SD(){let I;try{I=ye.storage.getItem("debug")||ye.storage.getItem("DEBUG")}catch{}return!I&&typeof process<"u"&&"env"in process&&(I=process.env.DEBUG),I}function RD(){try{return localStorage}catch{}}UC.exports=UB()(ye);var{formatters:kD}=UC.exports;kD.j=function(I){try{return JSON.stringify(I)}catch(A){return"[UnexpectedJSONParseError]: "+A.message}}}),Ns=K((EF,ms)=>{"use strict";ms.exports=(I,A=process.argv)=>{let e=I.startsWith("-")?"":I.length===1?"-":"--",g=A.indexOf(e+I),C=A.indexOf("--");return g!==-1&&(C===-1||g<C)}}),Js=K((sF,Ls)=>{"use strict";var MD=require("os"),Us=require("tty"),Ue=Ns(),{env:Ae}=process,kg;Ue("no-color")||Ue("no-colors")||Ue("color=false")||Ue("color=never")?kg=0:(Ue("color")||Ue("colors")||Ue("color=true")||Ue("color=always"))&&(kg=1),"FORCE_COLOR"in Ae&&(Ae.FORCE_COLOR==="true"?kg=1:Ae.FORCE_COLOR==="false"?kg=0:kg=Ae.FORCE_COLOR.length===0?1:Math.min(parseInt(Ae.FORCE_COLOR,10),3));function LB(I){return I===0?!1:{level:I,hasBasic:!0,has256:I>=2,has16m:I>=3}}function JB(I,A){if(kg===0)return 0;if(Ue("color=16m")||Ue("color=full")||Ue("color=truecolor"))return 3;if(Ue("color=256"))return 2;if(I&&!A&&kg===void 0)return 0;let e=kg||0;if(Ae.TERM==="dumb")return e;if(process.platform==="win32"){let g=MD.release().split(".");return Number(g[0])>=10&&Number(g[2])>=10586?Number(g[2])>=14931?3:2:1}if("CI"in Ae)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(g=>g in Ae)||Ae.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Ae)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ae.TEAMCITY_VERSION)?1:0;if(Ae.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ae){let g=parseInt((Ae.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ae.TERM_PROGRAM){case"iTerm.app":return g>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ae.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ae.TERM)||"COLORTERM"in Ae?1:e}function GD(I){let A=JB(I,I&&I.isTTY);return LB(A)}Ls.exports={supportsColor:GD,stdout:LB(JB(!0,Us.isatty(1))),stderr:LB(JB(!0,Us.isatty(2)))}}),Hs=K((ee,JC)=>{"use strict";var mD=require("tty"),LC=require("util");ee.init=bD,ee.log=JD,ee.formatArgs=UD,ee.save=KD,ee.load=HD,ee.useColors=ND,ee.destroy=LC.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),ee.colors=[6,2,3,4,5,1];try{let I=Js();I&&(I.stderr||I).level>=2&&(ee.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}ee.inspectOpts=Object.keys(process.env).filter(I=>/^debug_/i.test(I)).reduce((I,A)=>{let e=A.substring(6).toLowerCase().replace(/_([a-z])/g,(C,t)=>t.toUpperCase()),g=process.env[A];return/^(yes|on|true|enabled)$/i.test(g)?g=!0:/^(no|off|false|disabled)$/i.test(g)?g=!1:g==="null"?g=null:g=Number(g),I[e]=g,I},{});function ND(){return"colors"in ee.inspectOpts?!!ee.inspectOpts.colors:mD.isatty(process.stderr.fd)}function UD(I){let{namespace:A,useColors:e}=this;if(e){let g=this.color,C="\x1B[3"+(g<8?g:"8;5;"+g),t=` ${C};1m${A} \x1B[0m`;I[0]=t+I[0].split(` `).join(` `+t),I.push(C+"m+"+JC.exports.humanize(this.diff)+"\x1B[0m")}else I[0]=LD()+A+" "+I[0]}function LD(){return ee.inspectOpts.hideDate?"":new Date().toISOString()+" "}function JD(...I){return process.stderr.write(LC.formatWithOptions(ee.inspectOpts,...I)+` `)}function KD(I){I?process.env.DEBUG=I:delete process.env.DEBUG}function HD(){return process.env.DEBUG}function bD(I){I.inspectOpts={};let A=Object.keys(ee.inspectOpts);for(let e=0;e<A.length;e++)I.inspectOpts[A[e]]=ee.inspectOpts[A[e]]}JC.exports=UB()(ee);var{formatters:Ks}=JC.exports;Ks.o=function(I){return this.inspectOpts.colors=this.useColors,LC.inspect(I,this.inspectOpts).split(` `).map(A=>A.trim()).join(" ")},Ks.O=function(I){return this.inspectOpts.colors=this.useColors,LC.inspect(I,this.inspectOpts)}}),Le=K((rF,KB)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?KB.exports=Gs():KB.exports=Hs()}),Ys=K(bs=>{"use strict";var YD=require("url").parse,vD={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},xD=String.prototype.endsWith||function(I){return I.length<=this