wiki-viewer 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/agent/internal/span/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/pdf/save/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/share/[token]/asset/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/branch/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/wiki/file/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/index.html +1 -1
  65. package/.next/standalone/.next/server/app/index.rsc +2 -2
  66. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  67. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
  68. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  69. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  70. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  71. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gurz9a._.js +1 -1
  73. package/.next/standalone/.next/server/chunks/ssr/_0v4uz-4._.js +1 -1
  74. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  75. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  76. package/.next/standalone/.next/server/pages/404.html +1 -1
  77. package/.next/standalone/.next/server/pages/500.html +1 -1
  78. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  80. package/.next/standalone/.next/static/chunks/{0pd5k_eu2n6lx.js → 0p1blx45umac6.js} +1 -1
  81. package/.next/standalone/package.json +1 -1
  82. package/package.json +1 -1
  83. /package/.next/standalone/.next/static/{xsJTB5dwbN66j_C416RPY → FGEHouLkusE6SPcSxOC3u}/_buildManifest.js +0 -0
  84. /package/.next/standalone/.next/static/{xsJTB5dwbN66j_C416RPY → FGEHouLkusE6SPcSxOC3u}/_clientMiddlewareManifest.js +0 -0
  85. /package/.next/standalone/.next/static/{xsJTB5dwbN66j_C416RPY → FGEHouLkusE6SPcSxOC3u}/_ssgManifest.js +0 -0
@@ -28,7 +28,7 @@ upgrade: ${M}\r
28
28
  `;else _+=`${e}: ${t}\r
29
29
  `}return n.sendHeaders.hasSubscribers&&n.sendHeaders.publish({request:t,headers:_,socket:P}),H&&0!==V?o.isBuffer(H)?Ah(q,H,e,t,P,v,_,x):o.isBlobLike(H)?"function"==typeof H.stream?AI(q,H.stream(),e,t,P,v,_,x):AB(q,H,e,t,P,v,_,x):o.isStream(H)?(i=q,g=H,Q=e,E=t,h=P,I=v,C=_,c=x,s(0!==I||0===Q[p],"stream body cannot be pipelined"),u=!1,f=new AC({abort:i,socket:h,request:E,contentLength:I,client:Q,expectsPayload:c,header:C}),y=function(A){if(!u)try{!f.write(A)&&this.pause&&this.pause()}catch(A){o.destroy(this,A)}},w=function(){!u&&g.resume&&g.resume()},S=function(){if(queueMicrotask(()=>{g.removeListener("error",R)}),!u){let A=new l;queueMicrotask(()=>R(A))}},R=function(A){if(!u){if(u=!0,s(h.destroyed||h[N]&&Q[p]<=1),h.off("drain",w).off("error",R),g.removeListener("data",y).removeListener("end",R).removeListener("close",S),!A)try{f.end()}catch(e){A=e}f.destroy(A),A&&("UND_ERR_INFO"!==A.code||"reset"!==A.message)?o.destroy(g,A):o.destroy(g)}},g.on("data",y).on("end",R).on("error",R).on("close",S),g.resume&&g.resume(),h.on("drain",w).on("error",R),g.errorEmitted??g.errored?setImmediate(R,g.errored):(g.endEmitted??g.readableEnded)&&setImmediate(R,null),(g.closeEmitted??g.closed)&&setImmediate(S)):o.isIterable(H)?AI(q,H,e,t,P,v,_,x):s(!1):Ah(q,null,e,t,P,v,_,x),!0})(e,t),resume(){var A=e;let t=A[L];if(t&&!t.destroyed){if(0===A[S]?!t[U]&&t.unref&&(t.unref(),t[U]=!0):t[U]&&t.ref&&(t.ref(),t[U]=!1),0===A[S])8!==t[y].timeoutType&&t[y].setTimeout(A[Y],8);else if(A[p]>0&&t[y].statusCode<200&&3!==t[y].timeoutType){let e=A[R][A[M]],r=null!=e.headersTimeout?e.headersTimeout:A[x];t[y].setTimeout(r,3)}}},destroy(A,e){t[X]?queueMicrotask(e):(t.on("close",e),t.destroy(A))},get destroyed(){return t.destroyed},busy:A=>!!(t[N]||t[d]||t[D]||A&&(e[p]>0&&!A.idempotent||e[p]>0&&(A.upgrade||"CONNECT"===A.method)||e[p]>0&&0!==o.bodyLength(A.body)&&(o.isStream(A.body)||o.isAsyncIterable(A.body)||o.isFormDataLike(A.body))))||!1}}},246479,(A,e,t)=>{e.exports=A.x("node:http2",()=>require("node:http2"))},556273,(A,e,t)=>{"use strict";let r,s,o=A.r(57328),{pipeline:n}=A.r(81111),i=A.r(280324),{RequestContentLengthMismatchError:a,RequestAbortedError:g,SocketError:l,InformationalError:Q,InvalidArgumentError:E}=A.r(456763),{kUrl:h,kReset:B,kClient:I,kRunning:C,kPending:c,kQueue:u,kPendingIdx:d,kRunningIdx:f,kError:y,kSocket:D,kStrictContentLength:p,kOnError:w,kMaxConcurrentStreams:S,kPingInterval:N,kHTTP2Session:R,kHTTP2InitialWindowSize:U,kHTTP2ConnectionWindowSize:F,kHostAuthority:m,kResume:b,kSize:M,kHTTPContext:k,kClosed:T,kBodyTimeout:L,kEnableConnectProtocol:Y,kRemoteSettings:H,kHTTP2Stream:G,kHTTP2SessionState:v}=A.r(354615),{channels:x}=A.r(283250),V=Symbol("open streams"),O=Symbol("request stream id"),J=Symbol("request stream"),W=Symbol("request stream cleanup"),P=Symbol("request stream state"),q=Symbol("received goaway");try{s=A.r(246479)}catch{s={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:_,HTTP2_HEADER_METHOD:Z,HTTP2_HEADER_PATH:X,HTTP2_HEADER_SCHEME:j,HTTP2_HEADER_CONTENT_LENGTH:K,HTTP2_HEADER_EXPECT:z,HTTP2_HEADER_STATUS:$,HTTP2_HEADER_PROTOCOL:AA,NGHTTP2_NO_ERROR:Ae,NGHTTP2_REFUSED_STREAM:At}}=s;function Ar(A){A[O]=null,A[J]=null,A[W]=null}function As(A,e,t){let r=A[W],s=A[J];Ar(A),r?.(s),A[O]=e.id,A[J]=e,A[W]=t}function Ao(A){let e=A[W],t=A[J];Ar(A),e?.(t)}function An(A){try{"function"==typeof this.setLocalWindowSize&&this.setLocalWindowSize(A)}catch{}}function Ai(A){if(this[I][S]=A.maxConcurrentStreams??this[I][S],!0===this[H]&&!0===this[Y]&&!1===A.enableConnectProtocol){let A=new Q("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[D][y]=A,this[I][w](A);return}this[Y]=A.enableConnectProtocol??this[Y],this[H]=!0,this[I][b]()}function Aa(A){let e=A[v];if((A.closed||A.destroyed)&&null!=e.ping.interval){clearInterval(e.ping.interval),e.ping.interval=null;return}A.ping((function(A,e){let t=this[I],r=this[D];if(null!=A){let e=new Q(`HTTP/2: "PING" errored - type ${A.message}`);r[y]=e,t[w](e)}else t.emit("ping",e)}).bind(A))}function Ag(A){o("ERR_TLS_CERT_ALTNAME_INVALID"!==A.code),this[D][y]=A,this[I][w](A)}function Al(A,e,t){if(0===t){let t=new Q(`HTTP/2: "frameError" received - type ${A}, code ${e}`);this[D][y]=t,this[I][w](t)}}function AQ(){let A=new l("other side closed",i.getSocketInfo(this[D]));this.destroy(A),i.destroy(this[D],A)}function AE(A,e){if(this[q])return;this[q]=!0;let t=this[y]||(A===Ae?new Q(`HTTP/2: "GOAWAY" frame received with code ${A}`):new l(`HTTP/2: "GOAWAY" frame received with code ${A}`,i.getSocketInfo(this[D]))),r=this[I],s=r[d],o=function(A,e){let t=Number.isInteger(e)?e:Number.MAX_SAFE_INTEGER;for(let e=A[f];e<A[d];e++){let r=A[u][e];if(null!=r&&("number"!=typeof r[O]||r[O]>t))return e}return A[d]}(r,e),n=[];for(let A=o;A<s;A++){let e=r[u][A];null!=e&&(!function(A,e=At){let t=A[J];if(Ao(A),null!=t&&!t.destroyed&&!t.closed)try{t.close(e)}catch{}}(e),function(A){let{body:e}=A;return null==e||i.isBuffer(e)||i.isBlobLike(e)}(e)?n.push(e):i.errorRequest(r,e,t))}if(o!==s){let A=r[u].slice(s);r[u].length=o,r[u].push(...n,...A)}r[R]===this&&(r[D]=null,r[k]=null,r[R]=null),this.closed||this.destroyed||this.close(),r[d]=o,r.emit("disconnect",r[h],[r],t),r[b]()}function Ah(){let{[I]:A,[v]:e,[D]:t}=this,r=t[y]||this[y]||new l("closed",i.getSocketInfo(t));if(A[R]===this&&(A[D]=null,A[k]=null,A[R]=null),null!=e.ping.interval&&(clearInterval(e.ping.interval),e.ping.interval=null),A.destroyed){o(0===A[c]);let e=A[u].splice(A[f]);for(let t=0;t<e.length;t++){let s=e[t];i.errorRequest(A,s,r)}}}function AB(){let A=this[y]||new l("closed",i.getSocketInfo(this)),e=this[R],t=e[I];t[D]!==this&&(e[q]||null!=t[R]&&t[R]!==e)||(t[D]=null,t[k]=null,t[R]===e&&(t[R]=null),e.destroy(A),t[d]=t[f],o(0===t[C]),t.emit("disconnect",t[h],[t],A),t[b]())}function AI(A){o("ERR_TLS_CERT_ALTNAME_INVALID"!==A.code),this[y]=A,this[I][w](A)}function AC(){i.destroy(this,new l("other side closed",i.getSocketInfo(this)))}function Ac(){this[T]=!0}function Au(){}function Ad(A){let e=A[R];A[R]=null,e[V]-=1,0===e[V]&&e.unref()}function Af(){this.off("error",Au);let A=this[P];this[P]=null,Aw(A,new Q("HTTP/2: stream closed before response headers")),Ad(this)}function Ay(){this.off("data",Ab),this.off("error",Au),Ad(this),this[P]=null}function AD(A){A.off("response",AU),A.off("error",AS),A.off("end",AN),A.off("timeout",AR),A.off("error",Au)}function Ap(A){if(null==A)return;let e=A[P];if(null==e)return;let{request:t}=e;t[J]===A&&Ar(t),AD(A),A.destroyed||A.closed||A.once("error",Au)}function Aw(A,e){if(null==A)return;let{request:t}=A;A.responseReceived||t.aborted||t.completed||(Ap(A.stream),A.abort(e,!0))}function AS(){let A=this[P];"number"==typeof this.rstCode&&0!==this.rstCode?Aw(A,new Q(`HTTP/2: "stream error" received - code ${this.rstCode}`)):Aw(A,new Q("HTTP/2: stream errored before response headers"))}function AN(){Aw(this[P],new Q("HTTP/2: stream half-closed (remote)"))}function AR(){let A=this[P];Aw(A,new Q(`HTTP/2: "stream timeout after ${A.requestTimeout}"`))}function AU(A,e){let t=this[P],{request:r}=t;t.responseReceived=!0;let s=A[$];delete A[$],r.onRequestUpgrade(s,A,this),r.aborted||r.completed||(AD(this),Ar(r),t.finalizeRequest())}function AF(A,e){let{request:t,requestTimeout:r,session:s}=e;A[G]=!0,A[R]=s,A[P]=e,e.stream=A,As(t,A,Ap),A.once("response",AU),A.on("error",AS),A.once("end",AN),A.on("timeout",AR),A.once("close",Af),++s[V],A.setTimeout(r)}function Am(A){if(null==A)return;let e=A[P];if(null==e)return;let{request:t}=e;t[J]===A&&Ar(t),A.off("error",Au),A.off("continue",Av),A.off("response",AM),A.off("end",Ak),A.off("error",AT),A.off("frameError",AL),A.off("aborted",AY),A.off("timeout",AH),A.off("trailers",AG),A.off("data",Ab),A.destroyed||A.closed||A.once("error",Au)}function Ab(A){let{request:e}=this[P];e.aborted||e.completed||!1===e.onResponseData(A)&&this.pause()}function AM(A){let e=this[P],{request:t}=e;this.off("response",AM);let r=A[$];(delete A[$],t.onResponseStarted(),e.responseReceived=!0,t.aborted)?Am(this):(!1===t.onResponseStart(Number(r),A,this.resume.bind(this),"")&&this.pause(),this.on("data",Ab))}function Ak(){let A=this[P],{request:e}=A;this.off("end",Ak),Am(this),A.responseReceived?(e.aborted||e.completed||e.onResponseEnd({}),A.finalizeRequest()):A.abort(new Q("HTTP/2: stream half-closed (remote)"),!0)}function AT(A){let e=this[P];this.off("error",AT),Am(this),e.abort(A)}function AL(A,e){let t=this[P];this.off("frameError",AL),Am(this),t.abort(new Q(`HTTP/2: "frameError" received - type ${A}, code ${e}`))}function AY(){this.off("data",Ab)}function AH(){let A=this[P];Am(this);let e=new Q(`HTTP/2: "stream timeout after ${A.requestTimeout}"`);A.abort(e)}function AG(A){let e=this[P],{request:t}=e;this.off("trailers",AG),t.aborted||t.completed||(Am(this),t.onResponseEnd(A),e.finalizeRequest())}function Av(){var A,e,t,r,s,a,g;let l,{abort:Q,body:E,client:h,contentLength:I,expectsPayload:c,request:u}=this[P];E&&0!==I?i.isBuffer(E)?Ax(Q,this,E,h,u,h[D],I,c):i.isBlobLike(E)?"function"==typeof E.stream?AO(Q,this,E.stream(),h,u,h[D],I,c):AV(Q,this,E,h,u,h[D],I,c):i.isStream(E)?(A=Q,e=h[D],t=c,r=this,s=E,a=h,g=u,o(0!==I||0===a[C],"stream body cannot be pipelined"),l=n(s,r,r=>{r?(i.destroy(l,r),A(r)):(i.removeAllListeners(l),g.onRequestSent(),t||(e[B]=!0),a[b]())}),i.addListener(l,"data",function(A){g.onBodySent(A)})):i.isIterable(E)?AO(Q,this,E,h,u,h[D],I,c):o(!1):Ax(Q,this,null,h,u,h[D],I,c)}function Ax(A,e,t,r,s,n,a,g){try{null!=t&&i.isBuffer(t)&&(o(a===t.byteLength,"buffer body must have content length"),e.cork(),e.write(t),e.uncork(),e.end(),s.onBodySent(t)),g||(n[B]=!0),s.onRequestSent(),r[b]()}catch(e){A(e)}}async function AV(A,e,t,r,s,o,n,i){try{if(null!=n&&n!==t.size)throw new a;let A=Buffer.from(await t.arrayBuffer());e.cork(),e.write(A),e.uncork(),e.end(),s.onBodySent(A),s.onRequestSent(),i||(o[B]=!0),r[b]()}catch(e){A(e)}}async function AO(A,e,t,r,s,n,i,a){o(0!==i||0===r[C],"iterator body cannot be pipelined");let g=null;function l(){if(g){let A=g;g=null,A()}}let Q=()=>new Promise((A,e)=>{o(null===g),n[y]?e(n[y]):g=A});e.on("close",l).on("drain",l);try{for await(let A of t){if(n[y])throw n[y];let t=e.write(A);s.onBodySent(A),t||await Q()}e.end(),s.onRequestSent(),a||(n[B]=!0),r[b]()}catch(e){A(e)}finally{e.off("close",l).off("drain",l)}}e.exports=function(e,t){e[D]=t;let n=e[U],l=e[F],B=s.connect(e[h],{createConnection:()=>t,peerMaxConcurrentStreams:e[S],settings:{enablePush:!1,...null!=n?{initialWindowSize:n}:null}});return e[D]=t,B[V]=0,B[I]=e,B[D]=t,B[v]={ping:{interval:0===e[N]?null:setInterval(Aa,e[N],B).unref()}},B[q]=!1,B[Y]=!1,B[H]=!1,l&&i.addListener(B,"connect",An.bind(B,l)),i.addListener(B,"error",Ag),i.addListener(B,"frameError",Al),i.addListener(B,"end",AQ),i.addListener(B,"goaway",AE),i.addListener(B,"close",Ah),i.addListener(B,"remoteSettings",Ai),B.unref(),e[R]=B,t[R]=B,i.addListener(t,"error",AI),i.addListener(t,"end",AC),i.addListener(t,"close",AB),t[T]=!1,t.on("close",Ac),{version:"h2",defaultPipelining:1/0,write:t=>(function(e,t){let s=t.bodyTimeout??e[L],n=e[R],{method:l,path:h,host:B,upgrade:I,expectContinue:C,signal:c,protocol:S,headers:N}=t,{body:U}=t;if(null!=I&&"websocket"!==I)return i.errorRequest(e,t,new E(`Custom upgrade "${I}" not supported over HTTP/2`)),!1;let F=function(A){let e={};for(let t=0;t<A.length;t+=2){let r=A[t+0],s=A[t+1],o=e[r];if("cookie"===r){null!=o?e[r]=Array.isArray(o)?(o.push(s),o):[o,s]:e[r]=s;continue}if("string"==typeof s){e[r]=o?`${o}, ${s}`:s;continue}for(let A=0;A<s.length;A++)e[r]=e[r]?`${e[r]}, ${s[A]}`:s[A]}return e}(N),M=null;F[_]=B||e[m],F[Z]=l;let k=!1,T=(A=!1)=>{k||(k=!0,e[u][e[f]++]=null,A&&(e[d]=e[f]),e[b]())},H=(A,r=!1)=>{t.aborted||t.completed||(A=A||new g,i.errorRequest(e,t,A),null!=M&&(Ao(t),M.close(),e[w](A),T(r)),i.destroy(U,A))},v=(A,e)=>{try{return n.request(A,e)}catch(e){if(e?.code!=="ERR_HTTP2_INVALID_CONNECTION_HEADERS")throw e;let A=new Q(e.message,{cause:e});return n[y]=A,n[D][y]=A,n.destroy(A),i.destroy(n[D],A),H(A),null}};try{t.onRequestStart(H,null)}catch(A){i.errorRequest(e,t,A)}if(t.aborted)return!1;if(I||"CONNECT"===l){n.ref();let A={abort:H,finalizeRequest:T,request:t,requestTimeout:s,responseReceived:!1,session:n,stream:null};return"websocket"===I?!1===n[Y]?(i.errorRequest(e,t,new Q("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(F[Z]="CONNECT",F[AA]="websocket",F[X]=h,"ws:"===S||"wss:"===S?F[j]="ws:"===S?"http":"https":F[j]="http:"===S?"http":"https",null==(M=v(F,{endStream:!1,signal:c})))?(n.unref(),!1):(AF(M,A),!0):null==(M=v(F,{endStream:!1,signal:c}))?(n.unref(),!1):(AF(M,A),!0)}F[X]=h,F[j]="http:"===S?"http":"https";let O="PUT"===l||"POST"===l||"PATCH"===l||"QUERY"===l||"PROPFIND"===l||"PROPPATCH"===l;U&&"function"==typeof U.read&&U.read(0);let J=i.bodyLength(U);if(i.isFormDataLike(U)){let[e,t]=(r??=A.r(812471).extractBody)(U);F["content-type"]=t,U=e.stream,J=e.length}if(null==J&&(J=t.contentLength),0!==J||O||(J=null),"GET"!==l&&"HEAD"!==l&&"OPTIONS"!==l&&"TRACE"!==l&&"CONNECT"!==l&&J>0&&null!=t.contentLength&&t.contentLength!==J){if(e[p])return i.errorRequest(e,t,new a),!1;process.emitWarning(new a)}if(null!=J&&(o(U||0===J,"no body must not have content length"),F[K]=`${J}`),n.ref(),x.sendHeaders.hasSubscribers){let A="";for(let e in F)A+=`${e}: ${F[e]}\r
30
30
  `;x.sendHeaders.publish({request:t,headers:A,socket:n[D]})}let W=null===U||0===J,q={abort:H,body:U,client:e,contentLength:J,expectsPayload:O,finalizeRequest:T,request:t,requestTimeout:s,responseReceived:!1,session:n,stream:null};return C&&(F[z]="100-continue"),null!=(M=v(F,{endStream:W,signal:c}))&&(M[G]=!0,M[P]=q,q.stream=M,As(t,M,null),++n[V],M.setTimeout(s),M[R]=n,M.once("close",Ay),As(t,M,Am),C&&M.once("continue",Av),M.once("response",AM),M.once("end",Ak),M.once("error",AT),M.once("frameError",AL),M.on("aborted",AY),M.on("timeout",AH),M.once("trailers",AG),C||Av.call(M),!0)})(e,t),resume(){var A;let t;t=(A=e)[D],t?.destroyed===!1&&(0===A[M]||0===A[S]?(t.unref(),A[R].unref()):(t.ref(),A[R].ref()))},destroy(A,e){t[T]?queueMicrotask(e):t.destroy(A).on("close",e)},get destroyed(){return t.destroyed},busy(A){if(!1===B[H]&&e[C]>0||e[C]>=e[S])return!0;if(null!=A){if(!(e[C]>0))return("websocket"===A.upgrade||"CONNECT"===A.method)&&!1===B[H];else if(!1===A.idempotent||("websocket"===A.upgrade||"CONNECT"===A.method)&&!1===B[H]||0!==i.bodyLength(A.body)&&(i.isStream(A.body)||i.isAsyncIterable(A.body)||i.isFormDataLike(A.body)))return!0}return!1}}}},306847,(A,e,t)=>{"use strict";let r=A.r(57328),s=A.r(761095),o=A.r(347299),n=A.r(280324),{ClientStats:i}=A.r(110688),{channels:a}=A.r(283250),g=A.r(512534),l=A.r(778469),{InvalidArgumentError:Q,InformationalError:E,ClientDestroyedError:h}=A.r(456763),B=A.r(724604),{kUrl:I,kServerName:C,kClient:c,kBusy:u,kConnect:d,kResuming:f,kRunning:y,kPending:D,kSize:p,kQueue:w,kConnected:S,kConnecting:N,kNeedDrain:R,kKeepAliveDefaultTimeout:U,kHostHeader:F,kPendingIdx:m,kRunningIdx:b,kError:M,kPipelining:k,kKeepAliveTimeoutValue:T,kMaxHeadersSize:L,kKeepAliveMaxTimeout:Y,kKeepAliveTimeoutThreshold:H,kHeadersTimeout:G,kBodyTimeout:v,kStrictContentLength:x,kConnector:V,kMaxRequests:O,kCounter:J,kClose:W,kDestroy:P,kDispatch:q,kLocalAddress:_,kMaxResponseSize:Z,kOnError:X,kHTTPContext:j,kMaxConcurrentStreams:K,kHostAuthority:z,kHTTP2InitialWindowSize:$,kHTTP2ConnectionWindowSize:AA,kResume:Ae,kPingInterval:At}=A.r(354615),Ar=A.r(668921),As=A.r(556273),Ao=Symbol("kClosedResolve"),An=o&&o.maxHeaderSize&&Number.isInteger(o.maxHeaderSize)&&o.maxHeaderSize>0?()=>o.maxHeaderSize:()=>{throw new Q("http module not available or http.maxHeaderSize invalid")},Ai=()=>{};function Aa(A){return A[k]??A[j]?.defaultPipelining??1}function Ag(A,e){if(0===A[y]&&"UND_ERR_INFO"!==e.code&&"UND_ERR_SOCKET"!==e.code){r(A[m]===A[b]);let t=A[w].splice(A[b]);for(let r=0;r<t.length;r++){let s=t[r];n.errorRequest(A,s,e)}r(0===A[p])}}function Al(A){r(!A[N]),r(!A[j]);let{host:e,hostname:t,protocol:o,port:i}=A[I];if("["===t[0]){let A=t.indexOf("]");r(-1!==A);let e=t.substring(1,A);r(s.isIPv6(e)),t=e}A[N]=!0,a.beforeConnect.hasSubscribers&&a.beforeConnect.publish({connectParams:{host:e,hostname:t,protocol:o,port:i,version:A[j]?.version,servername:A[C],localAddress:A[_]},connector:A[V]});try{A[V]({host:e,hostname:t,protocol:o,port:i,servername:A[C],localAddress:A[_]},(s,g)=>{if(s){AQ(A,s,{host:e,hostname:t,protocol:o,port:i}),A[Ae]();return}if(A.destroyed){n.destroy(g.on("error",Ai),new h),A[Ae]();return}r(g);try{A[j]="h2"===g.alpnProtocol?As(A,g):Ar(A,g)}catch(r){g.destroy().on("error",Ai),AQ(A,r,{host:e,hostname:t,protocol:o,port:i}),A[Ae]();return}A[N]=!1,g[J]=0,g[O]=A[O],g[c]=A,g[M]=null,a.connected.hasSubscribers&&a.connected.publish({connectParams:{host:e,hostname:t,protocol:o,port:i,version:A[j]?.version,servername:A[C],localAddress:A[_]},connector:A[V],socket:g}),A.emit("connect",A[I],[A]),A[Ae]()})}catch(r){AQ(A,r,{host:e,hostname:t,protocol:o,port:i}),A[Ae]()}}function AQ(A,e,{host:t,hostname:s,protocol:o,port:i}){if(!A.destroyed){if(A[N]=!1,a.connectError.hasSubscribers&&a.connectError.publish({connectParams:{host:t,hostname:s,protocol:o,port:i,version:A[j]?.version,servername:A[C],localAddress:A[_]},connector:A[V],error:e}),"ERR_TLS_CERT_ALTNAME_INVALID"===e.code)for(r(0===A[y]);A[D]>0&&A[w][A[m]].servername===A[C];){let t=A[w][A[m]++];n.errorRequest(A,t,e)}else Ag(A,e);A.emit("connectionError",A[I],[A],e)}}function AE(A){A[R]=0,A.emit("drain",A[I],[A])}function Ah(A,e){2!==A[f]&&(A[f]=2,function(A,e){for(;;){if(A.destroyed)return void r(0===A[D]);if(A[Ao]&&!A[p]){A[Ao](),A[Ao]=null;return}if(A[j]&&A[j].resume(),A[u])A[R]=2;else if(2===A[R]){e?(A[R]=1,queueMicrotask(()=>AE(A))):AE(A);continue}if(0===A[D]||A[y]>=(Aa(A)||1))return;let t=A[w][A[m]];if(null===t)return;if("https:"===A[I].protocol&&A[C]!==t.servername){if(A[y]>0)return;A[C]=t.servername,A[j]?.destroy(new E("servername changed"),()=>{A[j]=null,Ah(A)})}if(A[N])return;if(!A[j])return void Al(A);if(A[j].destroyed||A[j].busy(t))return;!t.aborted&&A[j].write(t)?A[m]++:A[w].splice(A[m],1)}}(A,e),A[f]=0,A[b]>256&&(A[w].splice(0,A[b]),A[m]-=A[b],A[b]=0))}e.exports=class extends l{constructor(A,{maxHeaderSize:e,headersTimeout:t,socketTimeout:r,requestTimeout:o,connectTimeout:i,bodyTimeout:a,idleTimeout:g,keepAlive:l,keepAliveTimeout:E,maxKeepAliveTimeout:h,keepAliveMaxTimeout:c,keepAliveTimeoutThreshold:u,socketPath:d,pipelining:y,tls:D,strictContentLength:p,maxCachedSessions:S,connect:N,maxRequestsPerClient:M,localAddress:J,maxResponseSize:W,autoSelectFamily:P,autoSelectFamilyAttemptTimeout:q,maxConcurrentStreams:Ar,allowH2:As,useH2c:Ai,initialWindowSize:Aa,connectionWindowSize:Al,pingInterval:AQ,webSocket:AE}={}){if(void 0!==l)throw new Q("unsupported keepAlive, use pipelining=0 instead");if(void 0!==r)throw new Q("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==o)throw new Q("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==g)throw new Q("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==h)throw new Q("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=e){if(!Number.isInteger(e)||e<1)throw new Q("invalid maxHeaderSize")}else e=An();if(null!=d&&"string"!=typeof d)throw new Q("invalid socketPath");if(null!=i&&(!Number.isFinite(i)||i<0))throw new Q("invalid connectTimeout");if(null!=E&&(!Number.isFinite(E)||E<=0))throw new Q("invalid keepAliveTimeout");if(null!=c&&(!Number.isFinite(c)||c<=0))throw new Q("invalid keepAliveMaxTimeout");if(null!=u&&!Number.isFinite(u))throw new Q("invalid keepAliveTimeoutThreshold");if(null!=t&&(!Number.isInteger(t)||t<0))throw new Q("headersTimeout must be a positive integer or zero");if(null!=a&&(!Number.isInteger(a)||a<0))throw new Q("bodyTimeout must be a positive integer or zero");if(null!=N&&"function"!=typeof N&&"object"!=typeof N)throw new Q("connect must be a function or an object");if(null!=M&&(!Number.isInteger(M)||M<0))throw new Q("maxRequestsPerClient must be a positive number");if(null!=J&&("string"!=typeof J||0===s.isIP(J)))throw new Q("localAddress must be valid string IP address");if(null!=W&&(!Number.isInteger(W)||W<-1))throw new Q("maxResponseSize must be a positive number");if(null!=q&&(!Number.isInteger(q)||q<-1))throw new Q("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=As&&"boolean"!=typeof As)throw new Q("allowH2 must be a valid boolean value");if(null!=Ar&&("number"!=typeof Ar||Ar<1))throw new Q("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=Ai&&"boolean"!=typeof Ai)throw new Q("useH2c must be a valid boolean value");if(null!=Aa&&(!Number.isInteger(Aa)||Aa<1))throw new Q("initialWindowSize must be a positive integer, greater than 0");if(null!=Al&&(!Number.isInteger(Al)||Al<1))throw new Q("connectionWindowSize must be a positive integer, greater than 0");if(null!=AQ&&("number"!=typeof AQ||!Number.isInteger(AQ)||AQ<0))throw new Q("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:AE}),"function"!=typeof N)N=B({...D,maxCachedSessions:S,allowH2:As,useH2c:Ai,socketPath:d,timeout:i,..."boolean"==typeof P?{autoSelectFamily:P,autoSelectFamilyAttemptTimeout:q}:void 0,...N});else{const A=N;N=(e,t)=>A({...e,...null!=d?{socketPath:d}:null,...null!=As?{allowH2:As}:null},t)}this[I]=n.parseOrigin(A),this[z]=`${this[I].hostname}${this[I].port?`:${this[I].port}`:""}`,this[V]=N,this[k]=null!=y?y:1,this[L]=e,this[U]=null==E?4e3:E,this[Y]=null==c?6e5:c,this[H]=null==u?2e3:u,this[T]=this[U],this[C]=null,this[_]=null!=J?J:null,this[f]=0,this[R]=0,this[F]=`host: ${this[z]}\r
31
- `,this[v]=null!=a?a:3e5,this[G]=null!=t?t:3e5,this[x]=null==p||p,this[O]=M,this[Ao]=null,this[Z]=W>-1?W:-1,this[j]=null,this[K]=null!=Ar?Ar:100,this[$]=null!=Aa?Aa:262144,this[AA]=null!=Al?Al:524288,this[At]=null!=AQ?AQ:6e4,this[w]=[],this[b]=0,this[m]=0,this[Ae]=A=>Ah(this,A),this[X]=A=>Ag(this,A)}get pipelining(){return this[k]}set pipelining(A){this[k]=A,this[Ae](!0)}get stats(){return new i(this)}get[D](){return this[w].length-this[m]}get[y](){return this[m]-this[b]}get[p](){return this[w].length-this[b]}get[S](){return!!this[j]&&!this[N]&&!this[j].destroyed}get[u](){return!!(this[j]?.busy(null)||this[p]>=(Aa(this)||1)||this[D]>0)}[d](A){Al(this),this.once("connect",A)}[q](A,e){let t=new g(this[I].origin,A,e);return this[w].push(t),this[f]||(null==n.bodyLength(t.body)&&n.isIterable(t.body)?(this[f]=1,queueMicrotask(()=>Ah(this))):this[Ae](!0)),this[f]&&2!==this[R]&&this[u]&&(this[R]=2),this[R]<2}[W](){return new Promise(A=>{this[p]?this[Ao]=A:A(null)})}[P](A){return new Promise(e=>{let t=this[w].splice(this[m]);for(let e=0;e<t.length;e++){let r=t[e];n.errorRequest(this,r,A)}let r=()=>{this[Ao]&&(this[Ao](),this[Ao]=null),e(null)};this[j]?(this[j].destroy(A,r),this[j]=null):queueMicrotask(r),this[Ae]()})}}},645962,(A,e,t)=>{"use strict";class r{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(A){this.list[this.top]=A,this.top=this.top+1&2047}shift(){let A=this.list[this.bottom];return void 0===A?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,A)}}e.exports=class{constructor(){this.head=this.tail=new r}isEmpty(){return this.head.isEmpty()}push(A){this.head.isFull()&&(this.head=this.head.next=new r),this.head.push(A)}shift(){let A=this.tail,e=A.shift();return A.isEmpty()&&null!==A.next&&(this.tail=A.next,A.next=null),e}}},928198,(A,e,t)=>{"use strict";let{PoolStats:r}=A.r(110688),s=A.r(778469),o=A.r(645962),{kConnected:n,kSize:i,kRunning:a,kPending:g,kQueued:l,kBusy:Q,kFree:E,kUrl:h,kClose:B,kDestroy:I,kDispatch:C}=A.r(354615),c=Symbol("clients"),u=Symbol("needDrain"),d=Symbol("queue"),f=Symbol("closed resolve"),y=Symbol("onDrain"),D=Symbol("onConnect"),p=Symbol("onDisconnect"),w=Symbol("onConnectionError"),S=Symbol("get dispatcher"),N=Symbol("has dispatcher"),R=Symbol("add client"),U=Symbol("remove client");class F extends s{[d]=new o;[l]=0;[c]=[];[u]=!1;[y](A,e,t){let r=this[d],s=!1;for(;!s;){let e=r.shift();if(!e)break;this[l]--,s=!A.dispatch(e.opts,e.handler)}if(A[u]=s,!s&&this[u]&&(this[u]=!1,this.emit("drain",e,[this,...t])),this[f]&&r.isEmpty()){let A=[];for(let e=0;e<this[c].length;e++){let t=this[c][e];t.destroyed||A.push(t.close())}return Promise.all(A).then(this[f])}}[D]=(A,e)=>{this.emit("connect",A,[this,...e])};[p]=(A,e,t)=>{this.emit("disconnect",A,[this,...e],t)};[w]=(A,e,t)=>{this.emit("connectionError",A,[this,...e],t)};get[Q](){return this[u]}get[n](){let A=0;for(let{[n]:e}of this[c])A+=e;return A}get[E](){let A=0;for(let{[n]:e,[u]:t}of this[c])A+=e&&!t;return A}get[g](){let A=this[l];for(let{[g]:e}of this[c])A+=e;return A}get[a](){let A=0;for(let{[a]:e}of this[c])A+=e;return A}get[i](){let A=this[l];for(let{[i]:e}of this[c])A+=e;return A}get stats(){return new r(this)}[B](){if(!this[d].isEmpty())return new Promise(A=>{this[f]=A});{let A=[];for(let e=0;e<this[c].length;e++){let t=this[c][e];t.destroyed||A.push(t.close())}return Promise.all(A)}}[I](A){for(;;){let e=this[d].shift();if(!e)break;e.handler.onResponseError(null,A)}let e=Array(this[c].length);for(let t=0;t<this[c].length;t++)e[t]=this[c][t].destroy(A);return Promise.all(e)}[C](A,e){let t=this[S]();return t?t.dispatch(A,e)||(t[u]=!0,this[u]=!this[N]()):(this[u]=!0,this[d].push({opts:A,handler:e}),this[l]++),!this[u]}[N](){for(let A=0;A<this[c].length;A++){let e=this[c][A];if(!e[u]&&!0!==e.closed&&!0!==e.destroyed)return!0}return!1}[R](A){return A.on("drain",this[y].bind(this,A)).on("connect",this[D]).on("disconnect",this[p]).on("connectionError",this[w]),this[c].push(A),this[u]&&queueMicrotask(()=>{this[u]&&this[y](A,A[h],[A,this])}),this}[U](A){let e=this[c].indexOf(A);-1!==e&&this[c].splice(e,1),A.close(()=>{}),this[u]=!this[c].some(A=>!A[u]&&!0!==A.closed&&!0!==A.destroyed)}}e.exports={PoolBase:F,kClients:c,kNeedDrain:u,kAddClient:R,kRemoveClient:U,kGetDispatcher:S,kHasDispatcher:N}},481206,(A,e,t)=>{"use strict";let{PoolBase:r,kClients:s,kNeedDrain:o,kAddClient:n,kGetDispatcher:i,kHasDispatcher:a,kRemoveClient:g}=A.r(928198),l=A.r(306847),{InvalidArgumentError:Q}=A.r(456763),E=A.r(280324),{kUrl:h}=A.r(354615),B=A.r(724604),I=Symbol("options"),C=Symbol("connections"),c=Symbol("factory");function u(A,e){return new l(A,e)}e.exports=class extends r{constructor(A,{connections:e,factory:t=u,connect:r,connectTimeout:o,tls:n,maxCachedSessions:i,socketPath:a,autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l,allowH2:d,useH2c:f,clientTtl:y,...D}={}){if(null!=e&&(!Number.isFinite(e)||e<0))throw new Q("invalid connections");if("function"!=typeof t)throw new Q("factory must be a function.");if(null!=r&&"function"!=typeof r&&"object"!=typeof r)throw new Q("connect must be a function or an object");"function"!=typeof r&&(r=B({...n,maxCachedSessions:i,allowH2:d,useH2c:f,socketPath:a,timeout:o,..."boolean"==typeof g?{autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l}:void 0,...r})),super(D),this[C]=e||null,this[h]=E.parseOrigin(A),this[I]={...E.deepClone(D),connect:r,allowH2:d,useH2c:f,clientTtl:y,socketPath:a},this[c]=t,this.on("connect",(A,e)=>{if(null!=y&&y>0)for(let A of e)Object.assign(A,{ttl:Date.now()})}),this.on("connectionError",(A,e,t)=>{for(let A of e){let e=this[s].indexOf(A);-1!==e&&this[s].splice(e,1)}})}[i](){let A=this[I].clientTtl;for(let e=0;e<this[s].length;e++){let t=this[s][e];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A)this[g](t),e--;else if(!t[o])return t}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),A}}[a](){let A=this[I].clientTtl;for(let e=0;e<this[s].length;e++){let t=this[s][e];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A)this[g](t),e--;else if(!t[o])return!0}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),!0}return!1}}},551527,(A,e,t)=>{"use strict";let{BalancedPoolMissingUpstreamError:r,InvalidArgumentError:s}=A.r(456763),{PoolBase:o,kClients:n,kNeedDrain:i,kAddClient:a,kRemoveClient:g,kGetDispatcher:l}=A.r(928198),Q=A.r(481206),{kUrl:E}=A.r(354615),h=A.r(280324),B=Symbol("factory"),I=Symbol("options"),C=Symbol("kGreatestCommonDivisor"),c=Symbol("kCurrentWeight"),u=Symbol("kIndex"),d=Symbol("kWeight"),f=Symbol("kMaxWeightPerServer"),y=Symbol("kErrorPenalty");function D(A,e){return new Q(A,e)}e.exports=class extends o{constructor(A=[],{factory:e=D,...t}={}){if("function"!=typeof e)throw new s("factory must be a function.");for(const r of(super(),this[I]={...h.deepClone(t)},this[u]=-1,this[c]=0,this[f]=this[I].maxWeightPerServer||100,this[y]=this[I].errorPenalty||15,Array.isArray(A)||(A=[A]),this[B]=e,A))this.addUpstream(r);this._updateBalancedPoolStats()}addUpstream(A){let e=h.parseOrigin(A).origin;if(this[n].find(A=>A[E].origin===e&&!0!==A.closed&&!0!==A.destroyed))return this;let t=this[B](e,this[I]);for(let A of(this[a](t),t.on("connect",()=>{t[d]=Math.min(this[f],t[d]+this[y])}),t.on("connectionError",()=>{t[d]=Math.max(1,t[d]-this[y]),this._updateBalancedPoolStats()}),t.on("disconnect",(...A)=>{let e=A[2];e&&"UND_ERR_SOCKET"===e.code&&(t[d]=Math.max(1,t[d]-this[y]),this._updateBalancedPoolStats())}),this[n]))A[d]=this[f];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let A=0;for(let e=0;e<this[n].length;e++)A=function(A,e){if(0===A)return e;for(;0!==e;){let t=e;e=A%e,A=t}return A}(this[n][e][d],A);this[C]=A}removeUpstream(A){let e=h.parseOrigin(A).origin,t=this[n].find(A=>A[E].origin===e&&!0!==A.closed&&!0!==A.destroyed);return t&&this[g](t),this}getUpstream(A){let e=h.parseOrigin(A).origin;return this[n].find(A=>A[E].origin===e&&!0!==A.closed&&!0!==A.destroyed)}get upstreams(){return this[n].filter(A=>!0!==A.closed&&!0!==A.destroyed).map(A=>A[E].origin)}[l](){if(0===this[n].length)throw new r;let A=0,e=-1;for(;A++<this[n].length;){this[u]=(this[u]+1)%this[n].length;let A=this[n][this[u]];if((0===this[u]&&(this[c]=this[c]-this[C],this[c]<=0&&(this[c]=this[f])),!A[i]&&!0!==A.closed&&!0!==A.destroyed)&&((-1===e||A[d]>this[n][e][d])&&(e=this[u]),A[d]>=this[c]))return A}if(-1!==e)return this[c]=this[n][e][d],this[u]=e,this[n][e]}}},722447,(A,e,t)=>{"use strict";let{PoolBase:r,kClients:s,kNeedDrain:o,kAddClient:n,kGetDispatcher:i,kHasDispatcher:a,kRemoveClient:g}=A.r(928198),l=A.r(306847),{InvalidArgumentError:Q}=A.r(456763),E=A.r(280324),{kUrl:h}=A.r(354615),B=A.r(724604),I=Symbol("options"),C=Symbol("connections"),c=Symbol("factory"),u=Symbol("index");function d(A,e){return new l(A,e)}e.exports=class extends r{constructor(A,{connections:e,factory:t=d,connect:r,connectTimeout:o,tls:n,maxCachedSessions:i,socketPath:a,autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l,allowH2:f,clientTtl:y,...D}={}){if(null!=e&&(!Number.isFinite(e)||e<0))throw new Q("invalid connections");if("function"!=typeof t)throw new Q("factory must be a function.");if(null!=r&&"function"!=typeof r&&"object"!=typeof r)throw new Q("connect must be a function or an object");"function"!=typeof r&&(r=B({...n,maxCachedSessions:i,allowH2:f,socketPath:a,timeout:o,..."boolean"==typeof g?{autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l}:void 0,...r})),super(),this[C]=e||null,this[h]=E.parseOrigin(A),this[I]={...E.deepClone(D),connect:r,allowH2:f,clientTtl:y,socketPath:a},this[c]=t,this[u]=-1,this.on("connect",(A,e)=>{if(null!=y&&y>0)for(let A of e)Object.assign(A,{ttl:Date.now()})}),this.on("connectionError",(A,e,t)=>{for(let A of e){let e=this[s].indexOf(A);-1!==e&&this[s].splice(e,1)}})}[i](){let A=this[I].clientTtl;if(0===this[s].length){let A=this[c](this[h],this[I]);return this[n](A),A}let e=0;for(;e<this[s].length;){this[u]=(this[u]+1)%this[s].length;let t=this[s][this[u]];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A){this[g](t),this[u]--;continue}if(!t[o])return t;e++}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),A}}[a](){let A=this[I].clientTtl;for(let e=0;e<this[s].length;e++){let t=this[s][e];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A)this[g](t),e<=this[u]&&this[u]--,e--;else if(!t[o])return!0}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),!0}return!1}}},484221,(A,e,t)=>{"use strict";let{InvalidArgumentError:r,MaxOriginsReachedError:s}=A.r(456763),{kBusy:o,kClients:n,kConnected:i,kRunning:a,kClose:g,kDestroy:l,kDispatch:Q,kUrl:E}=A.r(354615),h=A.r(778469),B=A.r(481206),I=A.r(306847),C=A.r(280324),c=Symbol("onConnect"),u=Symbol("onDisconnect"),d=Symbol("onConnectionError"),f=Symbol("onDrain"),y=Symbol("factory"),D=Symbol("options"),p=Symbol("origins");function w(A,e){return e&&1===e.connections?new I(A,e):new B(A,e)}e.exports=class extends h{constructor({factory:A=w,maxOrigins:e=1/0,connect:t,...s}={}){if("function"!=typeof A)throw new r("factory must be a function.");if(null!=t&&"function"!=typeof t&&"object"!=typeof t)throw new r("connect must be a function or an object");if("number"!=typeof e||Number.isNaN(e)||e<=0)throw new r("maxOrigins must be a number greater than 0");super(s),t&&"function"!=typeof t&&(t={...t}),this[D]={...C.deepClone(s),maxOrigins:e,connect:t},this[y]=A,this[n]=new Map,this[p]=new Set,this[f]=(A,e)=>{this.emit("drain",A,[this,...e])},this[c]=(A,e)=>{this.emit("connect",A,[this,...e])},this[u]=(A,e,t)=>{this.emit("disconnect",A,[this,...e],t)},this[d]=(A,e,t)=>{this.emit("connectionError",A,[this,...e],t)}}get[a](){let A=0;for(let e of this[n].values())A+=e[a];return A}[Q](A,e){let t;if(A.origin&&("string"==typeof A.origin||A.origin instanceof URL))t=String(A.origin);else throw new r("opts.origin must be a non-empty string or URL.");let a=A.allowH2??this[D].allowH2,g=!1===a?`${t}#http1-only`:t;if(this[p].size>=this[D].maxOrigins&&!this[p].has(t))throw new s;let l=this[n].get(g);if(!l){l=this[y](A.origin,!1===a?{...this[D],allowH2:!1}:this[D]);let e=()=>{if(this[n].get(g)!==l||l[i]>0||l[o])return;this[n].delete(g),l.destroyed||l.close();let A=!1;for(let e of this[n].values())if(e[E].origin===l[E].origin){A=!0;break}A||this[p].delete(l[E].origin)};l.on("drain",this[f]).on("connect",this[c]).on("disconnect",(A,t,r)=>{e(),this[u](A,t,r)}).on("connectionError",(A,t,r)=>{e(),this[d](A,t,r)}),this[n].set(g,l),this[p].add(t)}return l.dispatch(A,e)}[g](){let A=[];for(let e of this[n].values())A.push(e.close());return this[n].clear(),Promise.all(A)}[l](A){let e=[];for(let t of this[n].values())e.push(t.destroy(A));return this[n].clear(),Promise.all(e)}get stats(){let A={};for(let e of this[n].values())e.stats&&(A[e[E].origin]=e.stats);return A}}},600079,(A,e,t)=>{"use strict";let r=A.r(777103),{InvalidArgumentError:s}=A.r(456763),{toRawHeaders:o}=A.r(280324);class n{#E;constructor(A){this.#E=A}onRequestStart(A,e){this.#E.onConnect?.(e=>A.abort(e),e)}onRequestUpgrade(A,e,t,r){let s=A?.rawHeaders??o(t??{});this.#E.onUpgrade?.(e,s,r)}onResponseStart(A,e,t,r){let s=A?.rawHeaders??o(t??{});this.#E.onHeaders?.(e,s,()=>A.resume(),r)===!1&&A.pause()}onResponseData(A,e){this.#E.onData?.(e)===!1&&A.pause()}onResponseEnd(A,e){let t=A?.rawTrailers??o(e??{});this.#E.onComplete?.(t)}onResponseError(A,e){if(!this.#E.onError)throw e;this.#E.onError(e)}onBodySent(A){this.#E.onBodySent?.(A)}onRequestSent(){this.#E.onRequestSent?.()}onResponseStarted(){this.#E.onResponseStarted?.()}}class i extends r{#h;constructor(A){if(super(),!A||"function"!=typeof A.dispatch)throw new s("Argument dispatcher must implement dispatch");this.#h=A}static wrapHandler(A){if(!A||"object"!=typeof A)throw new s("handler must be an object");return"function"==typeof A.onRequestStart?A:new n(A)}dispatch(A,e){return!1!==A.allowH2&&(A={...A,allowH2:!1}),this.#h.dispatch(A,i.wrapHandler(e))}close(...A){return this.#h.close(...A)}destroy(...A){return this.#h.destroy(...A)}}e.exports=i},75318,(A,e,t)=>{"use strict";let{Buffer:r}=A.r(951615),s=A.r(761095),{InvalidArgumentError:o}=A.r(456763);function n(A){let e=r.alloc(16),t=A;if(A.includes(".")){let e=A.lastIndexOf(":"),r=A.slice(e+1);if(s.isIPv4(r)){let s=r.split(".").map(Number),o=(s[0]<<8|s[1]).toString(16),n=(s[2]<<8|s[3]).toString(16);t=`${A.slice(0,e)}:${o}:${n}`}}let o=t.indexOf("::");if(-1!==o){let A=t.slice(0,o),r=t.slice(o+2),s=""===A?[]:A.split(":"),n=""===r?[]:r.split(":"),i=0;for(let A of s)e.writeUInt16BE(parseInt(A,16),i),i+=2;for(let A of(i=16-2*n.length,n))e.writeUInt16BE(parseInt(A,16),i),i+=2}else{let A=t.split(":");for(let t=0;t<A.length;t++)e.writeUInt16BE(parseInt(A[t],16),2*t)}return e}e.exports={parseAddress:function(A){if(s.isIPv4(A)){let e=A.split(".").map(Number);return{type:1,buffer:r.from(e)}}if(s.isIPv6(A))return{type:4,buffer:n(A)};let e=r.from(A,"utf8");if(e.length>255)throw new o("Domain name too long (max 255 bytes)");return{type:3,buffer:r.concat([r.from([e.length]),e])}},parseIPv6:n,buildAddressBuffer:function(A,e,t){let s=r.allocUnsafe(2);return s.writeUInt16BE(t,0),r.concat([r.from([A]),e,s])},parseResponseAddress:function(A,e=0){let t;if(A.length<e+1)throw new o("Buffer too small to contain address type");let r=A[e],s=e+1;switch(r){case 1:if(A.length<s+6)throw new o("Buffer too small for IPv4 address");t=Array.from(A.subarray(s,s+4)).join("."),s+=4;break;case 3:{if(A.length<s+1)throw new o("Buffer too small for domain length");let e=A[s];if(s+=1,A.length<s+e+2)throw new o("Buffer too small for domain address");t=A.subarray(s,s+e).toString("utf8"),s+=e;break}case 4:{if(A.length<s+18)throw new o("Buffer too small for IPv6 address");let e=[];for(let t=0;t<8;t++){let r=A.readUInt16BE(s+2*t);e.push(r.toString(16))}t=e.join(":"),s+=16;break}default:throw new o(`Invalid address type: ${r}`)}if(A.length<s+2)throw new o("Buffer too small for port");return{address:t,port:A.readUInt16BE(s),bytesRead:(s+=2)-e}},createReplyError:function(A){let e=Error({1:"General SOCKS server failure",2:"Connection not allowed by ruleset",3:"Network unreachable",4:"Host unreachable",5:"Connection refused",6:"TTL expired",7:"Command not supported",8:"Address type not supported"}[A]||`Unknown SOCKS5 error code: ${A}`);return e.code=`SOCKS5_${A}`,e}}},947243,(A,e,t)=>{"use strict";let{EventEmitter:r}=A.r(687769),{Buffer:s}=A.r(951615),{InvalidArgumentError:o,Socks5ProxyError:n}=A.r(456763),{debuglog:i}=A.r(812057),{parseAddress:a}=A.r(75318),g=i("undici:socks5"),l=s.alloc(0),Q={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},E={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},h={IPV4:1,DOMAIN:3,IPV6:4},B={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},I={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"};e.exports={Socks5Client:class extends r{constructor(A,e={}){if(super(),!A)throw new o("socket is required");this.socket=A,this.options=e,this.state=I.INITIAL,this.buffer=l,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],e.username&&e.password&&this.authMethods.push(Q.USERNAME_PASSWORD),this.authMethods.push(Q.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(A){g("received data",A.length,"bytes in state",this.state),this.buffer=s.concat([this.buffer,A]);try{switch(this.state){case I.HANDSHAKING:this.handleHandshakeResponse();break;case I.AUTHENTICATING:this.handleAuthResponse();break;case I.CONNECTING:this.handleConnectResponse()}}catch(A){this.onError(A)}}onError(A){g("socket error",A),this.state=I.ERROR,this.emit("error",A),this.destroy()}onClose(){g("socket closed"),this.state=I.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=I.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==I.INITIAL)throw new o("Handshake already started");g("starting handshake with",this.authMethods.length,"auth methods"),this.state=I.HANDSHAKING;let A=s.alloc(2+this.authMethods.length);A[0]=5,A[1]=this.authMethods.length,this.authMethods.forEach((e,t)=>{A[2+t]=e}),this.socket.write(A)}handleHandshakeResponse(){if(this.buffer.length<2)return;let A=this.buffer[0],e=this.buffer[1];if(5!==A)throw new n(`Invalid SOCKS version: ${A}`,"UND_ERR_SOCKS5_VERSION");if(e===Q.NO_ACCEPTABLE)throw new n("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),g("server selected auth method",e),e===Q.NO_AUTH)this.markAuthenticated();else if(e===Q.USERNAME_PASSWORD)this.state=I.AUTHENTICATING,this.sendAuthRequest();else throw new n(`Unsupported authentication method: ${e}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:A,password:e}=this.options;if(!A||!e)throw new o("Username and password required for authentication");g("sending username/password auth");let t=s.from(A),r=s.from(e);if(t.length>255||r.length>255)throw new o("Username or password too long");let n=s.alloc(3+t.length+r.length);n[0]=1,n[1]=t.length,t.copy(n,2),n[2+t.length]=r.length,r.copy(n,3+t.length),this.socket.write(n)}handleAuthResponse(){if(this.buffer.length<2)return;let A=this.buffer[0],e=this.buffer[1];if(1!==A)throw new n(`Invalid auth sub-negotiation version: ${A}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(0!==e)throw new n("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),g("authentication successful"),this.markAuthenticated()}connect(A,e){if(this.state===I.CONNECTING||this.state===I.CONNECTED)throw new o("Connection already in progress");if(this.state!==I.AUTHENTICATED)throw new o("Client must be authenticated before CONNECT");g("connecting to",A,e),this.state=I.CONNECTING;let t=this.buildConnectRequest(E.CONNECT,A,e);this.socket.write(t)}buildConnectRequest(A,e,t){let{type:r,buffer:o}=a(e),n=s.alloc(4+o.length+2);return n[0]=5,n[1]=A,n[2]=0,n[3]=r,o.copy(n,4),n.writeUInt16BE(t,4+o.length),n}handleConnectResponse(){let A;if(this.buffer.length<4)return;let e=this.buffer[0],t=this.buffer[1],r=this.buffer[3];if(5!==e)throw new n(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let s=4;if(r===h.IPV4)s+=6;else if(r===h.DOMAIN){if(this.buffer.length<5)return;s+=1+this.buffer[4]+2}else if(r===h.IPV6)s+=18;else throw new n(`Invalid address type in reply: ${r}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length<s)return;if(t!==B.SUCCEEDED){let A=this.getReplyErrorMessage(t);throw new n(`SOCKS5 connection failed: ${A}`,`UND_ERR_SOCKS5_REPLY_${t}`)}let o=4;if(r===h.IPV4)A=Array.from(this.buffer.subarray(o,o+4)).join("."),o+=4;else if(r===h.DOMAIN){let e=this.buffer[o];o+=1,A=this.buffer.subarray(o,o+e).toString(),o+=e}else if(r===h.IPV6){let e=[];for(let A=0;A<8;A++){let t=this.buffer.readUInt16BE(o+2*A);e.push(t.toString(16))}A=e.join(":"),o+=16}let i=this.buffer.readUInt16BE(o);this.buffer=l,this.state=I.CONNECTED,this.socket.removeListener("data",this.onSocketData),g("connected, bound address:",A,"port:",i),this.emit("connected",{address:A,port:i})}getReplyErrorMessage(A){switch(A){case B.GENERAL_FAILURE:return"General SOCKS server failure";case B.CONNECTION_NOT_ALLOWED:return"Connection not allowed by ruleset";case B.NETWORK_UNREACHABLE:return"Network unreachable";case B.HOST_UNREACHABLE:return"Host unreachable";case B.CONNECTION_REFUSED:return"Connection refused";case B.TTL_EXPIRED:return"TTL expired";case B.COMMAND_NOT_SUPPORTED:return"Command not supported";case B.ADDRESS_TYPE_NOT_SUPPORTED:return"Address type not supported";default:return`Unknown error code: ${A}`}}},AUTH_METHODS:Q,COMMANDS:E,ADDRESS_TYPES:h,REPLY_CODES:B,STATES:I}},494107,(A,e,t)=>{"use strict";let r,{URL:s}=A.r(857764),o=A.r(778469),{InvalidArgumentError:n}=A.r(456763),{Socks5Client:i,STATES:a}=A.r(947243),{kDispatch:g,kClose:l,kDestroy:Q}=A.r(354615),E=A.r(481206),h=A.r(724604),{debuglog:B}=A.r(812057),I=B("undici:socks5-proxy"),C=Symbol("proxy url"),c=Symbol("proxy headers"),u=Symbol("proxy auth"),d=Symbol("proxy protocol"),f=Symbol("pools"),y=Symbol("connector"),D=!1;e.exports=class extends o{constructor(A,e={}){if(super(),D||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),D=!0),!A)throw new n("Proxy URL is mandatory");const t="string"==typeof A?new s(A):A;if("socks5:"!==t.protocol&&"socks:"!==t.protocol)throw new n("Proxy URL must use socks5:// or socks:// protocol");this[C]=t,this[c]=e.headers||{},this[d]=e.proxyTls?"https:":"http:",this[u]={username:e.username||(t.username?decodeURIComponent(t.username):null),password:e.password||(t.password?decodeURIComponent(t.password):null)},this[y]=e.connect||h({...e.proxyTls,servername:e.proxyTls?.servername||t.hostname}),this[f]=new Map}async createSocks5Connection(A,e){let t=this[C].hostname,r=parseInt(this[C].port)||1080;I("creating SOCKS5 connection to",t,r);let s=Promise.withResolvers();this[y]({hostname:t,host:t,port:r,protocol:this[d]},(A,e)=>{A?s.reject(A):s.resolve(e)});let o=await s.promise,n=new i(o,this[u]);n.on("error",A=>{I("SOCKS5 error:",A),o.destroy()}),await n.handshake();let g=Promise.withResolvers(),l=setTimeout(()=>{g.reject(Error("SOCKS5 authentication timeout"))},5e3),Q=()=>{clearTimeout(l),n.removeListener("error",E),g.resolve()},E=A=>{clearTimeout(l),n.removeListener("authenticated",Q),g.reject(A)};n.state===a.AUTHENTICATED?(clearTimeout(l),g.resolve()):(n.once("authenticated",Q),n.once("error",E)),await g.promise,await n.connect(A,e);let h=Promise.withResolvers(),B=setTimeout(()=>{h.reject(Error("SOCKS5 connection timeout"))},5e3),c=t=>{I("SOCKS5 tunnel established to",A,e,"via",t),clearTimeout(B),n.removeListener("error",f),h.resolve()},f=A=>{clearTimeout(B),n.removeListener("connected",c),h.reject(A)};return n.once("connected",c),n.once("error",f),await h.promise,o}[g](e,t){let{origin:o}=e;I("dispatching request to",o,"via SOCKS5");try{let n=String(o),i=this[f].get(n);return(!i||i.destroyed||i.closed)&&(i=new E(o,{pipelining:e.pipelining,connections:e.connections,connect:async(e,t)=>{try{let n=new s(o),i=n.hostname,a=parseInt(n.port)||("https:"===n.protocol?443:80);I("establishing SOCKS5 connection to",i,a);let g=await this.createSocks5Connection(i,a),l=g;if("https:"===n.protocol){r||(r=A.r(685560)),I("upgrading to TLS"),l=r.connect({socket:g,servername:i,...e.tls||{}});let t=Promise.withResolvers();l.once("secureConnect",t.resolve),l.once("error",t.reject),await t.promise}t(null,l)}catch(A){I("SOCKS5 connection error:",A),t(A)}}}),this[f].set(n,i)),i[g](e,t)}catch(A){if(I("dispatch error:",A),"function"==typeof t.onResponseError)return t.onResponseError(null,A),!1;if("function"==typeof t.onError)return t.onError(A),!1;throw A}}async [l](){let A=[];for(let e of this[f].values())A.push(e.close());this[f].clear(),await Promise.all(A)}async [Q](A){let e=[];for(let t of this[f].values())e.push(t.destroy(A));this[f].clear(),await Promise.all(e)}}},144253,(A,e,t)=>{"use strict";let{kProxy:r,kClose:s,kDestroy:o,kDispatch:n}=A.r(354615),i=A.r(484221),a=A.r(481206),g=A.r(778469),{InvalidArgumentError:l,RequestAbortedError:Q,SecureProxyConnectionError:E}=A.r(456763),h=A.r(724604),B=A.r(306847),{channels:I}=A.r(283250),C=A.r(494107),c=Symbol("proxy agent"),u=Symbol("proxy client"),d=Symbol("proxy headers"),f=Symbol("request tls settings"),y=Symbol("proxy tls settings"),D=Symbol("connect endpoint function"),p=Symbol("connect endpoint function (http/1.1 only)"),w=Symbol("tunnel proxy"),S="proxy-authorization";function N(A,e){return new a(A,e)}let R=()=>{};function U(A,e){return 1===e.connections?new B(A,e):new a(A,e)}class F extends g{#B;constructor(A,{headers:e={},connect:t,factory:r}){if(!A)throw new l("Proxy URL is mandatory");super(),this[d]=e,r?this.#B=r(A,{connect:t}):this.#B=new B(A,{connect:t})}[n](A,e){let t=e.onResponseStart;e.onResponseStart=function(A,r,s,o){if(407===r){"function"==typeof e.onResponseError&&e.onResponseError(A,new l("Proxy Authentication Required (407)"));return}t&&t.call(this,A,r,s,o)};let{origin:r,path:s="/",headers:o={}}=A;if(A.path=r+s,!("host"in o)&&!("Host"in o)){let{host:A}=new URL(r);o.host=A}return A.headers={...this[d],...o},this.#B[n](A,e)}[s](){return this.#B.close()}[o](A){return this.#B.destroy(A)}}function m(A){return A.length===S.length&&A.toLowerCase()===S}function b(){throw new l("Proxy-Authorization should be sent in ProxyAgent constructor")}e.exports=class extends g{constructor(A){if(!A||"object"==typeof A&&!(A instanceof URL)&&!A.uri)throw new l("Proxy uri is mandatory");const{clientFactory:e=N}=A;if("function"!=typeof e)throw new l("Proxy opts.clientFactory must be a function.");const{proxyTunnel:t=!0,connectTimeout:s}=A;super();const o=this.#I(A),{href:n,origin:a,port:g,protocol:B,username:S,password:m,hostname:b}=o;if(this[r]={uri:n,protocol:B},this[f]=A.requestTls,this[y]=A.proxyTls,this[d]=A.headers||{},this[w]=t,A.auth&&A.token)throw new l("opts.auth cannot be used in combination with opts.token");A.auth?this[d]["proxy-authorization"]=`Basic ${A.auth}`:A.token?this[d]["proxy-authorization"]=A.token:S&&m?this[d]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(S)}:${decodeURIComponent(m)}`).toString("base64")}`:S&&(this[d]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(S)}:`).toString("base64")}`);const M=h({timeout:s,...A.proxyTls});this[D]=h({timeout:s,...A.requestTls}),this[p]=h({timeout:s,...A.requestTls,allowH2:!1});const k=A.factory||U,T=(e,t)=>{let{protocol:s}=new URL(e);return"socks5:"===this[r].protocol||"socks:"===this[r].protocol?new C(this[r].uri,{headers:this[d],connect:M,factory:k,username:A.username||S,password:A.password||m,proxyTls:A.proxyTls}):this[w]||"http:"!==s||"http:"!==this[r].protocol?k(e,t):new F(this[r].uri,{headers:this[d],connect:M,factory:k})};"socks5:"===B||"socks:"===B?this[u]=null:this[u]=e(o,{connect:M}),this[c]=new i({...A,factory:T,connect:async(A,e)=>{if(!this[u])return void e(new l("Cannot establish tunnel connection without a proxy client"));let t=A.host;A.port||(t+=`:${"https:"===A.protocol?443:80}`);try{let r,s={origin:a,port:g,path:t,signal:A.signal,headers:{...this[d],host:A.host,...null==A.connections||A.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[y]?.servername||b},{socket:o,statusCode:n}=await this[u].connect(s);if(200!==n){o.on("error",R).destroy(),e(new Q(`Proxy response (${n}) !== 200 when HTTP Tunneling`));return}if(I.proxyConnected.hasSubscribers&&I.proxyConnected.publish({socket:o,connectParams:s}),"https:"!==A.protocol)return void e(null,o);r=this[f]?this[f].servername:A.servername,(!1===A.allowH2?this[p]:this[D])({...A,servername:r,httpSocket:o},e)}catch(A){e("ERR_TLS_CERT_ALTNAME_INVALID"===A.code?new E(A):A)}}})}dispatch(A,e){let t=function(A){if(Array.isArray(A)){let e={};for(let t=0;t<A.length;t+=2)m(A[t])&&b(),e[A[t]]=A[t+1];return e}return A}(A.headers);if(function(A){for(let e in A)m(e)&&b()}(t),t&&!("host"in t)&&!("Host"in t)){let{host:e}=new URL(A.origin);t.host=e}return this[c].dispatch({...A,headers:t},e)}#I(A){return"string"==typeof A?new URL(A):A instanceof URL?A:new URL(A.uri)}[s](){let A=[this[c].close()];return this[u]&&A.push(this[u].close()),Promise.all(A)}[o](){let A=[this[c].destroy()];return this[u]&&A.push(this[u].destroy()),Promise.all(A)}}},178121,(A,e,t)=>{"use strict";let r=A.r(778469),{kClose:s,kDestroy:o,kClosed:n,kDestroyed:i,kDispatch:a,kNoProxyAgent:g,kHttpProxyAgent:l,kHttpsProxyAgent:Q}=A.r(354615),E=A.r(144253),h=A.r(484221),B={"http:":80,"https:":443};e.exports=class extends r{#C=null;#c=null;#u=null;constructor(A={}){super(),this.#u=A;const{httpProxy:e,httpsProxy:t,noProxy:r,...s}=A;this[g]=new h(s);const o=e??process.env.http_proxy??process.env.HTTP_PROXY;o?this[l]=new E({...s,uri:o}):this[l]=this[g];const n=t??process.env.https_proxy??process.env.HTTPS_PROXY;n?this[Q]=new E({...s,uri:n}):this[Q]=this[l],this.#d()}[a](A,e){let t=new URL(A.origin);return this.#f(t).dispatch(A,e)}[s](){return Promise.all([this[g].close(),!this[l][n]&&this[l].close(),!this[Q][n]&&this[Q].close()])}[o](A){return Promise.all([this[g].destroy(A),!this[l][i]&&this[l].destroy(A),!this[Q][i]&&this[Q].destroy(A)])}#f(A){let{protocol:e,host:t,port:r}=A;return(t=t.replace(/:\d*$/,"").toLowerCase(),r=Number.parseInt(r,10)||B[e]||0,this.#y(t,r))?"https:"===e?this[Q]:this[l]:this[g]}#y(A,e){if(this.#D&&this.#d(),0===this.#c.length)return!0;if("*"===this.#C)return!1;for(let t=0;t<this.#c.length;t++){let r=this.#c[t];if((!r.port||r.port===e)&&(A===r.hostname||A.slice(-(r.hostname.length+1))===`.${r.hostname}`))return!1}return!0}#d(){let A=this.#u.noProxy??this.#p,e=A.split(/[,\s]/),t=[];for(let A=0;A<e.length;A++){let r=e[A];if(!r)continue;let s=r.match(/^(.+):(\d+)$/);t.push({hostname:(s?s[1]:r).replace(/^\*?\./,"").toLowerCase(),port:s?Number.parseInt(s[2],10):0})}this.#C=A,this.#c=t}get #D(){return void 0===this.#u.noProxy&&this.#C!==this.#p}get #p(){return process.env.no_proxy??process.env.NO_PROXY??""}}},225316,(A,e,t)=>{"use strict";let r=A.r(57328),{kRetryHandlerDefaultRetry:s}=A.r(354615),{RequestRetryError:o}=A.r(456763),{isDisturbed:n,parseRangeHeader:i,wrapRequestBody:a}=A.r(280324);class g{constructor(A,{dispatch:e,handler:t}){const{retryOptions:r,...o}=A,{retry:n,maxRetries:i,maxTimeout:l,minTimeout:Q,timeoutFactor:E,methods:h,errorCodes:B,retryAfter:I,statusCodes:C,throwOnError:c}=r??{};this.error=null,this.dispatch=e,this.handler=t,this.opts={...o,body:a(A.body)},this.retryOpts={throwOnError:c??!0,retry:n??g[s],retryAfter:I??!0,maxTimeout:l??3e4,minTimeout:Q??500,timeoutFactor:E??2,maxRetries:i??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:C??[500,502,503,504,429],errorCodes:B??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null,this.statusCode=null,this.headers=null}onResponseStartWithRetry(A,e,t,r,s){if(this.retryOpts.throwOnError)return void(!1===this.retryOpts.statusCodes.includes(e)?(this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,r)):this.error=s);if(n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,r);return}A.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},(function(o){if(o){this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,r),A.resume();return}this.error=s,A.resume()}).bind(this))}onRequestStart(A,e){this.headersSent||this.handler.onRequestStart?.(A,e)}onRequestUpgrade(A,e,t,r){this.handler.onRequestUpgrade?.(A,e,t,r)}static[s](A,{state:e,opts:t},r){let{statusCode:s,code:o,headers:n}=A,{method:i,retryOptions:a}=t,{maxRetries:g,minTimeout:l,maxTimeout:Q,timeoutFactor:E,statusCodes:h,errorCodes:B,methods:I}=a,{counter:C}=e;if(o&&"UND_ERR_REQ_RETRY"!==o&&!B.includes(o)||Array.isArray(I)&&!I.includes(i)||null!=s&&Array.isArray(h)&&!h.includes(s)||C>g)return void r(A);let c=n?.["retry-after"];if(c){let A;c=Number.isNaN(c=Number(c))?isNaN(A=new Date(n["retry-after"]).getTime())?0:A-Date.now():1e3*c}setTimeout(()=>r(null),c>0?Math.min(c,Q):Math.min(l*E**(C-1),Q))}onResponseStart(A,e,t,s){if(this.error=null,this.retryCount+=1,this.statusCode=e,this.headers=t,e>=300){let r=new o("Request failed",e,{headers:t,data:{count:this.retryCount}});this.onResponseStartWithRetry(A,e,t,s,r);return}if(this.headersSent){if(206!==e&&(this.start>0||200!==e))throw new o("server does not support the range header and the payload was partially consumed",e,{headers:t,data:{count:this.retryCount}});let A=i(t["content-range"]);if(!A)throw new o("Content-Range mismatch",e,{headers:t,data:{count:this.retryCount}});if(null!=this.etag&&this.etag!==t.etag)throw new o("ETag mismatch",e,{headers:t,data:{count:this.retryCount}});let{start:s,size:n,end:a=n?n-1:null}=A;r(this.start===s,"content-range mismatch"),r(null==this.end||this.end===a,"content-range mismatch");return}if(null==this.end){if(206===e){let o=i(t["content-range"]);if(null==o){this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,s);return}let{start:n,size:a,end:g=a?a-1:null}=o;r(null!=n&&Number.isFinite(n),"content-range mismatch"),r(null!=g&&Number.isFinite(g),"invalid content-length"),this.start=n,this.end=g}if(null==this.end){let A=t["content-length"];this.end=null!=A?Number(A)-1:null}r(Number.isFinite(this.start)),r(null==this.end||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=null!=t.etag?t.etag:null,null!=this.etag&&"W"===this.etag[0]&&"/"===this.etag[1]&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,s)}else throw new o("Request failed",e,{headers:t,data:{count:this.retryCount}})}onResponseData(A,e){this.error||(this.start+=e.length,this.handler.onResponseData?.(A,e))}onResponseEnd(A,e){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error){if(null!=this.end&&Number.isFinite(this.end)&&this.start!==this.end+1)throw new o("Content-Range mismatch",this.statusCode,{headers:this.headers,data:{count:this.retryCount}});return this.retryCount=0,this.handler.onResponseEnd?.(A,e)}this.retry(A)}retry(A){if(0!==this.start){let A={range:`bytes=${this.start}-${this.end??""}`};null!=this.etag&&(A["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...A}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(e){this.handler.onResponseError?.(A,e)}}onResponseError(A,e){A?.aborted||n(this.opts.body)?this.handler.onResponseError?.(A,e):(this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},(function(e){e?this.handler?.onResponseError?.(A,e):this.retry(A)}).bind(this)))}}e.exports=g},69452,(A,e,t)=>{"use strict";let r=A.r(777103),s=A.r(225316);e.exports=class extends r{#w=null;#S=null;constructor(A,e={}){super(e),this.#w=A,this.#S=e}dispatch(A,e){let t=new s({...A,retryOptions:this.#S},{dispatch:this.#w.dispatch.bind(this.#w),handler:e});return this.#w.dispatch(A,t)}close(){return this.#w.close()}destroy(){return this.#w.destroy()}}},506146,(A,e,t)=>{"use strict";let{InvalidArgumentError:r}=A.r(456763),s=A.r(306847);e.exports=class extends s{constructor(A,e){if("string"==typeof A&&(A=new URL(A)),"http:"!==A.protocol)throw new r("h2c-client: Only h2c protocol is supported");const{maxConcurrentStreams:t,pipelining:s,...o}=e??{},n=t??100;let i=100;if(null!=t&&(!Number.isInteger(t)||t<1))throw new r("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=s&&Number.isInteger(s)&&s>0&&(i=s),i>n)throw new r("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(A,{...o,maxConcurrentStreams:n,pipelining:i,allowH2:!0,useH2c:!0})}}},580451,(A,e,t)=>{"use strict";let r=A.r(57328),{addAbortListener:s}=A.r(687769),{Readable:o}=A.r(81111),{RequestAbortedError:n,NotSupportedError:i,InvalidArgumentError:a,AbortError:g}=A.r(456763),l=A.r(280324),{ReadableStreamFrom:Q}=A.r(280324),E=Symbol("kConsume"),h=Symbol("kReading"),B=Symbol("kBody"),I=Symbol("kAbort"),C=Symbol("kContentType"),c=Symbol("kContentLength"),u=Symbol("kUsed"),d=Symbol("kBytesRead"),f=()=>{};function y(A,e){return r(!A[E]),new Promise((t,r)=>{if(l.isDisturbed(A)||A[B]?.locked===!0||null!==A[E]){let e=A._readableState;e.destroyed&&!1===e.closeEmitted?A.on("error",r).on("close",()=>{r(TypeError("unusable"))}):r(e.errored??TypeError("unusable"))}else queueMicrotask(()=>{A[E]={type:e,stream:A,resolve:t,reject:r,length:0,body:[]},A.on("error",function(A){N(this[E],A)}).on("close",function(){null!==this[E].body&&N(this[E],new n)}),function(A){if(null===A.body)return;let{_readableState:e}=A.stream;if(e.bufferIndex){let t=e.bufferIndex,r=e.buffer.length;for(let s=t;s<r;s++)S(A,e.buffer[s])}else for(let t of e.buffer)S(A,t);for(e.endEmitted?w(this[E],this._readableState.encoding):A.stream.on("end",function(){w(this[E],this._readableState.encoding)}),A.stream.resume();null!=A.stream.read(););}(A[E])})})}function D(A,e,t){if(0===A.length||0===e)return"";let r=1===A.length?A[0]:Buffer.concat(A,e),s=r.length,o=3*(s>2&&239===r[0]&&187===r[1]&&191===r[2]);return t&&"utf8"!==t&&"utf-8"!==t?r.subarray(o,s).toString(t):r.utf8Slice(o,s)}function p(A,e){if(0===A.length||0===e)return new Uint8Array(0);if(1===A.length)return new Uint8Array(A[0]);let t=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),r=0;for(let e=0;e<A.length;++e){let s=A[e];t.set(s,r),r+=s.length}return t}function w(A,e){let{type:t,body:r,resolve:s,stream:o,length:n}=A;try{"text"===t?s(D(r,n,e)):"json"===t?s(JSON.parse(D(r,n,e))):"arrayBuffer"===t?s(p(r,n).buffer):"blob"===t?s(new Blob(r,{type:o[C]})):"bytes"===t&&s(p(r,n)),N(A)}catch(A){o.destroy(A)}}function S(A,e){A.length+=e.length,A.body.push(e)}function N(A,e){null!==A.body&&(e?A.reject(e):A.resolve(),A.type=null,A.stream=null,A.resolve=null,A.reject=null,A.length=0,A.body=null)}e.exports={Readable:class extends o{constructor({resume:A,abort:e,contentType:t="",contentLength:r,highWaterMark:s=65536}){super({autoDestroy:!0,read:A,highWaterMark:s}),this._readableState.dataEmitted=!1,this[I]=e,this[E]=null,this[d]=0,this[B]=null,this[u]=!1,this[C]=t,this[c]=Number.isFinite(r)?r:null,this[h]=!1}_destroy(A,e){A||this._readableState.endEmitted||(A=new n),A&&this[I](),this[u]?e(A):setImmediate(e,A)}on(A,e){return("data"===A||"readable"===A)&&(this[h]=!0,this[u]=!0),super.on(A,e)}addListener(A,e){return this.on(A,e)}off(A,e){let t=super.off(A,e);return("data"===A||"readable"===A)&&(this[h]=this.listenerCount("data")>0||this.listenerCount("readable")>0),t}removeListener(A,e){return this.off(A,e)}push(A){return A&&(this[d]+=A.length,this[E])?(S(this[E],A),!this[h]||super.push(A)):super.push(A)}text(){return y(this,"text")}json(){return y(this,"json")}blob(){return y(this,"blob")}bytes(){return y(this,"bytes")}arrayBuffer(){return y(this,"arrayBuffer")}async formData(){throw new i}get bodyUsed(){return l.isDisturbed(this)}get body(){return!this[B]&&(this[B]=Q(this),this[E]&&(this[B].getReader(),r(this[B].locked))),this[B]}dump(A){let e=A?.signal;if(null!=e&&("object"!=typeof e||!("aborted"in e)))return Promise.reject(new a("signal must be an AbortSignal"));let t=A?.limit&&Number.isFinite(A.limit)?A.limit:131072;return e?.aborted?Promise.reject(e.reason??new g):this._readableState.closeEmitted?Promise.resolve(null):new Promise((A,r)=>{if((this[c]&&this[c]>t||this[d]>t)&&this.destroy(new g),e){let t=()=>{this.destroy(e.reason??new g)},o=s(e,t);this.on("close",function(){o[Symbol.dispose](),e.aborted?r(e.reason??new g):A(null)})}else this.on("close",A);this.on("error",f).on("data",()=>{this[d]>t&&this.destroy()}).resume()})}setEncoding(A){return Buffer.isEncoding(A)&&(this._readableState.encoding=A),this}},chunksDecode:D}},832052,(A,e,t)=>{"use strict";let r=A.r(57328),{AsyncResource:s}=A.r(478500),{Readable:o}=A.r(580451),{InvalidArgumentError:n,RequestAbortedError:i}=A.r(456763),a=A.r(280324);function g(){}class l extends s{constructor(A,e){if(!A||"object"!=typeof A)throw new n("invalid opts");const{signal:t,method:r,opaque:s,body:o,onInfo:l,responseHeaders:Q,highWaterMark:E}=A;try{if("function"!=typeof e)throw new n("invalid callback");if(null!=E&&(!Number.isFinite(E)||E<0))throw new n("invalid highWaterMark");if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new n("signal must be an EventEmitter or EventTarget");if("CONNECT"===r)throw new n("invalid method");if(l&&"function"!=typeof l)throw new n("invalid onInfo callback");super("UNDICI_REQUEST")}catch(A){throw a.isStream(o)&&a.destroy(o.on("error",g),A),A}this.method=r,this.responseHeaders=Q||null,this.opaque=s||null,this.callback=e,this.res=null,this.abort=null,this.body=o,this.trailers={},this.context=null,this.controller=null,this.onInfo=l||null,this.highWaterMark=E,this.reason=null,this.removeAbortListener=null,t?.aborted?this.reason=t.reason??new i:t&&(this.removeAbortListener=a.addAbortListener(t,()=>{this.reason=t.reason??new i,this.res?a.destroy(this.res.on("error",g),this.reason):this.abort&&this.abort(this.reason)}))}onRequestStart(A,e){this.reason?A.abort(this.reason):(r(this.callback),this.controller=A,this.abort=e=>A.abort(e),this.context=e)}onResponseStart(A,e,t,r){let{callback:s,opaque:n,context:i,responseHeaders:l,highWaterMark:Q}=this,E=A?.rawHeaders,h="raw"===l?a.parseRawHeaders(E):t;if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let B=t?.["content-type"],I=t?.["content-length"],C=new o({resume:()=>A.resume(),abort:e=>A.abort(e),contentType:B,contentLength:"HEAD"!==this.method&&I?Number(I):null,highWaterMark:Q});if(this.removeAbortListener&&(C.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=C,null!==s)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:r,headers:h,trailers:this.trailers,opaque:n,body:C,context:i})}catch(A){this.res=null,a.destroy(C.on("error",g),A),queueMicrotask(()=>{throw A})}}onResponseData(A,e){this.res&&!1===this.res.push(e)&&A.pause()}onResponseEnd(A,e){if(e&&"object"==typeof e)for(let A of Object.keys(e))"__proto__"===A?Object.defineProperty(this.trailers,A,{value:e[A],enumerable:!0,configurable:!0,writable:!0}):this.trailers[A]=e[A];this.res?.push(null)}onResponseError(A,e){let{res:t,callback:r,body:s,opaque:o}=this;r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:o})})),t&&(this.res=null,queueMicrotask(()=>{a.destroy(t.on("error",g),e)})),s&&(this.body=null,a.isStream(s)&&(s.on("error",g),a.destroy(s,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}}e.exports=function A(e,t){if(void 0===t)return new Promise((t,r)=>{A.call(this,e,(A,e)=>A?r(A):t(e))});try{let A=new l(e,t);this.dispatch(e,A)}catch(r){if("function"!=typeof t)throw r;let A=e?.opaque;queueMicrotask(()=>t(r,{opaque:A}))}},e.exports.RequestHandler=l},471710,(A,e,t)=>{"use strict";let{addAbortListener:r}=A.r(280324),{RequestAbortedError:s}=A.r(456763),o=Symbol("kListener"),n=Symbol("kSignal");function i(A){A.abort?A.abort(A[n]?.reason):A.reason=A[n]?.reason??new s,a(A)}function a(A){A[n]&&("removeEventListener"in A[n]?A[n].removeEventListener("abort",A[o]):A[n].removeListener("abort",A[o]),A[n]=null,A[o]=null)}e.exports={addSignal:function(A,e){if(A.reason=null,A[n]=null,A[o]=null,e){if(e.aborted)return void i(A);A[n]=e,A[o]=()=>{i(A)},r(A[n],A[o])}},removeSignal:a}},153226,(A,e,t)=>{"use strict";let r=A.r(57328),{AsyncResource:s}=A.r(478500),{InvalidArgumentError:o,InvalidReturnValueError:n}=A.r(456763),i=A.r(280324),{addSignal:a,removeSignal:g}=A.r(471710);function l(){}class Q extends s{constructor(A,e,t){if(!A||"object"!=typeof A)throw new o("invalid opts");const{signal:r,method:s,opaque:n,body:g,onInfo:Q,responseHeaders:E}=A;try{if("function"!=typeof t)throw new o("invalid callback");if("function"!=typeof e)throw new o("invalid factory");if(r&&"function"!=typeof r.on&&"function"!=typeof r.addEventListener)throw new o("signal must be an EventEmitter or EventTarget");if("CONNECT"===s)throw new o("invalid method");if(Q&&"function"!=typeof Q)throw new o("invalid onInfo callback");super("UNDICI_STREAM")}catch(A){throw i.isStream(g)&&i.destroy(g.on("error",l),A),A}this.responseHeaders=E||null,this.opaque=n||null,this.factory=e,this.callback=t,this.res=null,this.abort=null,this.context=null,this.controller=null,this.trailers=null,this.body=g,this.onInfo=Q||null,i.isStream(g)&&g.on("error",A=>{this.onResponseError(this.controller,A)}),a(this,r)}onRequestStart(A,e){this.reason?A.abort(this.reason):(r(this.callback),this.controller=A,this.abort=e=>A.abort(e),this.context=e)}onResponseStart(A,e,t,r){var s;let o,a,g,l,Q,{factory:E,opaque:h,context:B,responseHeaders:I}=this,C=A?.rawHeaders,c="raw"===I?i.parseRawHeaders(C):t;if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:c});return}if(this.factory=null,null===E)return;let u=this.runInAsyncScope(E,null,{statusCode:e,headers:c,opaque:h,context:B});if(!u||"function"!=typeof u.write||"function"!=typeof u.end||"function"!=typeof u.on)throw new n("expected Writable");s=(A,e)=>{let{callback:t,res:r,opaque:s,trailers:o,abort:n}=this;this.res=null,(A||!r?.readable)&&i.destroy(r,e?void 0:A),this.callback=null,this.runInAsyncScope(t,null,A||null,{opaque:s,trailers:o}),A&&n(A)},o=!1,a=(A,e=!1)=>{o||(o=!0,u.removeListener("close",g),u.removeListener("error",l),u.removeListener("finish",Q),s(A,e))},g=()=>{let A;a(u.errored??u.writableErrored??u._writableState?.errored??(u.writableFinished?void 0:((A=Error("Premature close")).code="ERR_STREAM_PREMATURE_CLOSE",A)))},l=A=>a(A,!0),Q=()=>a(),u.on("close",g),u.on("error",l),u.on("finish",Q),u.closed?process.nextTick(g):u.writableFinished&&process.nextTick(Q),u.on("drain",()=>A.resume()),this.res=u,!0===(void 0!==u.writableNeedDrain?u.writableNeedDrain:u._writableState?.needDrain)&&A.pause()}onResponseData(A,e){let{res:t}=this;t&&!1===t.write(e)&&A.pause()}onResponseEnd(A,e){let{res:t}=this;g(this),t&&(e&&"object"==typeof e&&(this.trailers=e),t.end())}onResponseError(A,e){let{res:t,callback:r,opaque:s,body:o}=this;g(this),this.factory=null,t?(this.res=null,i.destroy(t,e)):r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:s})})),o&&(this.body=null,i.destroy(o,e))}}e.exports=function A(e,t,r){if(void 0===r)return new Promise((r,s)=>{A.call(this,e,t,(A,e)=>A?s(A):r(e))});try{let A=new Q(e,t,r);this.dispatch(e,A)}catch(t){if("function"!=typeof r)throw t;let A=e?.opaque;queueMicrotask(()=>r(t,{opaque:A}))}}},610092,(A,e,t)=>{"use strict";let{Readable:r,Duplex:s,PassThrough:o}=A.r(81111),n=A.r(57328),{AsyncResource:i}=A.r(478500),{InvalidArgumentError:a,InvalidReturnValueError:g,RequestAbortedError:l}=A.r(456763),Q=A.r(280324),{kBodyUsed:E}=A.r(354615),{addSignal:h,removeSignal:B}=A.r(471710);function I(){}let C=Symbol("resume");class c extends r{constructor(){super({autoDestroy:!0}),this[C]=null,this[E]=!0}_read(){let{[C]:A}=this;A&&(this[C]=null,A())}_destroy(A,e){this._read(),e(A)}}class u extends r{constructor(A){super({autoDestroy:!0}),this[C]=A}_read(){this[C]()}_destroy(A,e){A||this._readableState.endEmitted||(A=new l),e(A)}}class d extends i{constructor(A,e){if(!A||"object"!=typeof A)throw new a("invalid opts");if("function"!=typeof e)throw new a("invalid handler");const{signal:t,method:r,opaque:o,onInfo:n,responseHeaders:i}=A;if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new a("signal must be an EventEmitter or EventTarget");if("CONNECT"===r)throw new a("invalid method");if(n&&"function"!=typeof n)throw new a("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=o||null,this.responseHeaders=i||null,this.handler=e,this.abort=null,this.context=null,this.onInfo=n||null,this.req=new c().on("error",I),this.ret=new s({readableObjectMode:A.objectMode,autoDestroy:!0,read:()=>{let{body:A}=this;A?.resume&&A.resume()},write:(A,e,t)=>{let{req:r}=this;r.push(A,e)||r._readableState.destroyed?t():r[C]=t},destroy:(A,e)=>{let{body:t,req:r,res:s,ret:o,abort:n}=this;A||o._readableState.endEmitted||(A=new l),n&&A&&n(),Q.destroy(t,A),Q.destroy(r,A),Q.destroy(s,A),B(this),e(A)}}).on("prefinish",()=>{let{req:A}=this;A.push(null)}),this.res=null,h(this,t)}onRequestStart(A,e){let{res:t}=this;this.reason?A.abort(this.reason):(n(!t,"pipeline cannot be retried"),this.abort=e=>A.abort(e),this.context=e)}onResponseStart(A,e,t,r){let s,{opaque:o,handler:n,context:i}=this;if(e<200){if(this.onInfo){let r=A?.rawHeaders,s="raw"===this.responseHeaders?Q.parseRawHeaders(r):t;this.onInfo({statusCode:e,headers:s})}return}this.res=new u(()=>A.resume());try{this.handler=null;let r=A?.rawHeaders,a="raw"===this.responseHeaders?Q.parseRawHeaders(r):t;s=this.runInAsyncScope(n,null,{statusCode:e,headers:a,opaque:o,body:this.res,context:i})}catch(A){throw this.res.on("error",I),A}if(!s||"function"!=typeof s.on)throw new g("expected Readable");s.on("data",A=>{let{ret:e,body:t}=this;!e.push(A)&&t.pause&&t.pause()}).on("error",A=>{let{ret:e}=this;Q.destroy(e,A)}).on("end",()=>{let{ret:A}=this;A.push(null)}).on("close",()=>{let{ret:A}=this;A._readableState.ended||Q.destroy(A,new l)}),this.body=s}onResponseData(A,e){let{res:t}=this;!1===t.push(e)&&A.pause()}onResponseEnd(A,e){let{res:t}=this;t.push(null)}onResponseError(A,e){let{ret:t}=this;this.handler=null,Q.destroy(t,e)}}e.exports=function(A,e){try{let t=new d(A,e);return this.dispatch({...A,body:t.req},t),t.ret}catch(A){return new o().destroy(A)}}},805893,(A,e,t)=>{"use strict";let{InvalidArgumentError:r,SocketError:s}=A.r(456763),{AsyncResource:o}=A.r(478500),n=A.r(57328),i=A.r(280324),{kHTTP2Stream:a}=A.r(354615),{addSignal:g,removeSignal:l}=A.r(471710);class Q extends o{constructor(A,e){if(!A||"object"!=typeof A)throw new r("invalid opts");if("function"!=typeof e)throw new r("invalid callback");const{signal:t,opaque:s,responseHeaders:o}=A;if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new r("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=o||null,this.opaque=s||null,this.callback=e,this.abort=null,this.context=null,g(this,t)}onRequestStart(A,e){this.reason?A.abort(this.reason):(n(this.callback),this.abort=e=>A.abort(e),this.context=e)}onResponseStart(){throw new s("bad upgrade",null)}onRequestUpgrade(A,e,t,r){if(e!==(!0===r[a]?200:101)){let e=!0===r[a]?null:i.getSocketInfo(r);A.abort(new s("bad upgrade",e));return}let{callback:o,opaque:n,context:g}=this;l(this),this.callback=null;let Q=A?.rawHeaders,E="raw"===this.responseHeaders?i.parseRawHeaders(Q):t;this.runInAsyncScope(o,null,null,{headers:E,socket:r,opaque:n,context:g})}onResponseError(A,e){let{callback:t,opaque:r}=this;l(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:r})}))}}e.exports=function A(e,t){if(void 0===t)return new Promise((t,r)=>{A.call(this,e,(A,e)=>A?r(A):t(e))});try{let A=new Q(e,t),r={...e,method:e.method||"GET",upgrade:e.protocol||"Websocket"};this.dispatch(r,A)}catch(r){if("function"!=typeof t)throw r;let A=e?.opaque;queueMicrotask(()=>t(r,{opaque:A}))}}},812409,(A,e,t)=>{"use strict";let r=A.r(57328),{AsyncResource:s}=A.r(478500),{InvalidArgumentError:o,SocketError:n}=A.r(456763),i=A.r(280324),{addSignal:a,removeSignal:g}=A.r(471710);class l extends s{constructor(A,e){if(!A||"object"!=typeof A)throw new o("invalid opts");if("function"!=typeof e)throw new o("invalid callback");const{signal:t,opaque:r,responseHeaders:s}=A;if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new o("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=r||null,this.responseHeaders=s||null,this.callback=e,this.abort=null,a(this,t)}onRequestStart(A,e){this.reason?A.abort(this.reason):(r(this.callback),this.abort=e=>A.abort(e),this.context=e)}onResponseStart(){throw new n("bad connect",null)}onRequestUpgrade(A,e,t,r){let{callback:s,opaque:o,context:n}=this;g(this),this.callback=null;let a=t,l=A?.rawHeaders;null!=a&&(a="raw"===this.responseHeaders?i.parseRawHeaders(l):t),this.runInAsyncScope(s,null,null,{statusCode:e,headers:a,socket:r,opaque:o,context:n})}onResponseError(A,e){let{callback:t,opaque:r}=this;g(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:r})}))}}e.exports=function A(e,t){if(void 0===t)return new Promise((t,r)=>{A.call(this,e,(A,e)=>A?r(A):t(e))});try{let A=new l(e,t),r={...e,method:"CONNECT"};this.dispatch(r,A)}catch(r){if("function"!=typeof t)throw r;let A=e?.opaque;queueMicrotask(()=>t(r,{opaque:A}))}}},413178,(A,e,t)=>{"use strict";e.exports.request=A.r(832052),e.exports.stream=A.r(153226),e.exports.pipeline=A.r(610092),e.exports.upgrade=A.r(805893),e.exports.connect=A.r(812409)},935609,(A,e,t)=>{"use strict";let{UndiciError:r}=A.r(456763),s=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");class o extends r{constructor(A){super(A),this.name="MockNotMatchedError",this.message=A||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](A){return A&&!0===A[s]}get[s](){return!0}}e.exports={MockNotMatchedError:o}},915098,(A,e,t)=>{"use strict";e.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}},640248,(A,e,t)=>{"use strict";let{MockNotMatchedError:r}=A.r(935609),{kDispatches:s,kMockAgent:o,kOriginalDispatch:n,kOrigin:i,kGetNetConnect:a,kTotalDispatchCount:g}=A.r(915098),{serializePathWithQuery:l,parseHeaders:Q}=A.r(280324),{STATUS_CODES:E}=A.r(347299),{types:{isPromise:h}}=A.r(812057),{InvalidArgumentError:B}=A.r(456763);function I(A,e){return"string"==typeof A?A===e:A instanceof RegExp?A.test(e):"function"==typeof A&&!0===A(e)}function C(A){return Object.fromEntries(Object.entries(A).map(([A,e])=>[A.toLocaleLowerCase(),e]))}function c(A,e){if(Array.isArray(A)){for(let t=0;t<A.length;t+=2)if(A[t].toLocaleLowerCase()===e.toLocaleLowerCase())return A[t+1];return}return"function"==typeof A.get?A.get(e):C(A)[e.toLocaleLowerCase()]}function u(A){let e=A.slice(),t=[];for(let A=0;A<e.length;A+=2)t.push([e[A],e[A+1]]);return Object.fromEntries(t)}function d(A,e){if("function"==typeof A.headers)return Array.isArray(e)&&(e=u(e)),A.headers(e?C(e):{});if(void 0===A.headers)return!0;if("object"!=typeof e||"object"!=typeof A.headers)return!1;for(let[t,r]of Object.entries(A.headers))if(!I(r,c(e,t)))return!1;return!0}function f(A){if("string"!=typeof A)return A;let e=A.split("?",3);if(2!==e.length)return A;let t=new URLSearchParams(e.pop());return t.sort(),[...e,t.toString()].join("?")}function y(A){if(Buffer.isBuffer(A)||A instanceof Uint8Array)return A;if(A instanceof ArrayBuffer)return A;if("object"==typeof A)return JSON.stringify(A);if(A)return A.toString();else return""}function D(A,e){let t=e.query?l(e.path,e.query):e.path,s="string"==typeof t?f(t):t,o=w(s),n=A.filter(({consumed:A})=>!A).filter(({path:A,ignoreTrailingSlash:e})=>e?I(w(f(A)),o):I(f(A),s));if(0===n.length)throw new r(`Mock dispatch not matched for path '${s}'`);if(0===(n=n.filter(({method:A})=>I(A,e.method))).length)throw new r(`Mock dispatch not matched for method '${e.method}' on path '${s}'`);if(0===(n=n.filter(({body:A})=>void 0===A||I(A,e.body))).length)throw new r(`Mock dispatch not matched for body '${e.body}' on path '${s}'`);if(0===(n=n.filter(A=>d(A,e.headers))).length){let A="object"==typeof e.headers?JSON.stringify(e.headers):e.headers;throw new r(`Mock dispatch not matched for headers '${A}' on path '${s}'`)}return n[0]}function p(A,e){let t=A.findIndex(A=>!!A.consumed&&function(A,{path:e,method:t,body:r,headers:s}){let o=I(A.path,e),n=I(A.method,t),i=void 0===A.body||I(A.body,r),a=d(A,s);return o&&n&&i&&a}(A,e));-1!==t&&A.splice(t,1)}function w(A){for(;A.endsWith("/");)A=A.slice(0,-1);return 0===A.length&&(A="/"),A}function S(A){let{path:e,method:t,body:r,headers:s,query:o}=A;return{path:e,method:t,body:r,headers:s,query:o}}function N(A){let e=Object.keys(A),t=[];for(let r=0;r<e.length;++r){let s=e[r],o=A[s],n=Buffer.from(`${s}`);if(Array.isArray(o))for(let A=0;A<o.length;++A)t.push(n,Buffer.from(`${o[A]}`));else t.push(n,Buffer.from(`${o}`))}return t}function R(A){return E[A]||"unknown"}function U(A,e){let t=S(A),r=D(this[s],t);r.timesInvoked++,r.data.callback&&(r.data={...r.data,...r.data.callback(A)});let{data:{statusCode:o,data:n,headers:i,trailers:a,error:g},delay:l,persist:E}=r,{timesInvoked:B,times:I}=r;if(r.consumed=!E&&B>=I,r.pending=B<I,null!==g)return p(this[s],t),e.onResponseError(null,g),!0;let C=!1,c=null,d={paused:!1,rawHeaders:null,rawTrailers:null,pause(){this.paused=!0},resume(){this.paused=!1},abort:A=>{C||(C=!0,null!==c&&(clearTimeout(c),c=null),e.onResponseError?.(d,A))}};function f(r,s=n){if(C)return;let g=Array.isArray(A.headers)?u(A.headers):A.headers,l="function"==typeof s?s({...A,headers:g}):s;if(h(l))return l.then(A=>f(r,A));if(C)return;let E=y(l),B=N(i),I=N(a);d.rawHeaders=B,d.rawTrailers=I,e.onResponseStart?.(d,o,Q(B),R(o)),e.onResponseData?.(d,Buffer.from(E)),e.onResponseEnd?.(d,Q(I)),p(r,t)}return e.onRequestStart?.(d,null),"number"==typeof l&&l>0?c=setTimeout(()=>{c=null,f(this[s])},l):f(this[s]),!0}function F(A,e){let t=new URL(e);return!0===A||!!(Array.isArray(A)&&A.some(A=>I(A,t.host)))}e.exports={getResponseData:y,getMockDispatch:D,addMockDispatch:function(A,e,t,r){let s={timesInvoked:0,times:1,persist:!1,consumed:!1,...r},o="function"==typeof t?{callback:t}:{...t},n={...s,...e,pending:!0,data:{error:null,...o}};return A.push(n),A[g]=(A[g]||0)+1,n},deleteMockDispatch:p,buildKey:S,generateKeyValues:N,matchValue:I,getResponse:async function A(A){let e=[];for await(let t of A)e.push(t);return Buffer.concat(e).toString("utf8")},getStatusText:R,mockDispatch:U,buildMockDispatch:function(){let A=this[o],e=this[i],t=this[n];return function(o,n){if(A.isMockActive)try{U.call(this,o,n)}catch(i){if("UND_MOCK_ERR_MOCK_NOT_MATCHED"===i.code){let l=A[a](),Q=this[s][g]||this[s].length,E=this[s].filter(({consumed:A})=>!A).length,h=`, ${E} interceptor(s) remaining out of ${Q} defined`;if(!1===l)throw new r(`${i.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${h}`);if(F(l,e))t.call(this,"__mockAgentBodyForDispatch"in o?{...o,body:o.__mockAgentBodyForDispatch}:o,n);else throw new r(`${i.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${h}`)}else throw i}else t.call(this,o,n)}},checkNetConnect:F,buildAndValidateMockOptions:function(A){let{agent:e,...t}=A;if("enableCallHistory"in t&&"boolean"!=typeof t.enableCallHistory)throw new B("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in t&&"boolean"!=typeof t.acceptNonStandardSearchParameters)throw new B("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in t&&"boolean"!=typeof t.ignoreTrailingSlash)throw new B("options.ignoreTrailingSlash must to be a boolean");return t},getHeaderByName:c,buildHeadersFromArray:u,normalizeSearchParams:function(A){if("string"!=typeof A)return A;let e=new URLSearchParams(A),t=new URLSearchParams;for(let[A,r]of e.entries()){if(A=A.replace("[]",""),/^(['"]).*\1$/.test(r)){t.append(A,r);continue}if(r.includes(",")){for(let e of r.split(","))t.append(A,e);continue}t.append(A,r)}return t},normalizeOrigin:function(A){return"string"==typeof A||A instanceof URL?A instanceof URL?A.origin:A.toLowerCase():A}}},599532,(A,e,t)=>{"use strict";let{getResponseData:r,buildKey:s,addMockDispatch:o}=A.r(640248),{kDispatches:n,kDispatchKey:i,kDefaultHeaders:a,kDefaultTrailers:g,kContentLength:l,kMockDispatch:Q,kIgnoreTrailingSlash:E}=A.r(915098),{InvalidArgumentError:h}=A.r(456763),{serializePathWithQuery:B}=A.r(280324);class I{constructor(A){this[Q]=A}delay(A){if("number"!=typeof A||!Number.isInteger(A)||A<=0)throw new h("waitInMs must be a valid integer > 0");return this[Q].delay=A,this}persist(){return this[Q].persist=!0,this}times(A){if("number"!=typeof A||!Number.isInteger(A)||A<=0)throw new h("repeatTimes must be a valid integer > 0");return this[Q].times=A,this}}e.exports.MockInterceptor=class{constructor(A,e){if("object"!=typeof A)throw new h("opts must be an object");if(void 0===A.path)throw new h("opts.path must be defined");if(void 0===A.method&&(A.method="GET"),"string"==typeof A.path)if(A.query)A.path=B(A.path,A.query);else{const e=new URL(A.path,"data://");A.path=e.pathname+e.search}"string"==typeof A.method&&(A.method=A.method.toUpperCase()),this[i]=s(A),this[n]=e,this[E]=A.ignoreTrailingSlash??!1,this[a]={},this[g]={},this[l]=!1}createMockScopeDispatchData({statusCode:A,data:e,responseOptions:t}){let s=r(e),o=this[l]?{"content-length":s.length}:{};return{statusCode:A,data:e,headers:{...this[a],...o,...t.headers},trailers:{...this[g],...t.trailers}}}validateReplyParameters(A){if(void 0===A.statusCode)throw new h("statusCode must be defined");if("object"!=typeof A.responseOptions||null===A.responseOptions)throw new h("responseOptions must be an object")}reply(A){if("function"==typeof A){let e=e=>{let t=A(e);if("object"!=typeof t||null===t)throw new h("reply options callback must return an object");let r={data:"",responseOptions:{},...t};return this.validateReplyParameters(r),{...this.createMockScopeDispatchData(r)}};return new I(o(this[n],this[i],e,{ignoreTrailingSlash:this[E]}))}let e={statusCode:A,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(e);let t=this.createMockScopeDispatchData(e);return new I(o(this[n],this[i],t,{ignoreTrailingSlash:this[E]}))}replyWithError(A){if(void 0===A)throw new h("error must be defined");return new I(o(this[n],this[i],{error:A},{ignoreTrailingSlash:this[E]}))}defaultReplyHeaders(A){if(void 0===A)throw new h("headers must be defined");return this[a]=A,this}defaultReplyTrailers(A){if(void 0===A)throw new h("trailers must be defined");return this[g]=A,this}replyContentLength(){return this[l]=!0,this}},e.exports.MockScope=I},232381,(A,e,t)=>{"use strict";let{promisify:r}=A.r(812057),s=A.r(306847),{buildMockDispatch:o}=A.r(640248),{kDispatches:n,kMockAgent:i,kClose:a,kOriginalClose:g,kOrigin:l,kOriginalDispatch:Q,kConnected:E,kIgnoreTrailingSlash:h}=A.r(915098),{MockInterceptor:B}=A.r(599532),I=A.r(354615),{InvalidArgumentError:C}=A.r(456763);class c extends s{constructor(A,e){if(!e||!e.agent||"function"!=typeof e.agent.dispatch)throw new C("Argument opts.agent must implement Agent");super(A,e),this[i]=e.agent,this[l]=A,this[h]=e.ignoreTrailingSlash??!1,this[n]=[],this[E]=1,this[Q]=this.dispatch,this[g]=this.close.bind(this),this.dispatch=o.call(this),this.close=this[a]}get[I.kConnected](){return this[E]}intercept(A){return new B(A&&{ignoreTrailingSlash:this[h],...A},this[n])}cleanMocks(){this[n]=[]}async [a](){await r(this[g])(),this[E]=0,this[i][I.kClients].delete(this[l])}}e.exports=c},862493,(A,e,t)=>{"use strict";let{kMockCallHistoryAddLog:r}=A.r(915098),{InvalidArgumentError:s}=A.r(456763);function o(A,e,t,r,o){switch(e.operator){case"OR":return r.push(...t(A,o)),r;case"AND":return t(A,r);default:throw new s("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function n(A){return(e,t)=>{if("string"==typeof e||null==e)return t.filter(t=>t[A]===e);if(e instanceof RegExp)return t.filter(t=>e.test(t[A]));throw new s(`${A} parameter should be one of string, regexp, undefined or null`)}}class i{constructor(A={}){this.body=A.body,this.headers=A.headers,this.method=A.method;const e=function(A){try{let e=new URL(A.path,A.origin);if(0!==e.search.length)return e;return e.search=new URLSearchParams(A.query).toString(),e}catch(A){throw new s("An error occurred when computing MockCallHistoryLog.url",{cause:A})}}(A);this.fullUrl=e.toString(),this.origin=e.origin,this.path=e.pathname,this.searchParams=Object.fromEntries(e.searchParams),this.protocol=e.protocol,this.host=e.host,this.port=e.port,this.hash=e.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let A="";return this.toMap().forEach((e,t)=>{("string"==typeof e||null==e)&&(A=`${A}${t}->${e}|`),("object"==typeof e&&null!==e||Array.isArray(e))&&(A=`${A}${t}->${JSON.stringify(e)}|`)}),A.slice(0,-1)}}class a{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(A){if("number"!=typeof A)throw new s("nthCall must be called with a number");if(!Number.isInteger(A))throw new s("nthCall must be called with an integer");if(1!==Math.sign(A))throw new s("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(A-1)}filterCalls(A,e){if(0===this.logs.length)return this.logs;if("function"==typeof A)return this.logs.filter(A);if(A instanceof RegExp)return this.logs.filter(e=>A.test(e.toString()));if("object"==typeof A&&null!==A){if(0===Object.keys(A).length)return this.logs;let t={operator:"OR",...function(A={}){let e={};if("operator"in A){if("string"!=typeof A.operator||"OR"!==A.operator.toUpperCase()&&"AND"!==A.operator.toUpperCase())throw new s("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:A.operator.toUpperCase()}}return e}(e)},r="AND"===t.operator?this.logs:[];return"protocol"in A&&(r=o(A.protocol,t,this.filterCallsByProtocol,r,this.logs)),"host"in A&&(r=o(A.host,t,this.filterCallsByHost,r,this.logs)),"port"in A&&(r=o(A.port,t,this.filterCallsByPort,r,this.logs)),"origin"in A&&(r=o(A.origin,t,this.filterCallsByOrigin,r,this.logs)),"path"in A&&(r=o(A.path,t,this.filterCallsByPath,r,this.logs)),"hash"in A&&(r=o(A.hash,t,this.filterCallsByHash,r,this.logs)),"fullUrl"in A&&(r=o(A.fullUrl,t,this.filterCallsByFullUrl,r,this.logs)),"method"in A&&(r=o(A.method,t,this.filterCallsByMethod,r,this.logs)),[...new Set(r)]}throw new s("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=n.call(this,"protocol");filterCallsByHost=n.call(this,"host");filterCallsByPort=n.call(this,"port");filterCallsByOrigin=n.call(this,"origin");filterCallsByPath=n.call(this,"path");filterCallsByHash=n.call(this,"hash");filterCallsByFullUrl=n.call(this,"fullUrl");filterCallsByMethod=n.call(this,"method");clear(){this.logs=[]}[r](A){let e=new i(A);return this.logs.push(e),e}*[Symbol.iterator](){for(let A of this.calls())yield A}}e.exports.MockCallHistory=a,e.exports.MockCallHistoryLog=i},154592,(A,e,t)=>{"use strict";let{promisify:r}=A.r(812057),s=A.r(481206),{buildMockDispatch:o}=A.r(640248),{kDispatches:n,kMockAgent:i,kClose:a,kOriginalClose:g,kOrigin:l,kOriginalDispatch:Q,kConnected:E,kIgnoreTrailingSlash:h}=A.r(915098),{MockInterceptor:B}=A.r(599532),I=A.r(354615),{InvalidArgumentError:C}=A.r(456763);class c extends s{constructor(A,e){if(!e||!e.agent||"function"!=typeof e.agent.dispatch)throw new C("Argument opts.agent must implement Agent");super(A,e),this[i]=e.agent,this[l]=A,this[h]=e.ignoreTrailingSlash??!1,this[n]=[],this[E]=1,this[Q]=this.dispatch,this[g]=this.close.bind(this),this.dispatch=o.call(this),this.close=this[a]}get[I.kConnected](){return this[E]}intercept(A){return new B(A&&{ignoreTrailingSlash:this[h],...A},this[n])}cleanMocks(){this[n]=[]}async [a](){await r(this[g])(),this[E]=0,this[i][I.kClients].delete(this[l])}}e.exports=c},241293,(A,e,t)=>{e.exports=A.x("node:console",()=>require("node:console"))},529096,(A,e,t)=>{"use strict";let{Transform:r}=A.r(81111),{Console:s}=A.r(241293),o=process.versions.icu?"✅":"Y ",n=process.versions.icu?"❌":"N ";e.exports=class{constructor({disableColors:A}={}){this.transform=new r({transform(A,e,t){t(null,A)}}),this.logger=new s({stdout:this.transform,inspectOptions:{colors:!A&&!process.env.CI}})}format(A){let e=A.map(({method:A,path:e,data:{statusCode:t},persist:r,times:s,timesInvoked:i,origin:a})=>({Method:A,Origin:a,Path:e,"Status code":t,Persistent:r?o:n,Invocations:i,Remaining:r?1/0:s-i}));return this.logger.table(e),this.transform.read().toString()}}},960906,(A,e,t)=>{"use strict";let{kClients:r}=A.r(354615),s=A.r(484221),{kAgent:o,kMockAgentSet:n,kMockAgentGet:i,kDispatches:a,kIsMockActive:g,kNetConnect:l,kGetNetConnect:Q,kOptions:E,kFactory:h,kMockAgentRegisterCallHistory:B,kMockAgentIsCallHistoryEnabled:I,kMockAgentAddCallHistoryLog:C,kMockAgentMockCallHistoryInstance:c,kMockAgentAcceptsNonStandardSearchParameters:u,kMockCallHistoryAddLog:d,kIgnoreTrailingSlash:f}=A.r(915098),y=A.r(232381),D=A.r(154592),{matchValue:p,normalizeSearchParams:w,buildAndValidateMockOptions:S,normalizeOrigin:N}=A.r(640248),{InvalidArgumentError:R,UndiciError:U}=A.r(456763),F=A.r(777103),m=A.r(529096),{MockCallHistory:b}=A.r(862493);e.exports=class extends F{constructor(A={}){super(A);const e=S(A);if(this[l]=!0,this[g]=!0,this[I]=e.enableCallHistory??!1,this[u]=e.acceptNonStandardSearchParameters??!1,this[f]=e.ignoreTrailingSlash??!1,A?.agent&&"function"!=typeof A.agent.dispatch)throw new R("Argument opts.agent must implement Agent");const t=A?.agent?A.agent:new s(A);this[o]=t,this[r]=t[r],this[E]=e,this[I]&&this[B]()}get(A){let e=N(A),t=this[f]?e.replace(/\/$/,""):e,r=this[i](t);return r||(r=this[h](t),this[n](t,r)),r}dispatch(A,e){A.origin=N(A.origin),this.get(A.origin),this[C](A);let t=this[u],r={...A};if(t&&r.path){let[A,e]=r.path.split("?"),s=w(e,t);r.path=`${A}?${s}`}return this[o].dispatch(r,e)}async close(){this.clearCallHistory(),await this[o].close(),this[r].clear()}deactivate(){this[g]=!1}activate(){this[g]=!0}enableNetConnect(A){if("string"==typeof A||"function"==typeof A||A instanceof RegExp)Array.isArray(this[l])?this[l].push(A):this[l]=[A];else if(void 0===A)this[l]=!0;else throw new R("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[l]=!1}enableCallHistory(){return this[I]=!0,this}disableCallHistory(){return this[I]=!1,this}getCallHistory(){return this[c]}clearCallHistory(){void 0!==this[c]&&this[c].clear()}get isMockActive(){return this[g]}[B](){void 0===this[c]&&(this[c]=new b)}[C](A){this[I]&&(this[B](),this[c][d](A))}[n](A,e){this[r].set(A,e)}[h](A){let e=Object.assign({agent:this},this[E]);return this[E]&&1===this[E].connections?new y(A,e):new D(A,e)}[i](A){let e=this[r].get(A);if(e)return e;if("string"!=typeof A){let e=this[h]("http://localhost:9999");return this[n](A,e),e}for(let[e,t]of Array.from(this[r]))if(t&&"string"!=typeof e&&p(e,A)){let e=this[h](A);return this[n](A,e),e[a]=t[a],e}}[Q](){return this[l]}pendingInterceptors(){return Array.from(this[r].entries()).flatMap(([A,e])=>e[a].map(e=>({...e,origin:A}))).filter(({pending:A})=>A)}assertNoPendingInterceptors({pendingInterceptorsFormatter:A=new m}={}){let e=this.pendingInterceptors();if(0!==e.length)throw new U(1===e.length?`1 interceptor is pending:
31
+ `,this[v]=null!=a?a:3e5,this[G]=null!=t?t:3e5,this[x]=null==p||p,this[O]=M,this[Ao]=null,this[Z]=W>-1?W:-1,this[j]=null,this[K]=null!=Ar?Ar:100,this[$]=null!=Aa?Aa:262144,this[AA]=null!=Al?Al:524288,this[At]=null!=AQ?AQ:6e4,this[w]=[],this[b]=0,this[m]=0,this[Ae]=A=>Ah(this,A),this[X]=A=>Ag(this,A)}get pipelining(){return this[k]}set pipelining(A){this[k]=A,this[Ae](!0)}get stats(){return new i(this)}get[D](){return this[w].length-this[m]}get[y](){return this[m]-this[b]}get[p](){return this[w].length-this[b]}get[S](){return!!this[j]&&!this[N]&&!this[j].destroyed}get[u](){return!!(this[j]?.busy(null)||this[p]>=(Aa(this)||1)||this[D]>0)}[d](A){Al(this),this.once("connect",A)}[q](A,e){let t=new g(this[I].origin,A,e);return this[w].push(t),this[f]||(null==n.bodyLength(t.body)&&n.isIterable(t.body)?(this[f]=1,queueMicrotask(()=>Ah(this))):this[Ae](!0)),this[f]&&2!==this[R]&&this[u]&&(this[R]=2),this[R]<2}[W](){return new Promise(A=>{this[p]?this[Ao]=A:A(null)})}[P](A){return new Promise(e=>{let t=this[w].splice(this[m]);for(let e=0;e<t.length;e++){let r=t[e];n.errorRequest(this,r,A)}let r=()=>{this[Ao]&&(this[Ao](),this[Ao]=null),e(null)};this[j]?(this[j].destroy(A,r),this[j]=null):queueMicrotask(r),this[Ae]()})}}},645962,(A,e,t)=>{"use strict";class r{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(A){this.list[this.top]=A,this.top=this.top+1&2047}shift(){let A=this.list[this.bottom];return void 0===A?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,A)}}e.exports=class{constructor(){this.head=this.tail=new r}isEmpty(){return this.head.isEmpty()}push(A){this.head.isFull()&&(this.head=this.head.next=new r),this.head.push(A)}shift(){let A=this.tail,e=A.shift();return A.isEmpty()&&null!==A.next&&(this.tail=A.next,A.next=null),e}}},928198,(A,e,t)=>{"use strict";let{PoolStats:r}=A.r(110688),s=A.r(778469),o=A.r(645962),{kConnected:n,kSize:i,kRunning:a,kPending:g,kQueued:l,kBusy:Q,kFree:E,kUrl:h,kClose:B,kDestroy:I,kDispatch:C}=A.r(354615),c=Symbol("clients"),u=Symbol("needDrain"),d=Symbol("queue"),f=Symbol("closed resolve"),y=Symbol("onDrain"),D=Symbol("onConnect"),p=Symbol("onDisconnect"),w=Symbol("onConnectionError"),S=Symbol("get dispatcher"),N=Symbol("has dispatcher"),R=Symbol("add client"),U=Symbol("remove client");class F extends s{[d]=new o;[l]=0;[c]=[];[u]=!1;[y](A,e,t){let r=this[d],s=!1;for(;!s;){let e=r.shift();if(!e)break;this[l]--,s=!A.dispatch(e.opts,e.handler)}if(A[u]=s,!s&&this[u]&&(this[u]=!1,this.emit("drain",e,[this,...t])),this[f]&&r.isEmpty()){let A=[];for(let e=0;e<this[c].length;e++){let t=this[c][e];t.destroyed||A.push(t.close())}return Promise.all(A).then(this[f])}}[D]=(A,e)=>{this.emit("connect",A,[this,...e])};[p]=(A,e,t)=>{this.emit("disconnect",A,[this,...e],t)};[w]=(A,e,t)=>{this.emit("connectionError",A,[this,...e],t)};get[Q](){return this[u]}get[n](){let A=0;for(let{[n]:e}of this[c])A+=e;return A}get[E](){let A=0;for(let{[n]:e,[u]:t}of this[c])A+=e&&!t;return A}get[g](){let A=this[l];for(let{[g]:e}of this[c])A+=e;return A}get[a](){let A=0;for(let{[a]:e}of this[c])A+=e;return A}get[i](){let A=this[l];for(let{[i]:e}of this[c])A+=e;return A}get stats(){return new r(this)}[B](){if(!this[d].isEmpty())return new Promise(A=>{this[f]=A});{let A=[];for(let e=0;e<this[c].length;e++){let t=this[c][e];t.destroyed||A.push(t.close())}return Promise.all(A)}}[I](A){for(;;){let e=this[d].shift();if(!e)break;e.handler.onResponseError(null,A)}let e=Array(this[c].length);for(let t=0;t<this[c].length;t++)e[t]=this[c][t].destroy(A);return Promise.all(e)}[C](A,e){let t=this[S]();return t?t.dispatch(A,e)||(t[u]=!0,this[u]=!this[N]()):(this[u]=!0,this[d].push({opts:A,handler:e}),this[l]++),!this[u]}[N](){for(let A=0;A<this[c].length;A++){let e=this[c][A];if(!e[u]&&!0!==e.closed&&!0!==e.destroyed)return!0}return!1}[R](A){return A.on("drain",this[y].bind(this,A)).on("connect",this[D]).on("disconnect",this[p]).on("connectionError",this[w]),this[c].push(A),this[u]&&queueMicrotask(()=>{this[u]&&this[y](A,A[h],[A,this])}),this}[U](A){let e=this[c].indexOf(A);-1!==e&&this[c].splice(e,1),A.close(()=>{}),this[u]=!this[c].some(A=>!A[u]&&!0!==A.closed&&!0!==A.destroyed)}}e.exports={PoolBase:F,kClients:c,kNeedDrain:u,kAddClient:R,kRemoveClient:U,kGetDispatcher:S,kHasDispatcher:N}},481206,(A,e,t)=>{"use strict";let{PoolBase:r,kClients:s,kNeedDrain:o,kAddClient:n,kGetDispatcher:i,kHasDispatcher:a,kRemoveClient:g}=A.r(928198),l=A.r(306847),{InvalidArgumentError:Q}=A.r(456763),E=A.r(280324),{kUrl:h}=A.r(354615),B=A.r(724604),I=Symbol("options"),C=Symbol("connections"),c=Symbol("factory");function u(A,e){return new l(A,e)}e.exports=class extends r{constructor(A,{connections:e,factory:t=u,connect:r,connectTimeout:o,tls:n,maxCachedSessions:i,socketPath:a,autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l,allowH2:d,useH2c:f,clientTtl:y,...D}={}){if(null!=e&&(!Number.isFinite(e)||e<0))throw new Q("invalid connections");if("function"!=typeof t)throw new Q("factory must be a function.");if(null!=r&&"function"!=typeof r&&"object"!=typeof r)throw new Q("connect must be a function or an object");"function"!=typeof r&&(r=B({...n,maxCachedSessions:i,allowH2:d,useH2c:f,socketPath:a,timeout:o,..."boolean"==typeof g?{autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l}:void 0,...r})),super(D),this[C]=e||null,this[h]=E.parseOrigin(A),this[I]={...E.deepClone(D),connect:r,allowH2:d,useH2c:f,clientTtl:y,socketPath:a},this[c]=t,this.on("connect",(A,e)=>{if(null!=y&&y>0)for(let A of e)Object.assign(A,{ttl:Date.now()})}),this.on("connectionError",(A,e,t)=>{for(let A of e){let e=this[s].indexOf(A);-1!==e&&this[s].splice(e,1)}})}[i](){let A=this[I].clientTtl;for(let e=0;e<this[s].length;e++){let t=this[s][e];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A)this[g](t),e--;else if(!t[o])return t}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),A}}[a](){let A=this[I].clientTtl;for(let e=0;e<this[s].length;e++){let t=this[s][e];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A)this[g](t),e--;else if(!t[o])return!0}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),!0}return!1}}},551527,(A,e,t)=>{"use strict";let{BalancedPoolMissingUpstreamError:r,InvalidArgumentError:s}=A.r(456763),{PoolBase:o,kClients:n,kNeedDrain:i,kAddClient:a,kRemoveClient:g,kGetDispatcher:l}=A.r(928198),Q=A.r(481206),{kUrl:E}=A.r(354615),h=A.r(280324),B=Symbol("factory"),I=Symbol("options"),C=Symbol("kGreatestCommonDivisor"),c=Symbol("kCurrentWeight"),u=Symbol("kIndex"),d=Symbol("kWeight"),f=Symbol("kMaxWeightPerServer"),y=Symbol("kErrorPenalty");function D(A,e){return new Q(A,e)}e.exports=class extends o{constructor(A=[],{factory:e=D,...t}={}){if("function"!=typeof e)throw new s("factory must be a function.");for(const r of(super(),this[I]={...h.deepClone(t)},this[u]=-1,this[c]=0,this[f]=this[I].maxWeightPerServer||100,this[y]=this[I].errorPenalty||15,Array.isArray(A)||(A=[A]),this[B]=e,A))this.addUpstream(r);this._updateBalancedPoolStats()}addUpstream(A){let e=h.parseOrigin(A).origin;if(this[n].find(A=>A[E].origin===e&&!0!==A.closed&&!0!==A.destroyed))return this;let t=this[B](e,this[I]);for(let A of(this[a](t),t.on("connect",()=>{t[d]=Math.min(this[f],t[d]+this[y])}),t.on("connectionError",()=>{t[d]=Math.max(1,t[d]-this[y]),this._updateBalancedPoolStats()}),t.on("disconnect",(...A)=>{let e=A[2];e&&"UND_ERR_SOCKET"===e.code&&(t[d]=Math.max(1,t[d]-this[y]),this._updateBalancedPoolStats())}),this[n]))A[d]=this[f];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let A=0;for(let e=0;e<this[n].length;e++)A=function(A,e){if(0===A)return e;for(;0!==e;){let t=e;e=A%e,A=t}return A}(this[n][e][d],A);this[C]=A}removeUpstream(A){let e=h.parseOrigin(A).origin,t=this[n].find(A=>A[E].origin===e&&!0!==A.closed&&!0!==A.destroyed);return t&&this[g](t),this}getUpstream(A){let e=h.parseOrigin(A).origin;return this[n].find(A=>A[E].origin===e&&!0!==A.closed&&!0!==A.destroyed)}get upstreams(){return this[n].filter(A=>!0!==A.closed&&!0!==A.destroyed).map(A=>A[E].origin)}[l](){if(0===this[n].length)throw new r;let A=0,e=-1;for(;A++<this[n].length;){this[u]=(this[u]+1)%this[n].length;let A=this[n][this[u]];if((0===this[u]&&(this[c]=this[c]-this[C],this[c]<=0&&(this[c]=this[f])),!A[i]&&!0!==A.closed&&!0!==A.destroyed)&&((-1===e||A[d]>this[n][e][d])&&(e=this[u]),A[d]>=this[c]))return A}if(-1!==e)return this[c]=this[n][e][d],this[u]=e,this[n][e]}}},722447,(A,e,t)=>{"use strict";let{PoolBase:r,kClients:s,kNeedDrain:o,kAddClient:n,kGetDispatcher:i,kHasDispatcher:a,kRemoveClient:g}=A.r(928198),l=A.r(306847),{InvalidArgumentError:Q}=A.r(456763),E=A.r(280324),{kUrl:h}=A.r(354615),B=A.r(724604),I=Symbol("options"),C=Symbol("connections"),c=Symbol("factory"),u=Symbol("index");function d(A,e){return new l(A,e)}e.exports=class extends r{constructor(A,{connections:e,factory:t=d,connect:r,connectTimeout:o,tls:n,maxCachedSessions:i,socketPath:a,autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l,allowH2:f,clientTtl:y,...D}={}){if(null!=e&&(!Number.isFinite(e)||e<0))throw new Q("invalid connections");if("function"!=typeof t)throw new Q("factory must be a function.");if(null!=r&&"function"!=typeof r&&"object"!=typeof r)throw new Q("connect must be a function or an object");"function"!=typeof r&&(r=B({...n,maxCachedSessions:i,allowH2:f,socketPath:a,timeout:o,..."boolean"==typeof g?{autoSelectFamily:g,autoSelectFamilyAttemptTimeout:l}:void 0,...r})),super(),this[C]=e||null,this[h]=E.parseOrigin(A),this[I]={...E.deepClone(D),connect:r,allowH2:f,clientTtl:y,socketPath:a},this[c]=t,this[u]=-1,this.on("connect",(A,e)=>{if(null!=y&&y>0)for(let A of e)Object.assign(A,{ttl:Date.now()})}),this.on("connectionError",(A,e,t)=>{for(let A of e){let e=this[s].indexOf(A);-1!==e&&this[s].splice(e,1)}})}[i](){let A=this[I].clientTtl;if(0===this[s].length){let A=this[c](this[h],this[I]);return this[n](A),A}let e=0;for(;e<this[s].length;){this[u]=(this[u]+1)%this[s].length;let t=this[s][this[u]];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A){this[g](t),this[u]--;continue}if(!t[o])return t;e++}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),A}}[a](){let A=this[I].clientTtl;for(let e=0;e<this[s].length;e++){let t=this[s][e];if(null!=A&&A>0&&t.ttl&&Date.now()-t.ttl>A)this[g](t),e<=this[u]&&this[u]--,e--;else if(!t[o])return!0}if(!this[C]||this[s].length<this[C]){let A=this[c](this[h],this[I]);return this[n](A),!0}return!1}}},484221,(A,e,t)=>{"use strict";let{InvalidArgumentError:r,MaxOriginsReachedError:s}=A.r(456763),{kBusy:o,kClients:n,kConnected:i,kRunning:a,kClose:g,kDestroy:l,kDispatch:Q,kUrl:E}=A.r(354615),h=A.r(778469),B=A.r(481206),I=A.r(306847),C=A.r(280324),c=Symbol("onConnect"),u=Symbol("onDisconnect"),d=Symbol("onConnectionError"),f=Symbol("onDrain"),y=Symbol("factory"),D=Symbol("options"),p=Symbol("origins");function w(A,e){return e&&1===e.connections?new I(A,e):new B(A,e)}e.exports=class extends h{constructor({factory:A=w,maxOrigins:e=1/0,connect:t,...s}={}){if("function"!=typeof A)throw new r("factory must be a function.");if(null!=t&&"function"!=typeof t&&"object"!=typeof t)throw new r("connect must be a function or an object");if("number"!=typeof e||Number.isNaN(e)||e<=0)throw new r("maxOrigins must be a number greater than 0");super(s),t&&"function"!=typeof t&&(t={...t}),this[D]={...C.deepClone(s),maxOrigins:e,connect:t},this[y]=A,this[n]=new Map,this[p]=new Set,this[f]=(A,e)=>{this.emit("drain",A,[this,...e])},this[c]=(A,e)=>{this.emit("connect",A,[this,...e])},this[u]=(A,e,t)=>{this.emit("disconnect",A,[this,...e],t)},this[d]=(A,e,t)=>{this.emit("connectionError",A,[this,...e],t)}}get[a](){let A=0;for(let e of this[n].values())A+=e[a];return A}[Q](A,e){let t;if(A.origin&&("string"==typeof A.origin||A.origin instanceof URL))t=String(A.origin);else throw new r("opts.origin must be a non-empty string or URL.");let a=A.allowH2??this[D].allowH2,g=!1===a?`${t}#http1-only`:t;if(this[p].size>=this[D].maxOrigins&&!this[p].has(t))throw new s;let l=this[n].get(g);if(!l){l=this[y](A.origin,!1===a?{...this[D],allowH2:!1}:this[D]);let e=()=>{if(this[n].get(g)!==l||l[i]>0||l[o])return;this[n].delete(g),l.destroyed||l.close();let A=!1;for(let e of this[n].values())if(e[E].origin===l[E].origin){A=!0;break}A||this[p].delete(l[E].origin)};l.on("drain",this[f]).on("connect",this[c]).on("disconnect",(A,t,r)=>{e(),this[u](A,t,r)}).on("connectionError",(A,t,r)=>{e(),this[d](A,t,r)}),this[n].set(g,l),this[p].add(t)}return l.dispatch(A,e)}[g](){let A=[];for(let e of this[n].values())A.push(e.close());return this[n].clear(),Promise.all(A)}[l](A){let e=[];for(let t of this[n].values())e.push(t.destroy(A));return this[n].clear(),Promise.all(e)}get stats(){let A={};for(let e of this[n].values())e.stats&&(A[e[E].origin]=e.stats);return A}}},600079,(A,e,t)=>{"use strict";let r=A.r(777103),{InvalidArgumentError:s}=A.r(456763),{toRawHeaders:o}=A.r(280324);class n{#E;constructor(A){this.#E=A}onRequestStart(A,e){this.#E.onConnect?.(e=>A.abort(e),e)}onRequestUpgrade(A,e,t,r){let s=A?.rawHeaders??o(t??{});this.#E.onUpgrade?.(e,s,r)}onResponseStart(A,e,t,r){let s=A?.rawHeaders??o(t??{});this.#E.onHeaders?.(e,s,()=>A.resume(),r)===!1&&A.pause()}onResponseData(A,e){this.#E.onData?.(e)===!1&&A.pause()}onResponseEnd(A,e){let t=A?.rawTrailers??o(e??{});this.#E.onComplete?.(t)}onResponseError(A,e){if(!this.#E.onError)throw e;this.#E.onError(e)}onBodySent(A){this.#E.onBodySent?.(A)}onRequestSent(){this.#E.onRequestSent?.()}onResponseStarted(){this.#E.onResponseStarted?.()}}class i extends r{#h;constructor(A){if(super(),!A||"function"!=typeof A.dispatch)throw new s("Argument dispatcher must implement dispatch");this.#h=A}static wrapHandler(A){if(!A||"object"!=typeof A)throw new s("handler must be an object");return"function"==typeof A.onRequestStart?A:new n(A)}dispatch(A,e){return!1!==A.allowH2&&(A={...A,allowH2:!1}),this.#h.dispatch(A,i.wrapHandler(e))}close(...A){return this.#h.close(...A)}destroy(...A){return this.#h.destroy(...A)}}e.exports=i},75318,(A,e,t)=>{"use strict";let{Buffer:r}=A.r(951615),s=A.r(761095),{InvalidArgumentError:o}=A.r(456763);function n(A){let e=r.alloc(16),t=A;if(A.includes(".")){let e=A.lastIndexOf(":"),r=A.slice(e+1);if(s.isIPv4(r)){let s=r.split(".").map(Number),o=(s[0]<<8|s[1]).toString(16),n=(s[2]<<8|s[3]).toString(16);t=`${A.slice(0,e)}:${o}:${n}`}}let o=t.indexOf("::");if(-1!==o){let A=t.slice(0,o),r=t.slice(o+2),s=""===A?[]:A.split(":"),n=""===r?[]:r.split(":"),i=0;for(let A of s)e.writeUInt16BE(parseInt(A,16),i),i+=2;for(let A of(i=16-2*n.length,n))e.writeUInt16BE(parseInt(A,16),i),i+=2}else{let A=t.split(":");for(let t=0;t<A.length;t++)e.writeUInt16BE(parseInt(A[t],16),2*t)}return e}e.exports={parseAddress:function(A){if(s.isIPv4(A)){let e=A.split(".").map(Number);return{type:1,buffer:r.from(e)}}if(s.isIPv6(A))return{type:4,buffer:n(A)};let e=r.from(A,"utf8");if(e.length>255)throw new o("Domain name too long (max 255 bytes)");return{type:3,buffer:r.concat([r.from([e.length]),e])}},parseIPv6:n,buildAddressBuffer:function(A,e,t){let s=r.allocUnsafe(2);return s.writeUInt16BE(t,0),r.concat([r.from([A]),e,s])},parseResponseAddress:function(A,e=0){let t;if(A.length<e+1)throw new o("Buffer too small to contain address type");let r=A[e],s=e+1;switch(r){case 1:if(A.length<s+6)throw new o("Buffer too small for IPv4 address");t=Array.from(A.subarray(s,s+4)).join("."),s+=4;break;case 3:{if(A.length<s+1)throw new o("Buffer too small for domain length");let e=A[s];if(s+=1,A.length<s+e+2)throw new o("Buffer too small for domain address");t=A.subarray(s,s+e).toString("utf8"),s+=e;break}case 4:{if(A.length<s+18)throw new o("Buffer too small for IPv6 address");let e=[];for(let t=0;t<8;t++){let r=A.readUInt16BE(s+2*t);e.push(r.toString(16))}t=e.join(":"),s+=16;break}default:throw new o(`Invalid address type: ${r}`)}if(A.length<s+2)throw new o("Buffer too small for port");return{address:t,port:A.readUInt16BE(s),bytesRead:(s+=2)-e}},createReplyError:function(A){let e=Error({1:"General SOCKS server failure",2:"Connection not allowed by ruleset",3:"Network unreachable",4:"Host unreachable",5:"Connection refused",6:"TTL expired",7:"Command not supported",8:"Address type not supported"}[A]||`Unknown SOCKS5 error code: ${A}`);return e.code=`SOCKS5_${A}`,e}}},947243,(A,e,t)=>{"use strict";let{EventEmitter:r}=A.r(687769),{Buffer:s}=A.r(951615),{InvalidArgumentError:o,Socks5ProxyError:n}=A.r(456763),{debuglog:i}=A.r(812057),{parseAddress:a}=A.r(75318),g=i("undici:socks5"),l=s.alloc(0),Q={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},E={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},h={IPV4:1,DOMAIN:3,IPV6:4},B={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},I={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"};e.exports={Socks5Client:class extends r{constructor(A,e={}){if(super(),!A)throw new o("socket is required");this.socket=A,this.options=e,this.state=I.INITIAL,this.buffer=l,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],e.username&&e.password&&this.authMethods.push(Q.USERNAME_PASSWORD),this.authMethods.push(Q.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(A){g("received data",A.length,"bytes in state",this.state),this.buffer=s.concat([this.buffer,A]);try{switch(this.state){case I.HANDSHAKING:this.handleHandshakeResponse();break;case I.AUTHENTICATING:this.handleAuthResponse();break;case I.CONNECTING:this.handleConnectResponse()}}catch(A){this.onError(A)}}onError(A){g("socket error",A),this.state=I.ERROR,this.emit("error",A),this.destroy()}onClose(){g("socket closed"),this.state=I.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=I.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==I.INITIAL)throw new o("Handshake already started");g("starting handshake with",this.authMethods.length,"auth methods"),this.state=I.HANDSHAKING;let A=s.alloc(2+this.authMethods.length);A[0]=5,A[1]=this.authMethods.length,this.authMethods.forEach((e,t)=>{A[2+t]=e}),this.socket.write(A)}handleHandshakeResponse(){if(this.buffer.length<2)return;let A=this.buffer[0],e=this.buffer[1];if(5!==A)throw new n(`Invalid SOCKS version: ${A}`,"UND_ERR_SOCKS5_VERSION");if(e===Q.NO_ACCEPTABLE)throw new n("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),g("server selected auth method",e),e===Q.NO_AUTH)this.markAuthenticated();else if(e===Q.USERNAME_PASSWORD)this.state=I.AUTHENTICATING,this.sendAuthRequest();else throw new n(`Unsupported authentication method: ${e}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:A,password:e}=this.options;if(!A||!e)throw new o("Username and password required for authentication");g("sending username/password auth");let t=s.from(A),r=s.from(e);if(t.length>255||r.length>255)throw new o("Username or password too long");let n=s.alloc(3+t.length+r.length);n[0]=1,n[1]=t.length,t.copy(n,2),n[2+t.length]=r.length,r.copy(n,3+t.length),this.socket.write(n)}handleAuthResponse(){if(this.buffer.length<2)return;let A=this.buffer[0],e=this.buffer[1];if(1!==A)throw new n(`Invalid auth sub-negotiation version: ${A}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(0!==e)throw new n("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),g("authentication successful"),this.markAuthenticated()}connect(A,e){if(this.state===I.CONNECTING||this.state===I.CONNECTED)throw new o("Connection already in progress");if(this.state!==I.AUTHENTICATED)throw new o("Client must be authenticated before CONNECT");g("connecting to",A,e),this.state=I.CONNECTING;let t=this.buildConnectRequest(E.CONNECT,A,e);this.socket.write(t)}buildConnectRequest(A,e,t){let{type:r,buffer:o}=a(e),n=s.alloc(4+o.length+2);return n[0]=5,n[1]=A,n[2]=0,n[3]=r,o.copy(n,4),n.writeUInt16BE(t,4+o.length),n}handleConnectResponse(){let A;if(this.buffer.length<4)return;let e=this.buffer[0],t=this.buffer[1],r=this.buffer[3];if(5!==e)throw new n(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let s=4;if(r===h.IPV4)s+=6;else if(r===h.DOMAIN){if(this.buffer.length<5)return;s+=1+this.buffer[4]+2}else if(r===h.IPV6)s+=18;else throw new n(`Invalid address type in reply: ${r}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length<s)return;if(t!==B.SUCCEEDED){let A=this.getReplyErrorMessage(t);throw new n(`SOCKS5 connection failed: ${A}`,`UND_ERR_SOCKS5_REPLY_${t}`)}let o=4;if(r===h.IPV4)A=Array.from(this.buffer.subarray(o,o+4)).join("."),o+=4;else if(r===h.DOMAIN){let e=this.buffer[o];o+=1,A=this.buffer.subarray(o,o+e).toString(),o+=e}else if(r===h.IPV6){let e=[];for(let A=0;A<8;A++){let t=this.buffer.readUInt16BE(o+2*A);e.push(t.toString(16))}A=e.join(":"),o+=16}let i=this.buffer.readUInt16BE(o);this.buffer=l,this.state=I.CONNECTED,this.socket.removeListener("data",this.onSocketData),g("connected, bound address:",A,"port:",i),this.emit("connected",{address:A,port:i})}getReplyErrorMessage(A){switch(A){case B.GENERAL_FAILURE:return"General SOCKS server failure";case B.CONNECTION_NOT_ALLOWED:return"Connection not allowed by ruleset";case B.NETWORK_UNREACHABLE:return"Network unreachable";case B.HOST_UNREACHABLE:return"Host unreachable";case B.CONNECTION_REFUSED:return"Connection refused";case B.TTL_EXPIRED:return"TTL expired";case B.COMMAND_NOT_SUPPORTED:return"Command not supported";case B.ADDRESS_TYPE_NOT_SUPPORTED:return"Address type not supported";default:return`Unknown error code: ${A}`}}},AUTH_METHODS:Q,COMMANDS:E,ADDRESS_TYPES:h,REPLY_CODES:B,STATES:I}},494107,(A,e,t)=>{"use strict";let r,{URL:s}=A.r(857764),o=A.r(778469),{InvalidArgumentError:n}=A.r(456763),{Socks5Client:i,STATES:a}=A.r(947243),{kDispatch:g,kClose:l,kDestroy:Q}=A.r(354615),E=A.r(481206),h=A.r(724604),{debuglog:B}=A.r(812057),I=B("undici:socks5-proxy"),C=Symbol("proxy url"),c=Symbol("proxy headers"),u=Symbol("proxy auth"),d=Symbol("proxy protocol"),f=Symbol("pools"),y=Symbol("connector"),D=!1;e.exports=class extends o{constructor(A,e={}){if(super(),D||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),D=!0),!A)throw new n("Proxy URL is mandatory");const t="string"==typeof A?new s(A):A;if("socks5:"!==t.protocol&&"socks:"!==t.protocol)throw new n("Proxy URL must use socks5:// or socks:// protocol");this[C]=t,this[c]=e.headers||{},this[d]=e.proxyTls?"https:":"http:",this[u]={username:e.username||(t.username?decodeURIComponent(t.username):null),password:e.password||(t.password?decodeURIComponent(t.password):null)},this[y]=e.connect||h({...e.proxyTls,servername:e.proxyTls?.servername||t.hostname}),this[f]=new Map}async createSocks5Connection(A,e){let t=this[C].hostname,r=parseInt(this[C].port)||1080;I("creating SOCKS5 connection to",t,r);let s=Promise.withResolvers();this[y]({hostname:t,host:t,port:r,protocol:this[d]},(A,e)=>{A?s.reject(A):s.resolve(e)});let o=await s.promise,n=new i(o,this[u]);n.on("error",A=>{I("SOCKS5 error:",A),o.destroy()}),await n.handshake();let g=Promise.withResolvers(),l=setTimeout(()=>{g.reject(Error("SOCKS5 authentication timeout"))},5e3),Q=()=>{clearTimeout(l),n.removeListener("error",E),g.resolve()},E=A=>{clearTimeout(l),n.removeListener("authenticated",Q),g.reject(A)};n.state===a.AUTHENTICATED?(clearTimeout(l),g.resolve()):(n.once("authenticated",Q),n.once("error",E)),await g.promise,await n.connect(A,e);let h=Promise.withResolvers(),B=setTimeout(()=>{h.reject(Error("SOCKS5 connection timeout"))},5e3),c=t=>{I("SOCKS5 tunnel established to",A,e,"via",t),clearTimeout(B),n.removeListener("error",f),h.resolve()},f=A=>{clearTimeout(B),n.removeListener("connected",c),h.reject(A)};return n.once("connected",c),n.once("error",f),await h.promise,o}[g](e,t){let{origin:o}=e;I("dispatching request to",o,"via SOCKS5");try{let n=String(o),i=this[f].get(n);return(!i||i.destroyed||i.closed)&&(i=new E(o,{pipelining:e.pipelining,connections:e.connections,connect:async(e,t)=>{try{let n=new s(o),i=n.hostname,a=parseInt(n.port)||("https:"===n.protocol?443:80);I("establishing SOCKS5 connection to",i,a);let g=await this.createSocks5Connection(i,a),l=g;if("https:"===n.protocol){r||(r=A.r(685560)),I("upgrading to TLS"),l=r.connect({socket:g,servername:i,...e.tls||{}});let t=Promise.withResolvers();l.once("secureConnect",t.resolve),l.once("error",t.reject),await t.promise}t(null,l)}catch(A){I("SOCKS5 connection error:",A),t(A)}}}),this[f].set(n,i)),i[g](e,t)}catch(A){if(I("dispatch error:",A),"function"==typeof t.onResponseError)return t.onResponseError(null,A),!1;if("function"==typeof t.onError)return t.onError(A),!1;throw A}}async [l](){let A=[];for(let e of this[f].values())A.push(e.close());this[f].clear(),await Promise.all(A)}async [Q](A){let e=[];for(let t of this[f].values())e.push(t.destroy(A));this[f].clear(),await Promise.all(e)}}},144253,(A,e,t)=>{"use strict";let{kProxy:r,kClose:s,kDestroy:o,kDispatch:n}=A.r(354615),i=A.r(484221),a=A.r(481206),g=A.r(778469),{InvalidArgumentError:l,RequestAbortedError:Q,SecureProxyConnectionError:E}=A.r(456763),h=A.r(724604),B=A.r(306847),{channels:I}=A.r(283250),C=A.r(494107),c=Symbol("proxy agent"),u=Symbol("proxy client"),d=Symbol("proxy headers"),f=Symbol("request tls settings"),y=Symbol("proxy tls settings"),D=Symbol("connect endpoint function"),p=Symbol("connect endpoint function (http/1.1 only)"),w=Symbol("tunnel proxy"),S="proxy-authorization";function N(A,e){return new a(A,e)}let R=()=>{};function U(A,e){return 1===e.connections?new B(A,e):new a(A,e)}class F extends g{#B;constructor(A,{headers:e={},connect:t,factory:r}){if(!A)throw new l("Proxy URL is mandatory");super(),this[d]=e,r?this.#B=r(A,{connect:t}):this.#B=new B(A,{connect:t})}[n](A,e){let t=e.onResponseStart;e.onResponseStart=function(A,r,s,o){if(407===r){"function"==typeof e.onResponseError&&e.onResponseError(A,new l("Proxy Authentication Required (407)"));return}t&&t.call(this,A,r,s,o)};let{origin:r,path:s="/",headers:o={}}=A;if(A.path=r+s,!("host"in o)&&!("Host"in o)){let{host:A}=new URL(r);o.host=A}return A.headers={...this[d],...o},this.#B[n](A,e)}[s](){return this.#B.close()}[o](A){return this.#B.destroy(A)}}function m(A){return A.length===S.length&&A.toLowerCase()===S}function b(){throw new l("Proxy-Authorization should be sent in ProxyAgent constructor")}e.exports=class extends g{constructor(A){if(!A||"object"==typeof A&&!(A instanceof URL)&&!A.uri)throw new l("Proxy uri is mandatory");const{clientFactory:e=N}=A;if("function"!=typeof e)throw new l("Proxy opts.clientFactory must be a function.");const{proxyTunnel:t=!0,connectTimeout:s}=A;super();const o=this.#I(A),{href:n,origin:a,port:g,protocol:B,username:S,password:m,hostname:b}=o;if(this[r]={uri:n,protocol:B},this[f]=A.requestTls,this[y]=A.proxyTls,this[d]=A.headers||{},this[w]=t,A.auth&&A.token)throw new l("opts.auth cannot be used in combination with opts.token");A.auth?this[d]["proxy-authorization"]=`Basic ${A.auth}`:A.token?this[d]["proxy-authorization"]=A.token:S&&m?this[d]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(S)}:${decodeURIComponent(m)}`).toString("base64")}`:S&&(this[d]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(S)}:`).toString("base64")}`);const M=h({timeout:s,...A.proxyTls});this[D]=h({timeout:s,...A.requestTls}),this[p]=h({timeout:s,...A.requestTls,allowH2:!1});const k=A.factory||U,T=(e,t)=>{let{protocol:s}=new URL(e);return"socks5:"===this[r].protocol||"socks:"===this[r].protocol?new C(this[r].uri,{headers:this[d],connect:M,factory:k,username:A.username||S,password:A.password||m,proxyTls:A.proxyTls}):this[w]||"http:"!==s||"http:"!==this[r].protocol?k(e,t):new F(this[r].uri,{headers:this[d],connect:M,factory:k})};"socks5:"===B||"socks:"===B?this[u]=null:this[u]=e(o,{connect:M}),this[c]=new i({...A,factory:T,connect:async(A,e)=>{if(!this[u])return void e(new l("Cannot establish tunnel connection without a proxy client"));let t=A.host;A.port||(t+=`:${"https:"===A.protocol?443:80}`);try{let r,s={origin:a,port:g,path:t,signal:A.signal,headers:{...this[d],host:A.host,...null==A.connections||A.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[y]?.servername||b},{socket:o,statusCode:n}=await this[u].connect(s);if(200!==n){o.on("error",R).destroy(),e(new Q(`Proxy response (${n}) !== 200 when HTTP Tunneling`));return}if(I.proxyConnected.hasSubscribers&&I.proxyConnected.publish({socket:o,connectParams:s}),"https:"!==A.protocol)return void e(null,o);r=this[f]?this[f].servername:A.servername,(!1===A.allowH2?this[p]:this[D])({...A,servername:r,httpSocket:o},e)}catch(A){e("ERR_TLS_CERT_ALTNAME_INVALID"===A.code?new E(A):A)}}})}dispatch(A,e){let t=function(A){if(Array.isArray(A)){let e={};for(let t=0;t<A.length;t+=2)m(A[t])&&b(),e[A[t]]=A[t+1];return e}return A}(A.headers);if(function(A){for(let e in A)m(e)&&b()}(t),t&&!("host"in t)&&!("Host"in t)){let{host:e}=new URL(A.origin);t.host=e}return this[c].dispatch({...A,headers:t},e)}#I(A){return"string"==typeof A?new URL(A):A instanceof URL?A:new URL(A.uri)}[s](){let A=[this[c].close()];return this[u]&&A.push(this[u].close()),Promise.all(A)}[o](){let A=[this[c].destroy()];return this[u]&&A.push(this[u].destroy()),Promise.all(A)}}},178121,(A,e,t)=>{"use strict";let r=A.r(778469),{kClose:s,kDestroy:o,kClosed:n,kDestroyed:i,kDispatch:a,kNoProxyAgent:g,kHttpProxyAgent:l,kHttpsProxyAgent:Q}=A.r(354615),E=A.r(144253),h=A.r(484221),B={"http:":80,"https:":443};e.exports=class extends r{#C=null;#c=null;#u=null;constructor(A={}){super(),this.#u=A;const{httpProxy:e,httpsProxy:t,noProxy:r,...s}=A;this[g]=new h(s);const o=e??process.env.http_proxy??process.env.HTTP_PROXY;o?this[l]=new E({...s,uri:o}):this[l]=this[g];const n=t??process.env.https_proxy??process.env.HTTPS_PROXY;n?this[Q]=new E({...s,uri:n}):this[Q]=this[l],this.#d()}[a](A,e){let t=new URL(A.origin);return this.#f(t).dispatch(A,e)}[s](){return Promise.all([this[g].close(),!this[l][n]&&this[l].close(),!this[Q][n]&&this[Q].close()])}[o](A){return Promise.all([this[g].destroy(A),!this[l][i]&&this[l].destroy(A),!this[Q][i]&&this[Q].destroy(A)])}#f(A){let{protocol:e,host:t,port:r}=A;return(t=t.replace(/:\d*$/,"").toLowerCase(),r=Number.parseInt(r,10)||B[e]||0,this.#y(t,r))?"https:"===e?this[Q]:this[l]:this[g]}#y(A,e){if(this.#D&&this.#d(),0===this.#c.length)return!0;if("*"===this.#C)return!1;for(let t=0;t<this.#c.length;t++){let r=this.#c[t];if((!r.port||r.port===e)&&(A===r.hostname||A.slice(-(r.hostname.length+1))===`.${r.hostname}`))return!1}return!0}#d(){let A=this.#u.noProxy??this.#p,e=A.split(/[,\s]/),t=[];for(let A=0;A<e.length;A++){let r=e[A];if(!r)continue;let s=r.match(/^(.+):(\d+)$/);t.push({hostname:(s?s[1]:r).replace(/^\*?\./,"").toLowerCase(),port:s?Number.parseInt(s[2],10):0})}this.#C=A,this.#c=t}get #D(){return void 0===this.#u.noProxy&&this.#C!==this.#p}get #p(){return process.env.no_proxy??process.env.NO_PROXY??""}}},225316,(A,e,t)=>{"use strict";let r=A.r(57328),{kRetryHandlerDefaultRetry:s}=A.r(354615),{RequestRetryError:o}=A.r(456763),{isDisturbed:n,parseRangeHeader:i,wrapRequestBody:a}=A.r(280324);class g{constructor(A,{dispatch:e,handler:t}){const{retryOptions:r,...o}=A,{retry:n,maxRetries:i,maxTimeout:l,minTimeout:Q,timeoutFactor:E,methods:h,errorCodes:B,retryAfter:I,statusCodes:C,throwOnError:c}=r??{};this.error=null,this.dispatch=e,this.handler=t,this.opts={...o,body:a(A.body)},this.retryOpts={throwOnError:c??!0,retry:n??g[s],retryAfter:I??!0,maxTimeout:l??3e4,minTimeout:Q??500,timeoutFactor:E??2,maxRetries:i??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:C??[500,502,503,504,429],errorCodes:B??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null,this.statusCode=null,this.headers=null}onResponseStartWithRetry(A,e,t,r,s){if(this.retryOpts.throwOnError)return void(!1===this.retryOpts.statusCodes.includes(e)?(this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,r)):this.error=s);if(n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,r);return}A.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},(function(o){if(o){this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,r),A.resume();return}this.error=s,A.resume()}).bind(this))}onRequestStart(A,e){this.headersSent||this.handler.onRequestStart?.(A,e)}onRequestUpgrade(A,e,t,r){this.handler.onRequestUpgrade?.(A,e,t,r)}static[s](A,{state:e,opts:t},r){let{statusCode:s,code:o,headers:n}=A,{method:i,retryOptions:a}=t,{maxRetries:g,minTimeout:l,maxTimeout:Q,timeoutFactor:E,statusCodes:h,errorCodes:B,methods:I}=a,{counter:C}=e;if(o&&"UND_ERR_REQ_RETRY"!==o&&!B.includes(o)||Array.isArray(I)&&!I.includes(i)||null!=s&&Array.isArray(h)&&!h.includes(s)||C>g)return void r(A);let c=n?.["retry-after"];if(c){let A;c=Number.isNaN(c=Number(c))?isNaN(A=new Date(n["retry-after"]).getTime())?0:A-Date.now():1e3*c}setTimeout(()=>r(null),c>0?Math.min(c,Q):Math.min(l*E**(C-1),Q))}onResponseStart(A,e,t,s){if(this.error=null,this.retryCount+=1,this.statusCode=e,this.headers=t,e>=300){let r=new o("Request failed",e,{headers:t,data:{count:this.retryCount}});this.onResponseStartWithRetry(A,e,t,s,r);return}if(this.headersSent){if(206!==e&&(this.start>0||200!==e))throw new o("server does not support the range header and the payload was partially consumed",e,{headers:t,data:{count:this.retryCount}});let A=i(t["content-range"]);if(!A)throw new o("Content-Range mismatch",e,{headers:t,data:{count:this.retryCount}});if(null!=this.etag&&this.etag!==t.etag)throw new o("ETag mismatch",e,{headers:t,data:{count:this.retryCount}});let{start:s,size:n,end:a=n?n-1:null}=A;r(this.start===s,"content-range mismatch"),r(null==this.end||this.end===a,"content-range mismatch");return}if(null==this.end){if(206===e){let o=i(t["content-range"]);if(null==o){this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,s);return}let{start:n,size:a,end:g=a?a-1:null}=o;r(null!=n&&Number.isFinite(n),"content-range mismatch"),r(null!=g&&Number.isFinite(g),"invalid content-length"),this.start=n,this.end=g}if(null==this.end){let A=t["content-length"];this.end=null!=A?Number(A)-1:null}r(Number.isFinite(this.start)),r(null==this.end||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=null!=t.etag?t.etag:null,null!=this.etag&&"W"===this.etag[0]&&"/"===this.etag[1]&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(A,e,t,s)}else throw new o("Request failed",e,{headers:t,data:{count:this.retryCount}})}onResponseData(A,e){this.error||(this.start+=e.length,this.handler.onResponseData?.(A,e))}onResponseEnd(A,e){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error){if(null!=this.end&&Number.isFinite(this.end)&&this.start!==this.end+1)throw new o("Content-Range mismatch",this.statusCode,{headers:this.headers,data:{count:this.retryCount}});return this.retryCount=0,this.handler.onResponseEnd?.(A,e)}this.retry(A)}retry(A){if(0!==this.start){let A={range:`bytes=${this.start}-${this.end??""}`};null!=this.etag&&(A["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...A}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(e){this.handler.onResponseError?.(A,e)}}onResponseError(A,e){A?.aborted||n(this.opts.body)?this.handler.onResponseError?.(A,e):(this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},(function(e){e?this.handler?.onResponseError?.(A,e):this.retry(A)}).bind(this)))}}e.exports=g},69452,(A,e,t)=>{"use strict";let r=A.r(777103),s=A.r(225316);e.exports=class extends r{#w=null;#S=null;constructor(A,e={}){super(e),this.#w=A,this.#S=e}dispatch(A,e){let t=new s({...A,retryOptions:this.#S},{dispatch:this.#w.dispatch.bind(this.#w),handler:e});return this.#w.dispatch(A,t)}close(){return this.#w.close()}destroy(){return this.#w.destroy()}}},506146,(A,e,t)=>{"use strict";let{InvalidArgumentError:r}=A.r(456763),s=A.r(306847);e.exports=class extends s{constructor(A,e){if("string"==typeof A&&(A=new URL(A)),"http:"!==A.protocol)throw new r("h2c-client: Only h2c protocol is supported");const{maxConcurrentStreams:t,pipelining:s,...o}=e??{},n=t??100;let i=100;if(null!=t&&(!Number.isInteger(t)||t<1))throw new r("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=s&&Number.isInteger(s)&&s>0&&(i=s),i>n)throw new r("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(A,{...o,maxConcurrentStreams:n,pipelining:i,allowH2:!0,useH2c:!0})}}},580451,(A,e,t)=>{"use strict";let r=A.r(57328),{addAbortListener:s}=A.r(687769),{Readable:o}=A.r(81111),{RequestAbortedError:n,NotSupportedError:i,InvalidArgumentError:a,AbortError:g}=A.r(456763),l=A.r(280324),{ReadableStreamFrom:Q}=A.r(280324),E=Symbol("kConsume"),h=Symbol("kReading"),B=Symbol("kBody"),I=Symbol("kAbort"),C=Symbol("kContentType"),c=Symbol("kContentLength"),u=Symbol("kUsed"),d=Symbol("kBytesRead"),f=()=>{};function y(A,e){return r(!A[E]),new Promise((t,r)=>{if(l.isDisturbed(A)||A[B]?.locked===!0||null!==A[E]){let e=A._readableState;e.destroyed&&!1===e.closeEmitted?A.on("error",r).on("close",()=>{r(TypeError("unusable"))}):r(e.errored??TypeError("unusable"))}else queueMicrotask(()=>{A[E]={type:e,stream:A,resolve:t,reject:r,length:0,body:[]},A.on("error",function(A){N(this[E],A)}).on("close",function(){null!==this[E].body&&N(this[E],new n)}),function(A){if(null===A.body)return;let{_readableState:e}=A.stream;if(e.bufferIndex){let t=e.bufferIndex,r=e.buffer.length;for(let s=t;s<r;s++)S(A,e.buffer[s])}else for(let t of e.buffer)S(A,t);for(e.endEmitted?w(this[E],this._readableState.encoding):A.stream.on("end",function(){w(this[E],this._readableState.encoding)}),A.stream.resume();null!=A.stream.read(););}(A[E])})})}function D(A,e,t){if(0===A.length||0===e)return"";let r=1===A.length?A[0]:Buffer.concat(A,e),s=r.length,o=3*(s>2&&239===r[0]&&187===r[1]&&191===r[2]);return t&&"utf8"!==t&&"utf-8"!==t?r.subarray(o,s).toString(t):r.utf8Slice(o,s)}function p(A,e){if(0===A.length||0===e)return new Uint8Array(0);if(1===A.length)return new Uint8Array(A[0]);let t=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),r=0;for(let e=0;e<A.length;++e){let s=A[e];t.set(s,r),r+=s.length}return t}function w(A,e){let{type:t,body:r,resolve:s,stream:o,length:n}=A;try{"text"===t?s(D(r,n,e)):"json"===t?s(JSON.parse(D(r,n,e))):"arrayBuffer"===t?s(p(r,n).buffer):"blob"===t?s(new Blob(r,{type:o[C]})):"bytes"===t&&s(p(r,n)),N(A)}catch(A){o.destroy(A)}}function S(A,e){A.length+=e.length,A.body.push(e)}function N(A,e){null!==A.body&&(e?A.reject(e):A.resolve(),A.type=null,A.stream=null,A.resolve=null,A.reject=null,A.length=0,A.body=null)}e.exports={Readable:class extends o{constructor({resume:A,abort:e,contentType:t="",contentLength:r,highWaterMark:s=65536}){super({autoDestroy:!0,read:A,highWaterMark:s}),this._readableState.dataEmitted=!1,this[I]=e,this[E]=null,this[d]=0,this[B]=null,this[u]=!1,this[C]=t,this[c]=Number.isFinite(r)?r:null,this[h]=!1}_destroy(A,e){A||this._readableState.endEmitted||(A=new n),A&&this[I](),this[u]?e(A):setImmediate(e,A)}on(A,e){return("data"===A||"readable"===A)&&(this[h]=!0,this[u]=!0),super.on(A,e)}addListener(A,e){return this.on(A,e)}off(A,e){let t=super.off(A,e);return("data"===A||"readable"===A)&&(this[h]=this.listenerCount("data")>0||this.listenerCount("readable")>0),t}removeListener(A,e){return this.off(A,e)}push(A){return A&&(this[d]+=A.length,this[E])?(S(this[E],A),!this[h]||super.push(A)):super.push(A)}text(){return y(this,"text")}json(){return y(this,"json")}blob(){return y(this,"blob")}bytes(){return y(this,"bytes")}arrayBuffer(){return y(this,"arrayBuffer")}async formData(){throw new i}get bodyUsed(){return l.isDisturbed(this)}get body(){return!this[B]&&(this[B]=Q(this),this[E]&&(this[B].getReader(),r(this[B].locked))),this[B]}dump(A){let e=A?.signal;if(null!=e&&("object"!=typeof e||!("aborted"in e)))return Promise.reject(new a("signal must be an AbortSignal"));let t=A?.limit&&Number.isFinite(A.limit)?A.limit:131072;return e?.aborted?Promise.reject(e.reason??new g):this._readableState.closeEmitted?Promise.resolve(null):new Promise((A,r)=>{if((this[c]&&this[c]>t||this[d]>t)&&this.destroy(new g),e){let t=()=>{this.destroy(e.reason??new g)},o=s(e,t);this.on("close",function(){o[Symbol.dispose](),e.aborted?r(e.reason??new g):A(null)})}else this.on("close",A);this.on("error",f).on("data",()=>{this[d]>t&&this.destroy()}).resume()})}setEncoding(A){return Buffer.isEncoding(A)&&(this._readableState.encoding=A),this}},chunksDecode:D}},832052,(A,e,t)=>{"use strict";let r=A.r(57328),{AsyncResource:s}=A.r(478500),{Readable:o}=A.r(580451),{InvalidArgumentError:n,RequestAbortedError:i}=A.r(456763),a=A.r(280324);function g(){}class l extends s{constructor(A,e){if(!A||"object"!=typeof A)throw new n("invalid opts");const{signal:t,method:r,opaque:s,body:o,onInfo:l,responseHeaders:Q,highWaterMark:E}=A;try{if("function"!=typeof e)throw new n("invalid callback");if(null!=E&&(!Number.isFinite(E)||E<0))throw new n("invalid highWaterMark");if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new n("signal must be an EventEmitter or EventTarget");if("CONNECT"===r)throw new n("invalid method");if(l&&"function"!=typeof l)throw new n("invalid onInfo callback");super("UNDICI_REQUEST")}catch(A){throw a.isStream(o)&&a.destroy(o.on("error",g),A),A}this.method=r,this.responseHeaders=Q||null,this.opaque=s||null,this.callback=e,this.res=null,this.abort=null,this.body=o,this.trailers={},this.context=null,this.controller=null,this.onInfo=l||null,this.highWaterMark=E,this.reason=null,this.removeAbortListener=null,t?.aborted?this.reason=t.reason??new i:t&&(this.removeAbortListener=a.addAbortListener(t,()=>{this.reason=t.reason??new i,this.res?a.destroy(this.res.on("error",g),this.reason):this.abort&&this.abort(this.reason)}))}onRequestStart(A,e){this.reason?A.abort(this.reason):(r(this.callback),this.controller=A,this.abort=e=>A.abort(e),this.context=e)}onResponseStart(A,e,t,r){let{callback:s,opaque:n,context:i,responseHeaders:l,highWaterMark:Q}=this,E=A?.rawHeaders,h="raw"===l?a.parseRawHeaders(E):t;if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let B=t?.["content-type"],I=t?.["content-length"],C=new o({resume:()=>A.resume(),abort:e=>A.abort(e),contentType:B,contentLength:"HEAD"!==this.method&&I?Number(I):null,highWaterMark:Q});if(this.removeAbortListener&&(C.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=C,null!==s)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:r,headers:h,trailers:this.trailers,opaque:n,body:C,context:i})}catch(A){this.res=null,a.destroy(C.on("error",g),A),queueMicrotask(()=>{throw A})}}onResponseData(A,e){this.res&&!1===this.res.push(e)&&A.pause()}onResponseEnd(A,e){if(e&&"object"==typeof e)for(let A of Object.keys(e))"__proto__"===A?Object.defineProperty(this.trailers,A,{value:e[A],enumerable:!0,configurable:!0,writable:!0}):this.trailers[A]=e[A];this.res?.push(null)}onResponseError(A,e){let{res:t,callback:r,body:s,opaque:o}=this;r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:o})})),t&&(this.res=null,queueMicrotask(()=>{a.destroy(t.on("error",g),e)})),s&&(this.body=null,a.isStream(s)&&(s.on("error",g),a.destroy(s,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}}e.exports=function A(e,t){if(void 0===t)return new Promise((t,r)=>{A.call(this,e,(A,e)=>A?r(A):t(e))});try{let A=new l(e,t);this.dispatch(e,A)}catch(r){if("function"!=typeof t)throw r;let A=e?.opaque;queueMicrotask(()=>t(r,{opaque:A}))}},e.exports.RequestHandler=l},471710,(A,e,t)=>{"use strict";let{addAbortListener:r}=A.r(280324),{RequestAbortedError:s}=A.r(456763),o=Symbol("kListener"),n=Symbol("kSignal");function i(A){A.abort?A.abort(A[n]?.reason):A.reason=A[n]?.reason??new s,a(A)}function a(A){A[n]&&("removeEventListener"in A[n]?A[n].removeEventListener("abort",A[o]):A[n].removeListener("abort",A[o]),A[n]=null,A[o]=null)}e.exports={addSignal:function(A,e){if(A.reason=null,A[n]=null,A[o]=null,e){if(e.aborted)return void i(A);A[n]=e,A[o]=()=>{i(A)},r(A[n],A[o])}},removeSignal:a}},153226,(A,e,t)=>{"use strict";let r=A.r(57328),{AsyncResource:s}=A.r(478500),{InvalidArgumentError:o,InvalidReturnValueError:n}=A.r(456763),i=A.r(280324),{addSignal:a,removeSignal:g}=A.r(471710);function l(){}class Q extends s{constructor(A,e,t){if(!A||"object"!=typeof A)throw new o("invalid opts");const{signal:r,method:s,opaque:n,body:g,onInfo:Q,responseHeaders:E}=A;try{if("function"!=typeof t)throw new o("invalid callback");if("function"!=typeof e)throw new o("invalid factory");if(r&&"function"!=typeof r.on&&"function"!=typeof r.addEventListener)throw new o("signal must be an EventEmitter or EventTarget");if("CONNECT"===s)throw new o("invalid method");if(Q&&"function"!=typeof Q)throw new o("invalid onInfo callback");super("UNDICI_STREAM")}catch(A){throw i.isStream(g)&&i.destroy(g.on("error",l),A),A}this.responseHeaders=E||null,this.opaque=n||null,this.factory=e,this.callback=t,this.res=null,this.abort=null,this.context=null,this.controller=null,this.trailers=null,this.body=g,this.onInfo=Q||null,i.isStream(g)&&g.on("error",A=>{this.onResponseError(this.controller,A)}),a(this,r)}onRequestStart(A,e){this.reason?A.abort(this.reason):(r(this.callback),this.controller=A,this.abort=e=>A.abort(e),this.context=e)}onResponseStart(A,e,t,r){var s;let o,a,g,l,Q,{factory:E,opaque:h,context:B,responseHeaders:I}=this,C=A?.rawHeaders,c="raw"===I?i.parseRawHeaders(C):t;if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:c});return}if(this.factory=null,null===E)return;let u=this.runInAsyncScope(E,null,{statusCode:e,headers:c,opaque:h,context:B});if(!u||"function"!=typeof u.write||"function"!=typeof u.end||"function"!=typeof u.on)throw new n("expected Writable");s=(A,e)=>{let{callback:t,res:r,opaque:s,trailers:o,abort:n}=this;this.res=null,(A||!r?.readable)&&i.destroy(r,e?void 0:A),this.callback=null,this.runInAsyncScope(t,null,A||null,{opaque:s,trailers:o}),A&&n(A)},o=!1,a=(A,e=!1)=>{o||(o=!0,u.removeListener("close",g),u.removeListener("error",l),u.removeListener("finish",Q),s(A,e))},g=()=>{let A;a(u.errored??u.writableErrored??u._writableState?.errored??(u.writableFinished?void 0:((A=Error("Premature close")).code="ERR_STREAM_PREMATURE_CLOSE",A)))},l=A=>a(A,!0),Q=()=>a(),u.on("close",g),u.on("error",l),u.on("finish",Q),u.closed?process.nextTick(g):u.writableFinished&&process.nextTick(Q),u.on("drain",()=>A.resume()),this.res=u,!0===(void 0!==u.writableNeedDrain?u.writableNeedDrain:u._writableState?.needDrain)&&A.pause()}onResponseData(A,e){let{res:t}=this;t&&!1===t.write(e)&&A.pause()}onResponseEnd(A,e){let{res:t}=this;g(this),t&&(e&&"object"==typeof e&&(this.trailers=e),t.end())}onResponseError(A,e){let{res:t,callback:r,opaque:s,body:o}=this;g(this),this.factory=null,t?(this.res=null,i.destroy(t,e)):r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:s})})),o&&(this.body=null,i.destroy(o,e))}}e.exports=function A(e,t,r){if(void 0===r)return new Promise((r,s)=>{A.call(this,e,t,(A,e)=>A?s(A):r(e))});try{let A=new Q(e,t,r);this.dispatch(e,A)}catch(t){if("function"!=typeof r)throw t;let A=e?.opaque;queueMicrotask(()=>r(t,{opaque:A}))}}},610092,(A,e,t)=>{"use strict";let{Readable:r,Duplex:s,PassThrough:o}=A.r(81111),n=A.r(57328),{AsyncResource:i}=A.r(478500),{InvalidArgumentError:a,InvalidReturnValueError:g,RequestAbortedError:l}=A.r(456763),Q=A.r(280324),{kBodyUsed:E}=A.r(354615),{addSignal:h,removeSignal:B}=A.r(471710);function I(){}let C=Symbol("resume");class c extends r{constructor(){super({autoDestroy:!0}),this[C]=null,this[E]=!0}_read(){let{[C]:A}=this;A&&(this[C]=null,A())}_destroy(A,e){this._read(),e(A)}}class u extends r{constructor(A){super({autoDestroy:!0}),this[C]=A}_read(){this[C]()}_destroy(A,e){A||this._readableState.endEmitted||(A=new l),e(A)}}class d extends i{constructor(A,e){if(!A||"object"!=typeof A)throw new a("invalid opts");if("function"!=typeof e)throw new a("invalid handler");const{signal:t,method:r,opaque:o,onInfo:n,responseHeaders:i}=A;if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new a("signal must be an EventEmitter or EventTarget");if("CONNECT"===r)throw new a("invalid method");if(n&&"function"!=typeof n)throw new a("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=o||null,this.responseHeaders=i||null,this.handler=e,this.abort=null,this.context=null,this.onInfo=n||null,this.req=new c().on("error",I),this.ret=new s({readableObjectMode:A.objectMode,autoDestroy:!0,read:()=>{let{body:A}=this;A?.resume&&A.resume()},write:(A,e,t)=>{let{req:r}=this;r.push(A,e)||r._readableState.destroyed?t():r[C]=t},destroy:(A,e)=>{let{body:t,req:r,res:s,ret:o,abort:n}=this;A||o._readableState.endEmitted||(A=new l),n&&A&&n(),Q.destroy(t,A),Q.destroy(r,A),Q.destroy(s,A),B(this),e(A)}}).on("prefinish",()=>{let{req:A}=this;A.push(null)}),this.res=null,h(this,t)}onRequestStart(A,e){let{res:t}=this;this.reason?A.abort(this.reason):(n(!t,"pipeline cannot be retried"),this.abort=e=>A.abort(e),this.context=e)}onResponseStart(A,e,t,r){let s,{opaque:o,handler:n,context:i}=this;if(e<200){if(this.onInfo){let r=A?.rawHeaders,s="raw"===this.responseHeaders?Q.parseRawHeaders(r):t;this.onInfo({statusCode:e,headers:s})}return}this.res=new u(()=>A.resume());try{this.handler=null;let r=A?.rawHeaders,a="raw"===this.responseHeaders?Q.parseRawHeaders(r):t;s=this.runInAsyncScope(n,null,{statusCode:e,headers:a,opaque:o,body:this.res,context:i})}catch(A){throw this.res.on("error",I),A}if(!s||"function"!=typeof s.on)throw new g("expected Readable");s.on("data",A=>{let{ret:e,body:t}=this;!e.push(A)&&t.pause&&t.pause()}).on("error",A=>{let{ret:e}=this;Q.destroy(e,A)}).on("end",()=>{let{ret:A}=this;A.push(null)}).on("close",()=>{let{ret:A}=this;A._readableState.ended||Q.destroy(A,new l)}),this.body=s}onResponseData(A,e){let{res:t}=this;!1===t.push(e)&&A.pause()}onResponseEnd(A,e){let{res:t}=this;t.push(null)}onResponseError(A,e){let{ret:t}=this;this.handler=null,Q.destroy(t,e)}}e.exports=function(A,e){try{let t=new d(A,e);return this.dispatch({...A,body:t.req},t),t.ret}catch(A){return new o().destroy(A)}}},805893,(A,e,t)=>{"use strict";let{InvalidArgumentError:r,SocketError:s}=A.r(456763),{AsyncResource:o}=A.r(478500),n=A.r(57328),i=A.r(280324),{kHTTP2Stream:a}=A.r(354615),{addSignal:g,removeSignal:l}=A.r(471710);class Q extends o{constructor(A,e){if(!A||"object"!=typeof A)throw new r("invalid opts");if("function"!=typeof e)throw new r("invalid callback");const{signal:t,opaque:s,responseHeaders:o}=A;if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new r("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=o||null,this.opaque=s||null,this.callback=e,this.abort=null,this.context=null,g(this,t)}onRequestStart(A,e){this.reason?A.abort(this.reason):(n(this.callback),this.abort=e=>A.abort(e),this.context=e)}onResponseStart(){throw new s("bad upgrade",null)}onRequestUpgrade(A,e,t,r){if(e!==(!0===r[a]?200:101)){let e=!0===r[a]?null:i.getSocketInfo(r);A.abort(new s("bad upgrade",e));return}let{callback:o,opaque:n,context:g}=this;l(this),this.callback=null;let Q=A?.rawHeaders,E="raw"===this.responseHeaders?i.parseRawHeaders(Q):t;this.runInAsyncScope(o,null,null,{headers:E,socket:r,opaque:n,context:g})}onResponseError(A,e){let{callback:t,opaque:r}=this;l(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:r})}))}}e.exports=function A(e,t){if(void 0===t)return new Promise((t,r)=>{A.call(this,e,(A,e)=>A?r(A):t(e))});try{let A=new Q(e,t),r={...e,method:e.method||"GET",upgrade:e.protocol||"Websocket"};this.dispatch(r,A)}catch(r){if("function"!=typeof t)throw r;let A=e?.opaque;queueMicrotask(()=>t(r,{opaque:A}))}}},812409,(A,e,t)=>{"use strict";let r=A.r(57328),{AsyncResource:s}=A.r(478500),{InvalidArgumentError:o,SocketError:n}=A.r(456763),i=A.r(280324),{addSignal:a,removeSignal:g}=A.r(471710);class l extends s{constructor(A,e){if(!A||"object"!=typeof A)throw new o("invalid opts");if("function"!=typeof e)throw new o("invalid callback");const{signal:t,opaque:r,responseHeaders:s}=A;if(t&&"function"!=typeof t.on&&"function"!=typeof t.addEventListener)throw new o("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=r||null,this.responseHeaders=s||null,this.callback=e,this.abort=null,a(this,t)}onRequestStart(A,e){this.reason?A.abort(this.reason):(r(this.callback),this.abort=e=>A.abort(e),this.context=e)}onResponseStart(){throw new n("bad connect",null)}onRequestUpgrade(A,e,t,r){let{callback:s,opaque:o,context:n}=this;g(this),this.callback=null;let a=t,l=A?.rawHeaders;null!=a&&(a="raw"===this.responseHeaders?i.parseRawHeaders(l):t),this.runInAsyncScope(s,null,null,{statusCode:e,headers:a,socket:r,opaque:o,context:n})}onResponseError(A,e){let{callback:t,opaque:r}=this;g(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:r})}))}}e.exports=function A(e,t){if(void 0===t)return new Promise((t,r)=>{A.call(this,e,(A,e)=>A?r(A):t(e))});try{let A=new l(e,t),r={...e,method:"CONNECT"};this.dispatch(r,A)}catch(r){if("function"!=typeof t)throw r;let A=e?.opaque;queueMicrotask(()=>t(r,{opaque:A}))}}},413178,(A,e,t)=>{"use strict";e.exports.request=A.r(832052),e.exports.stream=A.r(153226),e.exports.pipeline=A.r(610092),e.exports.upgrade=A.r(805893),e.exports.connect=A.r(812409)},935609,(A,e,t)=>{"use strict";let{UndiciError:r}=A.r(456763),s=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");class o extends r{constructor(A){super(A),this.name="MockNotMatchedError",this.message=A||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](A){return A&&!0===A[s]}get[s](){return!0}}e.exports={MockNotMatchedError:o}},915098,(A,e,t)=>{"use strict";e.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}},640248,(A,e,t)=>{"use strict";let{MockNotMatchedError:r}=A.r(935609),{kDispatches:s,kMockAgent:o,kOriginalDispatch:n,kOrigin:i,kGetNetConnect:a,kTotalDispatchCount:g}=A.r(915098),{serializePathWithQuery:l,parseHeaders:Q}=A.r(280324),{STATUS_CODES:E}=A.r(347299),{types:{isPromise:h}}=A.r(812057),{InvalidArgumentError:B}=A.r(456763);function I(A,e){return"string"==typeof A?A===e:A instanceof RegExp?A.test(e):"function"==typeof A&&!0===A(e)}function C(A){return Object.fromEntries(Object.entries(A).map(([A,e])=>[A.toLocaleLowerCase(),e]))}function c(A,e){if(Array.isArray(A)){for(let t=0;t<A.length;t+=2)if(A[t].toLocaleLowerCase()===e.toLocaleLowerCase())return A[t+1];return}return"function"==typeof A.get?A.get(e):C(A)[e.toLocaleLowerCase()]}function u(A){let e=A.slice(),t=[];for(let A=0;A<e.length;A+=2)t.push([e[A],e[A+1]]);return Object.fromEntries(t)}function d(A,e){if("function"==typeof A.headers)return Array.isArray(e)&&(e=u(e)),A.headers(e?C(e):{});if(void 0===A.headers)return!0;if("object"!=typeof e||"object"!=typeof A.headers)return!1;for(let[t,r]of Object.entries(A.headers))if(!I(r,c(e,t)))return!1;return!0}function f(A){if("string"!=typeof A)return A;let e=A.split("?",3);if(2!==e.length)return A;let t=new URLSearchParams(e.pop());return t.sort(),[...e,t.toString()].join("?")}function y(A){if(Buffer.isBuffer(A)||A instanceof Uint8Array)return A;if(A instanceof ArrayBuffer)return A;if("object"==typeof A)return JSON.stringify(A);if(A)return A.toString();else return""}function D(A,e){let t=e.query?l(e.path,e.query):e.path,s="string"==typeof t?f(t):t,o=w(s),n=A.filter(({consumed:A})=>!A).filter(({path:A,ignoreTrailingSlash:e})=>e?I(w(f(A)),o):I(f(A),s));if(0===n.length)throw new r(`Mock dispatch not matched for path '${s}'`);if(0===(n=n.filter(({method:A})=>I(A,e.method))).length)throw new r(`Mock dispatch not matched for method '${e.method}' on path '${s}'`);if(0===(n=n.filter(({body:A})=>void 0===A||I(A,e.body))).length)throw new r(`Mock dispatch not matched for body '${e.body}' on path '${s}'`);if(0===(n=n.filter(A=>d(A,e.headers))).length){let A="object"==typeof e.headers?JSON.stringify(e.headers):e.headers;throw new r(`Mock dispatch not matched for headers '${A}' on path '${s}'`)}return n[0]}function p(A,e){let t=A.findIndex(A=>!!A.consumed&&function(A,{path:e,method:t,body:r,headers:s}){let o=I(A.path,e),n=I(A.method,t),i=void 0===A.body||I(A.body,r),a=d(A,s);return o&&n&&i&&a}(A,e));-1!==t&&A.splice(t,1)}function w(A){for(;A.endsWith("/");)A=A.slice(0,-1);return 0===A.length&&(A="/"),A}function S(A){let{path:e,method:t,body:r,headers:s,query:o}=A;return{path:e,method:t,body:r,headers:s,query:o}}function N(A){let e=Object.keys(A),t=[];for(let r=0;r<e.length;++r){let s=e[r],o=A[s],n=Buffer.from(`${s}`);if(Array.isArray(o))for(let A=0;A<o.length;++A)t.push(n,Buffer.from(`${o[A]}`));else t.push(n,Buffer.from(`${o}`))}return t}function R(A){return E[A]||"unknown"}function U(A,e){let t=S(A),r=D(this[s],t);r.timesInvoked++,r.data.callback&&(r.data={...r.data,...r.data.callback(A)});let{data:{statusCode:o,data:n,headers:i,trailers:a,error:g},delay:l,persist:E}=r,{timesInvoked:B,times:I}=r;if(r.consumed=!E&&B>=I,r.pending=B<I,null!==g)return p(this[s],t),e.onResponseError(null,g),!0;let C=!1,c=null,d={paused:!1,rawHeaders:null,rawTrailers:null,pause(){this.paused=!0},resume(){this.paused=!1},abort:A=>{C||(C=!0,null!==c&&(clearTimeout(c),c=null),e.onResponseError?.(d,A))}};function f(r,s=n){if(C)return;let g=Array.isArray(A.headers)?u(A.headers):A.headers,l="function"==typeof s?s({...A,headers:g}):s;if(h(l))return l.then(A=>f(r,A));if(C)return;let E=y(l),B=N(i),I=N(a);d.rawHeaders=B,d.rawTrailers=I,e.onResponseStart?.(d,o,Q(B),R(o)),e.onResponseData?.(d,Buffer.from(E)),e.onResponseEnd?.(d,Q(I)),p(r,t)}return e.onRequestStart?.(d,null),"number"==typeof l&&l>0?c=setTimeout(()=>{c=null,f(this[s])},l):f(this[s]),!0}function F(A,e){let t=new URL(e);return!0===A||!!(Array.isArray(A)&&A.some(A=>I(A,t.host)))}e.exports={getResponseData:y,getMockDispatch:D,addMockDispatch:function(A,e,t,r){let s={timesInvoked:0,times:1,persist:!1,consumed:!1,...r},o="function"==typeof t?{callback:t}:{...t},n={...s,...e,pending:!0,data:{error:null,...o}};return A.push(n),A[g]=(A[g]||0)+1,n},deleteMockDispatch:p,buildKey:S,generateKeyValues:N,matchValue:I,getResponse:async function A(A){let e=[];for await(let t of A)e.push(t);return Buffer.concat(e).toString("utf8")},getStatusText:R,mockDispatch:U,buildMockDispatch:function(){let A=this[o],e=this[i],t=this[n];return function(o,n){if(A.isMockActive)try{U.call(this,o,n)}catch(i){if("UND_MOCK_ERR_MOCK_NOT_MATCHED"===i.code){let l=A[a](),Q=this[s][g]||this[s].length,E=this[s].filter(({consumed:A})=>!A).length,h=`, ${E} interceptor(s) remaining out of ${Q} defined`;if(!1===l)throw new r(`${i.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${h}`);if(F(l,e))t.call(this,"__mockAgentBodyForDispatch"in o?{...o,body:o.__mockAgentBodyForDispatch}:o,n);else throw new r(`${i.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${h}`)}else throw i}else t.call(this,o,n)}},checkNetConnect:F,buildAndValidateMockOptions:function(A){let{agent:e,...t}=A;if("enableCallHistory"in t&&"boolean"!=typeof t.enableCallHistory)throw new B("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in t&&"boolean"!=typeof t.acceptNonStandardSearchParameters)throw new B("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in t&&"boolean"!=typeof t.ignoreTrailingSlash)throw new B("options.ignoreTrailingSlash must to be a boolean");return t},getHeaderByName:c,buildHeadersFromArray:u,normalizeSearchParams:function(A){if("string"!=typeof A)return A;let e=new URLSearchParams(A),t=new URLSearchParams;for(let[A,r]of e.entries()){if(A=A.replace("[]",""),/^(['"]).*\1$/.test(r)){t.append(A,r);continue}if(r.includes(",")){for(let e of r.split(","))t.append(A,e);continue}t.append(A,r)}return t},normalizeOrigin:function(A){return"string"==typeof A||A instanceof URL?A instanceof URL?A.origin:A.toLowerCase():A}}},599532,(A,e,t)=>{"use strict";let{getResponseData:r,buildKey:s,addMockDispatch:o}=A.r(640248),{kDispatches:n,kDispatchKey:i,kDefaultHeaders:a,kDefaultTrailers:g,kContentLength:l,kMockDispatch:Q,kIgnoreTrailingSlash:E}=A.r(915098),{InvalidArgumentError:h}=A.r(456763),{serializePathWithQuery:B}=A.r(280324);class I{constructor(A){this[Q]=A}delay(A){if("number"!=typeof A||!Number.isInteger(A)||A<=0)throw new h("waitInMs must be a valid integer > 0");return this[Q].delay=A,this}persist(){return this[Q].persist=!0,this}times(A){if("number"!=typeof A||!Number.isInteger(A)||A<=0)throw new h("repeatTimes must be a valid integer > 0");return this[Q].times=A,this}}e.exports.MockInterceptor=class{constructor(A,e){if("object"!=typeof A)throw new h("opts must be an object");if(void 0===A.path)throw new h("opts.path must be defined");if(void 0===A.method&&(A.method="GET"),"string"==typeof A.path)if(A.query)A.path=B(A.path,A.query);else{const e=new URL(A.path,"data://");A.path=e.pathname+e.search}"string"==typeof A.method&&(A.method=A.method.toUpperCase()),this[i]=s(A),this[n]=e,this[E]=A.ignoreTrailingSlash??!1,this[a]={},this[g]={},this[l]=!1}createMockScopeDispatchData({statusCode:A,data:e,responseOptions:t}){let s=r(e),o=this[l]?{"content-length":s.length}:{};return{statusCode:A,data:e,headers:{...this[a],...o,...t.headers},trailers:{...this[g],...t.trailers}}}validateReplyParameters(A){if(void 0===A.statusCode)throw new h("statusCode must be defined");if("object"!=typeof A.responseOptions||null===A.responseOptions)throw new h("responseOptions must be an object")}reply(A){if("function"==typeof A){let e=e=>{let t=A(e);if("object"!=typeof t||null===t)throw new h("reply options callback must return an object");let r={data:"",responseOptions:{},...t};return this.validateReplyParameters(r),{...this.createMockScopeDispatchData(r)}};return new I(o(this[n],this[i],e,{ignoreTrailingSlash:this[E]}))}let e={statusCode:A,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(e);let t=this.createMockScopeDispatchData(e);return new I(o(this[n],this[i],t,{ignoreTrailingSlash:this[E]}))}replyWithError(A){if(void 0===A)throw new h("error must be defined");return new I(o(this[n],this[i],{error:A},{ignoreTrailingSlash:this[E]}))}defaultReplyHeaders(A){if(void 0===A)throw new h("headers must be defined");return this[a]=A,this}defaultReplyTrailers(A){if(void 0===A)throw new h("trailers must be defined");return this[g]=A,this}replyContentLength(){return this[l]=!0,this}},e.exports.MockScope=I},232381,(A,e,t)=>{"use strict";let{promisify:r}=A.r(812057),s=A.r(306847),{buildMockDispatch:o}=A.r(640248),{kDispatches:n,kMockAgent:i,kClose:a,kOriginalClose:g,kOrigin:l,kOriginalDispatch:Q,kConnected:E,kIgnoreTrailingSlash:h}=A.r(915098),{MockInterceptor:B}=A.r(599532),I=A.r(354615),{InvalidArgumentError:C}=A.r(456763);class c extends s{constructor(A,e){if(!e||!e.agent||"function"!=typeof e.agent.dispatch)throw new C("Argument opts.agent must implement Agent");super(A,e),this[i]=e.agent,this[l]=A,this[h]=e.ignoreTrailingSlash??!1,this[n]=[],this[E]=1,this[Q]=this.dispatch,this[g]=this.close.bind(this),this.dispatch=o.call(this),this.close=this[a]}get[I.kConnected](){return this[E]}intercept(A){return new B(A&&{ignoreTrailingSlash:this[h],...A},this[n])}cleanMocks(){this[n]=[]}async [a](){await r(this[g])(),this[E]=0,this[i][I.kClients].delete(this[l])}}e.exports=c},862493,(A,e,t)=>{"use strict";let{kMockCallHistoryAddLog:r}=A.r(915098),{InvalidArgumentError:s}=A.r(456763);function o(A,e,t,r,o){switch(e.operator){case"OR":return r.push(...t(A,o)),r;case"AND":return t(A,r);default:throw new s("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function n(A){return(e,t)=>{if("string"==typeof e||null==e)return t.filter(t=>t[A]===e);if(e instanceof RegExp)return t.filter(t=>e.test(t[A]));throw new s(`${A} parameter should be one of string, regexp, undefined or null`)}}class i{constructor(A={}){this.body=A.body,this.headers=A.headers,this.method=A.method;const e=function(A){try{let e=new URL(A.path,A.origin);if(0!==e.search.length)return e;return e.search=new URLSearchParams(A.query).toString(),e}catch(A){throw new s("An error occurred when computing MockCallHistoryLog.url",{cause:A})}}(A);this.fullUrl=e.toString(),this.origin=e.origin,this.path=e.pathname,this.searchParams=Object.fromEntries(e.searchParams),this.protocol=e.protocol,this.host=e.host,this.port=e.port,this.hash=e.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let A="";return this.toMap().forEach((e,t)=>{("string"==typeof e||null==e)&&(A=`${A}${t}->${e}|`),("object"==typeof e&&null!==e||Array.isArray(e))&&(A=`${A}${t}->${JSON.stringify(e)}|`)}),A.slice(0,-1)}}class a{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(A){if("number"!=typeof A)throw new s("nthCall must be called with a number");if(!Number.isInteger(A))throw new s("nthCall must be called with an integer");if(1!==Math.sign(A))throw new s("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(A-1)}filterCalls(A,e){if(0===this.logs.length)return this.logs;if("function"==typeof A)return this.logs.filter(A);if(A instanceof RegExp)return this.logs.filter(e=>A.test(e.toString()));if("object"==typeof A&&null!==A){if(0===Object.keys(A).length)return this.logs;let t={operator:"OR",...function(A={}){let e={};if("operator"in A){if("string"!=typeof A.operator||"OR"!==A.operator.toUpperCase()&&"AND"!==A.operator.toUpperCase())throw new s("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:A.operator.toUpperCase()}}return e}(e)},r="AND"===t.operator?this.logs:[];return"protocol"in A&&(r=o(A.protocol,t,this.filterCallsByProtocol,r,this.logs)),"host"in A&&(r=o(A.host,t,this.filterCallsByHost,r,this.logs)),"port"in A&&(r=o(A.port,t,this.filterCallsByPort,r,this.logs)),"origin"in A&&(r=o(A.origin,t,this.filterCallsByOrigin,r,this.logs)),"path"in A&&(r=o(A.path,t,this.filterCallsByPath,r,this.logs)),"hash"in A&&(r=o(A.hash,t,this.filterCallsByHash,r,this.logs)),"fullUrl"in A&&(r=o(A.fullUrl,t,this.filterCallsByFullUrl,r,this.logs)),"method"in A&&(r=o(A.method,t,this.filterCallsByMethod,r,this.logs)),[...new Set(r)]}throw new s("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=n.call(this,"protocol");filterCallsByHost=n.call(this,"host");filterCallsByPort=n.call(this,"port");filterCallsByOrigin=n.call(this,"origin");filterCallsByPath=n.call(this,"path");filterCallsByHash=n.call(this,"hash");filterCallsByFullUrl=n.call(this,"fullUrl");filterCallsByMethod=n.call(this,"method");clear(){this.logs=[]}[r](A){let e=new i(A);return this.logs.push(e),e}*[Symbol.iterator](){for(let A of this.calls())yield A}}e.exports.MockCallHistory=a,e.exports.MockCallHistoryLog=i},154592,(A,e,t)=>{"use strict";let{promisify:r}=A.r(812057),s=A.r(481206),{buildMockDispatch:o}=A.r(640248),{kDispatches:n,kMockAgent:i,kClose:a,kOriginalClose:g,kOrigin:l,kOriginalDispatch:Q,kConnected:E,kIgnoreTrailingSlash:h}=A.r(915098),{MockInterceptor:B}=A.r(599532),I=A.r(354615),{InvalidArgumentError:C}=A.r(456763);class c extends s{constructor(A,e){if(!e||!e.agent||"function"!=typeof e.agent.dispatch)throw new C("Argument opts.agent must implement Agent");super(A,e),this[i]=e.agent,this[l]=A,this[h]=e.ignoreTrailingSlash??!1,this[n]=[],this[E]=1,this[Q]=this.dispatch,this[g]=this.close.bind(this),this.dispatch=o.call(this),this.close=this[a]}get[I.kConnected](){return this[E]}intercept(A){return new B(A&&{ignoreTrailingSlash:this[h],...A},this[n])}cleanMocks(){this[n]=[]}async [a](){await r(this[g])(),this[E]=0,this[i][I.kClients].delete(this[l])}}e.exports=c},241293,(A,e,t)=>{e.exports=A.x("node:console",()=>require("node:console"))},857748,(A,e,t)=>{"use strict";let{Transform:r}=A.r(81111),{Console:s}=A.r(241293),o=process.versions.icu?"✅":"Y ",n=process.versions.icu?"❌":"N ";e.exports=class{constructor({disableColors:A}={}){this.transform=new r({transform(A,e,t){t(null,A)}}),this.logger=new s({stdout:this.transform,inspectOptions:{colors:!A&&!process.env.CI}})}format(A){let e=A.map(({method:A,path:e,data:{statusCode:t},persist:r,times:s,timesInvoked:i,origin:a})=>({Method:A,Origin:a,Path:e,"Status code":t,Persistent:r?o:n,Invocations:i,Remaining:r?1/0:s-i}));return this.logger.table(e),this.transform.read().toString()}}},960906,(A,e,t)=>{"use strict";let{kClients:r}=A.r(354615),s=A.r(484221),{kAgent:o,kMockAgentSet:n,kMockAgentGet:i,kDispatches:a,kIsMockActive:g,kNetConnect:l,kGetNetConnect:Q,kOptions:E,kFactory:h,kMockAgentRegisterCallHistory:B,kMockAgentIsCallHistoryEnabled:I,kMockAgentAddCallHistoryLog:C,kMockAgentMockCallHistoryInstance:c,kMockAgentAcceptsNonStandardSearchParameters:u,kMockCallHistoryAddLog:d,kIgnoreTrailingSlash:f}=A.r(915098),y=A.r(232381),D=A.r(154592),{matchValue:p,normalizeSearchParams:w,buildAndValidateMockOptions:S,normalizeOrigin:N}=A.r(640248),{InvalidArgumentError:R,UndiciError:U}=A.r(456763),F=A.r(777103),m=A.r(857748),{MockCallHistory:b}=A.r(862493);e.exports=class extends F{constructor(A={}){super(A);const e=S(A);if(this[l]=!0,this[g]=!0,this[I]=e.enableCallHistory??!1,this[u]=e.acceptNonStandardSearchParameters??!1,this[f]=e.ignoreTrailingSlash??!1,A?.agent&&"function"!=typeof A.agent.dispatch)throw new R("Argument opts.agent must implement Agent");const t=A?.agent?A.agent:new s(A);this[o]=t,this[r]=t[r],this[E]=e,this[I]&&this[B]()}get(A){let e=N(A),t=this[f]?e.replace(/\/$/,""):e,r=this[i](t);return r||(r=this[h](t),this[n](t,r)),r}dispatch(A,e){A.origin=N(A.origin),this.get(A.origin),this[C](A);let t=this[u],r={...A};if(t&&r.path){let[A,e]=r.path.split("?"),s=w(e,t);r.path=`${A}?${s}`}return this[o].dispatch(r,e)}async close(){this.clearCallHistory(),await this[o].close(),this[r].clear()}deactivate(){this[g]=!1}activate(){this[g]=!0}enableNetConnect(A){if("string"==typeof A||"function"==typeof A||A instanceof RegExp)Array.isArray(this[l])?this[l].push(A):this[l]=[A];else if(void 0===A)this[l]=!0;else throw new R("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[l]=!1}enableCallHistory(){return this[I]=!0,this}disableCallHistory(){return this[I]=!1,this}getCallHistory(){return this[c]}clearCallHistory(){void 0!==this[c]&&this[c].clear()}get isMockActive(){return this[g]}[B](){void 0===this[c]&&(this[c]=new b)}[C](A){this[I]&&(this[B](),this[c][d](A))}[n](A,e){this[r].set(A,e)}[h](A){let e=Object.assign({agent:this},this[E]);return this[E]&&1===this[E].connections?new y(A,e):new D(A,e)}[i](A){let e=this[r].get(A);if(e)return e;if("string"!=typeof A){let e=this[h]("http://localhost:9999");return this[n](A,e),e}for(let[e,t]of Array.from(this[r]))if(t&&"string"!=typeof e&&p(e,A)){let e=this[h](A);return this[n](A,e),e[a]=t[a],e}}[Q](){return this[l]}pendingInterceptors(){return Array.from(this[r].entries()).flatMap(([A,e])=>e[a].map(e=>({...e,origin:A}))).filter(({pending:A})=>A)}assertNoPendingInterceptors({pendingInterceptorsFormatter:A=new m}={}){let e=this.pendingInterceptors();if(0!==e.length)throw new U(1===e.length?`1 interceptor is pending:
32
32
 
33
33
  ${A.format(e)}`.trim():`${e.length} interceptors are pending:
34
34