@socketsecurity/lib 3.2.2 → 3.2.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 (307) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/abort.js +1 -1
  3. package/dist/agent.js +1 -1
  4. package/dist/ansi.js +1 -1
  5. package/dist/argv/flags.js +1 -1
  6. package/dist/argv/parse.js +1 -1
  7. package/dist/arrays.js +1 -1
  8. package/dist/bin.js +1 -1
  9. package/dist/cacache.js +1 -1
  10. package/dist/cache-with-ttl.js +1 -1
  11. package/dist/constants/agents.js +1 -1
  12. package/dist/constants/core.js +1 -1
  13. package/dist/constants/encoding.js +1 -1
  14. package/dist/constants/github.js +1 -1
  15. package/dist/constants/licenses.js +1 -1
  16. package/dist/constants/node.js +1 -1
  17. package/dist/constants/packages.js +1 -1
  18. package/dist/constants/paths.js +1 -1
  19. package/dist/constants/platform.js +1 -1
  20. package/dist/constants/process.js +1 -1
  21. package/dist/constants/socket.js +1 -1
  22. package/dist/constants/testing.js +1 -1
  23. package/dist/constants/time.js +1 -1
  24. package/dist/constants/typescript.js +1 -1
  25. package/dist/cover/code.js +1 -1
  26. package/dist/cover/formatters.js +1 -1
  27. package/dist/cover/type.js +1 -1
  28. package/dist/cover/types.js +1 -1
  29. package/dist/debug.js +1 -1
  30. package/dist/dlx-binary.js +1 -1
  31. package/dist/dlx-manifest.js +1 -1
  32. package/dist/dlx-package.js +1 -1
  33. package/dist/dlx.js +1 -1
  34. package/dist/effects/pulse-frames.js +4 -4
  35. package/dist/effects/text-shimmer.js +1 -1
  36. package/dist/effects/types.js +1 -1
  37. package/dist/effects/ultra.js +1 -1
  38. package/dist/env/ci.js +1 -1
  39. package/dist/env/debug.js +1 -1
  40. package/dist/env/github.js +1 -1
  41. package/dist/env/helpers.js +1 -1
  42. package/dist/env/home.js +1 -1
  43. package/dist/env/locale.js +1 -1
  44. package/dist/env/node-auth-token.js +1 -1
  45. package/dist/env/node-env.js +1 -1
  46. package/dist/env/npm.js +1 -1
  47. package/dist/env/package-manager.js +1 -1
  48. package/dist/env/path.js +1 -1
  49. package/dist/env/pre-commit.js +1 -1
  50. package/dist/env/rewire.js +1 -1
  51. package/dist/env/shell.js +1 -1
  52. package/dist/env/socket-cli-shadow.js +1 -1
  53. package/dist/env/socket-cli.js +1 -1
  54. package/dist/env/socket.js +1 -1
  55. package/dist/env/temp-dir.js +1 -1
  56. package/dist/env/term.js +1 -1
  57. package/dist/env/test.js +1 -1
  58. package/dist/env/windows.js +1 -1
  59. package/dist/env/xdg.js +1 -1
  60. package/dist/env.js +1 -1
  61. package/dist/external/@inquirer/confirm.js +16 -15
  62. package/dist/external/@inquirer/input.js +16 -15
  63. package/dist/external/@inquirer/password.js +17 -16
  64. package/dist/external/@inquirer/search.js +18 -17
  65. package/dist/external/@inquirer/select.js +19 -18
  66. package/dist/external/@npmcli/package-json/lib/read-package.js +7 -1
  67. package/dist/external/@npmcli/package-json/lib/sort.js +6 -1
  68. package/dist/external/@npmcli/package-json.js +18 -0
  69. package/dist/external/@npmcli/promise-spawn.js +2 -1
  70. package/dist/external/@socketregistry/is-unicode-supported.js +2 -1
  71. package/dist/external/@socketregistry/packageurl-js.js +3 -2
  72. package/dist/external/@socketregistry/yocto-spinner.js +5 -4
  73. package/dist/external/@yarnpkg/extensions.js +2 -1
  74. package/dist/external/cacache.js +10 -9
  75. package/dist/external/debug.js +2 -5
  76. package/dist/external/del.js +3 -2
  77. package/dist/external/fast-glob.js +3 -2
  78. package/dist/external/fast-sort.js +2 -1
  79. package/dist/external/get-east-asian-width.js +2 -1
  80. package/dist/external/libnpmexec.js +6 -0
  81. package/dist/external/libnpmpack.js +68 -71
  82. package/dist/external/make-fetch-happen.js +17 -20
  83. package/dist/external/normalize-package-data.js +3 -2
  84. package/dist/external/npm-package-arg.js +3 -2
  85. package/dist/external/pacote.js +38 -41
  86. package/dist/external/picomatch.js +2 -1
  87. package/dist/external/semver.js +2 -1
  88. package/dist/external/spdx-correct.js +2 -1
  89. package/dist/external/spdx-expression-parse.js +2 -1
  90. package/dist/external/streaming-iterables.js +2 -1
  91. package/dist/external/validate-npm-package-name.js +2 -1
  92. package/dist/external/which.js +2 -1
  93. package/dist/external/yargs-parser.js +2 -1
  94. package/dist/external/yoctocolors-cjs.js +2 -1
  95. package/dist/external/zod.js +10 -9
  96. package/dist/fs.js +1 -1
  97. package/dist/functions.js +1 -1
  98. package/dist/git.js +1 -1
  99. package/dist/github.js +1 -1
  100. package/dist/globs.js +1 -1
  101. package/dist/http-request.js +1 -1
  102. package/dist/ipc.js +1 -1
  103. package/dist/json.js +1 -1
  104. package/dist/links/index.js +1 -1
  105. package/dist/logger.d.ts +29 -4
  106. package/dist/logger.js +34 -5
  107. package/dist/maintained-node-versions.js +1 -1
  108. package/dist/memoization.js +1 -1
  109. package/dist/objects.js +1 -1
  110. package/dist/packages/editable.js +1 -1
  111. package/dist/packages/exports.js +1 -1
  112. package/dist/packages/isolation.js +1 -1
  113. package/dist/packages/licenses.js +1 -1
  114. package/dist/packages/manifest.js +1 -1
  115. package/dist/packages/normalize.js +1 -1
  116. package/dist/packages/operations.js +1 -1
  117. package/dist/packages/paths.js +1 -1
  118. package/dist/packages/provenance.js +1 -1
  119. package/dist/packages/specs.js +1 -1
  120. package/dist/packages/validation.js +1 -1
  121. package/dist/packages.js +1 -1
  122. package/dist/path.js +1 -1
  123. package/dist/paths/rewire.js +1 -1
  124. package/dist/paths.js +1 -1
  125. package/dist/performance.js +1 -1
  126. package/dist/process-lock.js +1 -1
  127. package/dist/promise-queue.js +1 -1
  128. package/dist/promises.js +1 -1
  129. package/dist/regexps.js +1 -1
  130. package/dist/sea.js +1 -1
  131. package/dist/shadow.js +1 -1
  132. package/dist/signal-exit.js +1 -1
  133. package/dist/sorts.js +1 -1
  134. package/dist/spawn.js +1 -1
  135. package/dist/spinner.js +1 -1
  136. package/dist/ssri.js +1 -1
  137. package/dist/stdio/clear.js +1 -1
  138. package/dist/stdio/divider.js +1 -1
  139. package/dist/stdio/footer.js +1 -1
  140. package/dist/stdio/header.js +1 -1
  141. package/dist/stdio/mask.js +1 -1
  142. package/dist/stdio/progress.js +1 -1
  143. package/dist/stdio/prompts.js +1 -1
  144. package/dist/stdio/stderr.js +1 -1
  145. package/dist/stdio/stdout.js +1 -1
  146. package/dist/streams.js +1 -1
  147. package/dist/strings.js +1 -1
  148. package/dist/suppress-warnings.js +1 -1
  149. package/dist/tables.js +1 -1
  150. package/dist/temporary-executor.js +1 -1
  151. package/dist/themes/context.js +1 -1
  152. package/dist/themes/index.js +1 -1
  153. package/dist/themes/themes.js +1 -1
  154. package/dist/themes/types.js +1 -1
  155. package/dist/themes/utils.js +1 -1
  156. package/dist/types.js +1 -1
  157. package/dist/url.js +1 -1
  158. package/dist/utils/get-ipc.js +1 -1
  159. package/dist/validation/json-parser.js +1 -1
  160. package/dist/validation/types.js +1 -1
  161. package/dist/versions.js +1 -1
  162. package/dist/words.js +1 -1
  163. package/dist/zod.js +1 -1
  164. package/package.json +1 -1
  165. package/dist/abort.js.map +0 -7
  166. package/dist/agent.js.map +0 -7
  167. package/dist/ansi.js.map +0 -7
  168. package/dist/argv/flags.js.map +0 -7
  169. package/dist/argv/parse.js.map +0 -7
  170. package/dist/arrays.js.map +0 -7
  171. package/dist/bin.js.map +0 -7
  172. package/dist/cacache.js.map +0 -7
  173. package/dist/cache-with-ttl.js.map +0 -7
  174. package/dist/constants/agents.js.map +0 -7
  175. package/dist/constants/core.js.map +0 -7
  176. package/dist/constants/encoding.js.map +0 -7
  177. package/dist/constants/github.js.map +0 -7
  178. package/dist/constants/licenses.js.map +0 -7
  179. package/dist/constants/node.js.map +0 -7
  180. package/dist/constants/packages.js.map +0 -7
  181. package/dist/constants/paths.js.map +0 -7
  182. package/dist/constants/platform.js.map +0 -7
  183. package/dist/constants/process.js.map +0 -7
  184. package/dist/constants/socket.js.map +0 -7
  185. package/dist/constants/testing.js.map +0 -7
  186. package/dist/constants/time.js.map +0 -7
  187. package/dist/constants/typescript.js.map +0 -7
  188. package/dist/cover/code.js.map +0 -7
  189. package/dist/cover/formatters.js.map +0 -7
  190. package/dist/cover/type.js.map +0 -7
  191. package/dist/cover/types.js.map +0 -7
  192. package/dist/debug.js.map +0 -7
  193. package/dist/dlx-binary.js.map +0 -7
  194. package/dist/dlx-manifest.js.map +0 -7
  195. package/dist/dlx-package.js.map +0 -7
  196. package/dist/dlx.js.map +0 -7
  197. package/dist/effects/pulse-frames.js.map +0 -7
  198. package/dist/effects/text-shimmer.js.map +0 -7
  199. package/dist/effects/types.js.map +0 -7
  200. package/dist/effects/ultra.js.map +0 -7
  201. package/dist/env/ci.js.map +0 -7
  202. package/dist/env/debug.js.map +0 -7
  203. package/dist/env/github.js.map +0 -7
  204. package/dist/env/helpers.js.map +0 -7
  205. package/dist/env/home.js.map +0 -7
  206. package/dist/env/locale.js.map +0 -7
  207. package/dist/env/node-auth-token.js.map +0 -7
  208. package/dist/env/node-env.js.map +0 -7
  209. package/dist/env/npm.js.map +0 -7
  210. package/dist/env/package-manager.js.map +0 -7
  211. package/dist/env/path.js.map +0 -7
  212. package/dist/env/pre-commit.js.map +0 -7
  213. package/dist/env/rewire.js.map +0 -7
  214. package/dist/env/shell.js.map +0 -7
  215. package/dist/env/socket-cli-shadow.js.map +0 -7
  216. package/dist/env/socket-cli.js.map +0 -7
  217. package/dist/env/socket.js.map +0 -7
  218. package/dist/env/temp-dir.js.map +0 -7
  219. package/dist/env/term.js.map +0 -7
  220. package/dist/env/test.js.map +0 -7
  221. package/dist/env/windows.js.map +0 -7
  222. package/dist/env/xdg.js.map +0 -7
  223. package/dist/env.js.map +0 -7
  224. package/dist/external/@npmcli/package-json/index.js +0 -1
  225. package/dist/external/@socketregistry/is-unicode-supported.d.ts +0 -2
  226. package/dist/external/@socketregistry/yocto-spinner.d.ts +0 -12
  227. package/dist/external/@yarnpkg/extensions.d.ts +0 -4
  228. package/dist/external/cacache.d.ts +0 -86
  229. package/dist/external/debug.d.ts +0 -22
  230. package/dist/external/del.d.ts +0 -1
  231. package/dist/external/fast-sort.d.ts +0 -3
  232. package/dist/external/get-east-asian-width.d.ts +0 -5
  233. package/dist/external/libnpmexec.d.ts +0 -33
  234. package/dist/external/libnpmpack.d.ts +0 -2
  235. package/dist/external/make-fetch-happen.d.ts +0 -15
  236. package/dist/external/pacote.d.ts +0 -14
  237. package/dist/external/semver.d.ts +0 -2
  238. package/dist/external/yargs-parser.d.ts +0 -2
  239. package/dist/external/yoctocolors-cjs.d.ts +0 -52
  240. package/dist/external/zod.d.ts +0 -1
  241. package/dist/fs.js.map +0 -7
  242. package/dist/functions.js.map +0 -7
  243. package/dist/git.js.map +0 -7
  244. package/dist/github.js.map +0 -7
  245. package/dist/globs.js.map +0 -7
  246. package/dist/http-request.js.map +0 -7
  247. package/dist/ipc.js.map +0 -7
  248. package/dist/json.js.map +0 -7
  249. package/dist/links/index.js.map +0 -7
  250. package/dist/logger.js.map +0 -7
  251. package/dist/maintained-node-versions.js.map +0 -7
  252. package/dist/memoization.js.map +0 -7
  253. package/dist/objects.js.map +0 -7
  254. package/dist/packages/editable.js.map +0 -7
  255. package/dist/packages/exports.js.map +0 -7
  256. package/dist/packages/isolation.js.map +0 -7
  257. package/dist/packages/licenses.js.map +0 -7
  258. package/dist/packages/manifest.js.map +0 -7
  259. package/dist/packages/normalize.js.map +0 -7
  260. package/dist/packages/operations.js.map +0 -7
  261. package/dist/packages/paths.js.map +0 -7
  262. package/dist/packages/provenance.js.map +0 -7
  263. package/dist/packages/specs.js.map +0 -7
  264. package/dist/packages/validation.js.map +0 -7
  265. package/dist/packages.js.map +0 -7
  266. package/dist/path.js.map +0 -7
  267. package/dist/paths/rewire.js.map +0 -7
  268. package/dist/paths.js.map +0 -7
  269. package/dist/performance.js.map +0 -7
  270. package/dist/process-lock.js.map +0 -7
  271. package/dist/promise-queue.js.map +0 -7
  272. package/dist/promises.js.map +0 -7
  273. package/dist/regexps.js.map +0 -7
  274. package/dist/sea.js.map +0 -7
  275. package/dist/shadow.js.map +0 -7
  276. package/dist/signal-exit.js.map +0 -7
  277. package/dist/sorts.js.map +0 -7
  278. package/dist/spawn.js.map +0 -7
  279. package/dist/spinner.js.map +0 -7
  280. package/dist/ssri.js.map +0 -7
  281. package/dist/stdio/clear.js.map +0 -7
  282. package/dist/stdio/divider.js.map +0 -7
  283. package/dist/stdio/footer.js.map +0 -7
  284. package/dist/stdio/header.js.map +0 -7
  285. package/dist/stdio/mask.js.map +0 -7
  286. package/dist/stdio/progress.js.map +0 -7
  287. package/dist/stdio/prompts.js.map +0 -7
  288. package/dist/stdio/stderr.js.map +0 -7
  289. package/dist/stdio/stdout.js.map +0 -7
  290. package/dist/streams.js.map +0 -7
  291. package/dist/strings.js.map +0 -7
  292. package/dist/suppress-warnings.js.map +0 -7
  293. package/dist/tables.js.map +0 -7
  294. package/dist/temporary-executor.js.map +0 -7
  295. package/dist/themes/context.js.map +0 -7
  296. package/dist/themes/index.js.map +0 -7
  297. package/dist/themes/themes.js.map +0 -7
  298. package/dist/themes/types.js.map +0 -7
  299. package/dist/themes/utils.js.map +0 -7
  300. package/dist/types.js.map +0 -7
  301. package/dist/url.js.map +0 -7
  302. package/dist/utils/get-ipc.js.map +0 -7
  303. package/dist/validation/json-parser.js.map +0 -7
  304. package/dist/validation/types.js.map +0 -7
  305. package/dist/versions.js.map +0 -7
  306. package/dist/words.js.map +0 -7
  307. package/dist/zod.js.map +0 -7
@@ -1,33 +1,30 @@
1
+ "use strict";
1
2
  /**
2
3
  * Bundled from make-fetch-happen
3
4
  * This is a zero-dependency bundle created by esbuild.
4
5
  */
5
- var Ch=Object.defineProperty;var o=(s,e)=>Ch(s,"name",{value:e,configurable:!0});var Ry=(s,e)=>()=>(s&&(e=s(s=0)),e);var m=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Oy=(s,e)=>{for(var t in e)Ch(s,t,{get:e[t],enumerable:!0})};var ee=m(oe=>{"use strict";var vy=oe&&oe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(oe,"__esModule",{value:!0});oe.Minipass=oe.isWritable=oe.isReadable=oe.isStream=void 0;var Ah=typeof process=="object"&&process?process:{stdout:null,stderr:null},oo=require("node:events"),Ph=vy(require("node:stream")),Iy=require("node:string_decoder"),Ty=o(s=>!!s&&typeof s=="object"&&(s instanceof Qr||s instanceof Ph.default||(0,oe.isReadable)(s)||(0,oe.isWritable)(s)),"isStream");oe.isStream=Ty;var Cy=o(s=>!!s&&typeof s=="object"&&s instanceof oo.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==Ph.default.Writable.prototype.pipe,"isReadable");oe.isReadable=Cy;var Ay=o(s=>!!s&&typeof s=="object"&&s instanceof oo.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function","isWritable");oe.isWritable=Ay;var st=Symbol("EOF"),rt=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),Wr=Symbol("emittingEnd"),js=Symbol("emittedError"),Zr=Symbol("closed"),xh=Symbol("read"),Kr=Symbol("flush"),Bh=Symbol("flushChunk"),ke=Symbol("encoding"),os=Symbol("decoder"),G=Symbol("flowing"),Hs=Symbol("paused"),as=Symbol("resume"),V=Symbol("buffer"),ne=Symbol("pipes"),W=Symbol("bufferLength"),eo=Symbol("bufferPush"),Yr=Symbol("bufferShift"),Q=Symbol("objectMode"),j=Symbol("destroyed"),to=Symbol("error"),so=Symbol("emitData"),Nh=Symbol("emitEnd"),ro=Symbol("emitEnd2"),qe=Symbol("async"),io=Symbol("abort"),Xr=Symbol("aborted"),zs=Symbol("signal"),Lt=Symbol("dataListeners"),Ee=Symbol("discarded"),Gs=o(s=>Promise.resolve().then(s),"defer"),xy=o(s=>s(),"nodefer"),By=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),Ny=o(s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBufferLike"),Py=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),Jr=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[as](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},no=class extends Jr{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},Ly=o(s=>!!s.objectMode,"isObjectModeOptions"),ky=o(s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer","isEncodingOptions"),Qr=class extends oo.EventEmitter{static{o(this,"Minipass")}[G]=!1;[Hs]=!1;[ne]=[];[V]=[];[Q];[ke];[qe];[os];[st]=!1;[_t]=!1;[Wr]=!1;[Zr]=!1;[js]=null;[W]=0;[j]=!1;[zs];[Xr]=!1;[Lt]=0;[Ee]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Ly(t)?(this[Q]=!0,this[ke]=null):ky(t)?(this[ke]=t.encoding,this[Q]=!1):(this[Q]=!1,this[ke]=null),this[qe]=!!t.async,this[os]=this[ke]?new Iy.StringDecoder(this[ke]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[V],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[ne],"get")});let{signal:r}=t;r&&(this[zs]=r,r.aborted?this[io]():r.addEventListener("abort",()=>this[io]()))}get bufferLength(){return this[W]}get encoding(){return this[ke]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Q]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[qe]}set async(e){this[qe]=this[qe]||!!e}[io](){this[Xr]=!0,this.emit("abort",this[zs]?.reason),this.destroy(this[zs]?.reason)}get aborted(){return this[Xr]}set aborted(e){}write(e,t,r){if(this[Xr])return!1;if(this[st])throw new Error("write after end");if(this[j])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[qe]?Gs:xy;if(!this[Q]&&!Buffer.isBuffer(e)){if(Py(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Ny(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Q]?(this[G]&&this[W]!==0&&this[Kr](!0),this[G]?this.emit("data",e):this[eo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this[G]):e.length?(typeof e=="string"&&!(t===this[ke]&&!this[os]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ke]&&(e=this[os].write(e)),this[G]&&this[W]!==0&&this[Kr](!0),this[G]?this.emit("data",e):this[eo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this[G]):(this[W]!==0&&this.emit("readable"),r&&i(r),this[G])}read(e){if(this[j])return null;if(this[Ee]=!1,this[W]===0||e===0||e&&e>this[W])return this[rt](),null;this[Q]&&(e=null),this[V].length>1&&!this[Q]&&(this[V]=[this[ke]?this[V].join(""):Buffer.concat(this[V],this[W])]);let t=this[xh](e||null,this[V][0]);return this[rt](),t}[xh](e,t){if(this[Q])this[Yr]();else{let r=t;e===r.length||e===null?this[Yr]():typeof r=="string"?(this[V][0]=r.slice(e),t=r.slice(0,e),this[W]-=e):(this[V][0]=r.subarray(e),t=r.subarray(0,e),this[W]-=e)}return this.emit("data",t),!this[V].length&&!this[st]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[st]=!0,this.writable=!1,(this[G]||!this[Hs])&&this[rt](),this}[as](){this[j]||(!this[Lt]&&!this[ne].length&&(this[Ee]=!0),this[Hs]=!1,this[G]=!0,this.emit("resume"),this[V].length?this[Kr]():this[st]?this[rt]():this.emit("drain"))}resume(){return this[as]()}pause(){this[G]=!1,this[Hs]=!0,this[Ee]=!1}get destroyed(){return this[j]}get flowing(){return this[G]}get paused(){return this[Hs]}[eo](e){this[Q]?this[W]+=1:this[W]+=e.length,this[V].push(e)}[Yr](){return this[Q]?this[W]-=1:this[W]-=this[V][0].length,this[V].shift()}[Kr](e=!1){do;while(this[Bh](this[Yr]())&&this[V].length);!e&&!this[V].length&&!this[st]&&this.emit("drain")}[Bh](e){return this.emit("data",e),this[G]}pipe(e,t){if(this[j])return e;this[Ee]=!1;let r=this[_t];return t=t||{},e===Ah.stdout||e===Ah.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[ne].push(t.proxyErrors?new no(this,e,t):new Jr(this,e,t)),this[qe]?Gs(()=>this[as]()):this[as]()),e}unpipe(e){let t=this[ne].find(r=>r.dest===e);t&&(this[ne].length===1?(this[G]&&this[Lt]===0&&(this[G]=!1),this[ne]=[]):this[ne].splice(this[ne].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[Ee]=!1,this[Lt]++,!this[ne].length&&!this[G]&&this[as]();else if(e==="readable"&&this[W]!==0)super.emit("readable");else if(By(e)&&this[_t])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[js]){let i=t;this[qe]?Gs(()=>i.call(this,this[js])):i.call(this,this[js])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Lt]=this.listeners("data").length,this[Lt]===0&&!this[Ee]&&!this[ne].length&&(this[G]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Lt]=0,!this[Ee]&&!this[ne].length&&(this[G]=!1)),t}get emittedEnd(){return this[_t]}[rt](){!this[Wr]&&!this[_t]&&!this[j]&&this[V].length===0&&this[st]&&(this[Wr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Zr]&&this.emit("close"),this[Wr]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==j&&this[j])return!1;if(e==="data")return!this[Q]&&!r?!1:this[qe]?(Gs(()=>this[so](r)),!0):this[so](r);if(e==="end")return this[Nh]();if(e==="close"){if(this[Zr]=!0,!this[_t]&&!this[j])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[js]=r,super.emit(to,r);let n=!this[zs]||this.listeners("error").length?super.emit("error",r):!1;return this[rt](),n}else if(e==="resume"){let n=super.emit("resume");return this[rt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...t);return this[rt](),i}[so](e){for(let r of this[ne])r.dest.write(e)===!1&&this.pause();let t=this[Ee]?!1:super.emit("data",e);return this[rt](),t}[Nh](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[qe]?(Gs(()=>this[ro]()),!0):this[ro]())}[ro](){if(this[os]){let t=this[os].end();if(t){for(let r of this[ne])r.dest.write(t);this[Ee]||super.emit("data",t)}}for(let t of this[ne])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Q]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Q]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Q])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[ke]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(j,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ee]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[st])return t();let n,a,c=o(f=>{this.off("data",h),this.off("end",u),this.off(j,l),t(),a(f)},"onerr"),h=o(f=>{this.off("error",c),this.off("end",u),this.off(j,l),this.pause(),n({value:f,done:!!this[st]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",h),this.off(j,l),t(),n({done:!0,value:void 0})},"onend"),l=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,d)=>{a=d,n=f,this.once(j,l),this.once("error",c),this.once("end",u),this.once("data",h)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ee]=!1;let e=!1,t=o(()=>(this.pause(),this.off(to,t),this.off(j,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(to,t),this.once(j,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[j])return e?this.emit("error",e):this.emit(j),this;this[j]=!0,this[Ee]=!0,this[V].length=0,this[W]=0;let t=this;return typeof t.close=="function"&&!this[Zr]&&t.close(),e?this.emit("error",e):this.emit(j),this}static get isStream(){return oe.isStream}};oe.Minipass=Qr});var ao=m(cs=>{"use strict";var Dy=cs&&cs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(cs,"__esModule",{value:!0});cs.constants=void 0;var Fy=Dy(require("zlib")),My=Fy.default.constants||{ZLIB_VERNUM:4736};cs.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},My))});var Dh=m(B=>{"use strict";var $y=B&&B.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),qy=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Uy=B&&B.__importStar||(function(){var s=o(function(e){return s=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},s(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=s(e),i=0;i<r.length;i++)r[i]!=="default"&&$y(t,e,r[i]);return qy(t,e),t}})(),jy=B&&B.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(B,"__esModule",{value:!0});B.ZstdDecompress=B.ZstdCompress=B.BrotliDecompress=B.BrotliCompress=B.Unzip=B.InflateRaw=B.DeflateRaw=B.Gunzip=B.Gzip=B.Inflate=B.Deflate=B.Zlib=B.ZlibError=B.constants=void 0;var uo=jy(require("assert")),kt=require("buffer"),Hy=ee(),Lh=Uy(require("zlib")),Ue=ao(),zy=ao();Object.defineProperty(B,"constants",{enumerable:!0,get:o(function(){return zy.constants},"get")});var Gy=kt.Buffer.concat,kh=Object.getOwnPropertyDescriptor(kt.Buffer,"concat"),Vy=o(s=>s,"noop"),co=kh?.writable===!0||kh?.set!==void 0?s=>{kt.Buffer.concat=s?Vy:Gy}:s=>{},Dt=Symbol("_superWrite"),Ft=class extends Error{static{o(this,"ZlibError")}code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};B.ZlibError=Ft;var ho=Symbol("flushFlag"),Vs=class extends Hy.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#s;#r;#i;#a;#l;get sawError(){return this.#e}get handle(){return this.#a}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#r=e.finishFlush??0,this.#i=e.fullFlushFlag??0,typeof Lh[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#a=new Lh[t](e)}catch(r){throw new Ft(r,this.constructor)}this.#l=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#a?.on("error",r=>this.#l(new Ft(r))),this.once("end",()=>this.close)}close(){this.#a&&(this.#a.close(),this.#a=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,uo.default)(this.#a,"zlib binding closed"),this.#a.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#i),this.write(Object.assign(kt.Buffer.alloc(0),{[ho]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Dt](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=kt.Buffer.from(e,t)),this.#e)return;(0,uo.default)(this.#a,"zlib binding closed");let i=this.#a._handle,n=i.close;i.close=()=>{};let a=this.#a.close;this.#a.close=()=>{},co(!0);let c;try{let u=typeof e[ho]=="number"?e[ho]:this.#s;c=this.#a._processChunk(e,u),co(!1)}catch(u){co(!1),this.#l(new Ft(u,this.write))}finally{this.#a&&(this.#a._handle=i,i.close=n,this.#a.close=a,this.#a.removeAllListeners("error"))}this.#a&&this.#a.on("error",u=>this.#l(new Ft(u,this.write)));let h;if(c)if(Array.isArray(c)&&c.length>0){let u=c[0];h=this[Dt](kt.Buffer.from(u));for(let l=1;l<c.length;l++)h=this[Dt](c[l])}else h=this[Dt](kt.Buffer.from(c));return r&&r(),h}},je=class extends Vs{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||Ue.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Ue.constants.Z_FINISH,e.fullFlushFlag=Ue.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#t=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#t!==t){this.flush(Ue.constants.Z_SYNC_FLUSH),(0,uo.default)(this.handle,"zlib binding closed");let r=this.handle.flush;this.handle.flush=(i,n)=>{typeof i=="function"&&(n=i,i=this.flushFlag),this.flush(i),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=r}this.handle&&(this.#e=e,this.#t=t)}}}};B.Zlib=je;var lo=class extends je{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};B.Deflate=lo;var fo=class extends je{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};B.Inflate=fo;var po=class extends je{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Dt](e){return this.#e?(this.#e=!1,e[9]=255,super[Dt](e)):super[Dt](e)}};B.Gzip=po;var mo=class extends je{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};B.Gunzip=mo;var go=class extends je{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};B.DeflateRaw=go;var yo=class extends je{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};B.InflateRaw=yo;var Eo=class extends je{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};B.Unzip=Eo;var ei=class extends Vs{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||Ue.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Ue.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=Ue.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},wo=class extends ei{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};B.BrotliCompress=wo;var So=class extends ei{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};B.BrotliDecompress=So;var ti=class extends Vs{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||Ue.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||Ue.constants.ZSTD_e_end,e.fullFlushFlag=Ue.constants.ZSTD_e_flush,super(e,t)}},_o=class extends ti{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};B.ZstdCompress=_o;var bo=class extends ti{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};B.ZstdDecompress=bo});var ai=m((qA,Gh)=>{"use strict";var Fh=typeof process=="object"&&process?process:{stdout:null,stderr:null},Wy=require("events"),Mh=require("stream"),$h=require("string_decoder").StringDecoder,it=Symbol("EOF"),nt=Symbol("maybeEmitEnd"),bt=Symbol("emittedEnd"),si=Symbol("emittingEnd"),Ws=Symbol("emittedError"),ri=Symbol("closed"),qh=Symbol("read"),ii=Symbol("flush"),Uh=Symbol("flushChunk"),le=Symbol("encoding"),ot=Symbol("decoder"),ni=Symbol("flowing"),Zs=Symbol("paused"),hs=Symbol("resume"),Z=Symbol("bufferLength"),Ro=Symbol("bufferPush"),Oo=Symbol("bufferShift"),te=Symbol("objectMode"),se=Symbol("destroyed"),vo=Symbol("emitData"),jh=Symbol("emitEnd"),Io=Symbol("emitEnd2"),at=Symbol("async"),Ks=o(s=>Promise.resolve().then(s),"defer"),Hh=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Zy=Hh&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ky=Hh&&Symbol.iterator||Symbol("iterator not implemented"),Yy=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),Xy=o(s=>s instanceof ArrayBuffer||typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBuffer"),Jy=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),oi=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[hs](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},To=class extends oi{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Gh.exports=class zh extends Mh{static{o(this,"Minipass")}constructor(e){super(),this[ni]=!1,this[Zs]=!1,this.pipes=[],this.buffer=[],this[te]=e&&e.objectMode||!1,this[te]?this[le]=null:this[le]=e&&e.encoding||null,this[le]==="buffer"&&(this[le]=null),this[at]=e&&!!e.async||!1,this[ot]=this[le]?new $h(this[le]):null,this[it]=!1,this[bt]=!1,this[si]=!1,this[ri]=!1,this[Ws]=null,this.writable=!0,this.readable=!0,this[Z]=0,this[se]=!1}get bufferLength(){return this[Z]}get encoding(){return this[le]}set encoding(e){if(this[te])throw new Error("cannot set encoding in objectMode");if(this[le]&&e!==this[le]&&(this[ot]&&this[ot].lastNeed||this[Z]))throw new Error("cannot change encoding");this[le]!==e&&(this[ot]=e?new $h(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[ot].write(t)))),this[le]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[te]}set objectMode(e){this[te]=this[te]||!!e}get async(){return this[at]}set async(e){this[at]=this[at]||!!e}write(e,t,r){if(this[it])throw new Error("write after end");if(this[se])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[at]?Ks:n=>n();return!this[te]&&!Buffer.isBuffer(e)&&(Jy(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Xy(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[te]?(this.flowing&&this[Z]!==0&&this[ii](!0),this.flowing?this.emit("data",e):this[Ro](e),this[Z]!==0&&this.emit("readable"),r&&i(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[le]&&!this[ot].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[le]&&(e=this[ot].write(e)),this.flowing&&this[Z]!==0&&this[ii](!0),this.flowing?this.emit("data",e):this[Ro](e),this[Z]!==0&&this.emit("readable"),r&&i(r),this.flowing):(this[Z]!==0&&this.emit("readable"),r&&i(r),this.flowing)}read(e){if(this[se])return null;if(this[Z]===0||e===0||e>this[Z])return this[nt](),null;this[te]&&(e=null),this.buffer.length>1&&!this[te]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Z])]);let t=this[qh](e||null,this.buffer[0]);return this[nt](),t}[qh](e,t){return e===t.length||e===null?this[Oo]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Z]-=e),this.emit("data",t),!this.buffer.length&&!this[it]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[it]=!0,this.writable=!1,(this.flowing||!this[Zs])&&this[nt](),this}[hs](){this[se]||(this[Zs]=!1,this[ni]=!0,this.emit("resume"),this.buffer.length?this[ii]():this[it]?this[nt]():this.emit("drain"))}resume(){return this[hs]()}pause(){this[ni]=!1,this[Zs]=!0}get destroyed(){return this[se]}get flowing(){return this[ni]}get paused(){return this[Zs]}[Ro](e){this[te]?this[Z]+=1:this[Z]+=e.length,this.buffer.push(e)}[Oo](){return this.buffer.length&&(this[te]?this[Z]-=1:this[Z]-=this.buffer[0].length),this.buffer.shift()}[ii](e){do;while(this[Uh](this[Oo]()));!e&&!this.buffer.length&&!this[it]&&this.emit("drain")}[Uh](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[se])return;let r=this[bt];return t=t||{},e===Fh.stdout||e===Fh.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new To(this,e,t):new oi(this,e,t)),this[at]?Ks(()=>this[hs]()):this[hs]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[hs]():e==="readable"&&this[Z]!==0?super.emit("readable"):Yy(e)&&this[bt]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ws]&&(this[at]?Ks(()=>t.call(this,this[Ws])):t.call(this,this[Ws])),r}get emittedEnd(){return this[bt]}[nt](){!this[si]&&!this[bt]&&!this[se]&&this.buffer.length===0&&this[it]&&(this[si]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ri]&&this.emit("close"),this[si]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==se&&this[se])return;if(e==="data")return t?this[at]?Ks(()=>this[vo](t)):this[vo](t):!1;if(e==="end")return this[jh]();if(e==="close"){if(this[ri]=!0,!this[bt]&&!this[se])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ws]=t;let n=super.emit("error",t);return this[nt](),n}else if(e==="resume"){let n=super.emit("resume");return this[nt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...r);return this[nt](),i}[vo](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[nt](),t}[jh](){this[bt]||(this[bt]=!0,this.readable=!1,this[at]?Ks(()=>this[Io]()):this[Io]())}[Io](){if(this[ot]){let t=this[ot].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[te]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[te]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[te]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[te]?Promise.reject(new Error("cannot concat in objectMode")):this[le]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(se,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Zy](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[it])return Promise.resolve({done:!0});let r=null,i=null,n=o(u=>{this.removeListener("data",a),this.removeListener("end",c),i(u)},"onerr"),a=o(u=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:u,done:!!this[it]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),h=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((u,l)=>{i=l,r=u,this.once(se,h),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[Ky](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[se]?(e?this.emit("error",e):this.emit(se),this):(this[se]=!0,this.buffer.length=0,this[Z]=0,typeof this.close=="function"&&!this[ri]&&this.close(),e?this.emit("error",e):this.emit(se),this)}static isStream(e){return!!e&&(e instanceof zh||e instanceof Mh||e instanceof Wy&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Wh=m((jA,Vh)=>{var Qy=ai(),Ys=class extends Error{static{o(this,"SizeError")}constructor(e,t){super(`Bad data size: expected ${t} bytes, but got ${e}`),this.expect=t,this.found=e,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}},ci=class extends Qy{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let i=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(i)?(this.found+=i.length,this.found>this.expect&&this.emit("error",new Ys(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new Ys(this.found,this.expect)),super.emit(e,...t)}};ci.SizeError=Ys;Vh.exports=ci});var Kh=m((zA,Zh)=>{"use strict";var{Minipass:eE}=ee(),Co=Symbol("type"),ct=Symbol("buffer"),hi=class s{static{o(this,"Blob")}constructor(e,t){this[Co]="";let r=[],i=0;if(e){let a=e,c=Number(a.length);for(let h=0;h<c;h++){let u=a[h],l=u instanceof Buffer?u:ArrayBuffer.isView(u)?Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?Buffer.from(u):u instanceof s?u[ct]:typeof u=="string"?Buffer.from(u):Buffer.from(String(u));i+=l.length,r.push(l)}}this[ct]=Buffer.concat(r,i);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[Co]=n)}get size(){return this[ct].length}get type(){return this[Co]}text(){return Promise.resolve(this[ct].toString())}arrayBuffer(){let e=this[ct],t=e.byteOffset,r=e.byteLength,i=e.buffer.slice(t,t+r);return Promise.resolve(i)}stream(){return new eE().end(this[ct])}slice(e,t,r){let i=this.size,n=e===void 0?0:e<0?Math.max(i+e,0):Math.min(e,i),a=t===void 0?i:t<0?Math.max(i+t,0):Math.min(t,i),c=Math.max(a-n,0),u=this[ct].slice(n,n+c),l=new s([],{type:r});return l[ct]=u,l}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return ct}};Object.defineProperties(hi.prototype,{size:{enumerable:!0},type:{enumerable:!0}});Zh.exports=hi});var xo=m((VA,Yh)=>{"use strict";var Ao=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};Yh.exports=Ao});var Jh=m((ZA,Xh)=>{Xh.exports={}});var li=m((KA,tu)=>{"use strict";var{Minipass:He}=ee(),Bo=Wh(),eu=Kh(),{BUFFER:tE}=eu,Xs=xo(),No;try{No=Jh().convert}catch{}var ht=Symbol("Body internals"),Mt=Symbol("consumeBody"),ui=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:i=0}=t,n=e==null?null:Qh(e)?Buffer.from(e.toString()):Js(e)||Buffer.isBuffer(e)?e:Object.prototype.toString.call(e)==="[object ArrayBuffer]"?Buffer.from(e):ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):He.isStream(e)?e:Buffer.from(String(e));this[ht]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=i,He.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Xs(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[ht].error=c})}get body(){return this[ht].body}get bodyUsed(){return this[ht].disturbed}arrayBuffer(){return this[Mt]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Mt]().then(t=>Object.assign(new eu([],{type:e.toLowerCase()}),{[tE]:t}))}async json(){let e=await this[Mt]();try{return JSON.parse(e.toString())}catch(t){throw new Xs(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Mt]().then(e=>e.toString())}buffer(){return this[Mt]()}textConverted(){return this[Mt]().then(e=>sE(e,this.headers))}[Mt](){if(this[ht].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[ht].disturbed=!0,this[ht].error)return Promise.reject(this[ht].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=Js(this.body)?this.body.stream():this.body;if(!He.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof Bo||!this.size&&e instanceof He&&!(e instanceof Bo)?e:this.size?new Bo({size:this.size}):new He,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Xs(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(i=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),i()}).then(()=>t.concat()).then(i=>(clearTimeout(r),i)).catch(i=>{throw clearTimeout(r),i.name==="AbortError"||i.name==="FetchError"?i:i.name==="RangeError"?new Xs(`Could not create Buffer from response body for ${this.url}: ${i.message}`,"system",i):new Xs(`Invalid response body while trying to fetch ${this.url}: ${i.message}`,"system",i)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(He.isStream(t)&&typeof t.getBoundary!="function"){let r=new He,i=new He,n=new He;return r.on("error",a=>{i.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(i),r.pipe(n),t.pipe(r),e[ht].body=i,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":Qh(e)?"application/x-www-form-urlencoded;charset=UTF-8":Js(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:He.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:Js(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(Js(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(ui.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var Qh=o(s=>typeof s!="object"||typeof s.append!="function"||typeof s.delete!="function"||typeof s.get!="function"||typeof s.getAll!="function"||typeof s.has!="function"||typeof s.set!="function"?!1:s.constructor.name==="URLSearchParams"||Object.prototype.toString.call(s)==="[object URLSearchParams]"||typeof s.sort=="function","isURLSearchParams"),Js=o(s=>typeof s=="object"&&typeof s.arrayBuffer=="function"&&typeof s.type=="string"&&typeof s.stream=="function"&&typeof s.constructor=="function"&&typeof s.constructor.name=="string"&&/^(Blob|File)$/.test(s.constructor.name)&&/^(Blob|File)$/.test(s[Symbol.toStringTag]),"isBlob"),sE=o((s,e)=>{if(typeof No!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",i;t&&(i=/charset=([^;]*)/i.exec(t));let n=s.slice(0,1024).toString();return!i&&n&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!i&&n&&(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),i||(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),i&&i.pop()),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&n&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),i&&(r=i.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),No(s,"UTF-8",r).toString()},"convertBody");tu.exports=ui});var di=m((XA,iu)=>{"use strict";var ru=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Lo=/[^\t\x20-\x7e\x80-\xff]/,Qs=o(s=>{if(s=`${s}`,ru.test(s)||s==="")throw new TypeError(`${s} is not a legal HTTP header name`)},"validateName"),su=o(s=>{if(s=`${s}`,Lo.test(s))throw new TypeError(`${s} is not a legal HTTP header value`)},"validateValue"),us=o((s,e)=>{e=e.toLowerCase();for(let t in s)if(t.toLowerCase()===e)return t},"find"),H=Symbol("map"),fi=class s{static{o(this,"Headers")}constructor(e=void 0){if(this[H]=Object.create(null),e instanceof s){let t=e.raw(),r=Object.keys(t);for(let i of r)for(let n of t[i])this.append(i,n);return}if(e!=null)if(typeof e=="object"){let t=e[Symbol.iterator];if(t!=null){if(typeof t!="function")throw new TypeError("Header pairs must be iterable");let r=[];for(let i of e){if(typeof i!="object"||typeof i[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(i);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");r.push(n)}for(let i of r)this.append(i[0],i[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Qs(e);let t=us(this[H],e);return t===void 0?null:this[H][t].join(", ")}forEach(e,t=void 0){let r=ko(this);for(let i=0;i<r.length;i++){let[n,a]=r[i];e.call(t,a,n,this),r=ko(this)}}set(e,t){e=`${e}`,t=`${t}`,Qs(e),su(t);let r=us(this[H],e);this[H][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,Qs(e),su(t);let r=us(this[H],e);r!==void 0?this[H][r].push(t):this[H][e]=[t]}has(e){return e=`${e}`,Qs(e),us(this[H],e)!==void 0}delete(e){e=`${e}`,Qs(e);let t=us(this[H],e);t!==void 0&&delete this[H][t]}raw(){return this[H]}keys(){return new $t(this,"key")}values(){return new $t(this,"value")}[Symbol.iterator](){return new $t(this,"key+value")}entries(){return new $t(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[H]),r=us(e[H],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new s;for(let r of Object.keys(e))if(!ru.test(r))if(Array.isArray(e[r]))for(let i of e[r])Lo.test(i)||(t[H][r]===void 0?t[H][r]=[i]:t[H][r].push(i));else Lo.test(e[r])||(t[H][r]=[e[r]]);return t}};Object.defineProperties(fi.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});var ko=o((s,e="key+value")=>Object.keys(s[H]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>s[H][t].join(", "):t=>[t.toLowerCase(),s[H][t].join(", ")]),"getHeaders"),Po=Symbol("internal"),$t=class s{static{o(this,"HeadersIterator")}constructor(e,t){this[Po]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==s.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[Po],i=ko(e,t),n=i.length;return r>=n?{value:void 0,done:!0}:(this[Po].index++,{value:i[r],done:!1})}};Object.setPrototypeOf($t.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));iu.exports=fi});var cu=m((QA,au)=>{"use strict";var rE=require("http"),{STATUS_CODES:iE}=rE,nu=di(),ou=li(),{clone:nE,extractContentType:oE}=ou,ut=Symbol("Response internals"),pi=class s extends ou{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,i=new nu(t.headers);if(e!=null&&!i.has("Content-Type")){let n=oE(e);n&&i.append("Content-Type",n)}this[ut]={url:t.url,status:r,statusText:t.statusText||iE[r],headers:i,counter:t.counter,trailer:Promise.resolve(t.trailer||new nu)}}get trailer(){return this[ut].trailer}get url(){return this[ut].url||""}get status(){return this[ut].status}get ok(){return this[ut].status>=200&&this[ut].status<300}get redirected(){return this[ut].counter>0}get statusText(){return this[ut].statusText}get headers(){return this[ut].headers}clone(){return new s(nE(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}};au.exports=pi;Object.defineProperties(pi.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var hu=m((tx,aE)=>{aE.exports={name:"minipass-fetch",version:"4.0.1",description:"An implementation of window.fetch in Node.js using Minipass streams",license:"MIT",main:"lib/index.js",scripts:{"test:tls-fixtures":"./test/fixtures/tls/setup.sh",test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{"coverage-map":"map.js","check-coverage":!0,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.3","@ungap/url-search-params":"^0.2.2","abort-controller":"^3.0.0","abortcontroller-polyfill":"~1.7.3",encoding:"^0.1.13","form-data":"^4.0.0",nock:"^13.2.4",parted:"^0.1.1","string-to-arraybuffer":"^1.0.2",tap:"^16.0.0"},dependencies:{minipass:"^7.0.3","minipass-sized":"^1.0.3",minizlib:"^3.0.1"},optionalDependencies:{encoding:"^0.1.13"},repository:{type:"git",url:"git+https://github.com/npm/minipass-fetch.git"},keywords:["fetch","minipass","node-fetch","window.fetch"],files:["bin/","lib/"],engines:{node:"^18.17.0 || >=20.5.0"},author:"GitHub Inc.",templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.3",publish:"true"}}});var fu=m((sx,lu)=>{"use strict";var{URL:Do}=require("url"),{Minipass:cE}=ee(),Fo=di(),{exportNodeCompatibleHeaders:hE}=Fo,uu=li(),{clone:uE,extractContentType:lE,getTotalBytes:fE}=uu,dE=hu().version,pE=`minipass-fetch/${dE} (+https://github.com/isaacs/minipass-fetch)`,De=Symbol("Request internals"),mi=o(s=>typeof s=="object"&&typeof s[De]=="object","isRequest"),mE=o(s=>{let e=s&&typeof s=="object"&&Object.getPrototypeOf(s);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),gi=class s extends uu{static{o(this,"Request")}constructor(e,t={}){let r=mi(e)?new Do(e.url):e&&e.href?new Do(e.href):new Do(`${e}`);mi(e)?t={...e[De],...t}:(!e||typeof e=="string")&&(e={});let i=(t.method||e.method||"GET").toUpperCase(),n=i==="GET"||i==="HEAD";if((t.body!==null&&t.body!==void 0||mi(e)&&e.body!==null)&&n)throw new TypeError("Request with GET/HEAD method cannot have body");let a=t.body!==null&&t.body!==void 0?t.body:mi(e)&&e.body!==null?uE(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Fo(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let tt=lE(a);tt&&c.append("Content-Type",tt)}let h="signal"in t?t.signal:null;if(h!=null&&!mE(h))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:y,ecdhCurve:g,family:w,honorCipherOrder:S,key:I,passphrase:T,pfx:_,rejectUnauthorized:O=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:A,secureProtocol:P,servername:z,sessionIdContext:ue}=t;this[De]={method:i,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:h,ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:y,ecdhCurve:g,family:w,honorCipherOrder:S,key:I,passphrase:T,pfx:_,rejectUnauthorized:O,secureOptions:A,secureProtocol:P,servername:z,sessionIdContext:ue},this.follow=t.follow!==void 0?t.follow:e.follow!==void 0?e.follow:20,this.compress=t.compress!==void 0?t.compress:e.compress!==void 0?e.compress:!0,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent}get method(){return this[De].method}get url(){return this[De].parsedURL.toString()}get headers(){return this[De].headers}get redirect(){return this[De].redirect}get signal(){return this[De].signal}clone(){return new s(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[De].parsedURL,r=new Fo(e[De].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&cE.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let i=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?fE(e):null;i&&r.set("Content-Length",i+""),r.has("User-Agent")||r.set("User-Agent",pE),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:y,key:g,passphrase:w,pfx:S,rejectUnauthorized:I,secureOptions:T,secureProtocol:_,servername:O,sessionIdContext:A}=e[De];return{...{auth:t.username||t.password?`${t.username}:${t.password}`:"",host:t.host,hostname:t.hostname,path:`${t.pathname}${t.search}`,port:t.port,protocol:t.protocol},method:e.method,headers:hE(r),agent:n,ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:y,key:g,passphrase:w,pfx:S,rejectUnauthorized:I,secureOptions:T,secureProtocol:_,servername:O,sessionIdContext:A,timeout:e.timeout}}};lu.exports=gi;Object.defineProperties(gi.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var pu=m((ix,du)=>{"use strict";var Mo=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(e){}};du.exports=Mo});var sr=m((ox,yu)=>{"use strict";var{URL:er}=require("url"),gE=require("http"),yE=require("https"),ls=Dh(),{Minipass:mu}=ee(),EE=li(),{writeToStream:wE,getTotalBytes:SE}=EE,qt=cu(),qo=di(),{createHeadersLenient:gu}=qo,tr=fu(),{getNodeRequestOptions:_E}=tr,Rt=xo(),$o=pu(),lt=o(async(s,e)=>{if(/^data:/.test(s)){let t=new tr(s,e);return Promise.resolve().then(()=>new Promise((r,i)=>{let n,a;try{let{pathname:u,search:l}=new er(s),f=u.split(",");if(f.length<2)throw new Error("invalid data: URI");let d=f.shift(),p=/;base64$/.test(d);n=p?d.slice(0,-7):d;let y=decodeURIComponent(f.join(",")+l);a=p?Buffer.from(y,"base64"):Buffer.from(y)}catch(u){return i(new Rt(`[${t.method}] ${t.url} invalid URL, ${u.message}`,"system",u))}let{signal:c}=t;if(c&&c.aborted)return i(new $o("The user aborted a request."));let h={"Content-Length":a.length};return n&&(h["Content-Type"]=n),r(new qt(a,{headers:h}))}))}return new Promise((t,r)=>{let i=new tr(s,e),n;try{n=_E(i)}catch(y){return r(y)}let a=(n.protocol==="https:"?yE:gE).request,{signal:c}=i,h=null,u=o(()=>{let y=new $o("The user aborted a request.");r(y),mu.isStream(i.body)&&typeof i.body.destroy=="function"&&i.body.destroy(y),h&&h.body&&h.body.emit("error",y)},"abort");if(c&&c.aborted)return u();let l=o(()=>{u(),f()},"abortAndFinalize"),f=o(()=>{d.abort(),c&&c.removeEventListener("abort",l),clearTimeout(p)},"finalize"),d=a(n);c&&c.addEventListener("abort",l);let p=null;i.timeout&&d.once("socket",()=>{p=setTimeout(()=>{r(new Rt(`network timeout at: ${i.url}`,"request-timeout")),f()},i.timeout)}),d.on("error",y=>{d.res&&d.res.emit("error",y),r(new Rt(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),f()}),d.on("response",y=>{clearTimeout(p);let g=gu(y.headers);if(lt.isRedirect(y.statusCode)){let O=g.get("Location"),A=null;try{A=O===null?null:new er(O,i.url).toString()}catch{if(i.redirect!=="manual"){r(new Rt(`uri requested responds with an invalid redirect URL: ${O}`,"invalid-redirect")),f();return}}if(i.redirect==="error"){r(new Rt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),f();return}else if(i.redirect==="manual"){if(A!==null)try{g.set("Location",A)}catch(P){r(P)}}else if(i.redirect==="follow"&&A!==null){if(i.counter>=i.follow){r(new Rt(`maximum redirect reached at: ${i.url}`,"max-redirect")),f();return}if(y.statusCode!==303&&i.body&&SE(i)===null){r(new Rt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}i.headers.set("host",new er(A).host);let P={headers:new qo(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout},z=new er(i.url),ue=new er(A);z.hostname!==ue.hostname&&(P.headers.delete("authorization"),P.headers.delete("cookie")),(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(P.method="GET",P.body=void 0,P.headers.delete("content-length")),t(lt(new tr(A,P))),f();return}}y.once("end",()=>c&&c.removeEventListener("abort",l));let w=new mu;w.on("error",f),y.on("error",O=>w.emit("error",O)),y.on("data",O=>w.write(O)),y.on("end",()=>w.end());let S={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:g,size:i.size,timeout:i.timeout,counter:i.counter,trailer:new Promise(O=>y.on("end",()=>O(gu(y.trailers))))},I=g.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||I===null||y.statusCode===204||y.statusCode===304){h=new qt(w,S),t(h);return}let T={flush:ls.constants.Z_SYNC_FLUSH,finishFlush:ls.constants.Z_SYNC_FLUSH};if(I==="gzip"||I==="x-gzip"){let O=new ls.Gunzip(T);h=new qt(w.on("error",A=>O.emit("error",A)).pipe(O),S),t(h);return}if(I==="deflate"||I==="x-deflate"){y.once("data",O=>{let A=(O[0]&15)===8?new ls.Inflate:new ls.InflateRaw;w.on("error",P=>A.emit("error",P)).pipe(A),h=new qt(A,S),t(h)});return}if(I==="br"){try{var _=new ls.BrotliDecompress}catch(O){r(O),f();return}w.on("error",O=>_.emit("error",O)).pipe(_),h=new qt(_,S),t(h);return}h=new qt(w,S),t(h)}),wE(d,i)})},"fetch");yu.exports=lt;lt.isRedirect=s=>s===301||s===302||s===303||s===307||s===308;lt.Headers=qo;lt.Request=tr;lt.Response=qt;lt.FetchError=Rt;lt.AbortError=$o});var wu=m((cx,Eu)=>{var bE=require("dns"),RE=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],OE=o(s=>{let{strictSSL:e,...t}={...s};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:bE.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(i=>RE.includes(i.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");Eu.exports=OE});var _u=m((lx,Su)=>{"use strict";var vE=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),IE=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),TE=new Set([500,502,503,504]),CE={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},AE={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function ft(s){let e=parseInt(s,10);return isFinite(e)?e:0}o(ft,"toNumberOrZero");function xE(s){return s?TE.has(s.status):!0}o(xE,"isErrorResponse");function Uo(s){let e={};if(!s)return e;let t=s.trim().split(/,/);for(let r of t){let[i,n]=r.split(/=/,2);e[i.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(Uo,"parseCacheControl");function BE(s){let e=[];for(let t in s){let r=s[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(BE,"formatCacheControl");Su.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,cacheHeuristic:i,immutableMinTimeToLive:n,ignoreCargoCult:a,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=r!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=Uo(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=Uo(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":BE(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&IE.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||vE.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=Uo(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>ft(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<ft(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)CE[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let i of r)delete t[i]}if(t.warning){let r=t.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return ft(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return ft(this._rescc["s-maxage"])}if(this._rescc["max-age"])return ft(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+ft(this._rescc["stale-if-error"]),r=e+ft(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+ft(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=ft(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let i=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));i.length?t["if-none-match"]=i.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&xE(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let i={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,i),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!AE[c]?t.headers[c]:this._resHeaders[c];let a=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,a,i),modified:!1,matches:!0}}}});var vu=m((dx,jo)=>{"use strict";jo.exports=Ou;jo.exports.preferredCharsets=Ou;var NE=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function PE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=LE(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(PE,"parseAcceptCharset");function LE(s,e){var t=NE.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{charset:r,q:i,i:e}}o(LE,"parseCharset");function kE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=DE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(kE,"getCharsetPriority");function DE(s,e,t){var r=0;if(e.charset.toLowerCase()===s.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(DE,"specify");function Ou(s,e){var t=PE(s===void 0?"*":s||"");if(!e)return t.filter(Ru).sort(bu).map(FE);var r=e.map(o(function(n,a){return kE(n,t,a)},"getPriority"));return r.filter(Ru).sort(bu).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(Ou,"preferredCharsets");function bu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(bu,"compareSpecs");function FE(s){return s.charset}o(FE,"getFullCharset");function Ru(s){return s.q>0}o(Ru,"isQuality")});var Au=m((mx,Ho)=>{"use strict";Ho.exports=Cu;Ho.exports.preferredEncodings=Cu;var ME=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function $E(s){for(var e=s.split(","),t=!1,r=1,i=0,n=0;i<e.length;i++){var a=qE(e[i].trim(),i);a&&(e[n++]=a,t=t||Tu("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i}),e.length=n,e}o($E,"parseAcceptEncoding");function qE(s,e){var t=ME.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{encoding:r,q:i,i:e}}o(qE,"parseEncoding");function UE(s,e,t){for(var r={encoding:s,o:-1,q:0,s:0},i=0;i<e.length;i++){var n=Tu(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(UE,"getEncodingPriority");function Tu(s,e,t){var r=0;if(e.encoding.toLowerCase()===s.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:s,i:t,o:e.i,q:e.q,s:r}}o(Tu,"specify");function Cu(s,e,t){var r=$E(s||""),i=t?o(function(c,h){if(c.q!==h.q)return h.q-c.q;var u=t.indexOf(c.encoding),l=t.indexOf(h.encoding);return u===-1&&l===-1?h.s-c.s||c.o-h.o||c.i-h.i:u!==-1&&l!==-1?u-l:u===-1?1:-1},"comparator"):jE;if(!e)return r.filter(Iu).sort(i).map(HE);var n=e.map(o(function(c,h){return UE(c,r,h)},"getPriority"));return n.filter(Iu).sort(i).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(Cu,"preferredEncodings");function jE(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i}o(jE,"compareSpecs");function HE(s){return s.encoding}o(HE,"getFullEncoding");function Iu(s){return s.q>0}o(Iu,"isQuality")});var Lu=m((yx,zo)=>{"use strict";zo.exports=Pu;zo.exports.preferredLanguages=Pu;var zE=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function GE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=Nu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(GE,"parseAcceptLanguage");function Nu(s,e){var t=zE.exec(s);if(!t)return null;var r=t[1],i=t[2],n=r;i&&(n+="-"+i);var a=1;if(t[3])for(var c=t[3].split(";"),h=0;h<c.length;h++){var u=c[h].split("=");u[0]==="q"&&(a=parseFloat(u[1]))}return{prefix:r,suffix:i,q:a,i:e,full:n}}o(Nu,"parseLanguage");function VE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=WE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(VE,"getLanguagePriority");function WE(s,e,t){var r=Nu(s);if(!r)return null;var i=0;if(e.full.toLowerCase()===r.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}o(WE,"specify");function Pu(s,e){var t=GE(s===void 0?"*":s||"");if(!e)return t.filter(Bu).sort(xu).map(ZE);var r=e.map(o(function(n,a){return VE(n,t,a)},"getPriority"));return r.filter(Bu).sort(xu).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(Pu,"preferredLanguages");function xu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(xu,"compareSpecs");function ZE(s){return s.full}o(ZE,"getFullLanguage");function Bu(s){return s.q>0}o(Bu,"isQuality")});var qu=m((wx,Go)=>{"use strict";Go.exports=Mu;Go.exports.preferredMediaTypes=Mu;var KE=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function YE(s){for(var e=tw(s),t=0,r=0;t<e.length;t++){var i=Fu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(YE,"parseAccept");function Fu(s,e){var t=KE.exec(s);if(!t)return null;var r=Object.create(null),i=1,n=t[2],a=t[1];if(t[3])for(var c=sw(t[3]).map(ew),h=0;h<c.length;h++){var u=c[h],l=u[0].toLowerCase(),f=u[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(l==="q"){i=parseFloat(d);break}r[l]=d}return{type:a,subtype:n,params:r,q:i,i:e}}o(Fu,"parseMediaType");function XE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=JE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(XE,"getMediaTypePriority");function JE(s,e,t){var r=Fu(s),i=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var n=Object.keys(e.params);if(n.length>0)if(n.every(function(a){return e.params[a]=="*"||(e.params[a]||"").toLowerCase()==(r.params[a]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}o(JE,"specify");function Mu(s,e){var t=YE(s===void 0?"*/*":s||"");if(!e)return t.filter(Du).sort(ku).map(QE);var r=e.map(o(function(n,a){return XE(n,t,a)},"getPriority"));return r.filter(Du).sort(ku).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(Mu,"preferredMediaTypes");function ku(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(ku,"compareSpecs");function QE(s){return s.type+"/"+s.subtype}o(QE,"getFullType");function Du(s){return s.q>0}o(Du,"isQuality");function $u(s){for(var e=0,t=0;(t=s.indexOf('"',t))!==-1;)e++,t++;return e}o($u,"quoteCount");function ew(s){var e=s.indexOf("="),t,r;return e===-1?t=s:(t=s.slice(0,e),r=s.slice(e+1)),[t,r]}o(ew,"splitKeyValuePair");function tw(s){for(var e=s.split(","),t=1,r=0;t<e.length;t++)$u(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(tw,"splitMediaTypes");function sw(s){for(var e=s.split(";"),t=1,r=0;t<e.length;t++)$u(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(sw,"splitParameters")});var Uu=m((_x,Vo)=>{"use strict";var rw=vu(),iw=Au(),nw=Lu(),ow=qu();Vo.exports=k;Vo.exports.Negotiator=k;function k(s){if(!(this instanceof k))return new k(s);this.request=s}o(k,"Negotiator");k.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");k.prototype.charsets=o(function(e){return rw(this.request.headers["accept-charset"],e)},"charsets");k.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");k.prototype.encodings=o(function(e,t){var r=t||{};return iw(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");k.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");k.prototype.languages=o(function(e){return nw(this.request.headers["accept-language"],e)},"languages");k.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");k.prototype.mediaTypes=o(function(e){return ow(this.request.headers.accept,e)},"mediaTypes");k.prototype.preferredCharset=k.prototype.charset;k.prototype.preferredCharsets=k.prototype.charsets;k.prototype.preferredEncoding=k.prototype.encoding;k.prototype.preferredEncodings=k.prototype.encodings;k.prototype.preferredLanguage=k.prototype.language;k.prototype.preferredLanguages=k.prototype.languages;k.prototype.preferredMediaType=k.prototype.mediaType;k.prototype.preferredMediaTypes=k.prototype.mediaTypes});var Ot=m((Rx,ze)=>{"use strict";var ir=require("crypto"),{Minipass:aw}=ee(),Zo=["sha512","sha384","sha256"],Yo=["sha512"],cw=/^[a-z0-9+/]+(?:=?=?)$/i,hw=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,uw=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,lw=/^[\x21-\x7E]+$/,nr=o(s=>s?.length?`?${s.join("?")}`:"","getOptString"),Ko=class extends aw{static{o(this,"IntegrityStream")}#e;#t;#s;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Yo],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(ir.createHash)}#r(){this.sri=this.opts?.integrity?we(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=nr(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#s?t(this.#s):super.on(e,t)}emit(e,t){return e==="end"&&this.#i(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#i(){this.goodSri||this.#r();let e=we(this.hashes.map((r,i)=>`${this.algorithms[i]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
6
+ "use strict";var dh=Object.defineProperty;var o=(s,e)=>dh(s,"name",{value:e,configurable:!0});var Qg=(s,e)=>()=>(s&&(e=s(s=0)),e);var m=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),ey=(s,e)=>{for(var t in e)dh(s,t,{get:e[t],enumerable:!0})};var J=m(ie=>{"use strict";var ty=ie&&ie.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ie,"__esModule",{value:!0});ie.Minipass=ie.isWritable=ie.isReadable=ie.isStream=void 0;var ph=typeof process=="object"&&process?process:{stdout:null,stderr:null},Kn=require("node:events"),Eh=ty(require("node:stream")),sy=require("node:string_decoder"),ry=o(s=>!!s&&typeof s=="object"&&(s instanceof Vr||s instanceof Eh.default||(0,ie.isReadable)(s)||(0,ie.isWritable)(s)),"isStream");ie.isStream=ry;var iy=o(s=>!!s&&typeof s=="object"&&s instanceof Kn.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==Eh.default.Writable.prototype.pipe,"isReadable");ie.isReadable=iy;var ny=o(s=>!!s&&typeof s=="object"&&s instanceof Kn.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function","isWritable");ie.isWritable=ny;var Je=Symbol("EOF"),Qe=Symbol("maybeEmitEnd"),yt=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),Ls=Symbol("emittedError"),Ur=Symbol("closed"),mh=Symbol("read"),jr=Symbol("flush"),gh=Symbol("flushChunk"),Be=Symbol("encoding"),es=Symbol("decoder"),z=Symbol("flowing"),ks=Symbol("paused"),ts=Symbol("resume"),G=Symbol("buffer"),re=Symbol("pipes"),V=Symbol("bufferLength"),Hn=Symbol("bufferPush"),Hr=Symbol("bufferShift"),X=Symbol("objectMode"),j=Symbol("destroyed"),zn=Symbol("error"),Gn=Symbol("emitData"),yh=Symbol("emitEnd"),Vn=Symbol("emitEnd2"),De=Symbol("async"),Wn=Symbol("abort"),zr=Symbol("aborted"),Ds=Symbol("signal"),xt=Symbol("dataListeners"),pe=Symbol("discarded"),Ms=o(s=>Promise.resolve().then(s),"defer"),oy=o(s=>s(),"nodefer"),ay=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),cy=o(s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBufferLike"),hy=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),Gr=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[ts](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Zn=class extends Gr{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},uy=o(s=>!!s.objectMode,"isObjectModeOptions"),ly=o(s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer","isEncodingOptions"),Vr=class extends Kn.EventEmitter{static{o(this,"Minipass")}[z]=!1;[ks]=!1;[re]=[];[G]=[];[X];[Be];[De];[es];[Je]=!1;[yt]=!1;[qr]=!1;[Ur]=!1;[Ls]=null;[V]=0;[j]=!1;[Ds];[zr]=!1;[xt]=0;[pe]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");uy(t)?(this[X]=!0,this[Be]=null):ly(t)?(this[Be]=t.encoding,this[X]=!1):(this[X]=!1,this[Be]=null),this[De]=!!t.async,this[es]=this[Be]?new sy.StringDecoder(this[Be]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[G],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[re],"get")});let{signal:r}=t;r&&(this[Ds]=r,r.aborted?this[Wn]():r.addEventListener("abort",()=>this[Wn]()))}get bufferLength(){return this[V]}get encoding(){return this[Be]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[X]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[De]}set async(e){this[De]=this[De]||!!e}[Wn](){this[zr]=!0,this.emit("abort",this[Ds]?.reason),this.destroy(this[Ds]?.reason)}get aborted(){return this[zr]}set aborted(e){}write(e,t,r){if(this[zr])return!1;if(this[Je])throw new Error("write after end");if(this[j])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[De]?Ms:oy;if(!this[X]&&!Buffer.isBuffer(e)){if(hy(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(cy(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[X]?(this[z]&&this[V]!==0&&this[jr](!0),this[z]?this.emit("data",e):this[Hn](e),this[V]!==0&&this.emit("readable"),r&&i(r),this[z]):e.length?(typeof e=="string"&&!(t===this[Be]&&!this[es]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Be]&&(e=this[es].write(e)),this[z]&&this[V]!==0&&this[jr](!0),this[z]?this.emit("data",e):this[Hn](e),this[V]!==0&&this.emit("readable"),r&&i(r),this[z]):(this[V]!==0&&this.emit("readable"),r&&i(r),this[z])}read(e){if(this[j])return null;if(this[pe]=!1,this[V]===0||e===0||e&&e>this[V])return this[Qe](),null;this[X]&&(e=null),this[G].length>1&&!this[X]&&(this[G]=[this[Be]?this[G].join(""):Buffer.concat(this[G],this[V])]);let t=this[mh](e||null,this[G][0]);return this[Qe](),t}[mh](e,t){if(this[X])this[Hr]();else{let r=t;e===r.length||e===null?this[Hr]():typeof r=="string"?(this[G][0]=r.slice(e),t=r.slice(0,e),this[V]-=e):(this[G][0]=r.subarray(e),t=r.subarray(0,e),this[V]-=e)}return this.emit("data",t),!this[G].length&&!this[Je]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Je]=!0,this.writable=!1,(this[z]||!this[ks])&&this[Qe](),this}[ts](){this[j]||(!this[xt]&&!this[re].length&&(this[pe]=!0),this[ks]=!1,this[z]=!0,this.emit("resume"),this[G].length?this[jr]():this[Je]?this[Qe]():this.emit("drain"))}resume(){return this[ts]()}pause(){this[z]=!1,this[ks]=!0,this[pe]=!1}get destroyed(){return this[j]}get flowing(){return this[z]}get paused(){return this[ks]}[Hn](e){this[X]?this[V]+=1:this[V]+=e.length,this[G].push(e)}[Hr](){return this[X]?this[V]-=1:this[V]-=this[G][0].length,this[G].shift()}[jr](e=!1){do;while(this[gh](this[Hr]())&&this[G].length);!e&&!this[G].length&&!this[Je]&&this.emit("drain")}[gh](e){return this.emit("data",e),this[z]}pipe(e,t){if(this[j])return e;this[pe]=!1;let r=this[yt];return t=t||{},e===ph.stdout||e===ph.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[re].push(t.proxyErrors?new Zn(this,e,t):new Gr(this,e,t)),this[De]?Ms(()=>this[ts]()):this[ts]()),e}unpipe(e){let t=this[re].find(r=>r.dest===e);t&&(this[re].length===1?(this[z]&&this[xt]===0&&(this[z]=!1),this[re]=[]):this[re].splice(this[re].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[pe]=!1,this[xt]++,!this[re].length&&!this[z]&&this[ts]();else if(e==="readable"&&this[V]!==0)super.emit("readable");else if(ay(e)&&this[yt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ls]){let i=t;this[De]?Ms(()=>i.call(this,this[Ls])):i.call(this,this[Ls])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[xt]=this.listeners("data").length,this[xt]===0&&!this[pe]&&!this[re].length&&(this[z]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[xt]=0,!this[pe]&&!this[re].length&&(this[z]=!1)),t}get emittedEnd(){return this[yt]}[Qe](){!this[qr]&&!this[yt]&&!this[j]&&this[G].length===0&&this[Je]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ur]&&this.emit("close"),this[qr]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==j&&this[j])return!1;if(e==="data")return!this[X]&&!r?!1:this[De]?(Ms(()=>this[Gn](r)),!0):this[Gn](r);if(e==="end")return this[yh]();if(e==="close"){if(this[Ur]=!0,!this[yt]&&!this[j])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ls]=r,super.emit(zn,r);let n=!this[Ds]||this.listeners("error").length?super.emit("error",r):!1;return this[Qe](),n}else if(e==="resume"){let n=super.emit("resume");return this[Qe](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...t);return this[Qe](),i}[Gn](e){for(let r of this[re])r.dest.write(e)===!1&&this.pause();let t=this[pe]?!1:super.emit("data",e);return this[Qe](),t}[yh](){return this[yt]?!1:(this[yt]=!0,this.readable=!1,this[De]?(Ms(()=>this[Vn]()),!0):this[Vn]())}[Vn](){if(this[es]){let t=this[es].end();if(t){for(let r of this[re])r.dest.write(t);this[pe]||super.emit("data",t)}}for(let t of this[re])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[X]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[X]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[X])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Be]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(j,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[pe]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Je])return t();let n,a,c=o(f=>{this.off("data",h),this.off("end",u),this.off(j,l),t(),a(f)},"onerr"),h=o(f=>{this.off("error",c),this.off("end",u),this.off(j,l),this.pause(),n({value:f,done:!!this[Je]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",h),this.off(j,l),t(),n({done:!0,value:void 0})},"onend"),l=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,d)=>{a=d,n=f,this.once(j,l),this.once("error",c),this.once("end",u),this.once("data",h)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[pe]=!1;let e=!1,t=o(()=>(this.pause(),this.off(zn,t),this.off(j,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(zn,t),this.once(j,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[j])return e?this.emit("error",e):this.emit(j),this;this[j]=!0,this[pe]=!0,this[G].length=0,this[V]=0;let t=this;return typeof t.close=="function"&&!this[Ur]&&t.close(),e?this.emit("error",e):this.emit(j),this}static get isStream(){return ie.isStream}};ie.Minipass=Vr});var Yn=m(ss=>{"use strict";var fy=ss&&ss.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ss,"__esModule",{value:!0});ss.constants=void 0;var dy=fy(require("zlib")),py=dy.default.constants||{ZLIB_VERNUM:4736};ss.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},py))});var _h=m(B=>{"use strict";var my=B&&B.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),gy=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),yy=B&&B.__importStar||(function(){var s=o(function(e){return s=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},s(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=s(e),i=0;i<r.length;i++)r[i]!=="default"&&my(t,e,r[i]);return gy(t,e),t}})(),Ey=B&&B.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(B,"__esModule",{value:!0});B.ZstdDecompress=B.ZstdCompress=B.BrotliDecompress=B.BrotliCompress=B.Unzip=B.InflateRaw=B.DeflateRaw=B.Gunzip=B.Gzip=B.Inflate=B.Deflate=B.Zlib=B.ZlibError=B.constants=void 0;var Qn=Ey(require("assert")),Ct=require("buffer"),wy=J(),wh=yy(require("zlib")),Me=Yn(),Sy=Yn();Object.defineProperty(B,"constants",{enumerable:!0,get:o(function(){return Sy.constants},"get")});var _y=Ct.Buffer.concat,Sh=Object.getOwnPropertyDescriptor(Ct.Buffer,"concat"),by=o(s=>s,"noop"),Xn=Sh?.writable===!0||Sh?.set!==void 0?s=>{Ct.Buffer.concat=s?by:_y}:s=>{},Bt=Symbol("_superWrite"),Nt=class extends Error{static{o(this,"ZlibError")}code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};B.ZlibError=Nt;var Jn=Symbol("flushFlag"),$s=class extends wy.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#s;#r;#i;#a;#l;get sawError(){return this.#e}get handle(){return this.#a}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#r=e.finishFlush??0,this.#i=e.fullFlushFlag??0,typeof wh[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#a=new wh[t](e)}catch(r){throw new Nt(r,this.constructor)}this.#l=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#a?.on("error",r=>this.#l(new Nt(r))),this.once("end",()=>this.close)}close(){this.#a&&(this.#a.close(),this.#a=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,Qn.default)(this.#a,"zlib binding closed"),this.#a.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#i),this.write(Object.assign(Ct.Buffer.alloc(0),{[Jn]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Bt](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=Ct.Buffer.from(e,t)),this.#e)return;(0,Qn.default)(this.#a,"zlib binding closed");let i=this.#a._handle,n=i.close;i.close=()=>{};let a=this.#a.close;this.#a.close=()=>{},Xn(!0);let c;try{let u=typeof e[Jn]=="number"?e[Jn]:this.#s;c=this.#a._processChunk(e,u),Xn(!1)}catch(u){Xn(!1),this.#l(new Nt(u,this.write))}finally{this.#a&&(this.#a._handle=i,i.close=n,this.#a.close=a,this.#a.removeAllListeners("error"))}this.#a&&this.#a.on("error",u=>this.#l(new Nt(u,this.write)));let h;if(c)if(Array.isArray(c)&&c.length>0){let u=c[0];h=this[Bt](Ct.Buffer.from(u));for(let l=1;l<c.length;l++)h=this[Bt](c[l])}else h=this[Bt](Ct.Buffer.from(c));return r&&r(),h}},$e=class extends $s{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||Me.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Me.constants.Z_FINISH,e.fullFlushFlag=Me.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#t=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#t!==t){this.flush(Me.constants.Z_SYNC_FLUSH),(0,Qn.default)(this.handle,"zlib binding closed");let r=this.handle.flush;this.handle.flush=(i,n)=>{typeof i=="function"&&(n=i,i=this.flushFlag),this.flush(i),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=r}this.handle&&(this.#e=e,this.#t=t)}}}};B.Zlib=$e;var eo=class extends $e{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};B.Deflate=eo;var to=class extends $e{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};B.Inflate=to;var so=class extends $e{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Bt](e){return this.#e?(this.#e=!1,e[9]=255,super[Bt](e)):super[Bt](e)}};B.Gzip=so;var ro=class extends $e{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};B.Gunzip=ro;var io=class extends $e{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};B.DeflateRaw=io;var no=class extends $e{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};B.InflateRaw=no;var oo=class extends $e{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};B.Unzip=oo;var Wr=class extends $s{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||Me.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Me.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=Me.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},ao=class extends Wr{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};B.BrotliCompress=ao;var co=class extends Wr{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};B.BrotliDecompress=co;var Zr=class extends $s{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||Me.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||Me.constants.ZSTD_e_end,e.fullFlushFlag=Me.constants.ZSTD_e_flush,super(e,t)}},ho=class extends Zr{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};B.ZstdCompress=ho;var uo=class extends Zr{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};B.ZstdDecompress=uo});var ei=m((ZA,Ch)=>{"use strict";var bh=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ry=require("events"),Rh=require("stream"),Oh=require("string_decoder").StringDecoder,et=Symbol("EOF"),tt=Symbol("maybeEmitEnd"),Et=Symbol("emittedEnd"),Kr=Symbol("emittingEnd"),Fs=Symbol("emittedError"),Yr=Symbol("closed"),Ih=Symbol("read"),Xr=Symbol("flush"),vh=Symbol("flushChunk"),ce=Symbol("encoding"),st=Symbol("decoder"),Jr=Symbol("flowing"),qs=Symbol("paused"),rs=Symbol("resume"),W=Symbol("bufferLength"),lo=Symbol("bufferPush"),fo=Symbol("bufferShift"),Q=Symbol("objectMode"),ee=Symbol("destroyed"),po=Symbol("emitData"),Th=Symbol("emitEnd"),mo=Symbol("emitEnd2"),rt=Symbol("async"),Us=o(s=>Promise.resolve().then(s),"defer"),Ah=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Oy=Ah&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Iy=Ah&&Symbol.iterator||Symbol("iterator not implemented"),vy=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),Ty=o(s=>s instanceof ArrayBuffer||typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBuffer"),Ay=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),Qr=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[rs](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},go=class extends Qr{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Ch.exports=class xh extends Rh{static{o(this,"Minipass")}constructor(e){super(),this[Jr]=!1,this[qs]=!1,this.pipes=[],this.buffer=[],this[Q]=e&&e.objectMode||!1,this[Q]?this[ce]=null:this[ce]=e&&e.encoding||null,this[ce]==="buffer"&&(this[ce]=null),this[rt]=e&&!!e.async||!1,this[st]=this[ce]?new Oh(this[ce]):null,this[et]=!1,this[Et]=!1,this[Kr]=!1,this[Yr]=!1,this[Fs]=null,this.writable=!0,this.readable=!0,this[W]=0,this[ee]=!1}get bufferLength(){return this[W]}get encoding(){return this[ce]}set encoding(e){if(this[Q])throw new Error("cannot set encoding in objectMode");if(this[ce]&&e!==this[ce]&&(this[st]&&this[st].lastNeed||this[W]))throw new Error("cannot change encoding");this[ce]!==e&&(this[st]=e?new Oh(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[st].write(t)))),this[ce]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Q]}set objectMode(e){this[Q]=this[Q]||!!e}get async(){return this[rt]}set async(e){this[rt]=this[rt]||!!e}write(e,t,r){if(this[et])throw new Error("write after end");if(this[ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[rt]?Us:n=>n();return!this[Q]&&!Buffer.isBuffer(e)&&(Ay(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Ty(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Q]?(this.flowing&&this[W]!==0&&this[Xr](!0),this.flowing?this.emit("data",e):this[lo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[ce]&&!this[st].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ce]&&(e=this[st].write(e)),this.flowing&&this[W]!==0&&this[Xr](!0),this.flowing?this.emit("data",e):this[lo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this.flowing):(this[W]!==0&&this.emit("readable"),r&&i(r),this.flowing)}read(e){if(this[ee])return null;if(this[W]===0||e===0||e>this[W])return this[tt](),null;this[Q]&&(e=null),this.buffer.length>1&&!this[Q]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[W])]);let t=this[Ih](e||null,this.buffer[0]);return this[tt](),t}[Ih](e,t){return e===t.length||e===null?this[fo]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[W]-=e),this.emit("data",t),!this.buffer.length&&!this[et]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[et]=!0,this.writable=!1,(this.flowing||!this[qs])&&this[tt](),this}[rs](){this[ee]||(this[qs]=!1,this[Jr]=!0,this.emit("resume"),this.buffer.length?this[Xr]():this[et]?this[tt]():this.emit("drain"))}resume(){return this[rs]()}pause(){this[Jr]=!1,this[qs]=!0}get destroyed(){return this[ee]}get flowing(){return this[Jr]}get paused(){return this[qs]}[lo](e){this[Q]?this[W]+=1:this[W]+=e.length,this.buffer.push(e)}[fo](){return this.buffer.length&&(this[Q]?this[W]-=1:this[W]-=this.buffer[0].length),this.buffer.shift()}[Xr](e){do;while(this[vh](this[fo]()));!e&&!this.buffer.length&&!this[et]&&this.emit("drain")}[vh](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[ee])return;let r=this[Et];return t=t||{},e===bh.stdout||e===bh.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new go(this,e,t):new Qr(this,e,t)),this[rt]?Us(()=>this[rs]()):this[rs]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[rs]():e==="readable"&&this[W]!==0?super.emit("readable"):vy(e)&&this[Et]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Fs]&&(this[rt]?Us(()=>t.call(this,this[Fs])):t.call(this,this[Fs])),r}get emittedEnd(){return this[Et]}[tt](){!this[Kr]&&!this[Et]&&!this[ee]&&this.buffer.length===0&&this[et]&&(this[Kr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yr]&&this.emit("close"),this[Kr]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return;if(e==="data")return t?this[rt]?Us(()=>this[po](t)):this[po](t):!1;if(e==="end")return this[Th]();if(e==="close"){if(this[Yr]=!0,!this[Et]&&!this[ee])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Fs]=t;let n=super.emit("error",t);return this[tt](),n}else if(e==="resume"){let n=super.emit("resume");return this[tt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...r);return this[tt](),i}[po](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[tt](),t}[Th](){this[Et]||(this[Et]=!0,this.readable=!1,this[rt]?Us(()=>this[mo]()):this[mo]())}[mo](){if(this[st]){let t=this[st].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Q]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Q]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[Q]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Q]?Promise.reject(new Error("cannot concat in objectMode")):this[ce]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(ee,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Oy](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[et])return Promise.resolve({done:!0});let r=null,i=null,n=o(u=>{this.removeListener("data",a),this.removeListener("end",c),i(u)},"onerr"),a=o(u=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:u,done:!!this[et]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),h=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((u,l)=>{i=l,r=u,this.once(ee,h),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[Iy](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[ee]?(e?this.emit("error",e):this.emit(ee),this):(this[ee]=!0,this.buffer.length=0,this[W]=0,typeof this.close=="function"&&!this[Yr]&&this.close(),e?this.emit("error",e):this.emit(ee),this)}static isStream(e){return!!e&&(e instanceof xh||e instanceof Rh||e instanceof Ry&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Nh=m((YA,Bh)=>{var xy=ei(),js=class extends Error{static{o(this,"SizeError")}constructor(e,t){super(`Bad data size: expected ${t} bytes, but got ${e}`),this.expect=t,this.found=e,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}},ti=class extends xy{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let i=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(i)?(this.found+=i.length,this.found>this.expect&&this.emit("error",new js(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new js(this.found,this.expect)),super.emit(e,...t)}};ti.SizeError=js;Bh.exports=ti});var Lh=m((JA,Ph)=>{"use strict";var{Minipass:Cy}=J(),yo=Symbol("type"),it=Symbol("buffer"),si=class s{static{o(this,"Blob")}constructor(e,t){this[yo]="";let r=[],i=0;if(e){let a=e,c=Number(a.length);for(let h=0;h<c;h++){let u=a[h],l=u instanceof Buffer?u:ArrayBuffer.isView(u)?Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?Buffer.from(u):u instanceof s?u[it]:typeof u=="string"?Buffer.from(u):Buffer.from(String(u));i+=l.length,r.push(l)}}this[it]=Buffer.concat(r,i);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[yo]=n)}get size(){return this[it].length}get type(){return this[yo]}text(){return Promise.resolve(this[it].toString())}arrayBuffer(){let e=this[it],t=e.byteOffset,r=e.byteLength,i=e.buffer.slice(t,t+r);return Promise.resolve(i)}stream(){return new Cy().end(this[it])}slice(e,t,r){let i=this.size,n=e===void 0?0:e<0?Math.max(i+e,0):Math.min(e,i),a=t===void 0?i:t<0?Math.max(i+t,0):Math.min(t,i),c=Math.max(a-n,0),u=this[it].slice(n,n+c),l=new s([],{type:r});return l[it]=u,l}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return it}};Object.defineProperties(si.prototype,{size:{enumerable:!0},type:{enumerable:!0}});Ph.exports=si});var wo=m((ex,kh)=>{"use strict";var Eo=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};kh.exports=Eo});var Mh=m((sx,Dh)=>{"use strict";Dh.exports={}});var ii=m((rx,qh)=>{"use strict";var{Minipass:Fe}=J(),So=Nh(),Fh=Lh(),{BUFFER:By}=Fh,Hs=wo(),_o;try{_o=Mh().convert}catch{}var nt=Symbol("Body internals"),Pt=Symbol("consumeBody"),ri=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:i=0}=t,n=e==null?null:$h(e)?Buffer.from(e.toString()):zs(e)||Buffer.isBuffer(e)?e:Object.prototype.toString.call(e)==="[object ArrayBuffer]"?Buffer.from(e):ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Fe.isStream(e)?e:Buffer.from(String(e));this[nt]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=i,Fe.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Hs(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[nt].error=c})}get body(){return this[nt].body}get bodyUsed(){return this[nt].disturbed}arrayBuffer(){return this[Pt]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Pt]().then(t=>Object.assign(new Fh([],{type:e.toLowerCase()}),{[By]:t}))}async json(){let e=await this[Pt]();try{return JSON.parse(e.toString())}catch(t){throw new Hs(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Pt]().then(e=>e.toString())}buffer(){return this[Pt]()}textConverted(){return this[Pt]().then(e=>Ny(e,this.headers))}[Pt](){if(this[nt].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[nt].disturbed=!0,this[nt].error)return Promise.reject(this[nt].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=zs(this.body)?this.body.stream():this.body;if(!Fe.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof So||!this.size&&e instanceof Fe&&!(e instanceof So)?e:this.size?new So({size:this.size}):new Fe,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Hs(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(i=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),i()}).then(()=>t.concat()).then(i=>(clearTimeout(r),i)).catch(i=>{throw clearTimeout(r),i.name==="AbortError"||i.name==="FetchError"?i:i.name==="RangeError"?new Hs(`Could not create Buffer from response body for ${this.url}: ${i.message}`,"system",i):new Hs(`Invalid response body while trying to fetch ${this.url}: ${i.message}`,"system",i)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(Fe.isStream(t)&&typeof t.getBoundary!="function"){let r=new Fe,i=new Fe,n=new Fe;return r.on("error",a=>{i.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(i),r.pipe(n),t.pipe(r),e[nt].body=i,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":$h(e)?"application/x-www-form-urlencoded;charset=UTF-8":zs(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:Fe.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:zs(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(zs(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(ri.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var $h=o(s=>typeof s!="object"||typeof s.append!="function"||typeof s.delete!="function"||typeof s.get!="function"||typeof s.getAll!="function"||typeof s.has!="function"||typeof s.set!="function"?!1:s.constructor.name==="URLSearchParams"||Object.prototype.toString.call(s)==="[object URLSearchParams]"||typeof s.sort=="function","isURLSearchParams"),zs=o(s=>typeof s=="object"&&typeof s.arrayBuffer=="function"&&typeof s.type=="string"&&typeof s.stream=="function"&&typeof s.constructor=="function"&&typeof s.constructor.name=="string"&&/^(Blob|File)$/.test(s.constructor.name)&&/^(Blob|File)$/.test(s[Symbol.toStringTag]),"isBlob"),Ny=o((s,e)=>{if(typeof _o!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",i;t&&(i=/charset=([^;]*)/i.exec(t));let n=s.slice(0,1024).toString();return!i&&n&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!i&&n&&(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),i||(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),i&&i.pop()),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&n&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),i&&(r=i.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),_o(s,"UTF-8",r).toString()},"convertBody");qh.exports=ri});var oi=m((nx,Hh)=>{"use strict";var jh=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Ro=/[^\t\x20-\x7e\x80-\xff]/,Gs=o(s=>{if(s=`${s}`,jh.test(s)||s==="")throw new TypeError(`${s} is not a legal HTTP header name`)},"validateName"),Uh=o(s=>{if(s=`${s}`,Ro.test(s))throw new TypeError(`${s} is not a legal HTTP header value`)},"validateValue"),is=o((s,e)=>{e=e.toLowerCase();for(let t in s)if(t.toLowerCase()===e)return t},"find"),H=Symbol("map"),ni=class s{static{o(this,"Headers")}constructor(e=void 0){if(this[H]=Object.create(null),e instanceof s){let t=e.raw(),r=Object.keys(t);for(let i of r)for(let n of t[i])this.append(i,n);return}if(e!=null)if(typeof e=="object"){let t=e[Symbol.iterator];if(t!=null){if(typeof t!="function")throw new TypeError("Header pairs must be iterable");let r=[];for(let i of e){if(typeof i!="object"||typeof i[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(i);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");r.push(n)}for(let i of r)this.append(i[0],i[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Gs(e);let t=is(this[H],e);return t===void 0?null:this[H][t].join(", ")}forEach(e,t=void 0){let r=Oo(this);for(let i=0;i<r.length;i++){let[n,a]=r[i];e.call(t,a,n,this),r=Oo(this)}}set(e,t){e=`${e}`,t=`${t}`,Gs(e),Uh(t);let r=is(this[H],e);this[H][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,Gs(e),Uh(t);let r=is(this[H],e);r!==void 0?this[H][r].push(t):this[H][e]=[t]}has(e){return e=`${e}`,Gs(e),is(this[H],e)!==void 0}delete(e){e=`${e}`,Gs(e);let t=is(this[H],e);t!==void 0&&delete this[H][t]}raw(){return this[H]}keys(){return new Lt(this,"key")}values(){return new Lt(this,"value")}[Symbol.iterator](){return new Lt(this,"key+value")}entries(){return new Lt(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[H]),r=is(e[H],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new s;for(let r of Object.keys(e))if(!jh.test(r))if(Array.isArray(e[r]))for(let i of e[r])Ro.test(i)||(t[H][r]===void 0?t[H][r]=[i]:t[H][r].push(i));else Ro.test(e[r])||(t[H][r]=[e[r]]);return t}};Object.defineProperties(ni.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});var Oo=o((s,e="key+value")=>Object.keys(s[H]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>s[H][t].join(", "):t=>[t.toLowerCase(),s[H][t].join(", ")]),"getHeaders"),bo=Symbol("internal"),Lt=class s{static{o(this,"HeadersIterator")}constructor(e,t){this[bo]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==s.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[bo],i=Oo(e,t),n=i.length;return r>=n?{value:void 0,done:!0}:(this[bo].index++,{value:i[r],done:!1})}};Object.setPrototypeOf(Lt.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Hh.exports=ni});var Wh=m((ax,Vh)=>{"use strict";var Py=require("http"),{STATUS_CODES:Ly}=Py,zh=oi(),Gh=ii(),{clone:ky,extractContentType:Dy}=Gh,ot=Symbol("Response internals"),ai=class s extends Gh{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,i=new zh(t.headers);if(e!=null&&!i.has("Content-Type")){let n=Dy(e);n&&i.append("Content-Type",n)}this[ot]={url:t.url,status:r,statusText:t.statusText||Ly[r],headers:i,counter:t.counter,trailer:Promise.resolve(t.trailer||new zh)}}get trailer(){return this[ot].trailer}get url(){return this[ot].url||""}get status(){return this[ot].status}get ok(){return this[ot].status>=200&&this[ot].status<300}get redirected(){return this[ot].counter>0}get statusText(){return this[ot].statusText}get headers(){return this[ot].headers}clone(){return new s(ky(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}};Vh.exports=ai;Object.defineProperties(ai.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Zh=m((hx,My)=>{My.exports={name:"minipass-fetch",version:"4.0.1",description:"An implementation of window.fetch in Node.js using Minipass streams",license:"MIT",main:"lib/index.js",scripts:{"test:tls-fixtures":"./test/fixtures/tls/setup.sh",test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{"coverage-map":"map.js","check-coverage":!0,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.3","@ungap/url-search-params":"^0.2.2","abort-controller":"^3.0.0","abortcontroller-polyfill":"~1.7.3",encoding:"^0.1.13","form-data":"^4.0.0",nock:"^13.2.4",parted:"^0.1.1","string-to-arraybuffer":"^1.0.2",tap:"^16.0.0"},dependencies:{minipass:"^7.0.3","minipass-sized":"^1.0.3",minizlib:"^3.0.1"},optionalDependencies:{encoding:"^0.1.13"},repository:{type:"git",url:"git+https://github.com/npm/minipass-fetch.git"},keywords:["fetch","minipass","node-fetch","window.fetch"],files:["bin/","lib/"],engines:{node:"^18.17.0 || >=20.5.0"},author:"GitHub Inc.",templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.3",publish:"true"}}});var Xh=m((ux,Yh)=>{"use strict";var{URL:Io}=require("url"),{Minipass:$y}=J(),vo=oi(),{exportNodeCompatibleHeaders:Fy}=vo,Kh=ii(),{clone:qy,extractContentType:Uy,getTotalBytes:jy}=Kh,Hy=Zh().version,zy=`minipass-fetch/${Hy} (+https://github.com/isaacs/minipass-fetch)`,Ne=Symbol("Request internals"),ci=o(s=>typeof s=="object"&&typeof s[Ne]=="object","isRequest"),Gy=o(s=>{let e=s&&typeof s=="object"&&Object.getPrototypeOf(s);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),hi=class s extends Kh{static{o(this,"Request")}constructor(e,t={}){let r=ci(e)?new Io(e.url):e&&e.href?new Io(e.href):new Io(`${e}`);ci(e)?t={...e[Ne],...t}:(!e||typeof e=="string")&&(e={});let i=(t.method||e.method||"GET").toUpperCase(),n=i==="GET"||i==="HEAD";if((t.body!==null&&t.body!==void 0||ci(e)&&e.body!==null)&&n)throw new TypeError("Request with GET/HEAD method cannot have body");let a=t.body!==null&&t.body!==void 0?t.body:ci(e)&&e.body!==null?qy(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new vo(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let Xe=Uy(a);Xe&&c.append("Content-Type",Xe)}let h="signal"in t?t.signal:null;if(h!=null&&!Gy(h))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:g,ecdhCurve:y,family:S,honorCipherOrder:w,key:T,passphrase:v,pfx:R,rejectUnauthorized:I=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:C,secureProtocol:P,servername:Y,sessionIdContext:Se}=t;this[Ne]={method:i,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:h,ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:g,ecdhCurve:y,family:S,honorCipherOrder:w,key:T,passphrase:v,pfx:R,rejectUnauthorized:I,secureOptions:C,secureProtocol:P,servername:Y,sessionIdContext:Se},this.follow=t.follow!==void 0?t.follow:e.follow!==void 0?e.follow:20,this.compress=t.compress!==void 0?t.compress:e.compress!==void 0?e.compress:!0,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent}get method(){return this[Ne].method}get url(){return this[Ne].parsedURL.toString()}get headers(){return this[Ne].headers}get redirect(){return this[Ne].redirect}get signal(){return this[Ne].signal}clone(){return new s(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[Ne].parsedURL,r=new vo(e[Ne].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&$y.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let i=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?jy(e):null;i&&r.set("Content-Length",i+""),r.has("User-Agent")||r.set("User-Agent",zy),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:g,key:y,passphrase:S,pfx:w,rejectUnauthorized:T,secureOptions:v,secureProtocol:R,servername:I,sessionIdContext:C}=e[Ne];return{...{auth:t.username||t.password?`${t.username}:${t.password}`:"",host:t.host,hostname:t.hostname,path:`${t.pathname}${t.search}`,port:t.port,protocol:t.protocol},method:e.method,headers:Fy(r),agent:n,ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:g,key:y,passphrase:S,pfx:w,rejectUnauthorized:T,secureOptions:v,secureProtocol:R,servername:I,sessionIdContext:C,timeout:e.timeout}}};Yh.exports=hi;Object.defineProperties(hi.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var Qh=m((fx,Jh)=>{"use strict";var To=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(e){}};Jh.exports=To});var Zs=m((px,su)=>{"use strict";var{URL:Vs}=require("url"),Vy=require("http"),Wy=require("https"),ns=_h(),{Minipass:eu}=J(),Zy=ii(),{writeToStream:Ky,getTotalBytes:Yy}=Zy,kt=Wh(),xo=oi(),{createHeadersLenient:tu}=xo,Ws=Xh(),{getNodeRequestOptions:Xy}=Ws,wt=wo(),Ao=Qh(),at=o(async(s,e)=>{if(/^data:/.test(s)){let t=new Ws(s,e);return Promise.resolve().then(()=>new Promise((r,i)=>{let n,a;try{let{pathname:u,search:l}=new Vs(s),f=u.split(",");if(f.length<2)throw new Error("invalid data: URI");let d=f.shift(),p=/;base64$/.test(d);n=p?d.slice(0,-7):d;let g=decodeURIComponent(f.join(",")+l);a=p?Buffer.from(g,"base64"):Buffer.from(g)}catch(u){return i(new wt(`[${t.method}] ${t.url} invalid URL, ${u.message}`,"system",u))}let{signal:c}=t;if(c&&c.aborted)return i(new Ao("The user aborted a request."));let h={"Content-Length":a.length};return n&&(h["Content-Type"]=n),r(new kt(a,{headers:h}))}))}return new Promise((t,r)=>{let i=new Ws(s,e),n;try{n=Xy(i)}catch(g){return r(g)}let a=(n.protocol==="https:"?Wy:Vy).request,{signal:c}=i,h=null,u=o(()=>{let g=new Ao("The user aborted a request.");r(g),eu.isStream(i.body)&&typeof i.body.destroy=="function"&&i.body.destroy(g),h&&h.body&&h.body.emit("error",g)},"abort");if(c&&c.aborted)return u();let l=o(()=>{u(),f()},"abortAndFinalize"),f=o(()=>{d.abort(),c&&c.removeEventListener("abort",l),clearTimeout(p)},"finalize"),d=a(n);c&&c.addEventListener("abort",l);let p=null;i.timeout&&d.once("socket",()=>{p=setTimeout(()=>{r(new wt(`network timeout at: ${i.url}`,"request-timeout")),f()},i.timeout)}),d.on("error",g=>{d.res&&d.res.emit("error",g),r(new wt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),f()}),d.on("response",g=>{clearTimeout(p);let y=tu(g.headers);if(at.isRedirect(g.statusCode)){let I=y.get("Location"),C=null;try{C=I===null?null:new Vs(I,i.url).toString()}catch{if(i.redirect!=="manual"){r(new wt(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),f();return}}if(i.redirect==="error"){r(new wt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),f();return}else if(i.redirect==="manual"){if(C!==null)try{y.set("Location",C)}catch(P){r(P)}}else if(i.redirect==="follow"&&C!==null){if(i.counter>=i.follow){r(new wt(`maximum redirect reached at: ${i.url}`,"max-redirect")),f();return}if(g.statusCode!==303&&i.body&&Yy(i)===null){r(new wt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}i.headers.set("host",new Vs(C).host);let P={headers:new xo(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout},Y=new Vs(i.url),Se=new Vs(C);Y.hostname!==Se.hostname&&(P.headers.delete("authorization"),P.headers.delete("cookie")),(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(P.method="GET",P.body=void 0,P.headers.delete("content-length")),t(at(new Ws(C,P))),f();return}}g.once("end",()=>c&&c.removeEventListener("abort",l));let S=new eu;S.on("error",f),g.on("error",I=>S.emit("error",I)),g.on("data",I=>S.write(I)),g.on("end",()=>S.end());let w={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:y,size:i.size,timeout:i.timeout,counter:i.counter,trailer:new Promise(I=>g.on("end",()=>I(tu(g.trailers))))},T=y.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||T===null||g.statusCode===204||g.statusCode===304){h=new kt(S,w),t(h);return}let v={flush:ns.constants.Z_SYNC_FLUSH,finishFlush:ns.constants.Z_SYNC_FLUSH};if(T==="gzip"||T==="x-gzip"){let I=new ns.Gunzip(v);h=new kt(S.on("error",C=>I.emit("error",C)).pipe(I),w),t(h);return}if(T==="deflate"||T==="x-deflate"){g.once("data",I=>{let C=(I[0]&15)===8?new ns.Inflate:new ns.InflateRaw;S.on("error",P=>C.emit("error",P)).pipe(C),h=new kt(C,w),t(h)});return}if(T==="br"){try{var R=new ns.BrotliDecompress}catch(I){r(I),f();return}S.on("error",I=>R.emit("error",I)).pipe(R),h=new kt(R,w),t(h);return}h=new kt(S,w),t(h)}),Ky(d,i)})},"fetch");su.exports=at;at.isRedirect=s=>s===301||s===302||s===303||s===307||s===308;at.Headers=xo;at.Request=Ws;at.Response=kt;at.FetchError=wt;at.AbortError=Ao});var iu=m((gx,ru)=>{var Jy=require("dns"),Qy=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],eE=o(s=>{let{strictSSL:e,...t}={...s};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:Jy.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(i=>Qy.includes(i.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");ru.exports=eE});var ou=m((wx,nu)=>{"use strict";var tE=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),sE=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),rE=new Set([500,502,503,504]),iE={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},nE={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function ct(s){let e=parseInt(s,10);return isFinite(e)?e:0}o(ct,"toNumberOrZero");function oE(s){return s?rE.has(s.status):!0}o(oE,"isErrorResponse");function Co(s){let e={};if(!s)return e;let t=s.trim().split(/,/);for(let r of t){let[i,n]=r.split(/=/,2);e[i.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(Co,"parseCacheControl");function aE(s){let e=[];for(let t in s){let r=s[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(aE,"formatCacheControl");nu.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,cacheHeuristic:i,immutableMinTimeToLive:n,ignoreCargoCult:a,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=r!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=Co(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=Co(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":aE(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&sE.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||tE.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=Co(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>ct(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<ct(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)iE[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let i of r)delete t[i]}if(t.warning){let r=t.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return ct(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return ct(this._rescc["s-maxage"])}if(this._rescc["max-age"])return ct(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+ct(this._rescc["stale-if-error"]),r=e+ct(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+ct(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=ct(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let i=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));i.length?t["if-none-match"]=i.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&oE(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let i={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,i),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!nE[c]?t.headers[c]:this._resHeaders[c];let a=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,a,i),modified:!1,matches:!0}}}});var uu=m((_x,Bo)=>{"use strict";Bo.exports=hu;Bo.exports.preferredCharsets=hu;var cE=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function hE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=uE(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(hE,"parseAcceptCharset");function uE(s,e){var t=cE.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{charset:r,q:i,i:e}}o(uE,"parseCharset");function lE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=fE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(lE,"getCharsetPriority");function fE(s,e,t){var r=0;if(e.charset.toLowerCase()===s.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(fE,"specify");function hu(s,e){var t=hE(s===void 0?"*":s||"");if(!e)return t.filter(cu).sort(au).map(dE);var r=e.map(o(function(n,a){return lE(n,t,a)},"getPriority"));return r.filter(cu).sort(au).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(hu,"preferredCharsets");function au(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(au,"compareSpecs");function dE(s){return s.charset}o(dE,"getFullCharset");function cu(s){return s.q>0}o(cu,"isQuality")});var pu=m((Rx,No)=>{"use strict";No.exports=du;No.exports.preferredEncodings=du;var pE=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function mE(s){for(var e=s.split(","),t=!1,r=1,i=0,n=0;i<e.length;i++){var a=gE(e[i].trim(),i);a&&(e[n++]=a,t=t||fu("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i}),e.length=n,e}o(mE,"parseAcceptEncoding");function gE(s,e){var t=pE.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{encoding:r,q:i,i:e}}o(gE,"parseEncoding");function yE(s,e,t){for(var r={encoding:s,o:-1,q:0,s:0},i=0;i<e.length;i++){var n=fu(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(yE,"getEncodingPriority");function fu(s,e,t){var r=0;if(e.encoding.toLowerCase()===s.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:s,i:t,o:e.i,q:e.q,s:r}}o(fu,"specify");function du(s,e,t){var r=mE(s||""),i=t?o(function(c,h){if(c.q!==h.q)return h.q-c.q;var u=t.indexOf(c.encoding),l=t.indexOf(h.encoding);return u===-1&&l===-1?h.s-c.s||c.o-h.o||c.i-h.i:u!==-1&&l!==-1?u-l:u===-1?1:-1},"comparator"):EE;if(!e)return r.filter(lu).sort(i).map(wE);var n=e.map(o(function(c,h){return yE(c,r,h)},"getPriority"));return n.filter(lu).sort(i).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(du,"preferredEncodings");function EE(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i}o(EE,"compareSpecs");function wE(s){return s.encoding}o(wE,"getFullEncoding");function lu(s){return s.q>0}o(lu,"isQuality")});var wu=m((Ix,Po)=>{"use strict";Po.exports=Eu;Po.exports.preferredLanguages=Eu;var SE=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function _E(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=yu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(_E,"parseAcceptLanguage");function yu(s,e){var t=SE.exec(s);if(!t)return null;var r=t[1],i=t[2],n=r;i&&(n+="-"+i);var a=1;if(t[3])for(var c=t[3].split(";"),h=0;h<c.length;h++){var u=c[h].split("=");u[0]==="q"&&(a=parseFloat(u[1]))}return{prefix:r,suffix:i,q:a,i:e,full:n}}o(yu,"parseLanguage");function bE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=RE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(bE,"getLanguagePriority");function RE(s,e,t){var r=yu(s);if(!r)return null;var i=0;if(e.full.toLowerCase()===r.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}o(RE,"specify");function Eu(s,e){var t=_E(s===void 0?"*":s||"");if(!e)return t.filter(gu).sort(mu).map(OE);var r=e.map(o(function(n,a){return bE(n,t,a)},"getPriority"));return r.filter(gu).sort(mu).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(Eu,"preferredLanguages");function mu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(mu,"compareSpecs");function OE(s){return s.full}o(OE,"getFullLanguage");function gu(s){return s.q>0}o(gu,"isQuality")});var Iu=m((Tx,Lo)=>{"use strict";Lo.exports=Ru;Lo.exports.preferredMediaTypes=Ru;var IE=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function vE(s){for(var e=BE(s),t=0,r=0;t<e.length;t++){var i=bu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(vE,"parseAccept");function bu(s,e){var t=IE.exec(s);if(!t)return null;var r=Object.create(null),i=1,n=t[2],a=t[1];if(t[3])for(var c=NE(t[3]).map(CE),h=0;h<c.length;h++){var u=c[h],l=u[0].toLowerCase(),f=u[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(l==="q"){i=parseFloat(d);break}r[l]=d}return{type:a,subtype:n,params:r,q:i,i:e}}o(bu,"parseMediaType");function TE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=AE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(TE,"getMediaTypePriority");function AE(s,e,t){var r=bu(s),i=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var n=Object.keys(e.params);if(n.length>0)if(n.every(function(a){return e.params[a]=="*"||(e.params[a]||"").toLowerCase()==(r.params[a]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}o(AE,"specify");function Ru(s,e){var t=vE(s===void 0?"*/*":s||"");if(!e)return t.filter(_u).sort(Su).map(xE);var r=e.map(o(function(n,a){return TE(n,t,a)},"getPriority"));return r.filter(_u).sort(Su).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(Ru,"preferredMediaTypes");function Su(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(Su,"compareSpecs");function xE(s){return s.type+"/"+s.subtype}o(xE,"getFullType");function _u(s){return s.q>0}o(_u,"isQuality");function Ou(s){for(var e=0,t=0;(t=s.indexOf('"',t))!==-1;)e++,t++;return e}o(Ou,"quoteCount");function CE(s){var e=s.indexOf("="),t,r;return e===-1?t=s:(t=s.slice(0,e),r=s.slice(e+1)),[t,r]}o(CE,"splitKeyValuePair");function BE(s){for(var e=s.split(","),t=1,r=0;t<e.length;t++)Ou(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(BE,"splitMediaTypes");function NE(s){for(var e=s.split(";"),t=1,r=0;t<e.length;t++)Ou(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(NE,"splitParameters")});var vu=m((xx,ko)=>{"use strict";var PE=uu(),LE=pu(),kE=wu(),DE=Iu();ko.exports=k;ko.exports.Negotiator=k;function k(s){if(!(this instanceof k))return new k(s);this.request=s}o(k,"Negotiator");k.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");k.prototype.charsets=o(function(e){return PE(this.request.headers["accept-charset"],e)},"charsets");k.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");k.prototype.encodings=o(function(e,t){var r=t||{};return LE(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");k.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");k.prototype.languages=o(function(e){return kE(this.request.headers["accept-language"],e)},"languages");k.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");k.prototype.mediaTypes=o(function(e){return DE(this.request.headers.accept,e)},"mediaTypes");k.prototype.preferredCharset=k.prototype.charset;k.prototype.preferredCharsets=k.prototype.charsets;k.prototype.preferredEncoding=k.prototype.encoding;k.prototype.preferredEncodings=k.prototype.encodings;k.prototype.preferredLanguage=k.prototype.language;k.prototype.preferredLanguages=k.prototype.languages;k.prototype.preferredMediaType=k.prototype.mediaType;k.prototype.preferredMediaTypes=k.prototype.mediaTypes});var St=m((Bx,qe)=>{"use strict";var Ys=require("crypto"),{Minipass:ME}=J(),Mo=["sha512","sha384","sha256"],Fo=["sha512"],$E=/^[a-z0-9+/]+(?:=?=?)$/i,FE=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,qE=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,UE=/^[\x21-\x7E]+$/,Xs=o(s=>s?.length?`?${s.join("?")}`:"","getOptString"),$o=class extends ME{static{o(this,"IntegrityStream")}#e;#t;#s;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Fo],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(Ys.createHash)}#r(){this.sri=this.opts?.integrity?me(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=Xs(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#s?t(this.#s):super.on(e,t)}emit(e,t){return e==="end"&&this.#i(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#i(){this.goodSri||this.#r();let e=me(this.hashes.map((r,i)=>`${this.algorithms[i]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
6
7
  Wanted: ${this.expectedSize}
7
- Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#s=t,this.emit("verified",t))}},dt=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let r=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let i=this.source.match(r?uw:hw);if(!i||r&&!Zo.includes(i[1]))return;this.algorithm=i[1],this.digest=i[2];let n=i[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(e,t){let r=we(e,t);if(!r)return!1;if(r.isIntegrity){let i=r.pickAlgorithm(t,[this.algorithm]);if(!i)return!1;let n=r[i].find(a=>a.digest===this.digest);return n||!1}return r.digest===this.digest?r:!1}toString(e){return e?.strict&&!(Zo.includes(this.algorithm)&&this.digest.match(cw)&&this.options.every(t=>t.match(lw)))?"":`${this.algorithm}-${this.digest}${nr(this.options)}`}};function ju(s,e,t,r){let i=s!=="",n=!1,a="",c=r.length-1;for(let u=0;u<c;u++){let l=dt.prototype.toString.call(r[u],t);l&&(n=!0,a+=l,a+=e)}let h=dt.prototype.toString.call(r[c],t);return h&&(n=!0,a+=h),i&&n?s+e+a:s+a}o(ju,"integrityHashToString");var Ut=class{static{o(this,"Integrity")}get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||" ",r="";if(e?.strict){t=t.replace(/\S+/g," ");for(let i of Zo)this[i]&&(r=ju(r,t,e,this[i]))}else for(let i of Object.keys(this))r=ju(r,t,e,this[i]);return r}concat(e,t){let r=typeof e=="string"?e:rr(e,t);return we(`${this.toString(t)} ${r}`,t)}hexDigest(){return we(this,{single:!0}).hexDigest()}merge(e,t){let r=we(e,t);for(let i in r)if(this[i]){if(!this[i].find(n=>r[i].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[i]=r[i]}match(e,t){let r=we(e,t);if(!r)return!1;let i=r.pickAlgorithm(t,Object.keys(this));return!!i&&this[i]&&r[i]&&this[i].find(n=>r[i].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let r=e?.pickAlgorithm||ww,i=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return i.length?i.reduce((n,a)=>r(n,a)||n):null}};ze.exports.parse=we;function we(s,e){if(!s)return null;if(typeof s=="string")return Wo(s,e);if(s.algorithm&&s.digest){let t=new Ut;return t[s.algorithm]=[s],Wo(rr(t,e),e)}else return Wo(rr(s,e),e)}o(we,"parse");function Wo(s,e){if(e?.single)return new dt(s,e);let t=s.trim().split(/\s+/).reduce((r,i)=>{let n=new dt(i,e);if(n.algorithm&&n.digest){let a=n.algorithm;r[a]||(r[a]=[]),r[a].push(n)}return r},new Ut);return t.isEmpty()?null:t}o(Wo,"_parse");ze.exports.stringify=rr;function rr(s,e){return s.algorithm&&s.digest?dt.prototype.toString.call(s,e):typeof s=="string"?rr(we(s,e),e):Ut.prototype.toString.call(s,e)}o(rr,"stringify");ze.exports.fromHex=fw;function fw(s,e,t){let r=nr(t?.options);return we(`${e}-${Buffer.from(s,"hex").toString("base64")}${r}`,t)}o(fw,"fromHex");ze.exports.fromData=dw;function dw(s,e){let t=e?.algorithms||[...Yo],r=nr(e?.options);return t.reduce((i,n)=>{let a=ir.createHash(n).update(s).digest("base64"),c=new dt(`${n}-${a}${r}`,e);if(c.algorithm&&c.digest){let h=c.algorithm;i[h]||(i[h]=[]),i[h].push(c)}return i},new Ut)}o(dw,"fromData");ze.exports.fromStream=pw;function pw(s,e){let t=Xo(e);return new Promise((r,i)=>{s.pipe(t),s.on("error",i),t.on("error",i);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>r(n)),t.resume()})}o(pw,"fromStream");ze.exports.checkData=mw;function mw(s,e,t){if(e=we(e,t),!e||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let r=e.pickAlgorithm(t),i=ir.createHash(r).update(s).digest("base64"),n=we({algorithm:r,digest:i}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&s.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
8
+ Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#s=t,this.emit("verified",t))}},ht=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let r=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let i=this.source.match(r?qE:FE);if(!i||r&&!Mo.includes(i[1]))return;this.algorithm=i[1],this.digest=i[2];let n=i[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(e,t){let r=me(e,t);if(!r)return!1;if(r.isIntegrity){let i=r.pickAlgorithm(t,[this.algorithm]);if(!i)return!1;let n=r[i].find(a=>a.digest===this.digest);return n||!1}return r.digest===this.digest?r:!1}toString(e){return e?.strict&&!(Mo.includes(this.algorithm)&&this.digest.match($E)&&this.options.every(t=>t.match(UE)))?"":`${this.algorithm}-${this.digest}${Xs(this.options)}`}};function Tu(s,e,t,r){let i=s!=="",n=!1,a="",c=r.length-1;for(let u=0;u<c;u++){let l=ht.prototype.toString.call(r[u],t);l&&(n=!0,a+=l,a+=e)}let h=ht.prototype.toString.call(r[c],t);return h&&(n=!0,a+=h),i&&n?s+e+a:s+a}o(Tu,"integrityHashToString");var Dt=class{static{o(this,"Integrity")}get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||" ",r="";if(e?.strict){t=t.replace(/\S+/g," ");for(let i of Mo)this[i]&&(r=Tu(r,t,e,this[i]))}else for(let i of Object.keys(this))r=Tu(r,t,e,this[i]);return r}concat(e,t){let r=typeof e=="string"?e:Ks(e,t);return me(`${this.toString(t)} ${r}`,t)}hexDigest(){return me(this,{single:!0}).hexDigest()}merge(e,t){let r=me(e,t);for(let i in r)if(this[i]){if(!this[i].find(n=>r[i].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[i]=r[i]}match(e,t){let r=me(e,t);if(!r)return!1;let i=r.pickAlgorithm(t,Object.keys(this));return!!i&&this[i]&&r[i]&&this[i].find(n=>r[i].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let r=e?.pickAlgorithm||KE,i=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return i.length?i.reduce((n,a)=>r(n,a)||n):null}};qe.exports.parse=me;function me(s,e){if(!s)return null;if(typeof s=="string")return Do(s,e);if(s.algorithm&&s.digest){let t=new Dt;return t[s.algorithm]=[s],Do(Ks(t,e),e)}else return Do(Ks(s,e),e)}o(me,"parse");function Do(s,e){if(e?.single)return new ht(s,e);let t=s.trim().split(/\s+/).reduce((r,i)=>{let n=new ht(i,e);if(n.algorithm&&n.digest){let a=n.algorithm;r[a]||(r[a]=[]),r[a].push(n)}return r},new Dt);return t.isEmpty()?null:t}o(Do,"_parse");qe.exports.stringify=Ks;function Ks(s,e){return s.algorithm&&s.digest?ht.prototype.toString.call(s,e):typeof s=="string"?Ks(me(s,e),e):Dt.prototype.toString.call(s,e)}o(Ks,"stringify");qe.exports.fromHex=jE;function jE(s,e,t){let r=Xs(t?.options);return me(`${e}-${Buffer.from(s,"hex").toString("base64")}${r}`,t)}o(jE,"fromHex");qe.exports.fromData=HE;function HE(s,e){let t=e?.algorithms||[...Fo],r=Xs(e?.options);return t.reduce((i,n)=>{let a=Ys.createHash(n).update(s).digest("base64"),c=new ht(`${n}-${a}${r}`,e);if(c.algorithm&&c.digest){let h=c.algorithm;i[h]||(i[h]=[]),i[h].push(c)}return i},new Dt)}o(HE,"fromData");qe.exports.fromStream=zE;function zE(s,e){let t=qo(e);return new Promise((r,i)=>{s.pipe(t),s.on("error",i),t.on("error",i);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>r(n)),t.resume()})}o(zE,"fromStream");qe.exports.checkData=GE;function GE(s,e,t){if(e=me(e,t),!e||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let r=e.pickAlgorithm(t),i=Ys.createHash(r).update(s).digest("base64"),n=me({algorithm:r,digest:i}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&s.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
8
9
  Wanted: ${t.size}
9
- Found: ${s.length}`);throw c.code="EBADSIZE",c.found=s.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${s.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(mw,"checkData");ze.exports.checkStream=gw;function gw(s,e,t){if(t=t||Object.create(null),t.integrity=e,e=we(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=Xo(t);return new Promise((i,n)=>{s.pipe(r),s.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>i(a)),r.resume()})}o(gw,"checkStream");ze.exports.integrityStream=Xo;function Xo(s=Object.create(null)){return new Ko(s)}o(Xo,"integrityStream");ze.exports.create=yw;function yw(s){let e=s?.algorithms||[...Yo],t=nr(s?.options),r=e.map(ir.createHash);return{update:o(function(i,n){return r.forEach(a=>a.update(i,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),h=new dt(`${a}-${c}${t}`,s);if(h.algorithm&&h.digest){let u=h.algorithm;n[u]||(n[u]=[]),n[u].push(h)}return n},new Ut)},"digest")}}o(yw,"createIntegrity");var Ew=ir.getHashes(),Hu=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(s=>Ew.includes(s));function ww(s,e){return Hu.indexOf(s.toLowerCase())>=Hu.indexOf(e.toLowerCase())?s:e}o(ww,"getPrioritizedHash")});var Qo=m((vx,Zu)=>{var zu=_u(),Gu=Uu(),Sw=Ot(),Vu={shared:!1,ignoreCargoCult:!0},_w={status:200,headers:{}},fs=o(s=>{let e={method:s.method,url:s.url,headers:{},compress:s.compress};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),Wu=o(s=>{let e={status:s.status,headers:{}};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Jo=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:i}){this.entry=e,this.request=fs(t),this.response=Wu(r),this.options=i,this.policy=new zu(this.request,this.response,Vu),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache==="no-store"||!["GET","HEAD"].includes(e.method)?!1:new zu(fs(e),_w,Vu).storable()}satisfies(e){let t=fs(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new Gu(this.request),i=new Gu(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(i.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(i.languages())||JSON.stringify(r.encodings())!==JSON.stringify(i.encodings())?!1:this.options.integrity?Sw.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(e){let t=fs(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=fs(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=fs(e),i=Wu(t);return!this.policy.revalidatedPolicy(r,i).modified}};Zu.exports=Jo});var Yu=m((Tx,Ku)=>{var ea=class extends Error{static{o(this,"NotCachedError")}constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}};Ku.exports={NotCachedError:ea}});var yi=m((Ax,el)=>{var bw=ai(),Xu=Symbol("_flush"),Ju=Symbol("_flushed"),Qu=Symbol("_flushing"),ta=class extends bw{static{o(this,"Flush")}constructor(e={}){if(typeof e=="function"&&(e={flush:e}),super(e),typeof e.flush!="function"&&typeof this.flush!="function")throw new TypeError("must provide flush function in options");this[Xu]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[Ju])return super.emit(e,...t);if(this[Qu])return;this[Qu]=!0;let r=o(n=>{this[Ju]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),i=this[Xu](r);i&&i.then&&i.then(()=>r(),n=>r(n))}};el.exports=ta});var na=m((Bx,ia)=>{var{Minipass:tl}=ee(),ds=Symbol("_data"),ps=Symbol("_length"),sa=class extends tl{static{o(this,"Collect")}constructor(e){super(e),this[ds]=[],this[ps]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[ds].push(i),this[ps]+=i.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[ds],this[ps]);return super.write(i),super.end(r)}};ia.exports=sa;var ra=class extends tl{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[ds]=[],this[ps]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[ds].push(i),this[ps]+=i.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[ds],this[ps]);return this.emit("collect",i),super.end(r)}};ia.exports.PassThrough=ra});var ms=m((Px,nl)=>{var Rw=ai(),Ow=require("events"),vw=o(s=>s&&s instanceof Ow&&(typeof s.pipe=="function"||typeof s.write=="function"&&typeof s.end=="function"),"isStream"),jt=Symbol("_head"),Se=Symbol("_tail"),oa=Symbol("_linkStreams"),aa=Symbol("_setHead"),ca=Symbol("_setTail"),sl=Symbol("_onError"),rl=Symbol("_onData"),ha=Symbol("_onEnd"),il=Symbol("_onDrain"),Ei=Symbol("_streams"),ua=class extends Rw{static{o(this,"Pipeline")}constructor(e,...t){vw(e)&&(t.unshift(e),e={}),super(e),this[Ei]=[],t.length&&this.push(...t)}[oa](e){return e.reduce((t,r)=>(t.on("error",i=>r.emit("error",i)),t.pipe(r),r))}push(...e){this[Ei].push(...e),this[Se]&&e.unshift(this[Se]);let t=this[oa](e);this[ca](t),this[jt]||this[aa](e[0])}unshift(...e){this[Ei].unshift(...e),this[jt]&&e.push(this[jt]);let t=this[oa](e);this[aa](e[0]),this[Se]||this[ca](t)}destroy(e){return this[Ei].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[ca](e){this[Se]=e,e.on("error",t=>this[sl](e,t)),e.on("data",t=>this[rl](e,t)),e.on("end",()=>this[ha](e)),e.on("finish",()=>this[ha](e))}[sl](e,t){e===this[Se]&&this.emit("error",t)}[rl](e,t){e===this[Se]&&super.write(t)}[ha](e){e===this[Se]&&super.end()}pause(){return super.pause(),this[Se]&&this[Se].pause&&this[Se].pause()}emit(e,...t){return e==="resume"&&this[Se]&&this[Se].resume&&this[Se].resume(),super.emit(e,...t)}[aa](e){this[jt]=e,e.on("drain",()=>this[il](e))}[il](e){e===this[jt]&&this.emit("drain")}write(e,t,r){return this[jt].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[jt].end(e,t,r),this}};nl.exports=ua});var ol=m((kx,la)=>{(function(){var s;function e(t,r){var i=this instanceof e?this:s;if(i.reset(r),typeof t=="string"&&t.length>0&&i.hash(t),i!==this)return i}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,i,n,a,c;switch(c=t.length,this.len+=c,i=this.k1,n=0,this.rem){case 0:i^=c>n?t.charCodeAt(n++)&65535:0;case 1:i^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:i^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:i^=c>n?(t.charCodeAt(n)&255)<<24:0,i^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(r=this.h1;i=i*11601+(i&65535)*3432906752&4294967295,i=i<<15|i>>>17,i=i*13715+(i&65535)*461832192&4294967295,r^=i,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(n>=c);)i=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),i^=(a&255)<<24^(a&65280)>>8;switch(i=0,this.rem){case 3:i^=(t.charCodeAt(n+2)&65535)<<16;case 2:i^=(t.charCodeAt(n+1)&65535)<<8;case 1:i^=t.charCodeAt(n)&65535}this.h1=r}return this.k1=i,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},s=new e,typeof la<"u"?la.exports=e:this.MurmurHash3=e})()});var cl=m((Fx,al)=>{"use strict";var Iw=ol();al.exports=function(s){if(s){var e=new Iw(s);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var fa=m((Mx,hl)=>{var Tw=require("path"),Cw=cl();hl.exports=function(s,e,t){return Tw.join(s,(e?e+"-":"")+Cw(t))}});var da=m(($x,Aw)=>{Aw.exports={name:"cacache",version:"20.0.1","cache-version":{content:"2",index:"5"},description:"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",snap:"tap",coverage:"tap","test-docker":'docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test',lint:"npm run eslint",npmclilint:"npmcli-lint",lintfix:"npm run eslint -- --fix",postsnap:"npm run lintfix --",postlint:"template-oss-check",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},repository:{type:"git",url:"git+https://github.com/npm/cacache.git"},keywords:["cache","caching","content-addressable","sri","sri hash","subresource integrity","cache","storage","store","file store","filesystem","disk cache","disk storage"],license:"ISC",dependencies:{"@npmcli/fs":"^4.0.0","fs-minipass":"^3.0.0",glob:"^11.0.3","lru-cache":"^11.1.0",minipass:"^7.0.3","minipass-collect":"^2.0.1","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","p-map":"^7.0.2",ssri:"^12.0.0","unique-filename":"^4.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",windowsCI:!1,version:"4.25.0",publish:"true"},author:"GitHub Inc.",tap:{"nyc-arg":["--exclude","tap-snapshots/**"]}}});var pa=m((qx,ul)=>{"use strict";ul.exports=xw;function xw(s){return[s.slice(0,2),s.slice(2,4),s.slice(4)]}o(xw,"hashToSegments")});var gs=m((jx,ma)=>{"use strict";var Bw=da()["cache-version"].content,Nw=pa(),ll=require("path"),Pw=Ot();ma.exports=Lw;function Lw(s,e){let t=Pw.parse(e,{single:!0});return ll.join(fl(s),t.algorithm,...Nw(t.hexDigest()))}o(Lw,"contentPath");ma.exports.contentDir=fl;function fl(s){return ll.join(s,`content-v${Bw}`)}o(fl,"contentDir")});var ga=m((zx,dl)=>{var kw=o((s,{copy:e,wrap:t})=>{let r={};if(s&&typeof s=="object")for(let i of e)s[i]!==void 0&&(r[i]=s[i]);else r[t]=s;return r},"getOptions");dl.exports=kw});var or=m((Vx,pl)=>{"use strict";var Dw="2.0.0",Fw=Number.MAX_SAFE_INTEGER||9007199254740991,Mw=16,$w=250,qw=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pl.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Mw,MAX_SAFE_BUILD_LENGTH:$w,MAX_SAFE_INTEGER:Fw,RELEASE_TYPES:qw,SEMVER_SPEC_VERSION:Dw,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ar=m((Wx,ml)=>{"use strict";var Uw=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>{}:()=>{};ml.exports=Uw});var ys=m((Ge,gl)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ya,MAX_SAFE_BUILD_LENGTH:jw,MAX_LENGTH:Hw}=or(),zw=ar();Ge=gl.exports={};var Gw=Ge.re=[],Vw=Ge.safeRe=[],b=Ge.src=[],Ww=Ge.safeSrc=[],R=Ge.t={},Zw=0,Ea="[a-zA-Z0-9-]",Kw=[["\\s",1],["\\d",Hw],[Ea,jw]],Yw=o(s=>{for(let[e,t]of Kw)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},"makeSafeRegex"),C=o((s,e,t)=>{let r=Yw(e),i=Zw++;zw(s,i,e),R[s]=i,b[i]=e,Ww[i]=r,Gw[i]=new RegExp(e,t?"g":void 0),Vw[i]=new RegExp(r,t?"g":void 0)},"createToken");C("NUMERICIDENTIFIER","0|[1-9]\\d*");C("NUMERICIDENTIFIERLOOSE","\\d+");C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ea}*`);C("MAINVERSION",`(${b[R.NUMERICIDENTIFIER]})\\.(${b[R.NUMERICIDENTIFIER]})\\.(${b[R.NUMERICIDENTIFIER]})`);C("MAINVERSIONLOOSE",`(${b[R.NUMERICIDENTIFIERLOOSE]})\\.(${b[R.NUMERICIDENTIFIERLOOSE]})\\.(${b[R.NUMERICIDENTIFIERLOOSE]})`);C("PRERELEASEIDENTIFIER",`(?:${b[R.NONNUMERICIDENTIFIER]}|${b[R.NUMERICIDENTIFIER]})`);C("PRERELEASEIDENTIFIERLOOSE",`(?:${b[R.NONNUMERICIDENTIFIER]}|${b[R.NUMERICIDENTIFIERLOOSE]})`);C("PRERELEASE",`(?:-(${b[R.PRERELEASEIDENTIFIER]}(?:\\.${b[R.PRERELEASEIDENTIFIER]})*))`);C("PRERELEASELOOSE",`(?:-?(${b[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[R.PRERELEASEIDENTIFIERLOOSE]})*))`);C("BUILDIDENTIFIER",`${Ea}+`);C("BUILD",`(?:\\+(${b[R.BUILDIDENTIFIER]}(?:\\.${b[R.BUILDIDENTIFIER]})*))`);C("FULLPLAIN",`v?${b[R.MAINVERSION]}${b[R.PRERELEASE]}?${b[R.BUILD]}?`);C("FULL",`^${b[R.FULLPLAIN]}$`);C("LOOSEPLAIN",`[v=\\s]*${b[R.MAINVERSIONLOOSE]}${b[R.PRERELEASELOOSE]}?${b[R.BUILD]}?`);C("LOOSE",`^${b[R.LOOSEPLAIN]}$`);C("GTLT","((?:<|>)?=?)");C("XRANGEIDENTIFIERLOOSE",`${b[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);C("XRANGEIDENTIFIER",`${b[R.NUMERICIDENTIFIER]}|x|X|\\*`);C("XRANGEPLAIN",`[v=\\s]*(${b[R.XRANGEIDENTIFIER]})(?:\\.(${b[R.XRANGEIDENTIFIER]})(?:\\.(${b[R.XRANGEIDENTIFIER]})(?:${b[R.PRERELEASE]})?${b[R.BUILD]}?)?)?`);C("XRANGEPLAINLOOSE",`[v=\\s]*(${b[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[R.XRANGEIDENTIFIERLOOSE]})(?:${b[R.PRERELEASELOOSE]})?${b[R.BUILD]}?)?)?`);C("XRANGE",`^${b[R.GTLT]}\\s*${b[R.XRANGEPLAIN]}$`);C("XRANGELOOSE",`^${b[R.GTLT]}\\s*${b[R.XRANGEPLAINLOOSE]}$`);C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ya}})(?:\\.(\\d{1,${ya}}))?(?:\\.(\\d{1,${ya}}))?`);C("COERCE",`${b[R.COERCEPLAIN]}(?:$|[^\\d])`);C("COERCEFULL",b[R.COERCEPLAIN]+`(?:${b[R.PRERELEASE]})?(?:${b[R.BUILD]})?(?:$|[^\\d])`);C("COERCERTL",b[R.COERCE],!0);C("COERCERTLFULL",b[R.COERCEFULL],!0);C("LONETILDE","(?:~>?)");C("TILDETRIM",`(\\s*)${b[R.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";C("TILDE",`^${b[R.LONETILDE]}${b[R.XRANGEPLAIN]}$`);C("TILDELOOSE",`^${b[R.LONETILDE]}${b[R.XRANGEPLAINLOOSE]}$`);C("LONECARET","(?:\\^)");C("CARETTRIM",`(\\s*)${b[R.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";C("CARET",`^${b[R.LONECARET]}${b[R.XRANGEPLAIN]}$`);C("CARETLOOSE",`^${b[R.LONECARET]}${b[R.XRANGEPLAINLOOSE]}$`);C("COMPARATORLOOSE",`^${b[R.GTLT]}\\s*(${b[R.LOOSEPLAIN]})$|^$`);C("COMPARATOR",`^${b[R.GTLT]}\\s*(${b[R.FULLPLAIN]})$|^$`);C("COMPARATORTRIM",`(\\s*)${b[R.GTLT]}\\s*(${b[R.LOOSEPLAIN]}|${b[R.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";C("HYPHENRANGE",`^\\s*(${b[R.XRANGEPLAIN]})\\s+-\\s+(${b[R.XRANGEPLAIN]})\\s*$`);C("HYPHENRANGELOOSE",`^\\s*(${b[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[R.XRANGEPLAINLOOSE]})\\s*$`);C("STAR","(<|>)?=?\\s*\\*");C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wi=m((Kx,yl)=>{"use strict";var Xw=Object.freeze({loose:!0}),Jw=Object.freeze({}),Qw=o(s=>s?typeof s!="object"?Xw:s:Jw,"parseOptions");yl.exports=Qw});var wa=m((Xx,Sl)=>{"use strict";var El=/^[0-9]+$/,wl=o((s,e)=>{let t=El.test(s),r=El.test(e);return t&&r&&(s=+s,e=+e),s===e?0:t&&!r?-1:r&&!t?1:s<e?-1:1},"compareIdentifiers"),eS=o((s,e)=>wl(e,s),"rcompareIdentifiers");Sl.exports={compareIdentifiers:wl,rcompareIdentifiers:eS}});var re=m((Qx,bl)=>{"use strict";var Si=ar(),{MAX_LENGTH:_l,MAX_SAFE_INTEGER:_i}=or(),{safeRe:bi,t:Ri}=ys(),tS=wi(),{compareIdentifiers:Es}=wa(),Sa=class s{static{o(this,"SemVer")}constructor(e,t){if(t=tS(t),e instanceof s){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>_l)throw new TypeError(`version is longer than ${_l} characters`);Si("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?bi[Ri.LOOSE]:bi[Ri.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>_i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<_i)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Si("SemVer.compare",this.version,this.options,e),!(e instanceof s)){if(typeof e=="string"&&e===this.version)return 0;e=new s(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),Es(this.major,e.major)||Es(this.minor,e.minor)||Es(this.patch,e.patch)}comparePre(e){if(e instanceof s||(e=new s(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(Si("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Es(r,i)}while(++t)}compareBuild(e){e instanceof s||(e=new s(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(Si("build compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Es(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?bi[Ri.PRERELEASELOOSE]:bi[Ri.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];r===!1&&(n=[t]),Es(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};bl.exports=Sa});var Ht=m((t1,Ol)=>{"use strict";var Rl=re(),sS=o((s,e,t=!1)=>{if(s instanceof Rl)return s;try{return new Rl(s,e)}catch(r){if(!t)return null;throw r}},"parse");Ol.exports=sS});var Il=m((r1,vl)=>{"use strict";var rS=Ht(),iS=o((s,e)=>{let t=rS(s,e);return t?t.version:null},"valid");vl.exports=iS});var Cl=m((n1,Tl)=>{"use strict";var nS=Ht(),oS=o((s,e)=>{let t=nS(s.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");Tl.exports=oS});var Bl=m((a1,xl)=>{"use strict";var Al=re(),aS=o((s,e,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new Al(s instanceof Al?s.version:s,t).inc(e,r,i).version}catch{return null}},"inc");xl.exports=aS});var Ll=m((h1,Pl)=>{"use strict";var Nl=Ht(),cS=o((s,e)=>{let t=Nl(s,null,!0),r=Nl(e,null,!0),i=t.compare(r);if(i===0)return null;let n=i>0,a=n?t:r,c=n?r:t,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let l=h?"pre":"";return t.major!==r.major?l+"major":t.minor!==r.minor?l+"minor":t.patch!==r.patch?l+"patch":"prerelease"},"diff");Pl.exports=cS});var Dl=m((l1,kl)=>{"use strict";var hS=re(),uS=o((s,e)=>new hS(s,e).major,"major");kl.exports=uS});var Ml=m((d1,Fl)=>{"use strict";var lS=re(),fS=o((s,e)=>new lS(s,e).minor,"minor");Fl.exports=fS});var ql=m((m1,$l)=>{"use strict";var dS=re(),pS=o((s,e)=>new dS(s,e).patch,"patch");$l.exports=pS});var jl=m((y1,Ul)=>{"use strict";var mS=Ht(),gS=o((s,e)=>{let t=mS(s,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");Ul.exports=gS});var Oe=m((w1,zl)=>{"use strict";var Hl=re(),yS=o((s,e,t)=>new Hl(s,t).compare(new Hl(e,t)),"compare");zl.exports=yS});var Vl=m((_1,Gl)=>{"use strict";var ES=Oe(),wS=o((s,e,t)=>ES(e,s,t),"rcompare");Gl.exports=wS});var Zl=m((R1,Wl)=>{"use strict";var SS=Oe(),_S=o((s,e)=>SS(s,e,!0),"compareLoose");Wl.exports=_S});var Oi=m((v1,Yl)=>{"use strict";var Kl=re(),bS=o((s,e,t)=>{let r=new Kl(s,t),i=new Kl(e,t);return r.compare(i)||r.compareBuild(i)},"compareBuild");Yl.exports=bS});var Jl=m((T1,Xl)=>{"use strict";var RS=Oi(),OS=o((s,e)=>s.sort((t,r)=>RS(t,r,e)),"sort");Xl.exports=OS});var ef=m((A1,Ql)=>{"use strict";var vS=Oi(),IS=o((s,e)=>s.sort((t,r)=>vS(r,t,e)),"rsort");Ql.exports=IS});var cr=m((B1,tf)=>{"use strict";var TS=Oe(),CS=o((s,e,t)=>TS(s,e,t)>0,"gt");tf.exports=CS});var vi=m((P1,sf)=>{"use strict";var AS=Oe(),xS=o((s,e,t)=>AS(s,e,t)<0,"lt");sf.exports=xS});var _a=m((k1,rf)=>{"use strict";var BS=Oe(),NS=o((s,e,t)=>BS(s,e,t)===0,"eq");rf.exports=NS});var ba=m((F1,nf)=>{"use strict";var PS=Oe(),LS=o((s,e,t)=>PS(s,e,t)!==0,"neq");nf.exports=LS});var Ii=m(($1,of)=>{"use strict";var kS=Oe(),DS=o((s,e,t)=>kS(s,e,t)>=0,"gte");of.exports=DS});var Ti=m((U1,af)=>{"use strict";var FS=Oe(),MS=o((s,e,t)=>FS(s,e,t)<=0,"lte");af.exports=MS});var Ra=m((H1,cf)=>{"use strict";var $S=_a(),qS=ba(),US=cr(),jS=Ii(),HS=vi(),zS=Ti(),GS=o((s,e,t,r)=>{switch(e){case"===":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s===t;case"!==":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s!==t;case"":case"=":case"==":return $S(s,t,r);case"!=":return qS(s,t,r);case">":return US(s,t,r);case">=":return jS(s,t,r);case"<":return HS(s,t,r);case"<=":return zS(s,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");cf.exports=GS});var uf=m((G1,hf)=>{"use strict";var VS=re(),WS=Ht(),{safeRe:Ci,t:Ai}=ys(),ZS=o((s,e)=>{if(s instanceof VS)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;e=e||{};let t=null;if(!e.rtl)t=s.match(e.includePrerelease?Ci[Ai.COERCEFULL]:Ci[Ai.COERCE]);else{let h=e.includePrerelease?Ci[Ai.COERCERTLFULL]:Ci[Ai.COERCERTL],u;for(;(u=h.exec(s))&&(!t||t.index+t[0].length!==s.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(t===null)return null;let r=t[2],i=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return WS(`${r}.${i}.${n}${a}${c}`,e)},"coerce");hf.exports=ZS});var ff=m((W1,lf)=>{"use strict";var Oa=class{static{o(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};lf.exports=Oa});var ve=m((K1,gf)=>{"use strict";var KS=/\s+/g,va=class s{static{o(this,"Range")}constructor(e,t){if(t=XS(t),e instanceof s)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new s(e.raw,t);if(e instanceof Ia)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(KS," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!pf(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&i_(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&s_)|(this.options.loose&&r_))+":"+e,i=df.get(r);if(i)return i;let n=this.options.loose,a=n?fe[ae.HYPHENRANGELOOSE]:fe[ae.HYPHENRANGE];e=e.replace(a,p_(this.options.includePrerelease)),q("hyphen replace",e),e=e.replace(fe[ae.COMPARATORTRIM],QS),q("comparator trim",e),e=e.replace(fe[ae.TILDETRIM],e_),q("tilde trim",e),e=e.replace(fe[ae.CARETTRIM],t_),q("caret trim",e);let c=e.split(" ").map(f=>n_(f,this.options)).join(" ").split(/\s+/).map(f=>d_(f,this.options));n&&(c=c.filter(f=>(q("loose invalid filter",f,this.options),!!f.match(fe[ae.COMPARATORLOOSE])))),q("range list",c);let h=new Map,u=c.map(f=>new Ia(f,this.options));for(let f of u){if(pf(f))return[f];h.set(f.value,f)}h.size>1&&h.has("")&&h.delete("");let l=[...h.values()];return df.set(r,l),l}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Range is required");return this.set.some(r=>mf(r,t)&&e.set.some(i=>mf(i,t)&&r.every(n=>i.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new JS(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(m_(this.set[t],e,this.options))return!0;return!1}};gf.exports=va;var YS=ff(),df=new YS,XS=wi(),Ia=hr(),q=ar(),JS=re(),{safeRe:fe,t:ae,comparatorTrimReplace:QS,tildeTrimReplace:e_,caretTrimReplace:t_}=ys(),{FLAG_INCLUDE_PRERELEASE:s_,FLAG_LOOSE:r_}=or(),pf=o(s=>s.value==="<0.0.0-0","isNullSet"),i_=o(s=>s.value==="","isAny"),mf=o((s,e)=>{let t=!0,r=s.slice(),i=r.pop();for(;t&&r.length;)t=r.every(n=>i.intersects(n,e)),i=r.pop();return t},"isSatisfiable"),n_=o((s,e)=>(q("comp",s,e),s=c_(s,e),q("caret",s),s=o_(s,e),q("tildes",s),s=u_(s,e),q("xrange",s),s=f_(s,e),q("stars",s),s),"parseComparator"),ce=o(s=>!s||s.toLowerCase()==="x"||s==="*","isX"),o_=o((s,e)=>s.trim().split(/\s+/).map(t=>a_(t,e)).join(" "),"replaceTildes"),a_=o((s,e)=>{let t=e.loose?fe[ae.TILDELOOSE]:fe[ae.TILDE];return s.replace(t,(r,i,n,a,c)=>{q("tilde",s,r,i,n,a,c);let h;return ce(i)?h="":ce(n)?h=`>=${i}.0.0 <${+i+1}.0.0-0`:ce(a)?h=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:c?(q("replaceTilde pr",c),h=`>=${i}.${n}.${a}-${c} <${i}.${+n+1}.0-0`):h=`>=${i}.${n}.${a} <${i}.${+n+1}.0-0`,q("tilde return",h),h})},"replaceTilde"),c_=o((s,e)=>s.trim().split(/\s+/).map(t=>h_(t,e)).join(" "),"replaceCarets"),h_=o((s,e)=>{q("caret",s,e);let t=e.loose?fe[ae.CARETLOOSE]:fe[ae.CARET],r=e.includePrerelease?"-0":"";return s.replace(t,(i,n,a,c,h)=>{q("caret",s,i,n,a,c,h);let u;return ce(n)?u="":ce(a)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:ce(c)?n==="0"?u=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:h?(q("replaceCaret pr",h),n==="0"?a==="0"?u=`>=${n}.${a}.${c}-${h} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}-${h} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c}-${h} <${+n+1}.0.0-0`):(q("no pr"),n==="0"?a==="0"?u=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),q("caret return",u),u})},"replaceCaret"),u_=o((s,e)=>(q("replaceXRanges",s,e),s.split(/\s+/).map(t=>l_(t,e)).join(" ")),"replaceXRanges"),l_=o((s,e)=>{s=s.trim();let t=e.loose?fe[ae.XRANGELOOSE]:fe[ae.XRANGE];return s.replace(t,(r,i,n,a,c,h)=>{q("xRange",s,r,i,n,a,c,h);let u=ce(n),l=u||ce(a),f=l||ce(c),d=f;return i==="="&&d&&(i=""),h=e.includePrerelease?"-0":"",u?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&d?(l&&(a=0),c=0,i===">"?(i=">=",l?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):i==="<="&&(i="<",l?n=+n+1:a=+a+1),i==="<"&&(h="-0"),r=`${i+n}.${a}.${c}${h}`):l?r=`>=${n}.0.0${h} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${h} <${n}.${+a+1}.0-0`),q("xRange return",r),r})},"replaceXRange"),f_=o((s,e)=>(q("replaceStars",s,e),s.trim().replace(fe[ae.STAR],"")),"replaceStars"),d_=o((s,e)=>(q("replaceGTE0",s,e),s.trim().replace(fe[e.includePrerelease?ae.GTE0PRE:ae.GTE0],"")),"replaceGTE0"),p_=o(s=>(e,t,r,i,n,a,c,h,u,l,f,d)=>(ce(r)?t="":ce(i)?t=`>=${r}.0.0${s?"-0":""}`:ce(n)?t=`>=${r}.${i}.0${s?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${s?"-0":""}`,ce(u)?h="":ce(l)?h=`<${+u+1}.0.0-0`:ce(f)?h=`<${u}.${+l+1}.0-0`:d?h=`<=${u}.${l}.${f}-${d}`:s?h=`<${u}.${l}.${+f+1}-0`:h=`<=${h}`,`${t} ${h}`.trim()),"hyphenReplace"),m_=o((s,e,t)=>{for(let r=0;r<s.length;r++)if(!s[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<s.length;r++)if(q(s[r].semver),s[r].semver!==Ia.ANY&&s[r].semver.prerelease.length>0){let i=s[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},"testSet")});var hr=m((X1,bf)=>{"use strict";var ur=Symbol("SemVer ANY"),Aa=class s{static{o(this,"Comparator")}static get ANY(){return ur}constructor(e,t){if(t=yf(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ca("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ur?this.value="":this.value=this.operator+this.semver.version,Ca("comp",this)}parse(e){let t=this.options.loose?Ef[wf.COMPARATORLOOSE]:Ef[wf.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Sf(r[2],this.options.loose):this.semver=ur}toString(){return this.value}test(e){if(Ca("Comparator.test",e,this.options.loose),this.semver===ur||e===ur)return!0;if(typeof e=="string")try{e=new Sf(e,this.options)}catch{return!1}return Ta(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new _f(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new _f(this.value,t).test(e.semver):(t=yf(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ta(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ta(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};bf.exports=Aa;var yf=wi(),{safeRe:Ef,t:wf}=ys(),Ta=Ra(),Ca=ar(),Sf=re(),_f=ve()});var lr=m((Q1,Rf)=>{"use strict";var g_=ve(),y_=o((s,e,t)=>{try{e=new g_(e,t)}catch{return!1}return e.test(s)},"satisfies");Rf.exports=y_});var vf=m((tB,Of)=>{"use strict";var E_=ve(),w_=o((s,e)=>new E_(s,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");Of.exports=w_});var Tf=m((rB,If)=>{"use strict";var S_=re(),__=ve(),b_=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new __(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new S_(r,t))}),r},"maxSatisfying");If.exports=b_});var Af=m((nB,Cf)=>{"use strict";var R_=re(),O_=ve(),v_=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new O_(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new R_(r,t))}),r},"minSatisfying");Cf.exports=v_});var Nf=m((aB,Bf)=>{"use strict";var xa=re(),I_=ve(),xf=cr(),T_=o((s,e)=>{s=new I_(s,e);let t=new xa("0.0.0");if(s.test(t)||(t=new xa("0.0.0-0"),s.test(t)))return t;t=null;for(let r=0;r<s.set.length;++r){let i=s.set[r],n=null;i.forEach(a=>{let c=new xa(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||xf(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||xf(t,n))&&(t=n)}return t&&s.test(t)?t:null},"minVersion");Bf.exports=T_});var Lf=m((hB,Pf)=>{"use strict";var C_=ve(),A_=o((s,e)=>{try{return new C_(s,e).range||"*"}catch{return null}},"validRange");Pf.exports=A_});var xi=m((lB,Mf)=>{"use strict";var x_=re(),Ff=hr(),{ANY:B_}=Ff,N_=ve(),P_=lr(),kf=cr(),Df=vi(),L_=Ti(),k_=Ii(),D_=o((s,e,t,r)=>{s=new x_(s,r),e=new N_(e,r);let i,n,a,c,h;switch(t){case">":i=kf,n=L_,a=Df,c=">",h=">=";break;case"<":i=Df,n=k_,a=kf,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P_(s,e,r))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],f=null,d=null;if(l.forEach(p=>{p.semver===B_&&(p=new Ff(">=0.0.0")),f=f||p,d=d||p,i(p.semver,f.semver,r)?f=p:a(p.semver,d.semver,r)&&(d=p)}),f.operator===c||f.operator===h||(!d.operator||d.operator===c)&&n(s,d.semver))return!1;if(d.operator===h&&a(s,d.semver))return!1}return!0},"outside");Mf.exports=D_});var qf=m((dB,$f)=>{"use strict";var F_=xi(),M_=o((s,e,t)=>F_(s,e,">",t),"gtr");$f.exports=M_});var jf=m((mB,Uf)=>{"use strict";var $_=xi(),q_=o((s,e,t)=>$_(s,e,"<",t),"ltr");Uf.exports=q_});var Gf=m((yB,zf)=>{"use strict";var Hf=ve(),U_=o((s,e,t)=>(s=new Hf(s,t),e=new Hf(e,t),s.intersects(e,t)),"intersects");zf.exports=U_});var Wf=m((wB,Vf)=>{"use strict";var j_=lr(),H_=Oe();Vf.exports=(s,e,t)=>{let r=[],i=null,n=null,a=s.sort((l,f)=>H_(l,f,t));for(let l of a)j_(l,e,t)?(n=l,i||(i=l)):(n&&r.push([i,n]),n=null,i=null);i&&r.push([i,null]);let c=[];for(let[l,f]of r)l===f?c.push(l):!f&&l===a[0]?c.push("*"):f?l===a[0]?c.push(`<=${f}`):c.push(`${l} - ${f}`):c.push(`>=${l}`);let h=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return h.length<u.length?h:e}});var Qf=m((SB,Jf)=>{"use strict";var Zf=ve(),Na=hr(),{ANY:Ba}=Na,fr=lr(),Pa=Oe(),z_=o((s,e,t={})=>{if(s===e)return!0;s=new Zf(s,t),e=new Zf(e,t);let r=!1;e:for(let i of s.set){for(let n of e.set){let a=V_(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),G_=[new Na(">=0.0.0-0")],Kf=[new Na(">=0.0.0")],V_=o((s,e,t)=>{if(s===e)return!0;if(s.length===1&&s[0].semver===Ba){if(e.length===1&&e[0].semver===Ba)return!0;t.includePrerelease?s=G_:s=Kf}if(e.length===1&&e[0].semver===Ba){if(t.includePrerelease)return!0;e=Kf}let r=new Set,i,n;for(let p of s)p.operator===">"||p.operator===">="?i=Yf(i,p,t):p.operator==="<"||p.operator==="<="?n=Xf(n,p,t):r.add(p.semver);if(r.size>1)return null;let a;if(i&&n){if(a=Pa(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of r){if(i&&!fr(p,String(i),t)||n&&!fr(p,String(n),t))return null;for(let y of e)if(!fr(p,String(y),t))return!1;return!0}let c,h,u,l,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,d=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",i){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator===">"||p.operator===">="){if(c=Yf(i,p,t),c===p&&c!==i)return!1}else if(i.operator===">="&&!fr(i.semver,String(p),t))return!1}if(n){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(h=Xf(n,p,t),h===p&&h!==n)return!1}else if(n.operator==="<="&&!fr(n.semver,String(p),t))return!1}if(!p.operator&&(n||i)&&a!==0)return!1}return!(i&&u&&!n&&a!==0||n&&l&&!i&&a!==0||d||f)},"simpleSubset"),Yf=o((s,e,t)=>{if(!s)return e;let r=Pa(s.semver,e.semver,t);return r>0?s:r<0||e.operator===">"&&s.operator===">="?e:s},"higherGT"),Xf=o((s,e,t)=>{if(!s)return e;let r=Pa(s.semver,e.semver,t);return r<0?s:r>0||e.operator==="<"&&s.operator==="<="?e:s},"lowerLT");Jf.exports=z_});var rd=m((bB,sd)=>{"use strict";var La=ys(),ed=or(),W_=re(),td=wa(),Z_=Ht(),K_=Il(),Y_=Cl(),X_=Bl(),J_=Ll(),Q_=Dl(),e0=Ml(),t0=ql(),s0=jl(),r0=Oe(),i0=Vl(),n0=Zl(),o0=Oi(),a0=Jl(),c0=ef(),h0=cr(),u0=vi(),l0=_a(),f0=ba(),d0=Ii(),p0=Ti(),m0=Ra(),g0=uf(),y0=hr(),E0=ve(),w0=lr(),S0=vf(),_0=Tf(),b0=Af(),R0=Nf(),O0=Lf(),v0=xi(),I0=qf(),T0=jf(),C0=Gf(),A0=Wf(),x0=Qf();sd.exports={parse:Z_,valid:K_,clean:Y_,inc:X_,diff:J_,major:Q_,minor:e0,patch:t0,prerelease:s0,compare:r0,rcompare:i0,compareLoose:n0,compareBuild:o0,sort:a0,rsort:c0,gt:h0,lt:u0,eq:l0,neq:f0,gte:d0,lte:p0,cmp:m0,coerce:g0,Comparator:y0,Range:E0,satisfies:w0,toComparators:S0,maxSatisfying:_0,minSatisfying:b0,minVersion:R0,validRange:O0,outside:v0,gtr:I0,ltr:T0,intersects:C0,simplifyRange:A0,subset:x0,SemVer:W_,re:La.re,src:La.src,tokens:La.t,SEMVER_SPEC_VERSION:ed.SEMVER_SPEC_VERSION,RELEASE_TYPES:ed.RELEASE_TYPES,compareIdentifiers:td.compareIdentifiers,rcompareIdentifiers:td.rcompareIdentifiers}});var nd=m((RB,id)=>{var B0=rd(),N0=o(s=>B0.satisfies(process.version,s,{includePrerelease:!0}),"satisfies");id.exports={satisfies:N0}});var od=m((TB,Da)=>{"use strict";var{inspect:P0}=require("util"),ka=class{static{o(this,"SystemError")}constructor(e,t,r){let i=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(i+=` ${r.path}`),r.dest!==void 0&&(i+=` => ${r.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:i,enumerable:!1,writable:!0,configurable:!0},info:{value:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return P0(this,{...t,getters:!0,customInspect:!1})}};function pt(s,e){Da.exports[s]=class extends ka{static{o(this,"NodeError")}constructor(r){super(s,e,r)}}}o(pt,"E");pt("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");pt("ERR_FS_CP_EEXIST","Target already exists");pt("ERR_FS_CP_EINVAL","Invalid src or dest");pt("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");pt("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");pt("ERR_FS_CP_SOCKET","Cannot copy a socket file");pt("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");pt("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");pt("ERR_FS_EISDIR","Path is a directory");Da.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var vd=m((AB,Od)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:L0,ERR_FS_CP_EEXIST:k0,ERR_FS_CP_EINVAL:Bi,ERR_FS_CP_FIFO_PIPE:D0,ERR_FS_CP_NON_DIR_TO_DIR:F0,ERR_FS_CP_SOCKET:M0,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:$0,ERR_FS_CP_UNKNOWN:q0,ERR_FS_EISDIR:U0,ERR_INVALID_ARG_TYPE:j0}=od(),{constants:{errno:{EEXIST:H0,EISDIR:z0,EINVAL:mt,ENOTDIR:G0}}}=require("os"),{chmod:V0,copyFile:W0,lstat:md,mkdir:gd,readdir:Z0,readlink:ad,stat:ws,symlink:Fa,unlink:yd,utimes:K0}=require("fs/promises"),{dirname:dr,isAbsolute:cd,join:hd,parse:Y0,resolve:pr,sep:X0,toNamespacedPath:ud}=require("path"),{fileURLToPath:J0}=require("url"),Q0={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function eb(s,e,t){if(t!=null&&typeof t!="object")throw new j0("options",["Object"],t);return tb(ud(ld(s)),ud(ld(e)),{...Q0,...t})}o(eb,"cp");function ld(s){return s!=null&&s.href&&s.origin?J0(s):s}o(ld,"getValidatedPath");async function tb(s,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await Ed(s,e,t),{srcStat:i,destStat:n}=r;return await Sd(s,i,e),t.filter?_d(fd,n,s,e,t):fd(n,s,e,t)}o(tb,"cpFn");async function Ed(s,e,t){let{0:r,1:i}=await sb(s,e,t);if(i){if(wd(r,i))throw new Bi({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:mt});if(r.isDirectory()&&!i.isDirectory())throw new L0({message:`cannot overwrite directory ${s} with non-directory ${e}`,path:e,syscall:"cp",errno:z0});if(!r.isDirectory()&&i.isDirectory())throw new F0({message:`cannot overwrite non-directory ${s} with directory ${e}`,path:e,syscall:"cp",errno:G0})}if(r.isDirectory()&&Ma(s,e))throw new Bi({message:`cannot copy ${s} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:mt});return{srcStat:r,destStat:i}}o(Ed,"checkPaths");function wd(s,e){return e.ino&&e.dev&&e.ino===s.ino&&e.dev===s.dev}o(wd,"areIdentical");function sb(s,e,t){let r=t.dereference?i=>ws(i,{bigint:!0}):i=>md(i,{bigint:!0});return Promise.all([r(s),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})])}o(sb,"getStats");async function fd(s,e,t,r){let i=dr(t);return await rb(i)||await gd(i,{recursive:!0}),Ni(s,e,t,r)}o(fd,"checkParentDir");function rb(s){return ws(s).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(rb,"pathExists");async function Sd(s,e,t){let r=pr(dr(s)),i=pr(dr(t));if(i===r||i===Y0(i).root)return;let n;try{n=await ws(i,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(wd(e,n))throw new Bi({message:`cannot copy ${s} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:mt});return Sd(s,e,i)}o(Sd,"checkParentPaths");var dd=o(s=>pr(s).split(X0).filter(Boolean),"normalizePathToArray");function Ma(s,e){let t=dd(s),r=dd(e);return t.every((i,n)=>r[n]===i)}o(Ma,"isSrcSubdir");async function _d(s,e,t,r,i,n){if(await i.filter(t,r))return s(e,t,r,i,n)}o(_d,"handleFilter");function ib(s,e,t,r){return r.filter?_d(Ni,s,e,t,r):Ni(s,e,t,r)}o(ib,"startCopy");async function Ni(s,e,t,r){let n=await(r.dereference?ws:md)(e);if(n.isDirectory()&&r.recursive)return lb(n,s,e,t,r);if(n.isDirectory())throw new U0({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:mt});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return nb(n,s,e,t,r);if(n.isSymbolicLink())return db(s,e,t);throw n.isSocket()?new M0({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:mt}):n.isFIFO()?new D0({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:mt}):new q0({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:mt})}o(Ni,"getStatsForCopy");function nb(s,e,t,r,i){return e?ob(s,t,r,i):bd(s,t,r,i)}o(nb,"onFile");async function ob(s,e,t,r){if(r.force)return await yd(t),bd(s,e,t,r);if(r.errorOnExist)throw new k0({message:`${t} already exists`,path:t,syscall:"cp",errno:H0})}o(ob,"mayCopyFile");async function bd(s,e,t,r){return await W0(e,t),r.preserveTimestamps?ab(s.mode,e,t):Pi(t,s.mode)}o(bd,"_copyFile");async function ab(s,e,t){return cb(s)&&await hb(t,s),pd(s,e,t)}o(ab,"handleTimestampsAndMode");function cb(s){return(s&128)===0}o(cb,"fileIsNotWritable");function hb(s,e){return Pi(s,e|128)}o(hb,"makeFileWritable");async function pd(s,e,t){return await ub(e,t),Pi(t,s)}o(pd,"setDestTimestampsAndMode");function Pi(s,e){return V0(s,e)}o(Pi,"setDestMode");async function ub(s,e){let t=await ws(s);return K0(e,t.atime,t.mtime)}o(ub,"setDestTimestamps");function lb(s,e,t,r,i){return e?Rd(t,r,i):fb(s.mode,t,r,i)}o(lb,"onDir");async function fb(s,e,t,r){return await gd(t),await Rd(e,t,r),Pi(t,s)}o(fb,"mkDirAndCopy");async function Rd(s,e,t){let r=await Z0(s);for(let i=0;i<r.length;i++){let n=r[i],a=hd(s,n),c=hd(e,n),{destStat:h}=await Ed(a,c,t);await ib(h,a,c,t)}}o(Rd,"copyDir");async function db(s,e,t){let r=await ad(e);if(cd(r)||(r=pr(dr(e),r)),!s)return Fa(r,t);let i;try{i=await ad(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Fa(r,t);throw a}if(cd(i)||(i=pr(dr(t),i)),Ma(r,i))throw new Bi({message:`cannot copy ${r} to a subdirectory of self ${i}`,path:t,syscall:"cp",errno:mt});if((await ws(e)).isDirectory()&&Ma(i,r))throw new $0({message:`cannot overwrite ${i} with ${r}`,path:t,syscall:"cp",errno:mt});return pb(r,t)}o(db,"onLink");async function pb(s,e){return await yd(e),Fa(s,e)}o(pb,"copyLink");Od.exports=eb});var Td=m((BB,Id)=>{var mb=require("fs/promises"),gb=ga(),yb=nd(),Eb=vd(),wb=yb.satisfies(">=16.7.0"),Sb=o(async(s,e,t)=>{let r=gb(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return wb?mb.cp(s,e,r):Eb(s,e,r)},"cp");Id.exports=Sb});var Ad=m((PB,Cd)=>{var{join:_b,sep:bb}=require("path"),Rb=ga(),{mkdir:Ob,mkdtemp:vb,rm:Ib}=require("fs/promises"),Tb=o(async(s,e,t)=>{let r=Rb(t,{copy:["tmpPrefix"]});await Ob(s,{recursive:!0});let i=await vb(_b(`${s}${bb}`,r.tmpPrefix||"")),n,a;try{a=await e(i)}catch(c){n=c}try{await Ib(i,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");Cd.exports=Tb});var Pd=m((kB,Nd)=>{var{readdir:xd}=require("fs/promises"),{join:Bd}=require("path"),Cb=o(async s=>{let e=[];for(let t of await xd(s))if(t.startsWith("@"))for(let r of await xd(Bd(s,t)))e.push(Bd(t,r));else e.push(t);return e},"readdirScoped");Nd.exports=Cb});var $d=m((FB,Md)=>{var{dirname:Ld,join:kd,resolve:Dd,relative:Ab,isAbsolute:xb}=require("path"),Ve=require("fs/promises"),Bb=o(async s=>{try{return await Ve.access(s),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),Fd=o(async(s,e,t={},r=!0,i=[])=>{if(!s||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await Bb(e))throw new Error(`The destination file exists: ${e}`);await Ve.mkdir(Ld(e),{recursive:!0});try{await Ve.rename(s,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await Ve.lstat(s);if(a.isDirectory()){let c=await Ve.readdir(s);await Promise.all(c.map(h=>Fd(kd(s,h),kd(e,h),t,!1,i)))}else a.isSymbolicLink()?i.push({source:s,destination:e}):await Ve.copyFile(s,e)}else throw n}r&&(await Promise.all(i.map(async({source:n,destination:a})=>{let c=await Ve.readlink(n);xb(c)&&(c=Dd(a,Ab(n,c)));let h="file";try{h=await Ve.stat(Dd(Ld(n),c)),h.isDirectory()&&(h="junction")}catch{}await Ve.symlink(c,a,h)})),await Ve.rm(s,{recursive:!0,force:!0}))},"moveFile");Md.exports=Fd});var Li=m(($B,qd)=>{"use strict";var Nb=Td(),Pb=Ad(),Lb=Pd(),kb=$d();qd.exports={cp:Nb,withTempDir:Pb,readdirScoped:Lb,moveFile:kb}});var ki={};Oy(ki,{default:()=>Ud,pMapIterable:()=>Db,pMapSkip:()=>mr});async function Ud(s,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:i}={}){return new Promise((n,a)=>{if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);let c=[],h=[],u=new Map,l=!1,f=!1,d=!1,p=0,y=0,g=s[Symbol.iterator]===void 0?s[Symbol.asyncIterator]():s[Symbol.iterator](),w=o(()=>{T(i.reason)},"signalListener"),S=o(()=>{i?.removeEventListener("abort",w)},"cleanup"),I=o(O=>{n(O),S()},"resolve"),T=o(O=>{l=!0,f=!0,a(O),S()},"reject");i&&(i.aborted&&T(i.reason),i.addEventListener("abort",w,{once:!0}));let _=o(async()=>{if(f)return;let O=await g.next(),A=y;if(y++,O.done){if(d=!0,p===0&&!f){if(!r&&h.length>0){T(new AggregateError(h));return}if(f=!0,u.size===0){I(c);return}let P=[];for(let[z,ue]of c.entries())u.get(z)!==mr&&P.push(ue);I(P)}return}p++,(async()=>{try{let P=await O.value;if(f)return;let z=await e(P,A);z===mr&&u.set(A,z),c[A]=z,p--,await _()}catch(P){if(r)T(P);else{h.push(P),p--;try{await _()}catch(z){T(z)}}}})()},"next");(async()=>{for(let O=0;O<t;O++){try{await _()}catch(A){T(A);break}if(d||l)break}})()})}function Db(s,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let i=s[Symbol.asyncIterator]===void 0?s[Symbol.iterator]():s[Symbol.asyncIterator](),n=[],a=0,c=!1,h=0;function u(){if(c||!(a<t&&n.length<r))return;let l=(async()=>{let{done:f,value:d}=await i.next();if(f)return{done:!0};a++,u();try{let p=await e(await d,h++);if(a--,p===mr){let y=n.indexOf(l);y>0&&n.splice(y,1)}return u(),{done:!1,value:p}}catch(p){return c=!0,{error:p}}})();n.push(l)}for(o(u,"trySpawn"),u();n.length>0;){let{error:l,done:f,value:d}=await n[0];if(n.shift(),l)throw l;if(f)return;u(),d!==mr&&(yield d)}}}}var mr,Di=Ry(()=>{o(Ud,"pMap");o(Db,"pMapIterable");mr=Symbol("skip")});var Ss=m((jB,_e)=>{"use strict";var Fb=require("crypto"),{appendFile:Mb,mkdir:Ua,readFile:$b,readdir:qb,rm:jd,writeFile:Ub}=require("fs/promises"),{Minipass:jb}=ee(),We=require("path"),Hb=Ot(),zb=fa(),Gb=gs(),Vb=pa(),Wb=da()["cache-version"].index,{moveFile:Zb}=Li(),$a=5;_e.exports.NotFoundError=class extends Error{static{o(this,"NotFoundError")}constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code="ENOENT",this.cache=e,this.key=t}};_e.exports.compact=Kb;async function Kb(s,e,t,r={}){let i=gr(s,e),n=await Fi(i),a=[];for(let d=n.length-1;d>=0;--d){let p=n[d];if(p.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(p)===!0)&&(a.length===0||!a.find(y=>t(y,p)))&&a.unshift(p)}let c=`
10
- `+a.map(d=>{let p=JSON.stringify(d);return`${Mi(p)} ${p}`}).join(`
11
- `),h=o(async()=>{let d=zb(We.join(s,"tmp"),r.tmpPrefix);return await Ua(We.dirname(d),{recursive:!0}),{target:d,moved:!1}},"setup"),u=o(async d=>{if(!d.moved)return jd(d.target,{recursive:!0,force:!0})},"teardown"),l=o(async d=>{await Ub(d.target,c,{flag:"wx"}),await Ua(We.dirname(i),{recursive:!0}),await Zb(d.target,i),d.moved=!0},"write"),f=await h();try{await l(f)}finally{await u(f)}return a.reverse().map(d=>$i(s,d,!0))}o(Kb,"compact");_e.exports.insert=Hd;async function Hd(s,e,t,r={}){let{metadata:i,size:n,time:a}=r,c=gr(s,e),h={key:e,integrity:t&&Hb.stringify(t),time:a||Date.now(),size:n,metadata:i};try{await Ua(We.dirname(c),{recursive:!0});let u=JSON.stringify(h);await Mb(c,`
12
- ${Mi(u)} ${u}`)}catch(u){if(u.code==="ENOENT")return;throw u}return $i(s,h)}o(Hd,"insert");_e.exports.find=Yb;async function Yb(s,e){let t=gr(s,e);try{return(await Fi(t)).reduce((i,n)=>n&&n.key===e?$i(s,n):i,null)}catch(r){if(r.code==="ENOENT")return null;throw r}}o(Yb,"find");_e.exports.delete=Xb;function Xb(s,e,t={}){if(!t.removeFully)return Hd(s,e,null,t);let r=gr(s,e);return jd(r,{recursive:!0,force:!0})}o(Xb,"del");_e.exports.lsStream=zd;function zd(s){let e=ja(s),t=new jb({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(Di(),ki)),i=await qa(e);return await r(i,async n=>{let a=We.join(e,n),c=await qa(a);await r(c,async h=>{let u=We.join(a,h),l=await qa(u);await r(l,async f=>{let d=We.join(u,f);try{let y=(await Fi(d)).reduce((g,w)=>(g.set(w.key,w),g),new Map);for(let g of y.values()){let w=$i(s,g);w&&t.write(w)}}catch(p){if(p.code==="ENOENT")return;throw p}},{concurrency:$a})},{concurrency:$a})},{concurrency:$a}),t.end(),t}).catch(r=>t.emit("error",r)),t}o(zd,"lsStream");_e.exports.ls=Jb;async function Jb(s){return(await zd(s).collect()).reduce((t,r)=>(t[r.key]=r,t),{})}o(Jb,"ls");_e.exports.bucketEntries=Fi;async function Fi(s,e){let t=await $b(s,"utf8");return Qb(t,e)}o(Fi,"bucketEntries");function Qb(s){let e=[];return s.split(`
13
- `).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||Mi(r[1])!==r[0])return;let i;try{i=JSON.parse(r[1])}catch{}i&&e.push(i)}),e}o(Qb,"_bucketEntries");_e.exports.bucketDir=ja;function ja(s){return We.join(s,`index-v${Wb}`)}o(ja,"bucketDir");_e.exports.bucketPath=gr;function gr(s,e){let t=Gd(e);return We.join.apply(We,[ja(s)].concat(Vb(t)))}o(gr,"bucketPath");_e.exports.hashKey=Gd;function Gd(s){return Vd(s,"sha256")}o(Gd,"hashKey");_e.exports.hashEntry=Mi;function Mi(s){return Vd(s,"sha1")}o(Mi,"hashEntry");function Vd(s,e){return Fb.createHash(e).update(s).digest("hex")}o(Vd,"hash");function $i(s,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?Gb(s,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o($i,"formatEntry");function qa(s){return qb(s).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(qa,"readdirOrEmpty")});var bs=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.LRUCache=void 0;var eR=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zd=new Set,Ha=typeof process=="object"&&process?process:{},Kd=o((s,e,t,r)=>{typeof Ha.emitWarning=="function"&&Ha.emitWarning(s,e,t,r)},"emitWarning"),qi=globalThis.AbortController,Wd=globalThis.AbortSignal;if(typeof qi>"u"){Wd=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},qi=class{static{o(this,"AbortController")}constructor(){e()}signal=new Wd;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let s=Ha.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{s&&(s=!1,Kd("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var tR=o(s=>!Zd.has(s),"shouldWarn"),VB=Symbol("type"),vt=o(s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),"isPosInt"),Yd=o(s=>vt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?_s:null:null,"getUintArray"),_s=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},za=class s{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=Yd(e);if(!t)return[];s.#e=!0;let r=new s(e,t);return s.#e=!1,r}constructor(e,t){if(!s.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Ga=class s{static{o(this,"LRUCache")}#e;#t;#s;#r;#i;#a;#l;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#p;#d;#h;#n;#g;#_;#S;#y;#C;#E;#R;#I;#w;#b;#T;#m;#o;static unsafeExposeInternals(e){return{starts:e.#I,ttls:e.#w,sizes:e.#R,keyMap:e.#d,keyList:e.#h,valList:e.#n,next:e.#g,prev:e.#_,get head(){return e.#S},get tail(){return e.#y},free:e.#C,isBackgroundFetch:o(t=>e.#u(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,n)=>e.#H(t,r,i,n),"backgroundFetch"),moveToTail:o(t=>e.#F(t),"moveToTail"),indexes:o(t=>e.#x(t),"indexes"),rindexes:o(t=>e.#N(t),"rindexes"),isStale:o(t=>e.#v(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#l}get dispose(){return this.#s}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:h,dispose:u,onInsert:l,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:g=0,sizeCalculation:w,fetchMethod:S,memoMethod:I,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:A,ignoreFetchAbort:P,perf:z}=e;if(z!==void 0&&typeof z?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=z??eR,t!==0&&!vt(t))throw new TypeError("max option must be a nonnegative integer");let ue=t?Yd(t):Array;if(!ue)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=y,this.maxEntrySize=g||this.#t,this.sizeCalculation=w,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=I,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=S,this.#T=!!S,this.#d=new Map,this.#h=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#g=new ue(t),this.#_=new ue(t),this.#S=0,this.#y=0,this.#C=za.create(t),this.#c=0,this.#p=0,typeof u=="function"&&(this.#s=u),typeof l=="function"&&(this.#r=l),typeof f=="function"?(this.#i=f,this.#E=[]):(this.#i=void 0,this.#E=void 0),this.#b=!!this.#s,this.#o=!!this.#r,this.#m=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#t!==0&&!vt(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!vt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=vt(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!vt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let tt="LRU_CACHE_UNBOUNDED";tR(tt)&&(Zd.add(tt),Kd("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",tt,s))}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#P(){let e=new _s(this.#e),t=new _s(this.#e);this.#w=e,this.#I=t,this.#U=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#v(n)&&this.#B(this.#h[n],"expire")},a+1);h.unref&&h.unref()}},this.#A=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#O=(n,a)=>{if(e[a]){let c=e[a],h=t[a];if(!c||!h)return;n.ttl=c,n.start=h,n.now=r||i();let u=n.now-h;n.remainingTTL=c-u}};let r=0,i=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#d.get(n);if(a===void 0)return 0;let c=e[a],h=t[a];if(!c||!h)return 1/0;let u=(r||i())-h;return c-u},this.#v=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||i())-a>c}}#A=o(()=>{},"#updateItemAge");#O=o(()=>{},"#statusTTL");#U=o(()=>{},"#setItemTTL");#v=o(()=>!1,"#isStale");#M(){let e=new _s(this.#e);this.#p=0,this.#R=e,this.#L=t=>{this.#p-=e[t],e[t]=0},this.#k=(t,r,i,n)=>{if(this.#u(r))return 0;if(!vt(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(r,t),!vt(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#$=(t,r,i)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#p>n;)this.#D(!0)}this.#p+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#p)}}#L=o(e=>{},"#removeItemSize");#$=o((e,t,r)=>{},"#addItemSize");#k=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#x({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#j(t)||((e||!this.#v(t))&&(yield t),t===this.#S));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;!(!this.#j(t)||((e||!this.#v(t))&&(yield t),t===this.#y));)t=this.#g[t]}#j(e){return e!==void 0&&this.#d.get(this.#h[e])===e}*entries(){for(let e of this.#x())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*rentries(){for(let e of this.#N())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*keys(){for(let e of this.#x()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*values(){for(let e of this.#x())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#N())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#x()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#x()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#N()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#v(t)&&(this.#B(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#d.get(e);if(t===void 0)return;let r=this.#n[t],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let n={value:i};if(this.#w&&this.#I){let a=this.#w[t],c=this.#I[t];if(a&&c){let h=a-(this.#f.now()-c);n.ttl=h,n.start=Date.now()}}return this.#R&&(n.size=this.#R[t]),n}dump(){let e=[];for(let t of this.#x({allowStale:!0})){let r=this.#h[t],i=this.#n[t],n=this.#u(i)?i.__staleWhileFetching:i;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#w&&this.#I){a.ttl=this.#w[t];let c=this.#f.now()-this.#I[t];a.start=Math.floor(Date.now()-c)}this.#R&&(a.size=this.#R[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=this.#f.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,l=this.#k(e,t,r.size||0,c);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#B(e,"set"),this;let f=this.#c===0?void 0:this.#d.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#C.length!==0?this.#C.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#n[f]=t,this.#d.set(e,f),this.#g[this.#y]=f,this.#_[f]=this.#y,this.#y=f,this.#c++,this.#$(f,l,h),h&&(h.set="add"),u=!1,this.#o&&this.#r?.(t,e,"add");else{this.#F(f);let d=this.#n[f];if(t!==d){if(this.#T&&this.#u(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#b&&this.#s?.(p,e,"set"),this.#m&&this.#E?.push([p,e,"set"]))}else a||(this.#b&&this.#s?.(d,e,"set"),this.#m&&this.#E?.push([d,e,"set"]));if(this.#L(f),this.#$(f,l,h),this.#n[f]=t,h){h.set="replace";let p=d&&this.#u(d)?d.__staleWhileFetching:d;p!==void 0&&(h.oldValue=p)}}else h&&(h.set="update");this.#o&&this.onInsert?.(t,e,t===d?"update":"replace")}if(i!==0&&!this.#w&&this.#P(),this.#w&&(u||this.#U(f,i,n),h&&this.#O(h,f)),!a&&this.#m&&this.#E){let d=this.#E,p;for(;p=d?.shift();)this.#i?.(...p)}return this}pop(){try{for(;this.#c;){let e=this.#n[this.#S];if(this.#D(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#E){let e=this.#E,t;for(;t=e?.shift();)this.#i?.(...t)}}}#D(e){let t=this.#S,r=this.#h[t],i=this.#n[t];return this.#T&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(i,r,"evict"),this.#m&&this.#E?.push([i,r,"evict"])),this.#L(t),e&&(this.#h[t]=void 0,this.#n[t]=void 0,this.#C.push(t)),this.#c===1?(this.#S=this.#y=0,this.#C.length=0):this.#S=this.#g[t],this.#d.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,n=this.#d.get(e);if(n!==void 0){let a=this.#n[n];if(this.#u(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#v(n))i&&(i.has="stale",this.#O(i,n));else return r&&this.#A(n),i&&(i.has="hit",this.#O(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#d.get(e);if(i===void 0||!r&&this.#v(i))return;let n=this.#n[i];return this.#u(n)?n.__staleWhileFetching:n}#H(e,t,r,i){let n=t===void 0?void 0:this.#n[t];if(this.#u(n))return n;let a=new qi,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let h={signal:a.signal,options:r,context:i},u=o((g,w=!1)=>{let{aborted:S}=a.signal,I=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(S&&!w?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!I&&!w)return f(a.signal.reason);let T=p,_=this.#n[t];return(_===p||I&&w&&_===void 0)&&(g===void 0?T.__staleWhileFetching!==void 0?this.#n[t]=T.__staleWhileFetching:this.#B(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,h.options))),g},"cb"),l=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:w}=a.signal,S=w&&r.allowStaleOnFetchAbort,I=S||r.allowStaleOnFetchRejection,T=I||r.noDeleteOnFetchRejection,_=p;if(this.#n[t]===p&&(!T||_.__staleWhileFetching===void 0?this.#B(e,"fetch"):S||(this.#n[t]=_.__staleWhileFetching)),I)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw g},"fetchFail"),d=o((g,w)=>{let S=this.#a?.(e,n,h);S&&S instanceof Promise&&S.then(I=>g(I===void 0?void 0:I),w),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(I=>u(I,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,l),y=Object.assign(p,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...h.options,status:void 0}),t=this.#d.get(e)):this.#n[t]=y,y}#u(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof qi}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:w=!1,status:S,signal:I}=t;if(!this.#T)return S&&(S.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:S});let T={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:h,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:S,signal:I},_=this.#d.get(e);if(_===void 0){S&&(S.fetch="miss");let O=this.#H(e,_,T,g);return O.__returned=O}else{let O=this.#n[_];if(this.#u(O)){let tt=r&&O.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",tt&&(S.returnedStale=!0)),tt?O.__staleWhileFetching:O.__returned=O}let A=this.#v(_);if(!w&&!A)return S&&(S.fetch="hit"),this.#F(_),i&&this.#A(_),S&&this.#O(S,_),O;let P=this.#H(e,_,T,g),ue=P.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=A?"stale":"refresh",ue&&A&&(S.returnedStale=!0)),ue?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#l;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let h=r(e,c,{options:a,context:i});return this.set(e,h,a),h}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#d.get(e);if(c!==void 0){let h=this.#n[c],u=this.#u(h);return a&&this.#O(a,c),this.#v(c)?(a&&(a.get="stale"),u?(a&&r&&h.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?h.__staleWhileFetching:void 0):(n||this.#B(e,"expire"),a&&r&&(a.returnedStale=!0),r?h:void 0)):(a&&(a.get="hit"),u?h.__staleWhileFetching:(this.#F(c),i&&this.#A(c),h))}else a&&(a.get="miss")}#z(e,t){this.#_[t]=e,this.#g[e]=t}#F(e){e!==this.#y&&(e===this.#S?this.#S=this.#g[e]:this.#z(this.#_[e],this.#g[e]),this.#z(this.#y,e),this.#y=e)}delete(e){return this.#B(e,"delete")}#B(e,t){let r=!1;if(this.#c!==0){let i=this.#d.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#L(i);let n=this.#n[i];if(this.#u(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(n,e,t),this.#m&&this.#E?.push([n,e,t])),this.#d.delete(e),this.#h[i]=void 0,this.#n[i]=void 0,i===this.#y)this.#y=this.#_[i];else if(i===this.#S)this.#S=this.#g[i];else{let a=this.#_[i];this.#g[a]=this.#g[i];let c=this.#g[i];this.#_[c]=this.#_[i]}this.#c--,this.#C.push(i)}}if(this.#m&&this.#E?.length){let i=this.#E,n;for(;n=i?.shift();)this.#i?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#N({allowStale:!0})){let r=this.#n[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#h[t];this.#b&&this.#s?.(r,i,e),this.#m&&this.#E?.push([r,i,e])}}if(this.#d.clear(),this.#n.fill(void 0),this.#h.fill(void 0),this.#w&&this.#I&&(this.#w.fill(0),this.#I.fill(0)),this.#R&&this.#R.fill(0),this.#S=0,this.#y=0,this.#C.length=0,this.#p=0,this.#c=0,this.#m&&this.#E){let t=this.#E,r;for(;r=t?.shift();)this.#i?.(...r)}}};Ui.LRUCache=Ga});var yr=m((KB,Rs)=>{"use strict";var{LRUCache:sR}=bs(),ji=new sR({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((s,e)=>e.startsWith("key:")?s.data.length:s.length,"sizeCalculation")});Rs.exports.clearMemoized=rR;function rR(){let s={};return ji.forEach((e,t)=>{s[t]=e}),ji.clear(),s}o(rR,"clearMemoized");Rs.exports.put=iR;function iR(s,e,t,r){Hi(r).set(`key:${s}:${e.key}`,{entry:e,data:t}),Xd(s,e.integrity,t,r)}o(iR,"put");Rs.exports.put.byDigest=Xd;function Xd(s,e,t,r){Hi(r).set(`digest:${s}:${e}`,t)}o(Xd,"putDigest");Rs.exports.get=nR;function nR(s,e,t){return Hi(t).get(`key:${s}:${e}`)}o(nR,"get");Rs.exports.get.byDigest=oR;function oR(s,e,t){return Hi(t).get(`digest:${s}:${e}`)}o(oR,"getDigest");var Va=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function Hi(s){return!s||!s.memoize?ji:s.memoize.get&&s.memoize.set?s.memoize:typeof s.memoize=="object"?new Va(s.memoize):ji}o(Hi,"pickMem")});var Xi=m(wr=>{"use strict";var{Minipass:aR}=ee(),cR=require("events").EventEmitter,de=require("fs"),hR=de.writev,Cs=Symbol("_autoClose"),Fe=Symbol("_close"),Er=Symbol("_ended"),D=Symbol("_fd"),Jd=Symbol("_finished"),Tt=Symbol("_flags"),Wa=Symbol("_flush"),Ka=Symbol("_handleChunk"),Ya=Symbol("_makeBuf"),Zi=Symbol("_mode"),zi=Symbol("_needDrain"),Is=Symbol("_onerror"),As=Symbol("_onopen"),Za=Symbol("_onread"),Os=Symbol("_onwrite"),Ct=Symbol("_open"),gt=Symbol("_path"),Gt=Symbol("_pos"),Ze=Symbol("_queue"),vs=Symbol("_read"),Qd=Symbol("_readSize"),It=Symbol("_reading"),Gi=Symbol("_remain"),ep=Symbol("_size"),Vi=Symbol("_write"),zt=Symbol("_writing"),Wi=Symbol("_defaultFlag"),Ts=Symbol("_errored"),Ki=class extends aR{static{o(this,"ReadStream")}constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Ts]=!1,this[D]=typeof t.fd=="number"?t.fd:null,this[gt]=e,this[Qd]=t.readSize||16*1024*1024,this[It]=!1,this[ep]=typeof t.size=="number"?t.size:1/0,this[Gi]=this[ep],this[Cs]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[D]=="number"?this[vs]():this[Ct]()}get fd(){return this[D]}get path(){return this[gt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ct](){de.open(this[gt],"r",(e,t)=>this[As](e,t))}[As](e,t){e?this[Is](e):(this[D]=t,this.emit("open",t),this[vs]())}[Ya](){return Buffer.allocUnsafe(Math.min(this[Qd],this[Gi]))}[vs](){if(!this[It]){this[It]=!0;let e=this[Ya]();if(e.length===0)return process.nextTick(()=>this[Za](null,0,e));de.read(this[D],e,0,e.length,null,(t,r,i)=>this[Za](t,r,i))}}[Za](e,t,r){this[It]=!1,e?this[Is](e):this[Ka](t,r)&&this[vs]()}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Is](e){this[It]=!0,this[Fe](),this.emit("error",e)}[Ka](e,t){let r=!1;return this[Gi]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Gi]<=0)&&(r=!1,this[Fe](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[D]=="number"&&this[vs]();break;case"error":return this[Ts]?void 0:(this[Ts]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xa=class extends Ki{static{o(this,"ReadStreamSync")}[Ct](){let e=!0;try{this[As](null,de.openSync(this[gt],"r")),e=!1}finally{e&&this[Fe]()}}[vs](){let e=!0;try{if(!this[It]){this[It]=!0;do{let t=this[Ya](),r=t.length===0?0:de.readSync(this[D],t,0,t.length,null);if(!this[Ka](r,t))break}while(!0);this[It]=!1}e=!1}finally{e&&this[Fe]()}}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.closeSync(e),this.emit("close")}}},Yi=class extends cR{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Ts]=!1,this[zt]=!1,this[Er]=!1,this[zi]=!1,this[Ze]=[],this[gt]=e,this[D]=typeof t.fd=="number"?t.fd:null,this[Zi]=t.mode===void 0?438:t.mode,this[Gt]=typeof t.start=="number"?t.start:null,this[Cs]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Gt]!==null?"r+":"w";this[Wi]=t.flags===void 0,this[Tt]=this[Wi]?r:t.flags,this[D]===null&&this[Ct]()}emit(e,t){if(e==="error"){if(this[Ts])return;this[Ts]=!0}return super.emit(e,t)}get fd(){return this[D]}get path(){return this[gt]}[Is](e){this[Fe](),this[zt]=!0,this.emit("error",e)}[Ct](){de.open(this[gt],this[Tt],this[Zi],(e,t)=>this[As](e,t))}[As](e,t){this[Wi]&&this[Tt]==="r+"&&e&&e.code==="ENOENT"?(this[Tt]="w",this[Ct]()):e?this[Is](e):(this[D]=t,this.emit("open",t),this[zt]||this[Wa]())}end(e,t){return e&&this.write(e,t),this[Er]=!0,!this[zt]&&!this[Ze].length&&typeof this[D]=="number"&&this[Os](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Er]?(this.emit("error",new Error("write() after end()")),!1):this[D]===null||this[zt]||this[Ze].length?(this[Ze].push(e),this[zi]=!0,!1):(this[zt]=!0,this[Vi](e),!0)}[Vi](e){de.write(this[D],e,0,e.length,this[Gt],(t,r)=>this[Os](t,r))}[Os](e,t){e?this[Is](e):(this[Gt]!==null&&(this[Gt]+=t),this[Ze].length?this[Wa]():(this[zt]=!1,this[Er]&&!this[Jd]?(this[Jd]=!0,this[Fe](),this.emit("finish")):this[zi]&&(this[zi]=!1,this.emit("drain"))))}[Wa](){if(this[Ze].length===0)this[Er]&&this[Os](null,0);else if(this[Ze].length===1)this[Vi](this[Ze].pop());else{let e=this[Ze];this[Ze]=[],hR(this[D],e,this[Gt],(t,r)=>this[Os](t,r))}}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Ja=class extends Yi{static{o(this,"WriteStreamSync")}[Ct](){let e;if(this[Wi]&&this[Tt]==="r+")try{e=de.openSync(this[gt],this[Tt],this[Zi])}catch(t){if(t.code==="ENOENT")return this[Tt]="w",this[Ct]();throw t}else e=de.openSync(this[gt],this[Tt],this[Zi]);this[As](null,e)}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.closeSync(e),this.emit("close")}}[Vi](e){let t=!0;try{this[Os](null,de.writeSync(this[D],e,0,e.length,this[Gt])),t=!1}finally{if(t)try{this[Fe]()}catch{}}}};wr.ReadStream=Ki;wr.ReadStreamSync=Xa;wr.WriteStream=Yi;wr.WriteStreamSync=Ja});var ec=m((QB,xs)=>{"use strict";var Sr=require("fs/promises"),uR=Xi(),Qa=Ot(),lR=gs(),tp=ms();xs.exports=fR;var sp=64*1024*1024;async function fR(s,e,t={}){let{size:r}=t,{stat:i,cpath:n,sri:a}=await _r(s,e,async(h,u)=>({stat:r?{size:r}:await Sr.stat(h),cpath:h,sri:u}));if(i.size>sp)return rp(n,i.size,a,new tp).concat();let c=await Sr.readFile(n,{encoding:null});if(i.size!==c.length)throw mR(i.size,c.length);if(!Qa.checkData(c,a))throw gR(a,n);return c}o(fR,"read");var rp=o((s,e,t,r)=>(r.push(new uR.ReadStream(s,{size:e,readSize:sp}),Qa.integrityStream({integrity:t,size:e})),r),"readPipeline");xs.exports.stream=ip;xs.exports.readStream=ip;function ip(s,e,t={}){let{size:r}=t,i=new tp;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await _r(s,e,async(h,u)=>({stat:r?{size:r}:await Sr.stat(h),cpath:h,sri:u}));return rp(a,n.size,c,i)}).catch(n=>i.emit("error",n)),i}o(ip,"readStream");xs.exports.copy=dR;function dR(s,e,t){return _r(s,e,r=>Sr.copyFile(r,t))}o(dR,"copy");xs.exports.hasContent=pR;async function pR(s,e){if(!e)return!1;try{return await _r(s,e,async(t,r)=>{let i=await Sr.stat(t);return{size:i.size,sri:r,stat:i}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(pR,"hasContent");async function _r(s,e,t){let r=Qa.parse(e),i=r.pickAlgorithm(),n=r[i];if(n.length<=1){let a=lR(s,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async u=>{try{return await _r(s,u,t)}catch(l){return l.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):l}})),c=a.find(u=>!(u instanceof Error));if(c)return c;let h=a.find(u=>u.code==="ENOENT");throw h||a.find(u=>u instanceof Error)}}o(_r,"withContentSri");function mR(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(mR,"sizeError");function gR(s,e){let t=new Error(`Integrity verification failed for ${s} (${e})`);return t.code="EINTEGRITY",t.sri=s,t.path=e,t}o(gR,"integrityError")});var cp=m((tN,Et)=>{"use strict";var np=na(),{Minipass:op}=ee(),ap=ms(),Vt=Ss(),yt=yr(),Wt=ec();async function yR(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=yt.get(s,e,t);if(a&&i!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Vt.find(s,e,t);if(!c)throw new Vt.NotFoundError(s,e);let h=await Wt(s,c.integrity,{integrity:r,size:n});return i&&yt.put(s,c,h,t),{data:h,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(yR,"getData");Et.exports=yR;async function ER(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=yt.get.byDigest(s,e,t);if(a&&i!==!1)return a;let c=await Wt(s,e,{integrity:r,size:n});return i&&yt.put.byDigest(s,e,c,t),c}o(ER,"getDataByDigest");Et.exports.byDigest=ER;var wR=o(s=>{let e=new op;return e.on("newListener",function(t,r){t==="metadata"&&r(s.entry.metadata),t==="integrity"&&r(s.entry.integrity),t==="size"&&r(s.entry.size)}),e.end(s.data),e},"getMemoizedStream");function SR(s,e,t={}){let{memoize:r,size:i}=t,n=yt.get(s,e,t);if(n&&r!==!1)return wR(n);let a=new ap;return Promise.resolve().then(async()=>{let c=await Vt.find(s,e);if(!c)throw new Vt.NotFoundError(s,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(u,l){u==="metadata"&&l(c.metadata),u==="integrity"&&l(c.integrity),u==="size"&&l(c.size)});let h=Wt.readStream(s,c.integrity,{...t,size:typeof i!="number"?c.size:i});if(r){let u=new np.PassThrough;u.on("collect",l=>yt.put(s,c,l,t)),a.unshift(u)}return a.unshift(h),a}).catch(c=>a.emit("error",c)),a}o(SR,"getStream");Et.exports.stream=SR;function _R(s,e,t={}){let{memoize:r}=t,i=yt.get.byDigest(s,e,t);if(i&&r!==!1){let n=new op;return n.end(i),n}else{let n=Wt.readStream(s,e,t);if(!r)return n;let a=new np.PassThrough;return a.on("collect",c=>yt.put.byDigest(s,e,c,t)),new ap(n,a)}}o(_R,"getStreamDigest");Et.exports.stream.byDigest=_R;function bR(s,e,t={}){let{memoize:r}=t,i=yt.get(s,e,t);return i&&r!==!1?Promise.resolve(i.entry):Vt.find(s,e)}o(bR,"info");Et.exports.info=bR;async function RR(s,e,t,r={}){let i=await Vt.find(s,e,r);if(!i)throw new Vt.NotFoundError(s,e);return await Wt.copy(s,i.integrity,t,r),{metadata:i.metadata,size:i.size,integrity:i.integrity}}o(RR,"copy");Et.exports.copy=RR;async function OR(s,e,t,r={}){return await Wt.copy(s,e,t,r),e}o(OR,"copyByDigest");Et.exports.copy.byDigest=OR;Et.exports.hasContent=Wt.hasContent});var dp=m((rN,ic)=>{"use strict";var hp=require("events"),vR=gs(),Rr=require("fs/promises"),{moveFile:IR}=Li(),{Minipass:TR}=ee(),up=ms(),CR=yi(),tc=require("path"),sc=Ot(),AR=fa(),xR=Xi();ic.exports=BR;var br=new Map;async function BR(s,e,t={}){let{algorithms:r,size:i,integrity:n}=t;if(typeof i=="number"&&e.length!==i)throw kR(i,e.length);let a=sc.fromData(e,r?{algorithms:r}:{});if(n&&!sc.checkData(e,n,t))throw DR(n,a);for(let c in a){let h=await lp(s,t),u=a[c].toString();try{await Rr.writeFile(h.target,e,{flag:"wx"}),await fp(h,s,u,t)}finally{h.moved||await Rr.rm(h.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(BR,"write");ic.exports.stream=NR;var rc=class extends CR{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new TR,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=PR(this.inputStream,this.cache,this.opts),this.handleContentP.catch(i=>this.emit("error",i))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function NR(s,e={}){return new rc(s,e)}o(NR,"writeStream");async function PR(s,e,t){let r=await lp(e,t);try{let i=await LR(s,e,r.target,t);return await fp(r,e,i.integrity,t),i}finally{r.moved||await Rr.rm(r.target,{recursive:!0,force:!0})}}o(PR,"handleContent");async function LR(s,e,t,r){let i=new xR.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[u,l]=await Promise.all([hp.once(r.integrityEmitter,"integrity").then(f=>f[0]),hp.once(r.integrityEmitter,"size").then(f=>f[0]),new up(s,i).promise()]);return{integrity:u,size:l}}let n,a,c=sc.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",u=>{n=u}),c.on("size",u=>{a=u}),await new up(s,c,i).promise(),{integrity:n,size:a}}o(LR,"pipeToTmp");async function lp(s,e){let t=AR(tc.join(s,"tmp"),e.tmpPrefix);return await Rr.mkdir(tc.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(lp,"makeTmp");async function fp(s,e,t){let r=vR(e,t),i=tc.dirname(r);return br.has(r)||br.set(r,Rr.mkdir(i,{recursive:!0}).then(async()=>(await IR(s.target,r,{overwrite:!1}),s.moved=!0,s.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{br.delete(r)})),br.get(r)}o(fp,"moveToDestination");function kR(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(kR,"sizeError");function DR(s,e){let t=new Error(`Integrity check failed:
10
+ Found: ${s.length}`);throw c.code="EBADSIZE",c.found=s.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${s.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(GE,"checkData");qe.exports.checkStream=VE;function VE(s,e,t){if(t=t||Object.create(null),t.integrity=e,e=me(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=qo(t);return new Promise((i,n)=>{s.pipe(r),s.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>i(a)),r.resume()})}o(VE,"checkStream");qe.exports.integrityStream=qo;function qo(s=Object.create(null)){return new $o(s)}o(qo,"integrityStream");qe.exports.create=WE;function WE(s){let e=s?.algorithms||[...Fo],t=Xs(s?.options),r=e.map(Ys.createHash);return{update:o(function(i,n){return r.forEach(a=>a.update(i,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),h=new ht(`${a}-${c}${t}`,s);if(h.algorithm&&h.digest){let u=h.algorithm;n[u]||(n[u]=[]),n[u].push(h)}return n},new Dt)},"digest")}}o(WE,"createIntegrity");var ZE=Ys.getHashes(),Au=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(s=>ZE.includes(s));function KE(s,e){return Au.indexOf(s.toLowerCase())>=Au.indexOf(e.toLowerCase())?s:e}o(KE,"getPrioritizedHash")});var jo=m((Px,Pu)=>{var xu=ou(),Cu=vu(),YE=St(),Bu={shared:!1,ignoreCargoCult:!0},XE={status:200,headers:{}},os=o(s=>{let e={method:s.method,url:s.url,headers:{},compress:s.compress};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),Nu=o(s=>{let e={status:s.status,headers:{}};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Uo=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:i}){this.entry=e,this.request=os(t),this.response=Nu(r),this.options=i,this.policy=new xu(this.request,this.response,Bu),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache==="no-store"||!["GET","HEAD"].includes(e.method)?!1:new xu(os(e),XE,Bu).storable()}satisfies(e){let t=os(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new Cu(this.request),i=new Cu(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(i.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(i.languages())||JSON.stringify(r.encodings())!==JSON.stringify(i.encodings())?!1:this.options.integrity?YE.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(e){let t=os(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=os(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=os(e),i=Nu(t);return!this.policy.revalidatedPolicy(r,i).modified}};Pu.exports=Uo});var ku=m((kx,Lu)=>{var Ho=class extends Error{static{o(this,"NotCachedError")}constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}};Lu.exports={NotCachedError:Ho}});var ui=m((Mx,Fu)=>{var JE=ei(),Du=Symbol("_flush"),Mu=Symbol("_flushed"),$u=Symbol("_flushing"),zo=class extends JE{static{o(this,"Flush")}constructor(e={}){if(typeof e=="function"&&(e={flush:e}),super(e),typeof e.flush!="function"&&typeof this.flush!="function")throw new TypeError("must provide flush function in options");this[Du]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[Mu])return super.emit(e,...t);if(this[$u])return;this[$u]=!0;let r=o(n=>{this[Mu]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),i=this[Du](r);i&&i.then&&i.then(()=>r(),n=>r(n))}};Fu.exports=zo});var Zo=m((Fx,Wo)=>{var{Minipass:qu}=J(),as=Symbol("_data"),cs=Symbol("_length"),Go=class extends qu{static{o(this,"Collect")}constructor(e){super(e),this[as]=[],this[cs]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[as].push(i),this[cs]+=i.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[as],this[cs]);return super.write(i),super.end(r)}};Wo.exports=Go;var Vo=class extends qu{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[as]=[],this[cs]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[as].push(i),this[cs]+=i.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[as],this[cs]);return this.emit("collect",i),super.end(r)}};Wo.exports.PassThrough=Vo});var hs=m((Ux,zu)=>{var QE=ei(),ew=require("events"),tw=o(s=>s&&s instanceof ew&&(typeof s.pipe=="function"||typeof s.write=="function"&&typeof s.end=="function"),"isStream"),Mt=Symbol("_head"),ge=Symbol("_tail"),Ko=Symbol("_linkStreams"),Yo=Symbol("_setHead"),Xo=Symbol("_setTail"),Uu=Symbol("_onError"),ju=Symbol("_onData"),Jo=Symbol("_onEnd"),Hu=Symbol("_onDrain"),li=Symbol("_streams"),Qo=class extends QE{static{o(this,"Pipeline")}constructor(e,...t){tw(e)&&(t.unshift(e),e={}),super(e),this[li]=[],t.length&&this.push(...t)}[Ko](e){return e.reduce((t,r)=>(t.on("error",i=>r.emit("error",i)),t.pipe(r),r))}push(...e){this[li].push(...e),this[ge]&&e.unshift(this[ge]);let t=this[Ko](e);this[Xo](t),this[Mt]||this[Yo](e[0])}unshift(...e){this[li].unshift(...e),this[Mt]&&e.push(this[Mt]);let t=this[Ko](e);this[Yo](e[0]),this[ge]||this[Xo](t)}destroy(e){return this[li].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[Xo](e){this[ge]=e,e.on("error",t=>this[Uu](e,t)),e.on("data",t=>this[ju](e,t)),e.on("end",()=>this[Jo](e)),e.on("finish",()=>this[Jo](e))}[Uu](e,t){e===this[ge]&&this.emit("error",t)}[ju](e,t){e===this[ge]&&super.write(t)}[Jo](e){e===this[ge]&&super.end()}pause(){return super.pause(),this[ge]&&this[ge].pause&&this[ge].pause()}emit(e,...t){return e==="resume"&&this[ge]&&this[ge].resume&&this[ge].resume(),super.emit(e,...t)}[Yo](e){this[Mt]=e,e.on("drain",()=>this[Hu](e))}[Hu](e){e===this[Mt]&&this.emit("drain")}write(e,t,r){return this[Mt].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[Mt].end(e,t,r),this}};zu.exports=Qo});var Gu=m((Hx,ea)=>{(function(){var s;function e(t,r){var i=this instanceof e?this:s;if(i.reset(r),typeof t=="string"&&t.length>0&&i.hash(t),i!==this)return i}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,i,n,a,c;switch(c=t.length,this.len+=c,i=this.k1,n=0,this.rem){case 0:i^=c>n?t.charCodeAt(n++)&65535:0;case 1:i^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:i^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:i^=c>n?(t.charCodeAt(n)&255)<<24:0,i^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(r=this.h1;i=i*11601+(i&65535)*3432906752&4294967295,i=i<<15|i>>>17,i=i*13715+(i&65535)*461832192&4294967295,r^=i,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(n>=c);)i=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),i^=(a&255)<<24^(a&65280)>>8;switch(i=0,this.rem){case 3:i^=(t.charCodeAt(n+2)&65535)<<16;case 2:i^=(t.charCodeAt(n+1)&65535)<<8;case 1:i^=t.charCodeAt(n)&65535}this.h1=r}return this.k1=i,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},s=new e,typeof ea<"u"?ea.exports=e:this.MurmurHash3=e})()});var Wu=m((Gx,Vu)=>{"use strict";var sw=Gu();Vu.exports=function(s){if(s){var e=new sw(s);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var ta=m((Vx,Zu)=>{var rw=require("path"),iw=Wu();Zu.exports=function(s,e,t){return rw.join(s,(e?e+"-":"")+iw(t))}});var sa=m((Wx,nw)=>{nw.exports={name:"cacache",version:"20.0.1","cache-version":{content:"2",index:"5"},description:"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",snap:"tap",coverage:"tap","test-docker":'docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test',lint:"npm run eslint",npmclilint:"npmcli-lint",lintfix:"npm run eslint -- --fix",postsnap:"npm run lintfix --",postlint:"template-oss-check",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},repository:{type:"git",url:"git+https://github.com/npm/cacache.git"},keywords:["cache","caching","content-addressable","sri","sri hash","subresource integrity","cache","storage","store","file store","filesystem","disk cache","disk storage"],license:"ISC",dependencies:{"@npmcli/fs":"^4.0.0","fs-minipass":"^3.0.0",glob:"^11.0.3","lru-cache":"^11.1.0",minipass:"^7.0.3","minipass-collect":"^2.0.1","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","p-map":"^7.0.2",ssri:"^12.0.0","unique-filename":"^4.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",windowsCI:!1,version:"4.25.0",publish:"true"},author:"GitHub Inc.",tap:{"nyc-arg":["--exclude","tap-snapshots/**"]}}});var ra=m((Zx,Ku)=>{"use strict";Ku.exports=ow;function ow(s){return[s.slice(0,2),s.slice(2,4),s.slice(4)]}o(ow,"hashToSegments")});var us=m((Yx,ia)=>{"use strict";var aw=sa()["cache-version"].content,cw=ra(),Yu=require("path"),hw=St();ia.exports=uw;function uw(s,e){let t=hw.parse(e,{single:!0});return Yu.join(Xu(s),t.algorithm,...cw(t.hexDigest()))}o(uw,"contentPath");ia.exports.contentDir=Xu;function Xu(s){return Yu.join(s,`content-v${aw}`)}o(Xu,"contentDir")});var na=m((Jx,Ju)=>{var lw=o((s,{copy:e,wrap:t})=>{let r={};if(s&&typeof s=="object")for(let i of e)s[i]!==void 0&&(r[i]=s[i]);else r[t]=s;return r},"getOptions");Ju.exports=lw});var Js=m((eC,Qu)=>{"use strict";var fw="2.0.0",dw=Number.MAX_SAFE_INTEGER||9007199254740991,pw=16,mw=250,gw=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Qu.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:pw,MAX_SAFE_BUILD_LENGTH:mw,MAX_SAFE_INTEGER:dw,RELEASE_TYPES:gw,SEMVER_SPEC_VERSION:fw,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Qs=m((tC,el)=>{"use strict";var yw=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>{}:()=>{};el.exports=yw});var ls=m((Ue,tl)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:oa,MAX_SAFE_BUILD_LENGTH:Ew,MAX_LENGTH:ww}=Js(),Sw=Qs();Ue=tl.exports={};var _w=Ue.re=[],bw=Ue.safeRe=[],_=Ue.src=[],Rw=Ue.safeSrc=[],b=Ue.t={},Ow=0,aa="[a-zA-Z0-9-]",Iw=[["\\s",1],["\\d",ww],[aa,Ew]],vw=o(s=>{for(let[e,t]of Iw)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},"makeSafeRegex"),A=o((s,e,t)=>{let r=vw(e),i=Ow++;Sw(s,i,e),b[s]=i,_[i]=e,Rw[i]=r,_w[i]=new RegExp(e,t?"g":void 0),bw[i]=new RegExp(r,t?"g":void 0)},"createToken");A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","\\d+");A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${aa}*`);A("MAINVERSION",`(${_[b.NUMERICIDENTIFIER]})\\.(${_[b.NUMERICIDENTIFIER]})\\.(${_[b.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${_[b.NUMERICIDENTIFIERLOOSE]})\\.(${_[b.NUMERICIDENTIFIERLOOSE]})\\.(${_[b.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${_[b.NONNUMERICIDENTIFIER]}|${_[b.NUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${_[b.NONNUMERICIDENTIFIER]}|${_[b.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASE",`(?:-(${_[b.PRERELEASEIDENTIFIER]}(?:\\.${_[b.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${_[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_[b.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER",`${aa}+`);A("BUILD",`(?:\\+(${_[b.BUILDIDENTIFIER]}(?:\\.${_[b.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${_[b.MAINVERSION]}${_[b.PRERELEASE]}?${_[b.BUILD]}?`);A("FULL",`^${_[b.FULLPLAIN]}$`);A("LOOSEPLAIN",`[v=\\s]*${_[b.MAINVERSIONLOOSE]}${_[b.PRERELEASELOOSE]}?${_[b.BUILD]}?`);A("LOOSE",`^${_[b.LOOSEPLAIN]}$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${_[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${_[b.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${_[b.XRANGEIDENTIFIER]})(?:\\.(${_[b.XRANGEIDENTIFIER]})(?:\\.(${_[b.XRANGEIDENTIFIER]})(?:${_[b.PRERELEASE]})?${_[b.BUILD]}?)?)?`);A("XRANGEPLAINLOOSE",`[v=\\s]*(${_[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[b.XRANGEIDENTIFIERLOOSE]})(?:${_[b.PRERELEASELOOSE]})?${_[b.BUILD]}?)?)?`);A("XRANGE",`^${_[b.GTLT]}\\s*${_[b.XRANGEPLAIN]}$`);A("XRANGELOOSE",`^${_[b.GTLT]}\\s*${_[b.XRANGEPLAINLOOSE]}$`);A("COERCEPLAIN",`(^|[^\\d])(\\d{1,${oa}})(?:\\.(\\d{1,${oa}}))?(?:\\.(\\d{1,${oa}}))?`);A("COERCE",`${_[b.COERCEPLAIN]}(?:$|[^\\d])`);A("COERCEFULL",_[b.COERCEPLAIN]+`(?:${_[b.PRERELEASE]})?(?:${_[b.BUILD]})?(?:$|[^\\d])`);A("COERCERTL",_[b.COERCE],!0);A("COERCERTLFULL",_[b.COERCEFULL],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${_[b.LONETILDE]}\\s+`,!0);Ue.tildeTrimReplace="$1~";A("TILDE",`^${_[b.LONETILDE]}${_[b.XRANGEPLAIN]}$`);A("TILDELOOSE",`^${_[b.LONETILDE]}${_[b.XRANGEPLAINLOOSE]}$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${_[b.LONECARET]}\\s+`,!0);Ue.caretTrimReplace="$1^";A("CARET",`^${_[b.LONECARET]}${_[b.XRANGEPLAIN]}$`);A("CARETLOOSE",`^${_[b.LONECARET]}${_[b.XRANGEPLAINLOOSE]}$`);A("COMPARATORLOOSE",`^${_[b.GTLT]}\\s*(${_[b.LOOSEPLAIN]})$|^$`);A("COMPARATOR",`^${_[b.GTLT]}\\s*(${_[b.FULLPLAIN]})$|^$`);A("COMPARATORTRIM",`(\\s*)${_[b.GTLT]}\\s*(${_[b.LOOSEPLAIN]}|${_[b.XRANGEPLAIN]})`,!0);Ue.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${_[b.XRANGEPLAIN]})\\s+-\\s+(${_[b.XRANGEPLAIN]})\\s*$`);A("HYPHENRANGELOOSE",`^\\s*(${_[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${_[b.XRANGEPLAINLOOSE]})\\s*$`);A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fi=m((rC,sl)=>{"use strict";var Tw=Object.freeze({loose:!0}),Aw=Object.freeze({}),xw=o(s=>s?typeof s!="object"?Tw:s:Aw,"parseOptions");sl.exports=xw});var ca=m((nC,nl)=>{"use strict";var rl=/^[0-9]+$/,il=o((s,e)=>{let t=rl.test(s),r=rl.test(e);return t&&r&&(s=+s,e=+e),s===e?0:t&&!r?-1:r&&!t?1:s<e?-1:1},"compareIdentifiers"),Cw=o((s,e)=>il(e,s),"rcompareIdentifiers");nl.exports={compareIdentifiers:il,rcompareIdentifiers:Cw}});var te=m((aC,al)=>{"use strict";var di=Qs(),{MAX_LENGTH:ol,MAX_SAFE_INTEGER:pi}=Js(),{safeRe:mi,t:gi}=ls(),Bw=fi(),{compareIdentifiers:fs}=ca(),ha=class s{static{o(this,"SemVer")}constructor(e,t){if(t=Bw(t),e instanceof s){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ol)throw new TypeError(`version is longer than ${ol} characters`);di("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?mi[gi.LOOSE]:mi[gi.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>pi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pi||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<pi)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(di("SemVer.compare",this.version,this.options,e),!(e instanceof s)){if(typeof e=="string"&&e===this.version)return 0;e=new s(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),fs(this.major,e.major)||fs(this.minor,e.minor)||fs(this.patch,e.patch)}comparePre(e){if(e instanceof s||(e=new s(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(di("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return fs(r,i)}while(++t)}compareBuild(e){e instanceof s||(e=new s(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(di("build compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return fs(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?mi[gi.PRERELEASELOOSE]:mi[gi.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];r===!1&&(n=[t]),fs(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};al.exports=ha});var $t=m((hC,hl)=>{"use strict";var cl=te(),Nw=o((s,e,t=!1)=>{if(s instanceof cl)return s;try{return new cl(s,e)}catch(r){if(!t)return null;throw r}},"parse");hl.exports=Nw});var ll=m((lC,ul)=>{"use strict";var Pw=$t(),Lw=o((s,e)=>{let t=Pw(s,e);return t?t.version:null},"valid");ul.exports=Lw});var dl=m((dC,fl)=>{"use strict";var kw=$t(),Dw=o((s,e)=>{let t=kw(s.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");fl.exports=Dw});var gl=m((mC,ml)=>{"use strict";var pl=te(),Mw=o((s,e,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new pl(s instanceof pl?s.version:s,t).inc(e,r,i).version}catch{return null}},"inc");ml.exports=Mw});var wl=m((yC,El)=>{"use strict";var yl=$t(),$w=o((s,e)=>{let t=yl(s,null,!0),r=yl(e,null,!0),i=t.compare(r);if(i===0)return null;let n=i>0,a=n?t:r,c=n?r:t,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let l=h?"pre":"";return t.major!==r.major?l+"major":t.minor!==r.minor?l+"minor":t.patch!==r.patch?l+"patch":"prerelease"},"diff");El.exports=$w});var _l=m((wC,Sl)=>{"use strict";var Fw=te(),qw=o((s,e)=>new Fw(s,e).major,"major");Sl.exports=qw});var Rl=m((_C,bl)=>{"use strict";var Uw=te(),jw=o((s,e)=>new Uw(s,e).minor,"minor");bl.exports=jw});var Il=m((RC,Ol)=>{"use strict";var Hw=te(),zw=o((s,e)=>new Hw(s,e).patch,"patch");Ol.exports=zw});var Tl=m((IC,vl)=>{"use strict";var Gw=$t(),Vw=o((s,e)=>{let t=Gw(s,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");vl.exports=Vw});var _e=m((TC,xl)=>{"use strict";var Al=te(),Ww=o((s,e,t)=>new Al(s,t).compare(new Al(e,t)),"compare");xl.exports=Ww});var Bl=m((xC,Cl)=>{"use strict";var Zw=_e(),Kw=o((s,e,t)=>Zw(e,s,t),"rcompare");Cl.exports=Kw});var Pl=m((BC,Nl)=>{"use strict";var Yw=_e(),Xw=o((s,e)=>Yw(s,e,!0),"compareLoose");Nl.exports=Xw});var yi=m((PC,kl)=>{"use strict";var Ll=te(),Jw=o((s,e,t)=>{let r=new Ll(s,t),i=new Ll(e,t);return r.compare(i)||r.compareBuild(i)},"compareBuild");kl.exports=Jw});var Ml=m((kC,Dl)=>{"use strict";var Qw=yi(),eS=o((s,e)=>s.sort((t,r)=>Qw(t,r,e)),"sort");Dl.exports=eS});var Fl=m((MC,$l)=>{"use strict";var tS=yi(),sS=o((s,e)=>s.sort((t,r)=>tS(r,t,e)),"rsort");$l.exports=sS});var er=m((FC,ql)=>{"use strict";var rS=_e(),iS=o((s,e,t)=>rS(s,e,t)>0,"gt");ql.exports=iS});var Ei=m((UC,Ul)=>{"use strict";var nS=_e(),oS=o((s,e,t)=>nS(s,e,t)<0,"lt");Ul.exports=oS});var ua=m((HC,jl)=>{"use strict";var aS=_e(),cS=o((s,e,t)=>aS(s,e,t)===0,"eq");jl.exports=cS});var la=m((GC,Hl)=>{"use strict";var hS=_e(),uS=o((s,e,t)=>hS(s,e,t)!==0,"neq");Hl.exports=uS});var wi=m((WC,zl)=>{"use strict";var lS=_e(),fS=o((s,e,t)=>lS(s,e,t)>=0,"gte");zl.exports=fS});var Si=m((KC,Gl)=>{"use strict";var dS=_e(),pS=o((s,e,t)=>dS(s,e,t)<=0,"lte");Gl.exports=pS});var fa=m((XC,Vl)=>{"use strict";var mS=ua(),gS=la(),yS=er(),ES=wi(),wS=Ei(),SS=Si(),_S=o((s,e,t,r)=>{switch(e){case"===":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s===t;case"!==":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s!==t;case"":case"=":case"==":return mS(s,t,r);case"!=":return gS(s,t,r);case">":return yS(s,t,r);case">=":return ES(s,t,r);case"<":return wS(s,t,r);case"<=":return SS(s,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Vl.exports=_S});var Zl=m((QC,Wl)=>{"use strict";var bS=te(),RS=$t(),{safeRe:_i,t:bi}=ls(),OS=o((s,e)=>{if(s instanceof bS)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;e=e||{};let t=null;if(!e.rtl)t=s.match(e.includePrerelease?_i[bi.COERCEFULL]:_i[bi.COERCE]);else{let h=e.includePrerelease?_i[bi.COERCERTLFULL]:_i[bi.COERCERTL],u;for(;(u=h.exec(s))&&(!t||t.index+t[0].length!==s.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(t===null)return null;let r=t[2],i=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return RS(`${r}.${i}.${n}${a}${c}`,e)},"coerce");Wl.exports=OS});var Yl=m((tB,Kl)=>{"use strict";var da=class{static{o(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};Kl.exports=da});var be=m((rB,ef)=>{"use strict";var IS=/\s+/g,pa=class s{static{o(this,"Range")}constructor(e,t){if(t=TS(t),e instanceof s)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new s(e.raw,t);if(e instanceof ma)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(IS," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!Jl(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&LS(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&NS)|(this.options.loose&&PS))+":"+e,i=Xl.get(r);if(i)return i;let n=this.options.loose,a=n?he[ne.HYPHENRANGELOOSE]:he[ne.HYPHENRANGE];e=e.replace(a,zS(this.options.includePrerelease)),q("hyphen replace",e),e=e.replace(he[ne.COMPARATORTRIM],xS),q("comparator trim",e),e=e.replace(he[ne.TILDETRIM],CS),q("tilde trim",e),e=e.replace(he[ne.CARETTRIM],BS),q("caret trim",e);let c=e.split(" ").map(f=>kS(f,this.options)).join(" ").split(/\s+/).map(f=>HS(f,this.options));n&&(c=c.filter(f=>(q("loose invalid filter",f,this.options),!!f.match(he[ne.COMPARATORLOOSE])))),q("range list",c);let h=new Map,u=c.map(f=>new ma(f,this.options));for(let f of u){if(Jl(f))return[f];h.set(f.value,f)}h.size>1&&h.has("")&&h.delete("");let l=[...h.values()];return Xl.set(r,l),l}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Range is required");return this.set.some(r=>Ql(r,t)&&e.set.some(i=>Ql(i,t)&&r.every(n=>i.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new AS(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(GS(this.set[t],e,this.options))return!0;return!1}};ef.exports=pa;var vS=Yl(),Xl=new vS,TS=fi(),ma=tr(),q=Qs(),AS=te(),{safeRe:he,t:ne,comparatorTrimReplace:xS,tildeTrimReplace:CS,caretTrimReplace:BS}=ls(),{FLAG_INCLUDE_PRERELEASE:NS,FLAG_LOOSE:PS}=Js(),Jl=o(s=>s.value==="<0.0.0-0","isNullSet"),LS=o(s=>s.value==="","isAny"),Ql=o((s,e)=>{let t=!0,r=s.slice(),i=r.pop();for(;t&&r.length;)t=r.every(n=>i.intersects(n,e)),i=r.pop();return t},"isSatisfiable"),kS=o((s,e)=>(q("comp",s,e),s=$S(s,e),q("caret",s),s=DS(s,e),q("tildes",s),s=qS(s,e),q("xrange",s),s=jS(s,e),q("stars",s),s),"parseComparator"),oe=o(s=>!s||s.toLowerCase()==="x"||s==="*","isX"),DS=o((s,e)=>s.trim().split(/\s+/).map(t=>MS(t,e)).join(" "),"replaceTildes"),MS=o((s,e)=>{let t=e.loose?he[ne.TILDELOOSE]:he[ne.TILDE];return s.replace(t,(r,i,n,a,c)=>{q("tilde",s,r,i,n,a,c);let h;return oe(i)?h="":oe(n)?h=`>=${i}.0.0 <${+i+1}.0.0-0`:oe(a)?h=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:c?(q("replaceTilde pr",c),h=`>=${i}.${n}.${a}-${c} <${i}.${+n+1}.0-0`):h=`>=${i}.${n}.${a} <${i}.${+n+1}.0-0`,q("tilde return",h),h})},"replaceTilde"),$S=o((s,e)=>s.trim().split(/\s+/).map(t=>FS(t,e)).join(" "),"replaceCarets"),FS=o((s,e)=>{q("caret",s,e);let t=e.loose?he[ne.CARETLOOSE]:he[ne.CARET],r=e.includePrerelease?"-0":"";return s.replace(t,(i,n,a,c,h)=>{q("caret",s,i,n,a,c,h);let u;return oe(n)?u="":oe(a)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:oe(c)?n==="0"?u=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:h?(q("replaceCaret pr",h),n==="0"?a==="0"?u=`>=${n}.${a}.${c}-${h} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}-${h} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c}-${h} <${+n+1}.0.0-0`):(q("no pr"),n==="0"?a==="0"?u=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),q("caret return",u),u})},"replaceCaret"),qS=o((s,e)=>(q("replaceXRanges",s,e),s.split(/\s+/).map(t=>US(t,e)).join(" ")),"replaceXRanges"),US=o((s,e)=>{s=s.trim();let t=e.loose?he[ne.XRANGELOOSE]:he[ne.XRANGE];return s.replace(t,(r,i,n,a,c,h)=>{q("xRange",s,r,i,n,a,c,h);let u=oe(n),l=u||oe(a),f=l||oe(c),d=f;return i==="="&&d&&(i=""),h=e.includePrerelease?"-0":"",u?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&d?(l&&(a=0),c=0,i===">"?(i=">=",l?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):i==="<="&&(i="<",l?n=+n+1:a=+a+1),i==="<"&&(h="-0"),r=`${i+n}.${a}.${c}${h}`):l?r=`>=${n}.0.0${h} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${h} <${n}.${+a+1}.0-0`),q("xRange return",r),r})},"replaceXRange"),jS=o((s,e)=>(q("replaceStars",s,e),s.trim().replace(he[ne.STAR],"")),"replaceStars"),HS=o((s,e)=>(q("replaceGTE0",s,e),s.trim().replace(he[e.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),"replaceGTE0"),zS=o(s=>(e,t,r,i,n,a,c,h,u,l,f,d)=>(oe(r)?t="":oe(i)?t=`>=${r}.0.0${s?"-0":""}`:oe(n)?t=`>=${r}.${i}.0${s?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${s?"-0":""}`,oe(u)?h="":oe(l)?h=`<${+u+1}.0.0-0`:oe(f)?h=`<${u}.${+l+1}.0-0`:d?h=`<=${u}.${l}.${f}-${d}`:s?h=`<${u}.${l}.${+f+1}-0`:h=`<=${h}`,`${t} ${h}`.trim()),"hyphenReplace"),GS=o((s,e,t)=>{for(let r=0;r<s.length;r++)if(!s[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<s.length;r++)if(q(s[r].semver),s[r].semver!==ma.ANY&&s[r].semver.prerelease.length>0){let i=s[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},"testSet")});var tr=m((nB,af)=>{"use strict";var sr=Symbol("SemVer ANY"),Ea=class s{static{o(this,"Comparator")}static get ANY(){return sr}constructor(e,t){if(t=tf(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),ya("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===sr?this.value="":this.value=this.operator+this.semver.version,ya("comp",this)}parse(e){let t=this.options.loose?sf[rf.COMPARATORLOOSE]:sf[rf.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new nf(r[2],this.options.loose):this.semver=sr}toString(){return this.value}test(e){if(ya("Comparator.test",e,this.options.loose),this.semver===sr||e===sr)return!0;if(typeof e=="string")try{e=new nf(e,this.options)}catch{return!1}return ga(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new of(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new of(this.value,t).test(e.semver):(t=tf(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||ga(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||ga(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};af.exports=Ea;var tf=fi(),{safeRe:sf,t:rf}=ls(),ga=fa(),ya=Qs(),nf=te(),of=be()});var rr=m((aB,cf)=>{"use strict";var VS=be(),WS=o((s,e,t)=>{try{e=new VS(e,t)}catch{return!1}return e.test(s)},"satisfies");cf.exports=WS});var uf=m((hB,hf)=>{"use strict";var ZS=be(),KS=o((s,e)=>new ZS(s,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");hf.exports=KS});var ff=m((lB,lf)=>{"use strict";var YS=te(),XS=be(),JS=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new XS(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new YS(r,t))}),r},"maxSatisfying");lf.exports=JS});var pf=m((dB,df)=>{"use strict";var QS=te(),e_=be(),t_=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new e_(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new QS(r,t))}),r},"minSatisfying");df.exports=t_});var yf=m((mB,gf)=>{"use strict";var wa=te(),s_=be(),mf=er(),r_=o((s,e)=>{s=new s_(s,e);let t=new wa("0.0.0");if(s.test(t)||(t=new wa("0.0.0-0"),s.test(t)))return t;t=null;for(let r=0;r<s.set.length;++r){let i=s.set[r],n=null;i.forEach(a=>{let c=new wa(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||mf(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||mf(t,n))&&(t=n)}return t&&s.test(t)?t:null},"minVersion");gf.exports=r_});var wf=m((yB,Ef)=>{"use strict";var i_=be(),n_=o((s,e)=>{try{return new i_(s,e).range||"*"}catch{return null}},"validRange");Ef.exports=n_});var Ri=m((wB,Rf)=>{"use strict";var o_=te(),bf=tr(),{ANY:a_}=bf,c_=be(),h_=rr(),Sf=er(),_f=Ei(),u_=Si(),l_=wi(),f_=o((s,e,t,r)=>{s=new o_(s,r),e=new c_(e,r);let i,n,a,c,h;switch(t){case">":i=Sf,n=u_,a=_f,c=">",h=">=";break;case"<":i=_f,n=l_,a=Sf,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(h_(s,e,r))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],f=null,d=null;if(l.forEach(p=>{p.semver===a_&&(p=new bf(">=0.0.0")),f=f||p,d=d||p,i(p.semver,f.semver,r)?f=p:a(p.semver,d.semver,r)&&(d=p)}),f.operator===c||f.operator===h||(!d.operator||d.operator===c)&&n(s,d.semver))return!1;if(d.operator===h&&a(s,d.semver))return!1}return!0},"outside");Rf.exports=f_});var If=m((_B,Of)=>{"use strict";var d_=Ri(),p_=o((s,e,t)=>d_(s,e,">",t),"gtr");Of.exports=p_});var Tf=m((RB,vf)=>{"use strict";var m_=Ri(),g_=o((s,e,t)=>m_(s,e,"<",t),"ltr");vf.exports=g_});var Cf=m((IB,xf)=>{"use strict";var Af=be(),y_=o((s,e,t)=>(s=new Af(s,t),e=new Af(e,t),s.intersects(e,t)),"intersects");xf.exports=y_});var Nf=m((TB,Bf)=>{"use strict";var E_=rr(),w_=_e();Bf.exports=(s,e,t)=>{let r=[],i=null,n=null,a=s.sort((l,f)=>w_(l,f,t));for(let l of a)E_(l,e,t)?(n=l,i||(i=l)):(n&&r.push([i,n]),n=null,i=null);i&&r.push([i,null]);let c=[];for(let[l,f]of r)l===f?c.push(l):!f&&l===a[0]?c.push("*"):f?l===a[0]?c.push(`<=${f}`):c.push(`${l} - ${f}`):c.push(`>=${l}`);let h=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return h.length<u.length?h:e}});var $f=m((AB,Mf)=>{"use strict";var Pf=be(),_a=tr(),{ANY:Sa}=_a,ir=rr(),ba=_e(),S_=o((s,e,t={})=>{if(s===e)return!0;s=new Pf(s,t),e=new Pf(e,t);let r=!1;e:for(let i of s.set){for(let n of e.set){let a=b_(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),__=[new _a(">=0.0.0-0")],Lf=[new _a(">=0.0.0")],b_=o((s,e,t)=>{if(s===e)return!0;if(s.length===1&&s[0].semver===Sa){if(e.length===1&&e[0].semver===Sa)return!0;t.includePrerelease?s=__:s=Lf}if(e.length===1&&e[0].semver===Sa){if(t.includePrerelease)return!0;e=Lf}let r=new Set,i,n;for(let p of s)p.operator===">"||p.operator===">="?i=kf(i,p,t):p.operator==="<"||p.operator==="<="?n=Df(n,p,t):r.add(p.semver);if(r.size>1)return null;let a;if(i&&n){if(a=ba(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of r){if(i&&!ir(p,String(i),t)||n&&!ir(p,String(n),t))return null;for(let g of e)if(!ir(p,String(g),t))return!1;return!0}let c,h,u,l,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,d=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",i){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator===">"||p.operator===">="){if(c=kf(i,p,t),c===p&&c!==i)return!1}else if(i.operator===">="&&!ir(i.semver,String(p),t))return!1}if(n){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(h=Df(n,p,t),h===p&&h!==n)return!1}else if(n.operator==="<="&&!ir(n.semver,String(p),t))return!1}if(!p.operator&&(n||i)&&a!==0)return!1}return!(i&&u&&!n&&a!==0||n&&l&&!i&&a!==0||d||f)},"simpleSubset"),kf=o((s,e,t)=>{if(!s)return e;let r=ba(s.semver,e.semver,t);return r>0?s:r<0||e.operator===">"&&s.operator===">="?e:s},"higherGT"),Df=o((s,e,t)=>{if(!s)return e;let r=ba(s.semver,e.semver,t);return r<0?s:r>0||e.operator==="<"&&s.operator==="<="?e:s},"lowerLT");Mf.exports=S_});var jf=m((CB,Uf)=>{"use strict";var Ra=ls(),Ff=Js(),R_=te(),qf=ca(),O_=$t(),I_=ll(),v_=dl(),T_=gl(),A_=wl(),x_=_l(),C_=Rl(),B_=Il(),N_=Tl(),P_=_e(),L_=Bl(),k_=Pl(),D_=yi(),M_=Ml(),$_=Fl(),F_=er(),q_=Ei(),U_=ua(),j_=la(),H_=wi(),z_=Si(),G_=fa(),V_=Zl(),W_=tr(),Z_=be(),K_=rr(),Y_=uf(),X_=ff(),J_=pf(),Q_=yf(),e0=wf(),t0=Ri(),s0=If(),r0=Tf(),i0=Cf(),n0=Nf(),o0=$f();Uf.exports={parse:O_,valid:I_,clean:v_,inc:T_,diff:A_,major:x_,minor:C_,patch:B_,prerelease:N_,compare:P_,rcompare:L_,compareLoose:k_,compareBuild:D_,sort:M_,rsort:$_,gt:F_,lt:q_,eq:U_,neq:j_,gte:H_,lte:z_,cmp:G_,coerce:V_,Comparator:W_,Range:Z_,satisfies:K_,toComparators:Y_,maxSatisfying:X_,minSatisfying:J_,minVersion:Q_,validRange:e0,outside:t0,gtr:s0,ltr:r0,intersects:i0,simplifyRange:n0,subset:o0,SemVer:R_,re:Ra.re,src:Ra.src,tokens:Ra.t,SEMVER_SPEC_VERSION:Ff.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ff.RELEASE_TYPES,compareIdentifiers:qf.compareIdentifiers,rcompareIdentifiers:qf.rcompareIdentifiers}});var zf=m((BB,Hf)=>{var a0=jf(),c0=o(s=>a0.satisfies(process.version,s,{includePrerelease:!0}),"satisfies");Hf.exports={satisfies:c0}});var Gf=m((kB,Ia)=>{"use strict";var{inspect:h0}=require("util"),Oa=class{static{o(this,"SystemError")}constructor(e,t,r){let i=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(i+=` ${r.path}`),r.dest!==void 0&&(i+=` => ${r.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:i,enumerable:!1,writable:!0,configurable:!0},info:{value:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return h0(this,{...t,getters:!0,customInspect:!1})}};function ut(s,e){Ia.exports[s]=class extends Oa{static{o(this,"NodeError")}constructor(r){super(s,e,r)}}}o(ut,"E");ut("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");ut("ERR_FS_CP_EEXIST","Target already exists");ut("ERR_FS_CP_EINVAL","Invalid src or dest");ut("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");ut("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");ut("ERR_FS_CP_SOCKET","Cannot copy a socket file");ut("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");ut("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");ut("ERR_FS_EISDIR","Path is a directory");Ia.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var ud=m((MB,hd)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:u0,ERR_FS_CP_EEXIST:l0,ERR_FS_CP_EINVAL:Oi,ERR_FS_CP_FIFO_PIPE:f0,ERR_FS_CP_NON_DIR_TO_DIR:d0,ERR_FS_CP_SOCKET:p0,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:m0,ERR_FS_CP_UNKNOWN:g0,ERR_FS_EISDIR:y0,ERR_INVALID_ARG_TYPE:E0}=Gf(),{constants:{errno:{EEXIST:w0,EISDIR:S0,EINVAL:lt,ENOTDIR:_0}}}=require("os"),{chmod:b0,copyFile:R0,lstat:ed,mkdir:td,readdir:O0,readlink:Vf,stat:ds,symlink:va,unlink:sd,utimes:I0}=require("fs/promises"),{dirname:nr,isAbsolute:Wf,join:Zf,parse:v0,resolve:or,sep:T0,toNamespacedPath:Kf}=require("path"),{fileURLToPath:A0}=require("url"),x0={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function C0(s,e,t){if(t!=null&&typeof t!="object")throw new E0("options",["Object"],t);return B0(Kf(Yf(s)),Kf(Yf(e)),{...x0,...t})}o(C0,"cp");function Yf(s){return s!=null&&s.href&&s.origin?A0(s):s}o(Yf,"getValidatedPath");async function B0(s,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await rd(s,e,t),{srcStat:i,destStat:n}=r;return await nd(s,i,e),t.filter?od(Xf,n,s,e,t):Xf(n,s,e,t)}o(B0,"cpFn");async function rd(s,e,t){let{0:r,1:i}=await N0(s,e,t);if(i){if(id(r,i))throw new Oi({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:lt});if(r.isDirectory()&&!i.isDirectory())throw new u0({message:`cannot overwrite directory ${s} with non-directory ${e}`,path:e,syscall:"cp",errno:S0});if(!r.isDirectory()&&i.isDirectory())throw new d0({message:`cannot overwrite non-directory ${s} with directory ${e}`,path:e,syscall:"cp",errno:_0})}if(r.isDirectory()&&Ta(s,e))throw new Oi({message:`cannot copy ${s} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:lt});return{srcStat:r,destStat:i}}o(rd,"checkPaths");function id(s,e){return e.ino&&e.dev&&e.ino===s.ino&&e.dev===s.dev}o(id,"areIdentical");function N0(s,e,t){let r=t.dereference?i=>ds(i,{bigint:!0}):i=>ed(i,{bigint:!0});return Promise.all([r(s),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})])}o(N0,"getStats");async function Xf(s,e,t,r){let i=nr(t);return await P0(i)||await td(i,{recursive:!0}),Ii(s,e,t,r)}o(Xf,"checkParentDir");function P0(s){return ds(s).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(P0,"pathExists");async function nd(s,e,t){let r=or(nr(s)),i=or(nr(t));if(i===r||i===v0(i).root)return;let n;try{n=await ds(i,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(id(e,n))throw new Oi({message:`cannot copy ${s} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:lt});return nd(s,e,i)}o(nd,"checkParentPaths");var Jf=o(s=>or(s).split(T0).filter(Boolean),"normalizePathToArray");function Ta(s,e){let t=Jf(s),r=Jf(e);return t.every((i,n)=>r[n]===i)}o(Ta,"isSrcSubdir");async function od(s,e,t,r,i,n){if(await i.filter(t,r))return s(e,t,r,i,n)}o(od,"handleFilter");function L0(s,e,t,r){return r.filter?od(Ii,s,e,t,r):Ii(s,e,t,r)}o(L0,"startCopy");async function Ii(s,e,t,r){let n=await(r.dereference?ds:ed)(e);if(n.isDirectory()&&r.recursive)return U0(n,s,e,t,r);if(n.isDirectory())throw new y0({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:lt});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return k0(n,s,e,t,r);if(n.isSymbolicLink())return H0(s,e,t);throw n.isSocket()?new p0({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:lt}):n.isFIFO()?new f0({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:lt}):new g0({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:lt})}o(Ii,"getStatsForCopy");function k0(s,e,t,r,i){return e?D0(s,t,r,i):ad(s,t,r,i)}o(k0,"onFile");async function D0(s,e,t,r){if(r.force)return await sd(t),ad(s,e,t,r);if(r.errorOnExist)throw new l0({message:`${t} already exists`,path:t,syscall:"cp",errno:w0})}o(D0,"mayCopyFile");async function ad(s,e,t,r){return await R0(e,t),r.preserveTimestamps?M0(s.mode,e,t):vi(t,s.mode)}o(ad,"_copyFile");async function M0(s,e,t){return $0(s)&&await F0(t,s),Qf(s,e,t)}o(M0,"handleTimestampsAndMode");function $0(s){return(s&128)===0}o($0,"fileIsNotWritable");function F0(s,e){return vi(s,e|128)}o(F0,"makeFileWritable");async function Qf(s,e,t){return await q0(e,t),vi(t,s)}o(Qf,"setDestTimestampsAndMode");function vi(s,e){return b0(s,e)}o(vi,"setDestMode");async function q0(s,e){let t=await ds(s);return I0(e,t.atime,t.mtime)}o(q0,"setDestTimestamps");function U0(s,e,t,r,i){return e?cd(t,r,i):j0(s.mode,t,r,i)}o(U0,"onDir");async function j0(s,e,t,r){return await td(t),await cd(e,t,r),vi(t,s)}o(j0,"mkDirAndCopy");async function cd(s,e,t){let r=await O0(s);for(let i=0;i<r.length;i++){let n=r[i],a=Zf(s,n),c=Zf(e,n),{destStat:h}=await rd(a,c,t);await L0(h,a,c,t)}}o(cd,"copyDir");async function H0(s,e,t){let r=await Vf(e);if(Wf(r)||(r=or(nr(e),r)),!s)return va(r,t);let i;try{i=await Vf(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return va(r,t);throw a}if(Wf(i)||(i=or(nr(t),i)),Ta(r,i))throw new Oi({message:`cannot copy ${r} to a subdirectory of self ${i}`,path:t,syscall:"cp",errno:lt});if((await ds(e)).isDirectory()&&Ta(i,r))throw new m0({message:`cannot overwrite ${i} with ${r}`,path:t,syscall:"cp",errno:lt});return z0(r,t)}o(H0,"onLink");async function z0(s,e){return await sd(e),va(s,e)}o(z0,"copyLink");hd.exports=C0});var fd=m((FB,ld)=>{var G0=require("fs/promises"),V0=na(),W0=zf(),Z0=ud(),K0=W0.satisfies(">=16.7.0"),Y0=o(async(s,e,t)=>{let r=V0(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return K0?G0.cp(s,e,r):Z0(s,e,r)},"cp");ld.exports=Y0});var pd=m((UB,dd)=>{var{join:X0,sep:J0}=require("path"),Q0=na(),{mkdir:eb,mkdtemp:tb,rm:sb}=require("fs/promises"),rb=o(async(s,e,t)=>{let r=Q0(t,{copy:["tmpPrefix"]});await eb(s,{recursive:!0});let i=await tb(X0(`${s}${J0}`,r.tmpPrefix||"")),n,a;try{a=await e(i)}catch(c){n=c}try{await sb(i,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");dd.exports=rb});var Ed=m((HB,yd)=>{var{readdir:md}=require("fs/promises"),{join:gd}=require("path"),ib=o(async s=>{let e=[];for(let t of await md(s))if(t.startsWith("@"))for(let r of await md(gd(s,t)))e.push(gd(t,r));else e.push(t);return e},"readdirScoped");yd.exports=ib});var Od=m((GB,Rd)=>{var{dirname:wd,join:Sd,resolve:_d,relative:nb,isAbsolute:ob}=require("path"),je=require("fs/promises"),ab=o(async s=>{try{return await je.access(s),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),bd=o(async(s,e,t={},r=!0,i=[])=>{if(!s||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await ab(e))throw new Error(`The destination file exists: ${e}`);await je.mkdir(wd(e),{recursive:!0});try{await je.rename(s,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await je.lstat(s);if(a.isDirectory()){let c=await je.readdir(s);await Promise.all(c.map(h=>bd(Sd(s,h),Sd(e,h),t,!1,i)))}else a.isSymbolicLink()?i.push({source:s,destination:e}):await je.copyFile(s,e)}else throw n}r&&(await Promise.all(i.map(async({source:n,destination:a})=>{let c=await je.readlink(n);ob(c)&&(c=_d(a,nb(n,c)));let h="file";try{h=await je.stat(_d(wd(n),c)),h.isDirectory()&&(h="junction")}catch{}await je.symlink(c,a,h)})),await je.rm(s,{recursive:!0,force:!0}))},"moveFile");Rd.exports=bd});var Ti=m((WB,Id)=>{"use strict";var cb=fd(),hb=pd(),ub=Ed(),lb=Od();Id.exports={cp:cb,withTempDir:hb,readdirScoped:ub,moveFile:lb}});var Ai={};ey(Ai,{default:()=>vd,pMapIterable:()=>fb,pMapSkip:()=>ar});async function vd(s,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:i}={}){return new Promise((n,a)=>{if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);let c=[],h=[],u=new Map,l=!1,f=!1,d=!1,p=0,g=0,y=s[Symbol.iterator]===void 0?s[Symbol.asyncIterator]():s[Symbol.iterator](),S=o(()=>{v(i.reason)},"signalListener"),w=o(()=>{i?.removeEventListener("abort",S)},"cleanup"),T=o(I=>{n(I),w()},"resolve"),v=o(I=>{l=!0,f=!0,a(I),w()},"reject");i&&(i.aborted&&v(i.reason),i.addEventListener("abort",S,{once:!0}));let R=o(async()=>{if(f)return;let I=await y.next(),C=g;if(g++,I.done){if(d=!0,p===0&&!f){if(!r&&h.length>0){v(new AggregateError(h));return}if(f=!0,u.size===0){T(c);return}let P=[];for(let[Y,Se]of c.entries())u.get(Y)!==ar&&P.push(Se);T(P)}return}p++,(async()=>{try{let P=await I.value;if(f)return;let Y=await e(P,C);Y===ar&&u.set(C,Y),c[C]=Y,p--,await R()}catch(P){if(r)v(P);else{h.push(P),p--;try{await R()}catch(Y){v(Y)}}}})()},"next");(async()=>{for(let I=0;I<t;I++){try{await R()}catch(C){v(C);break}if(d||l)break}})()})}function fb(s,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let i=s[Symbol.asyncIterator]===void 0?s[Symbol.iterator]():s[Symbol.asyncIterator](),n=[],a=0,c=!1,h=0;function u(){if(c||!(a<t&&n.length<r))return;let l=(async()=>{let{done:f,value:d}=await i.next();if(f)return{done:!0};a++,u();try{let p=await e(await d,h++);if(a--,p===ar){let g=n.indexOf(l);g>0&&n.splice(g,1)}return u(),{done:!1,value:p}}catch(p){return c=!0,{error:p}}})();n.push(l)}for(o(u,"trySpawn"),u();n.length>0;){let{error:l,done:f,value:d}=await n[0];if(n.shift(),l)throw l;if(f)return;u(),d!==ar&&(yield d)}}}}var ar,xi=Qg(()=>{o(vd,"pMap");o(fb,"pMapIterable");ar=Symbol("skip")});var ps=m((YB,ye)=>{"use strict";var db=require("crypto"),{appendFile:pb,mkdir:Ca,readFile:mb,readdir:gb,rm:Td,writeFile:yb}=require("fs/promises"),{Minipass:Eb}=J(),He=require("path"),wb=St(),Sb=ta(),_b=us(),bb=ra(),Rb=sa()["cache-version"].index,{moveFile:Ob}=Ti(),Aa=5;ye.exports.NotFoundError=class extends Error{static{o(this,"NotFoundError")}constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code="ENOENT",this.cache=e,this.key=t}};ye.exports.compact=Ib;async function Ib(s,e,t,r={}){let i=cr(s,e),n=await Ci(i),a=[];for(let d=n.length-1;d>=0;--d){let p=n[d];if(p.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(p)===!0)&&(a.length===0||!a.find(g=>t(g,p)))&&a.unshift(p)}let c=`
11
+ `+a.map(d=>{let p=JSON.stringify(d);return`${Bi(p)} ${p}`}).join(`
12
+ `),h=o(async()=>{let d=Sb(He.join(s,"tmp"),r.tmpPrefix);return await Ca(He.dirname(d),{recursive:!0}),{target:d,moved:!1}},"setup"),u=o(async d=>{if(!d.moved)return Td(d.target,{recursive:!0,force:!0})},"teardown"),l=o(async d=>{await yb(d.target,c,{flag:"wx"}),await Ca(He.dirname(i),{recursive:!0}),await Ob(d.target,i),d.moved=!0},"write"),f=await h();try{await l(f)}finally{await u(f)}return a.reverse().map(d=>Ni(s,d,!0))}o(Ib,"compact");ye.exports.insert=Ad;async function Ad(s,e,t,r={}){let{metadata:i,size:n,time:a}=r,c=cr(s,e),h={key:e,integrity:t&&wb.stringify(t),time:a||Date.now(),size:n,metadata:i};try{await Ca(He.dirname(c),{recursive:!0});let u=JSON.stringify(h);await pb(c,`
13
+ ${Bi(u)} ${u}`)}catch(u){if(u.code==="ENOENT")return;throw u}return Ni(s,h)}o(Ad,"insert");ye.exports.find=vb;async function vb(s,e){let t=cr(s,e);try{return(await Ci(t)).reduce((i,n)=>n&&n.key===e?Ni(s,n):i,null)}catch(r){if(r.code==="ENOENT")return null;throw r}}o(vb,"find");ye.exports.delete=Tb;function Tb(s,e,t={}){if(!t.removeFully)return Ad(s,e,null,t);let r=cr(s,e);return Td(r,{recursive:!0,force:!0})}o(Tb,"del");ye.exports.lsStream=xd;function xd(s){let e=Ba(s),t=new Eb({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(xi(),Ai)),i=await xa(e);return await r(i,async n=>{let a=He.join(e,n),c=await xa(a);await r(c,async h=>{let u=He.join(a,h),l=await xa(u);await r(l,async f=>{let d=He.join(u,f);try{let g=(await Ci(d)).reduce((y,S)=>(y.set(S.key,S),y),new Map);for(let y of g.values()){let S=Ni(s,y);S&&t.write(S)}}catch(p){if(p.code==="ENOENT")return;throw p}},{concurrency:Aa})},{concurrency:Aa})},{concurrency:Aa}),t.end(),t}).catch(r=>t.emit("error",r)),t}o(xd,"lsStream");ye.exports.ls=Ab;async function Ab(s){return(await xd(s).collect()).reduce((t,r)=>(t[r.key]=r,t),{})}o(Ab,"ls");ye.exports.bucketEntries=Ci;async function Ci(s,e){let t=await mb(s,"utf8");return xb(t,e)}o(Ci,"bucketEntries");function xb(s){let e=[];return s.split(`
14
+ `).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||Bi(r[1])!==r[0])return;let i;try{i=JSON.parse(r[1])}catch{}i&&e.push(i)}),e}o(xb,"_bucketEntries");ye.exports.bucketDir=Ba;function Ba(s){return He.join(s,`index-v${Rb}`)}o(Ba,"bucketDir");ye.exports.bucketPath=cr;function cr(s,e){let t=Cd(e);return He.join.apply(He,[Ba(s)].concat(bb(t)))}o(cr,"bucketPath");ye.exports.hashKey=Cd;function Cd(s){return Bd(s,"sha256")}o(Cd,"hashKey");ye.exports.hashEntry=Bi;function Bi(s){return Bd(s,"sha1")}o(Bi,"hashEntry");function Bd(s,e){return db.createHash(e).update(s).digest("hex")}o(Bd,"hash");function Ni(s,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?_b(s,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(Ni,"formatEntry");function xa(s){return gb(s).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(xa,"readdirOrEmpty")});var gs=m(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.LRUCache=void 0;var Cb=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Pd=new Set,Na=typeof process=="object"&&process?process:{},Ld=o((s,e,t,r)=>{typeof Na.emitWarning=="function"&&Na.emitWarning(s,e,t,r)},"emitWarning"),Pi=globalThis.AbortController,Nd=globalThis.AbortSignal;if(typeof Pi>"u"){Nd=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Pi=class{static{o(this,"AbortController")}constructor(){e()}signal=new Nd;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let s=Na.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{s&&(s=!1,Ld("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var Bb=o(s=>!Pd.has(s),"shouldWarn"),e1=Symbol("type"),_t=o(s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),"isPosInt"),kd=o(s=>_t(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?ms:null:null,"getUintArray"),ms=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Pa=class s{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=kd(e);if(!t)return[];s.#e=!0;let r=new s(e,t);return s.#e=!1,r}constructor(e,t){if(!s.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},La=class s{static{o(this,"LRUCache")}#e;#t;#s;#r;#i;#a;#l;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#p;#d;#h;#n;#g;#_;#S;#y;#A;#E;#R;#v;#w;#b;#T;#m;#o;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#w,sizes:e.#R,keyMap:e.#d,keyList:e.#h,valList:e.#n,next:e.#g,prev:e.#_,get head(){return e.#S},get tail(){return e.#y},free:e.#A,isBackgroundFetch:o(t=>e.#u(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,n)=>e.#H(t,r,i,n),"backgroundFetch"),moveToTail:o(t=>e.#M(t),"moveToTail"),indexes:o(t=>e.#C(t),"indexes"),rindexes:o(t=>e.#N(t),"rindexes"),isStale:o(t=>e.#I(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#l}get dispose(){return this.#s}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:h,dispose:u,onInsert:l,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:S,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:C,ignoreFetchAbort:P,perf:Y}=e;if(Y!==void 0&&typeof Y?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=Y??Cb,t!==0&&!_t(t))throw new TypeError("max option must be a nonnegative integer");let Se=t?kd(t):Array;if(!Se)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=y||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=T,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=w,this.#T=!!w,this.#d=new Map,this.#h=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#g=new Se(t),this.#_=new Se(t),this.#S=0,this.#y=0,this.#A=Pa.create(t),this.#c=0,this.#p=0,typeof u=="function"&&(this.#s=u),typeof l=="function"&&(this.#r=l),typeof f=="function"?(this.#i=f,this.#E=[]):(this.#i=void 0,this.#E=void 0),this.#b=!!this.#s,this.#o=!!this.#r,this.#m=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#t!==0&&!_t(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!_t(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=_t(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!_t(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let Xe="LRU_CACHE_UNBOUNDED";Bb(Xe)&&(Pd.add(Xe),Ld("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Xe,s))}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#P(){let e=new ms(this.#e),t=new ms(this.#e);this.#w=e,this.#v=t,this.#U=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#I(n)&&this.#B(this.#h[n],"expire")},a+1);h.unref&&h.unref()}},this.#x=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#O=(n,a)=>{if(e[a]){let c=e[a],h=t[a];if(!c||!h)return;n.ttl=c,n.start=h,n.now=r||i();let u=n.now-h;n.remainingTTL=c-u}};let r=0,i=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#d.get(n);if(a===void 0)return 0;let c=e[a],h=t[a];if(!c||!h)return 1/0;let u=(r||i())-h;return c-u},this.#I=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||i())-a>c}}#x=o(()=>{},"#updateItemAge");#O=o(()=>{},"#statusTTL");#U=o(()=>{},"#setItemTTL");#I=o(()=>!1,"#isStale");#$(){let e=new ms(this.#e);this.#p=0,this.#R=e,this.#L=t=>{this.#p-=e[t],e[t]=0},this.#k=(t,r,i,n)=>{if(this.#u(r))return 0;if(!_t(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(r,t),!_t(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#F=(t,r,i)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#p>n;)this.#D(!0)}this.#p+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#p)}}#L=o(e=>{},"#removeItemSize");#F=o((e,t,r)=>{},"#addItemSize");#k=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#j(t)||((e||!this.#I(t))&&(yield t),t===this.#S));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;!(!this.#j(t)||((e||!this.#I(t))&&(yield t),t===this.#y));)t=this.#g[t]}#j(e){return e!==void 0&&this.#d.get(this.#h[e])===e}*entries(){for(let e of this.#C())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*rentries(){for(let e of this.#N())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*keys(){for(let e of this.#C()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*values(){for(let e of this.#C())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#N())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#C()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#C()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#N()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#I(t)&&(this.#B(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#d.get(e);if(t===void 0)return;let r=this.#n[t],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let n={value:i};if(this.#w&&this.#v){let a=this.#w[t],c=this.#v[t];if(a&&c){let h=a-(this.#f.now()-c);n.ttl=h,n.start=Date.now()}}return this.#R&&(n.size=this.#R[t]),n}dump(){let e=[];for(let t of this.#C({allowStale:!0})){let r=this.#h[t],i=this.#n[t],n=this.#u(i)?i.__staleWhileFetching:i;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#w&&this.#v){a.ttl=this.#w[t];let c=this.#f.now()-this.#v[t];a.start=Math.floor(Date.now()-c)}this.#R&&(a.size=this.#R[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=this.#f.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,l=this.#k(e,t,r.size||0,c);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#B(e,"set"),this;let f=this.#c===0?void 0:this.#d.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#A.length!==0?this.#A.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#n[f]=t,this.#d.set(e,f),this.#g[this.#y]=f,this.#_[f]=this.#y,this.#y=f,this.#c++,this.#F(f,l,h),h&&(h.set="add"),u=!1,this.#o&&this.#r?.(t,e,"add");else{this.#M(f);let d=this.#n[f];if(t!==d){if(this.#T&&this.#u(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#b&&this.#s?.(p,e,"set"),this.#m&&this.#E?.push([p,e,"set"]))}else a||(this.#b&&this.#s?.(d,e,"set"),this.#m&&this.#E?.push([d,e,"set"]));if(this.#L(f),this.#F(f,l,h),this.#n[f]=t,h){h.set="replace";let p=d&&this.#u(d)?d.__staleWhileFetching:d;p!==void 0&&(h.oldValue=p)}}else h&&(h.set="update");this.#o&&this.onInsert?.(t,e,t===d?"update":"replace")}if(i!==0&&!this.#w&&this.#P(),this.#w&&(u||this.#U(f,i,n),h&&this.#O(h,f)),!a&&this.#m&&this.#E){let d=this.#E,p;for(;p=d?.shift();)this.#i?.(...p)}return this}pop(){try{for(;this.#c;){let e=this.#n[this.#S];if(this.#D(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#E){let e=this.#E,t;for(;t=e?.shift();)this.#i?.(...t)}}}#D(e){let t=this.#S,r=this.#h[t],i=this.#n[t];return this.#T&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(i,r,"evict"),this.#m&&this.#E?.push([i,r,"evict"])),this.#L(t),e&&(this.#h[t]=void 0,this.#n[t]=void 0,this.#A.push(t)),this.#c===1?(this.#S=this.#y=0,this.#A.length=0):this.#S=this.#g[t],this.#d.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,n=this.#d.get(e);if(n!==void 0){let a=this.#n[n];if(this.#u(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#I(n))i&&(i.has="stale",this.#O(i,n));else return r&&this.#x(n),i&&(i.has="hit",this.#O(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#d.get(e);if(i===void 0||!r&&this.#I(i))return;let n=this.#n[i];return this.#u(n)?n.__staleWhileFetching:n}#H(e,t,r,i){let n=t===void 0?void 0:this.#n[t];if(this.#u(n))return n;let a=new Pi,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let h={signal:a.signal,options:r,context:i},u=o((y,S=!1)=>{let{aborted:w}=a.signal,T=r.ignoreFetchAbort&&y!==void 0;if(r.status&&(w&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),w&&!T&&!S)return f(a.signal.reason);let v=p,R=this.#n[t];return(R===p||T&&S&&R===void 0)&&(y===void 0?v.__staleWhileFetching!==void 0?this.#n[t]=v.__staleWhileFetching:this.#B(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,h.options))),y},"cb"),l=o(y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),f(y)),"eb"),f=o(y=>{let{aborted:S}=a.signal,w=S&&r.allowStaleOnFetchAbort,T=w||r.allowStaleOnFetchRejection,v=T||r.noDeleteOnFetchRejection,R=p;if(this.#n[t]===p&&(!v||R.__staleWhileFetching===void 0?this.#B(e,"fetch"):w||(this.#n[t]=R.__staleWhileFetching)),T)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw y},"fetchFail"),d=o((y,S)=>{let w=this.#a?.(e,n,h);w&&w instanceof Promise&&w.then(T=>y(T===void 0?void 0:T),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(void 0),r.allowStaleOnFetchAbort&&(y=o(T=>u(T,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,l),g=Object.assign(p,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,g,{...h.options,status:void 0}),t=this.#d.get(e)):this.#n[t]=g,g}#u(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Pi}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:y,forceRefresh:S=!1,status:w,signal:T}=t;if(!this.#T)return w&&(w.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:w});let v={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:h,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:w,signal:T},R=this.#d.get(e);if(R===void 0){w&&(w.fetch="miss");let I=this.#H(e,R,v,y);return I.__returned=I}else{let I=this.#n[R];if(this.#u(I)){let Xe=r&&I.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Xe&&(w.returnedStale=!0)),Xe?I.__staleWhileFetching:I.__returned=I}let C=this.#I(R);if(!S&&!C)return w&&(w.fetch="hit"),this.#M(R),i&&this.#x(R),w&&this.#O(w,R),I;let P=this.#H(e,R,v,y),Se=P.__staleWhileFetching!==void 0&&r;return w&&(w.fetch=C?"stale":"refresh",Se&&C&&(w.returnedStale=!0)),Se?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#l;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let h=r(e,c,{options:a,context:i});return this.set(e,h,a),h}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#d.get(e);if(c!==void 0){let h=this.#n[c],u=this.#u(h);return a&&this.#O(a,c),this.#I(c)?(a&&(a.get="stale"),u?(a&&r&&h.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?h.__staleWhileFetching:void 0):(n||this.#B(e,"expire"),a&&r&&(a.returnedStale=!0),r?h:void 0)):(a&&(a.get="hit"),u?h.__staleWhileFetching:(this.#M(c),i&&this.#x(c),h))}else a&&(a.get="miss")}#z(e,t){this.#_[t]=e,this.#g[e]=t}#M(e){e!==this.#y&&(e===this.#S?this.#S=this.#g[e]:this.#z(this.#_[e],this.#g[e]),this.#z(this.#y,e),this.#y=e)}delete(e){return this.#B(e,"delete")}#B(e,t){let r=!1;if(this.#c!==0){let i=this.#d.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#L(i);let n=this.#n[i];if(this.#u(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(n,e,t),this.#m&&this.#E?.push([n,e,t])),this.#d.delete(e),this.#h[i]=void 0,this.#n[i]=void 0,i===this.#y)this.#y=this.#_[i];else if(i===this.#S)this.#S=this.#g[i];else{let a=this.#_[i];this.#g[a]=this.#g[i];let c=this.#g[i];this.#_[c]=this.#_[i]}this.#c--,this.#A.push(i)}}if(this.#m&&this.#E?.length){let i=this.#E,n;for(;n=i?.shift();)this.#i?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#N({allowStale:!0})){let r=this.#n[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#h[t];this.#b&&this.#s?.(r,i,e),this.#m&&this.#E?.push([r,i,e])}}if(this.#d.clear(),this.#n.fill(void 0),this.#h.fill(void 0),this.#w&&this.#v&&(this.#w.fill(0),this.#v.fill(0)),this.#R&&this.#R.fill(0),this.#S=0,this.#y=0,this.#A.length=0,this.#p=0,this.#c=0,this.#m&&this.#E){let t=this.#E,r;for(;r=t?.shift();)this.#i?.(...r)}}};Li.LRUCache=La});var hr=m((r1,ys)=>{"use strict";var{LRUCache:Nb}=gs(),ki=new Nb({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((s,e)=>e.startsWith("key:")?s.data.length:s.length,"sizeCalculation")});ys.exports.clearMemoized=Pb;function Pb(){let s={};return ki.forEach((e,t)=>{s[t]=e}),ki.clear(),s}o(Pb,"clearMemoized");ys.exports.put=Lb;function Lb(s,e,t,r){Di(r).set(`key:${s}:${e.key}`,{entry:e,data:t}),Dd(s,e.integrity,t,r)}o(Lb,"put");ys.exports.put.byDigest=Dd;function Dd(s,e,t,r){Di(r).set(`digest:${s}:${e}`,t)}o(Dd,"putDigest");ys.exports.get=kb;function kb(s,e,t){return Di(t).get(`key:${s}:${e}`)}o(kb,"get");ys.exports.get.byDigest=Db;function Db(s,e,t){return Di(t).get(`digest:${s}:${e}`)}o(Db,"getDigest");var ka=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function Di(s){return!s||!s.memoize?ki:s.memoize.get&&s.memoize.set?s.memoize:typeof s.memoize=="object"?new ka(s.memoize):ki}o(Di,"pickMem")});var zi=m(lr=>{"use strict";var{Minipass:Mb}=J(),$b=require("events").EventEmitter,ue=require("fs"),Fb=ue.writev,bs=Symbol("_autoClose"),Pe=Symbol("_close"),ur=Symbol("_ended"),D=Symbol("_fd"),Md=Symbol("_finished"),Rt=Symbol("_flags"),Da=Symbol("_flush"),$a=Symbol("_handleChunk"),Fa=Symbol("_makeBuf"),Ui=Symbol("_mode"),Mi=Symbol("_needDrain"),Ss=Symbol("_onerror"),Rs=Symbol("_onopen"),Ma=Symbol("_onread"),Es=Symbol("_onwrite"),Ot=Symbol("_open"),ft=Symbol("_path"),qt=Symbol("_pos"),ze=Symbol("_queue"),ws=Symbol("_read"),$d=Symbol("_readSize"),bt=Symbol("_reading"),$i=Symbol("_remain"),Fd=Symbol("_size"),Fi=Symbol("_write"),Ft=Symbol("_writing"),qi=Symbol("_defaultFlag"),_s=Symbol("_errored"),ji=class extends Mb{static{o(this,"ReadStream")}constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[_s]=!1,this[D]=typeof t.fd=="number"?t.fd:null,this[ft]=e,this[$d]=t.readSize||16*1024*1024,this[bt]=!1,this[Fd]=typeof t.size=="number"?t.size:1/0,this[$i]=this[Fd],this[bs]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[D]=="number"?this[ws]():this[Ot]()}get fd(){return this[D]}get path(){return this[ft]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ot](){ue.open(this[ft],"r",(e,t)=>this[Rs](e,t))}[Rs](e,t){e?this[Ss](e):(this[D]=t,this.emit("open",t),this[ws]())}[Fa](){return Buffer.allocUnsafe(Math.min(this[$d],this[$i]))}[ws](){if(!this[bt]){this[bt]=!0;let e=this[Fa]();if(e.length===0)return process.nextTick(()=>this[Ma](null,0,e));ue.read(this[D],e,0,e.length,null,(t,r,i)=>this[Ma](t,r,i))}}[Ma](e,t,r){this[bt]=!1,e?this[Ss](e):this[$a](t,r)&&this[ws]()}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ss](e){this[bt]=!0,this[Pe](),this.emit("error",e)}[$a](e,t){let r=!1;return this[$i]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[$i]<=0)&&(r=!1,this[Pe](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[D]=="number"&&this[ws]();break;case"error":return this[_s]?void 0:(this[_s]=!0,super.emit(e,t));default:return super.emit(e,t)}}},qa=class extends ji{static{o(this,"ReadStreamSync")}[Ot](){let e=!0;try{this[Rs](null,ue.openSync(this[ft],"r")),e=!1}finally{e&&this[Pe]()}}[ws](){let e=!0;try{if(!this[bt]){this[bt]=!0;do{let t=this[Fa](),r=t.length===0?0:ue.readSync(this[D],t,0,t.length,null);if(!this[$a](r,t))break}while(!0);this[bt]=!1}e=!1}finally{e&&this[Pe]()}}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.closeSync(e),this.emit("close")}}},Hi=class extends $b{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[_s]=!1,this[Ft]=!1,this[ur]=!1,this[Mi]=!1,this[ze]=[],this[ft]=e,this[D]=typeof t.fd=="number"?t.fd:null,this[Ui]=t.mode===void 0?438:t.mode,this[qt]=typeof t.start=="number"?t.start:null,this[bs]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[qt]!==null?"r+":"w";this[qi]=t.flags===void 0,this[Rt]=this[qi]?r:t.flags,this[D]===null&&this[Ot]()}emit(e,t){if(e==="error"){if(this[_s])return;this[_s]=!0}return super.emit(e,t)}get fd(){return this[D]}get path(){return this[ft]}[Ss](e){this[Pe](),this[Ft]=!0,this.emit("error",e)}[Ot](){ue.open(this[ft],this[Rt],this[Ui],(e,t)=>this[Rs](e,t))}[Rs](e,t){this[qi]&&this[Rt]==="r+"&&e&&e.code==="ENOENT"?(this[Rt]="w",this[Ot]()):e?this[Ss](e):(this[D]=t,this.emit("open",t),this[Ft]||this[Da]())}end(e,t){return e&&this.write(e,t),this[ur]=!0,!this[Ft]&&!this[ze].length&&typeof this[D]=="number"&&this[Es](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[ur]?(this.emit("error",new Error("write() after end()")),!1):this[D]===null||this[Ft]||this[ze].length?(this[ze].push(e),this[Mi]=!0,!1):(this[Ft]=!0,this[Fi](e),!0)}[Fi](e){ue.write(this[D],e,0,e.length,this[qt],(t,r)=>this[Es](t,r))}[Es](e,t){e?this[Ss](e):(this[qt]!==null&&(this[qt]+=t),this[ze].length?this[Da]():(this[Ft]=!1,this[ur]&&!this[Md]?(this[Md]=!0,this[Pe](),this.emit("finish")):this[Mi]&&(this[Mi]=!1,this.emit("drain"))))}[Da](){if(this[ze].length===0)this[ur]&&this[Es](null,0);else if(this[ze].length===1)this[Fi](this[ze].pop());else{let e=this[ze];this[ze]=[],Fb(this[D],e,this[qt],(t,r)=>this[Es](t,r))}}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Ua=class extends Hi{static{o(this,"WriteStreamSync")}[Ot](){let e;if(this[qi]&&this[Rt]==="r+")try{e=ue.openSync(this[ft],this[Rt],this[Ui])}catch(t){if(t.code==="ENOENT")return this[Rt]="w",this[Ot]();throw t}else e=ue.openSync(this[ft],this[Rt],this[Ui]);this[Rs](null,e)}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.closeSync(e),this.emit("close")}}[Fi](e){let t=!0;try{this[Es](null,ue.writeSync(this[D],e,0,e.length,this[qt])),t=!1}finally{if(t)try{this[Pe]()}catch{}}}};lr.ReadStream=ji;lr.ReadStreamSync=qa;lr.WriteStream=Hi;lr.WriteStreamSync=Ua});var Ha=m((a1,Os)=>{"use strict";var fr=require("fs/promises"),qb=zi(),ja=St(),Ub=us(),qd=hs();Os.exports=jb;var Ud=64*1024*1024;async function jb(s,e,t={}){let{size:r}=t,{stat:i,cpath:n,sri:a}=await dr(s,e,async(h,u)=>({stat:r?{size:r}:await fr.stat(h),cpath:h,sri:u}));if(i.size>Ud)return jd(n,i.size,a,new qd).concat();let c=await fr.readFile(n,{encoding:null});if(i.size!==c.length)throw Gb(i.size,c.length);if(!ja.checkData(c,a))throw Vb(a,n);return c}o(jb,"read");var jd=o((s,e,t,r)=>(r.push(new qb.ReadStream(s,{size:e,readSize:Ud}),ja.integrityStream({integrity:t,size:e})),r),"readPipeline");Os.exports.stream=Hd;Os.exports.readStream=Hd;function Hd(s,e,t={}){let{size:r}=t,i=new qd;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await dr(s,e,async(h,u)=>({stat:r?{size:r}:await fr.stat(h),cpath:h,sri:u}));return jd(a,n.size,c,i)}).catch(n=>i.emit("error",n)),i}o(Hd,"readStream");Os.exports.copy=Hb;function Hb(s,e,t){return dr(s,e,r=>fr.copyFile(r,t))}o(Hb,"copy");Os.exports.hasContent=zb;async function zb(s,e){if(!e)return!1;try{return await dr(s,e,async(t,r)=>{let i=await fr.stat(t);return{size:i.size,sri:r,stat:i}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(zb,"hasContent");async function dr(s,e,t){let r=ja.parse(e),i=r.pickAlgorithm(),n=r[i];if(n.length<=1){let a=Ub(s,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async u=>{try{return await dr(s,u,t)}catch(l){return l.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):l}})),c=a.find(u=>!(u instanceof Error));if(c)return c;let h=a.find(u=>u.code==="ENOENT");throw h||a.find(u=>u instanceof Error)}}o(dr,"withContentSri");function Gb(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(Gb,"sizeError");function Vb(s,e){let t=new Error(`Integrity verification failed for ${s} (${e})`);return t.code="EINTEGRITY",t.sri=s,t.path=e,t}o(Vb,"integrityError")});var Wd=m((h1,pt)=>{"use strict";var zd=Zo(),{Minipass:Gd}=J(),Vd=hs(),Ut=ps(),dt=hr(),jt=Ha();async function Wb(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=dt.get(s,e,t);if(a&&i!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Ut.find(s,e,t);if(!c)throw new Ut.NotFoundError(s,e);let h=await jt(s,c.integrity,{integrity:r,size:n});return i&&dt.put(s,c,h,t),{data:h,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(Wb,"getData");pt.exports=Wb;async function Zb(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=dt.get.byDigest(s,e,t);if(a&&i!==!1)return a;let c=await jt(s,e,{integrity:r,size:n});return i&&dt.put.byDigest(s,e,c,t),c}o(Zb,"getDataByDigest");pt.exports.byDigest=Zb;var Kb=o(s=>{let e=new Gd;return e.on("newListener",function(t,r){t==="metadata"&&r(s.entry.metadata),t==="integrity"&&r(s.entry.integrity),t==="size"&&r(s.entry.size)}),e.end(s.data),e},"getMemoizedStream");function Yb(s,e,t={}){let{memoize:r,size:i}=t,n=dt.get(s,e,t);if(n&&r!==!1)return Kb(n);let a=new Vd;return Promise.resolve().then(async()=>{let c=await Ut.find(s,e);if(!c)throw new Ut.NotFoundError(s,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(u,l){u==="metadata"&&l(c.metadata),u==="integrity"&&l(c.integrity),u==="size"&&l(c.size)});let h=jt.readStream(s,c.integrity,{...t,size:typeof i!="number"?c.size:i});if(r){let u=new zd.PassThrough;u.on("collect",l=>dt.put(s,c,l,t)),a.unshift(u)}return a.unshift(h),a}).catch(c=>a.emit("error",c)),a}o(Yb,"getStream");pt.exports.stream=Yb;function Xb(s,e,t={}){let{memoize:r}=t,i=dt.get.byDigest(s,e,t);if(i&&r!==!1){let n=new Gd;return n.end(i),n}else{let n=jt.readStream(s,e,t);if(!r)return n;let a=new zd.PassThrough;return a.on("collect",c=>dt.put.byDigest(s,e,c,t)),new Vd(n,a)}}o(Xb,"getStreamDigest");pt.exports.stream.byDigest=Xb;function Jb(s,e,t={}){let{memoize:r}=t,i=dt.get(s,e,t);return i&&r!==!1?Promise.resolve(i.entry):Ut.find(s,e)}o(Jb,"info");pt.exports.info=Jb;async function Qb(s,e,t,r={}){let i=await Ut.find(s,e,r);if(!i)throw new Ut.NotFoundError(s,e);return await jt.copy(s,i.integrity,t,r),{metadata:i.metadata,size:i.size,integrity:i.integrity}}o(Qb,"copy");pt.exports.copy=Qb;async function eR(s,e,t,r={}){return await jt.copy(s,e,t,r),e}o(eR,"copyByDigest");pt.exports.copy.byDigest=eR;pt.exports.hasContent=jt.hasContent});var Jd=m((l1,Wa)=>{"use strict";var Zd=require("events"),tR=us(),mr=require("fs/promises"),{moveFile:sR}=Ti(),{Minipass:rR}=J(),Kd=hs(),iR=ui(),za=require("path"),Ga=St(),nR=ta(),oR=zi();Wa.exports=aR;var pr=new Map;async function aR(s,e,t={}){let{algorithms:r,size:i,integrity:n}=t;if(typeof i=="number"&&e.length!==i)throw lR(i,e.length);let a=Ga.fromData(e,r?{algorithms:r}:{});if(n&&!Ga.checkData(e,n,t))throw fR(n,a);for(let c in a){let h=await Yd(s,t),u=a[c].toString();try{await mr.writeFile(h.target,e,{flag:"wx"}),await Xd(h,s,u,t)}finally{h.moved||await mr.rm(h.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(aR,"write");Wa.exports.stream=cR;var Va=class extends iR{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new rR,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=hR(this.inputStream,this.cache,this.opts),this.handleContentP.catch(i=>this.emit("error",i))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function cR(s,e={}){return new Va(s,e)}o(cR,"writeStream");async function hR(s,e,t){let r=await Yd(e,t);try{let i=await uR(s,e,r.target,t);return await Xd(r,e,i.integrity,t),i}finally{r.moved||await mr.rm(r.target,{recursive:!0,force:!0})}}o(hR,"handleContent");async function uR(s,e,t,r){let i=new oR.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[u,l]=await Promise.all([Zd.once(r.integrityEmitter,"integrity").then(f=>f[0]),Zd.once(r.integrityEmitter,"size").then(f=>f[0]),new Kd(s,i).promise()]);return{integrity:u,size:l}}let n,a,c=Ga.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",u=>{n=u}),c.on("size",u=>{a=u}),await new Kd(s,c,i).promise(),{integrity:n,size:a}}o(uR,"pipeToTmp");async function Yd(s,e){let t=nR(za.join(s,"tmp"),e.tmpPrefix);return await mr.mkdir(za.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(Yd,"makeTmp");async function Xd(s,e,t){let r=tR(e,t),i=za.dirname(r);return pr.has(r)||pr.set(r,mr.mkdir(i,{recursive:!0}).then(async()=>(await sR(s.target,r,{overwrite:!1}),s.moved=!0,s.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{pr.delete(r)})),pr.get(r)}o(Xd,"moveToDestination");function lR(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(lR,"sizeError");function fR(s,e){let t=new Error(`Integrity check failed:
14
15
  Wanted: ${s}
15
- Found: ${e}`);return t.code="EINTEGRITY",t.expected=s,t.found=e,t}o(DR,"checksumError")});var Ep=m((nN,nc)=>{"use strict";var pp=Ss(),mp=yr(),gp=dp(),FR=yi(),{PassThrough:MR}=na(),$R=ms(),yp=o(s=>({algorithms:["sha512"],...s}),"putOpts");nc.exports=qR;async function qR(s,e,t,r={}){let{memoize:i}=r;r=yp(r);let n=await gp(s,t,r),a=await pp.insert(s,e,n.integrity,{...r,size:n.size});return i&&mp.put(s,a,t,r),n.integrity}o(qR,"putData");nc.exports.stream=UR;function UR(s,e,t={}){let{memoize:r}=t;t=yp(t);let i,n,a,c,h=new $R;if(r){let l=new MR().on("collect",f=>{c=f});h.push(l)}let u=gp.stream(s,t).on("integrity",l=>{i=l}).on("size",l=>{n=l}).on("error",l=>{a=l});return h.push(u),h.push(new FR({async flush(){if(!a){let l=await pp.insert(s,e,i,{...t,size:n});r&&c&&mp.put(s,l,c,t),h.emit("integrity",i),h.emit("size",n)}}})),h}o(UR,"putStream")});var Sp=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.range=Zt.balanced=void 0;var jR=o((s,e,t)=>{let r=s instanceof RegExp?wp(s,t):s,i=e instanceof RegExp?wp(e,t):e,n=r!==null&&i!=null&&(0,Zt.range)(r,i,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+i.length)}},"balanced");Zt.balanced=jR;var wp=o((s,e)=>{let t=e.match(s);return t?t[0]:null},"maybeMatch"),HR=o((s,e,t)=>{let r,i,n,a,c,h=t.indexOf(s),u=t.indexOf(e,h+1),l=h;if(h>=0&&u>0){if(s===e)return[h,u];for(r=[],n=t.length;l>=0&&!c;){if(l===h)r.push(l),h=t.indexOf(s,l+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,u])}else i=r.pop(),i!==void 0&&i<n&&(n=i,a=u),u=t.indexOf(e,l+1);l=h<u&&h>=0?h:u}r.length&&a!==void 0&&(c=[n,a])}return c},"range");Zt.range=HR});var Tp=m(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.expand=sO;var _p=Sp(),bp="\0SLASH"+Math.random()+"\0",Rp="\0OPEN"+Math.random()+"\0",ac="\0CLOSE"+Math.random()+"\0",Op="\0COMMA"+Math.random()+"\0",vp="\0PERIOD"+Math.random()+"\0",zR=new RegExp(bp,"g"),GR=new RegExp(Rp,"g"),VR=new RegExp(ac,"g"),WR=new RegExp(Op,"g"),ZR=new RegExp(vp,"g"),KR=/\\\\/g,YR=/\\{/g,XR=/\\}/g,JR=/\\,/g,QR=/\\./g;function oc(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}o(oc,"numeric");function eO(s){return s.replace(KR,bp).replace(YR,Rp).replace(XR,ac).replace(JR,Op).replace(QR,vp)}o(eO,"escapeBraces");function tO(s){return s.replace(zR,"\\").replace(GR,"{").replace(VR,"}").replace(WR,",").replace(ZR,".")}o(tO,"unescapeBraces");function Ip(s){if(!s)return[""];let e=[],t=(0,_p.balanced)("{","}",s);if(!t)return s.split(",");let{pre:r,body:i,post:n}=t,a=r.split(",");a[a.length-1]+="{"+i+"}";let c=Ip(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(Ip,"parseCommaParts");function sO(s){return s?(s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),Or(eO(s),!0).map(tO)):[]}o(sO,"expand");function rO(s){return"{"+s+"}"}o(rO,"embrace");function iO(s){return/^-?0\d/.test(s)}o(iO,"isPadded");function nO(s,e){return s<=e}o(nO,"lte");function oO(s,e){return s>=e}o(oO,"gte");function Or(s,e){let t=[],r=(0,_p.balanced)("{","}",s);if(!r)return[s];let i=r.pre,n=r.post.length?Or(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=i+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=a||c,u=r.body.indexOf(",")>=0;if(!h&&!u)return r.post.match(/,(?!,).*\}/)?(s=r.pre+"{"+r.body+ac+r.post,Or(s)):[s];let l;if(h)l=r.body.split(/\.\./);else if(l=Ip(r.body),l.length===1&&l[0]!==void 0&&(l=Or(l[0],!1).map(rO),l.length===1))return n.map(d=>r.pre+l[0]+d);let f;if(h&&l[0]!==void 0&&l[1]!==void 0){let d=oc(l[0]),p=oc(l[1]),y=Math.max(l[0].length,l[1].length),g=l.length===3&&l[2]!==void 0?Math.abs(oc(l[2])):1,w=nO;p<d&&(g*=-1,w=oO);let I=l.some(iO);f=[];for(let T=d;w(T,p);T+=g){let _;if(c)_=String.fromCharCode(T),_==="\\"&&(_="");else if(_=String(T),I){let O=y-_.length;if(O>0){let A=new Array(O+1).join("0");T<0?_="-"+A+_.slice(1):_=A+_}}f.push(_)}}else{f=[];for(let d=0;d<l.length;d++)f.push.apply(f,Or(l[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<n.length;p++){let y=i+f[d]+n[p];(!e||h||y)&&t.push(y)}}return t}o(Or,"expand_")});var Cp=m(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.assertValidPattern=void 0;var aO=1024*64,cO=o(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>aO)throw new TypeError("pattern is too long")},"assertValidPattern");Ji.assertValidPattern=cO});var xp=m(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.parseClass=void 0;var hO={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},vr=o(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),uO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Ap=o(s=>s.join(""),"rangesToString"),lO=o((s,e)=>{let t=e;if(s.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],n=t+1,a=!1,c=!1,h=!1,u=!1,l=t,f="";e:for(;n<s.length;){let g=s.charAt(n);if((g==="!"||g==="^")&&n===t+1){u=!0,n++;continue}if(g==="]"&&a&&!h){l=n+1;break}if(a=!0,g==="\\"&&!h){h=!0,n++;continue}if(g==="["&&!h){for(let[w,[S,I,T]]of Object.entries(hO))if(s.startsWith(w,n)){if(f)return["$.",!1,s.length-t,!0];n+=w.length,T?i.push(S):r.push(S),c=c||I;continue e}}if(h=!1,f){g>f?r.push(vr(f)+"-"+vr(g)):g===f&&r.push(vr(g)),f="",n++;continue}if(s.startsWith("-]",n+1)){r.push(vr(g+"-")),n+=2;continue}if(s.startsWith("-",n+1)){f=g,n+=2;continue}r.push(vr(g)),n++}if(l<n)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,s.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let g=r[0].length===2?r[0].slice(-1):r[0];return[uO(g),!1,l-t,!1]}let d="["+(u?"^":"")+Ap(r)+"]",p="["+(u?"":"^")+Ap(i)+"]";return[r.length&&i.length?"("+d+"|"+p+")":r.length?d:p,c,l-t,!0]},"parseClass");Qi.parseClass=lO});var tn=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.unescape=void 0;var fO=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");en.unescape=fO});var lc=m(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.AST=void 0;var dO=xp(),sn=tn(),pO=new Set(["!","?","+","*","@"]),Bp=o(s=>pO.has(s),"isExtglobType"),mO="(?!(?:^|/)\\.\\.?(?:$|/))",rn="(?!\\.)",gO=new Set(["[","."]),yO=new Set(["..","."]),EO=new Set("().*{}+?[]^$\\!"),wO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),uc="[^/]",Np=uc+"*?",Pp=uc+"+?",hc=class s{static{o(this,"AST")}type;#e;#t;#s=!1;#r=[];#i;#a;#l;#f=!1;#c;#p;#d=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#p=this.#r.map(e=>String(e)).join("")}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#i;for(;r;){for(let i=t.#a+1;!r.type&&i<r.#r.length;i++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[i])}t=r,r=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof s&&t.#i===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let r=e.#r[t];if(!(r instanceof s&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new s(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#n(e,t,r,i){let n=!1,a=!1,c=-1,h=!1;if(t.type===null){let p=r,y="";for(;p<e.length;){let g=e.charAt(p++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){p===c+1?(g==="^"||g==="!")&&(h=!0):g==="]"&&!(p===c+2&&h)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=p,h=!1,y+=g;continue}if(!i.noext&&Bp(g)&&e.charAt(p)==="("){t.push(y),y="";let w=new s(g,t);p=s.#n(e,w,p,i),t.push(w);continue}y+=g}return t.push(y),p}let u=r+1,l=new s(null,t),f=[],d="";for(;u<e.length;){let p=e.charAt(u++);if(n||p==="\\"){n=!n,d+=p;continue}if(a){u===c+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(u===c+2&&h)&&(a=!1),d+=p;continue}else if(p==="["){a=!0,c=u,h=!1,d+=p;continue}if(Bp(p)&&e.charAt(u)==="("){l.push(d),d="";let y=new s(p,l);l.push(y),u=s.#n(e,y,u,i);continue}if(p==="|"){l.push(d),d="",f.push(l),l=new s(null,t);continue}if(p===")")return d===""&&t.#r.length===0&&(t.#d=!0),l.push(d),d="",t.push(...f,l),u;d+=p}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],u}static fromGlob(e,t={}){let r=new s(null,void 0,t);return s.#n(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,n]=this.toRegExpSource();if(!(i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&this.#h(),!this.type){let h=this.isStart()&&this.isEnd(),u=this.#r.map(p=>{let[y,g,w,S]=typeof p=="string"?s.#_(p,this.#t,h):p.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||S,y}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&yO.has(this.#r[0]))){let y=gO,g=t&&y.has(u.charAt(0))||u.startsWith("\\.")&&y.has(u.charAt(2))||u.startsWith("\\.\\.")&&y.has(u.charAt(4)),w=!t&&!e&&y.has(u.charAt(0));l=g?mO:w?rn:""}let f="";return this.isEnd()&&this.#e.#f&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[l+u+f,(0,sn.unescape)(u),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#g(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let h=this.toString();return this.#r=[h],this.type=null,this.#t=void 0,[h,(0,sn.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!rn?"":this.#g(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#d)c=(this.isStart()&&!t?rn:"")+Pp;else{let h=this.type==="!"?"))"+(this.isStart()&&!t&&!e?rn:"")+Np+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+n+h}return[c,(0,sn.unescape)(n),this.#t=!!this.#t,this.#s]}#g(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,n,a]=t.toRegExpSource(e);return this.#s=this.#s||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#_(e,t,r=!1){let i=!1,n="",a=!1;for(let c=0;c<e.length;c++){let h=e.charAt(c);if(i){i=!1,n+=(EO.has(h)?"\\":"")+h;continue}if(h==="\\"){c===e.length-1?n+="\\\\":i=!0;continue}if(h==="["){let[u,l,f,d]=(0,dO.parseClass)(e,c);if(f){n+=u,a=a||l,c+=f-1,t=t||d;continue}}if(h==="*"){r&&e==="*"?n+=Pp:n+=Np,t=!0;continue}if(h==="?"){n+=uc,t=!0;continue}n+=wO(h)}return[n,(0,sn.unescape)(e),!!t,a]}};nn.AST=hc});var fc=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.escape=void 0;var SO=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");on.escape=SO});var At=m(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.unescape=v.escape=v.AST=v.Minimatch=v.match=v.makeRe=v.braceExpand=v.defaults=v.filter=v.GLOBSTAR=v.sep=v.minimatch=void 0;var _O=Tp(),an=Cp(),Dp=lc(),bO=fc(),RO=tn(),OO=o((s,e,t={})=>((0,an.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Kt(e,t).match(s)),"minimatch");v.minimatch=OO;var vO=/^\*+([^+@!?\*\[\(]*)$/,IO=o(s=>e=>!e.startsWith(".")&&e.endsWith(s),"starDotExtTest"),TO=o(s=>e=>e.endsWith(s),"starDotExtTestDot"),CO=o(s=>(s=s.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(s)),"starDotExtTestNocase"),AO=o(s=>(s=s.toLowerCase(),e=>e.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),xO=/^\*+\.\*+$/,BO=o(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),NO=o(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),PO=/^\.\*+$/,LO=o(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),kO=/^\*+$/,DO=o(s=>s.length!==0&&!s.startsWith("."),"starTest"),FO=o(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),MO=/^\?+([^+@!?\*\[\(]*)?$/,$O=o(([s,e=""])=>{let t=Fp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),qO=o(([s,e=""])=>{let t=Mp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),UO=o(([s,e=""])=>{let t=Mp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),jO=o(([s,e=""])=>{let t=Fp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),Fp=o(([s])=>{let e=s.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Mp=o(([s])=>{let e=s.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),$p=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Lp={win32:{sep:"\\"},posix:{sep:"/"}};v.sep=$p==="win32"?Lp.win32.sep:Lp.posix.sep;v.minimatch.sep=v.sep;v.GLOBSTAR=Symbol("globstar **");v.minimatch.GLOBSTAR=v.GLOBSTAR;var HO="[^/]",zO=HO+"*?",GO="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VO="(?:(?!(?:\\/|^)\\.).)*?",WO=o((s,e={})=>t=>(0,v.minimatch)(t,s,e),"filter");v.filter=WO;v.minimatch.filter=v.filter;var Ie=o((s,e={})=>Object.assign({},s,e),"ext"),ZO=o(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return v.minimatch;let e=v.minimatch;return Object.assign(o((r,i,n={})=>e(r,i,Ie(s,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,n={}){super(i,Ie(s,n))}static defaults(i){return e.defaults(Ie(s,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,n,a={}){super(i,n,Ie(s,a))}static fromGlob(i,n={}){return e.AST.fromGlob(i,Ie(s,n))}},unescape:o((r,i={})=>e.unescape(r,Ie(s,i)),"unescape"),escape:o((r,i={})=>e.escape(r,Ie(s,i)),"escape"),filter:o((r,i={})=>e.filter(r,Ie(s,i)),"filter"),defaults:o(r=>e.defaults(Ie(s,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,Ie(s,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,Ie(s,i)),"braceExpand"),match:o((r,i,n={})=>e.match(r,i,Ie(s,n)),"match"),sep:e.sep,GLOBSTAR:v.GLOBSTAR})},"defaults");v.defaults=ZO;v.minimatch.defaults=v.defaults;var KO=o((s,e={})=>((0,an.assertValidPattern)(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,_O.expand)(s)),"braceExpand");v.braceExpand=KO;v.minimatch.braceExpand=v.braceExpand;var YO=o((s,e={})=>new Kt(s,e).makeRe(),"makeRe");v.makeRe=YO;v.minimatch.makeRe=v.makeRe;var XO=o((s,e,t={})=>{let r=new Kt(e,t);return s=s.filter(i=>r.match(i)),r.options.nonull&&!s.length&&s.push(e),s},"match");v.match=XO;v.minimatch.match=v.match;var kp=/[?*]|[+@!]\(.*?\)|\[|\]/,JO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Kt=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,an.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||$p,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!kp.test(n[2]))&&!kp.test(n[3]),u=/^[a-z]:/i.test(n[0]);if(h)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(u)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let n=r[r.length-1];return i==="**"&&n==="**"?r:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],h=r[i+2],u=r[i+3];if(c!==".."||!h||h==="."||h===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let h=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...h),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,n=0,a=[],c="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])a.push(c==="b"?t[n]:e[i]),i++,n++;else if(r&&e[i]==="**"&&t[n]===e[i+1])a.push(e[i]),i++;else if(r&&t[n]==="**"&&e[i]===t[n+1])a.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),i++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),I=!S&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:g?0:void 0,_=I?3:S?0:void 0;if(typeof T=="number"&&typeof _=="number"){let[O,A]=[e[T],t[_]];O.toLowerCase()===A.toLowerCase()&&(t[_]=O,_>T?t=t.slice(_):T>_&&(e=e.slice(T)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,h=e.length,u=t.length;a<h&&c<u;a++,c++){this.debug("matchOne loop");var l=t[c],f=e[a];if(this.debug(t,l,f),l===!1)return!1;if(l===v.GLOBSTAR){this.debug("GLOBSTAR",[t,l,f]);var d=a,p=c+1;if(p===u){for(this.debug("** at the end");a<h;a++)if(e[a]==="."||e[a]===".."||!i.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<h;){var y=e[d];if(this.debug(`
16
- globstar while`,e,d,t,p,y),this.matchOne(e.slice(d),t.slice(p),r))return this.debug("globstar found match!",d,h,y),!0;if(y==="."||y===".."||!i.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
17
- >>> no match, partial?`,e,d,t,p),d===h))}let g;if(typeof l=="string"?(g=f===l,this.debug("string match",l,f,g)):(g=l.test(f),this.debug("pattern match",l,f,g)),!g)return!1}if(a===h&&c===u)return!0;if(a===h)return r;if(c===u)return a===h-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,v.braceExpand)(this.pattern,this.options)}parse(e){(0,an.assertValidPattern)(e);let t=this.options;if(e==="**")return v.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(kO))?i=t.dot?FO:DO:(r=e.match(vO))?i=(t.nocase?t.dot?AO:CO:t.dot?TO:IO)(r[1]):(r=e.match(MO))?i=(t.nocase?t.dot?qO:$O:t.dot?UO:jO)(r):(r=e.match(xO))?i=t.dot?NO:BO:(r=e.match(PO))&&(i=LO);let n=Dp.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?zO:t.dot?GO:VO,i=new Set(t.nocase?["i"]:[]),n=e.map(h=>{let u=h.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))i.add(f);return typeof l=="string"?JO(l):l===v.GLOBSTAR?v.GLOBSTAR:l._src});return u.forEach((l,f)=>{let d=u[f+1],p=u[f-1];l!==v.GLOBSTAR||p===v.GLOBSTAR||(p===void 0?d!==void 0&&d!==v.GLOBSTAR?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=p+"(?:\\/|"+r+")?":d!==v.GLOBSTAR&&(u[f-1]=p+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=v.GLOBSTAR))}),u.filter(l=>l!==v.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<n.length;c++){let h=n[c],u=i;if(r.matchBase&&h.length===1&&(u=[a]),this.matchOne(u,h,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return v.minimatch.defaults(e).Minimatch}};v.Minimatch=Kt;var QO=lc();Object.defineProperty(v,"AST",{enumerable:!0,get:o(function(){return QO.AST},"get")});var ev=fc();Object.defineProperty(v,"escape",{enumerable:!0,get:o(function(){return ev.escape},"get")});var tv=tn();Object.defineProperty(v,"unescape",{enumerable:!0,get:o(function(){return tv.unescape},"get")});v.minimatch.AST=Dp.AST;v.minimatch.Minimatch=Kt;v.minimatch.escape=bO.escape;v.minimatch.unescape=RO.unescape});var em=m(L=>{"use strict";var sv=L&&L.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),rv=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),iv=L&&L.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&sv(e,s,t);return rv(e,s),e};Object.defineProperty(L,"__esModule",{value:!0});L.PathScurry=L.Path=L.PathScurryDarwin=L.PathScurryPosix=L.PathScurryWin32=L.PathScurryBase=L.PathPosix=L.PathWin32=L.PathBase=L.ChildrenCache=L.ResolveCache=void 0;var Gp=bs(),fn=require("node:path"),nv=require("node:url"),Tr=require("fs"),ov=iv(require("node:fs")),av=Tr.realpathSync.native,cn=require("node:fs/promises"),qp=ee(),Cr={lstatSync:Tr.lstatSync,readdir:Tr.readdir,readdirSync:Tr.readdirSync,readlinkSync:Tr.readlinkSync,realpathSync:av,promises:{lstat:cn.lstat,readdir:cn.readdir,readlink:cn.readlink,realpath:cn.realpath}},Vp=o(s=>!s||s===Cr||s===ov?Cr:{...Cr,...s,promises:{...Cr.promises,...s.promises||{}}},"fsFromOption"),Wp=/^\\\\\?\\([a-z]:)\\?$/i,cv=o(s=>s.replace(/\//g,"\\").replace(Wp,"$1\\"),"uncToDrive"),hv=/[\\\/]/,Ce=0,Zp=1,Kp=2,Ke=4,Yp=6,Xp=8,Yt=10,Jp=12,Te=15,Ir=~Te,dc=16,Up=32,Ar=64,Me=128,hn=256,ln=512,jp=Ar|Me|ln,uv=1023,pc=o(s=>s.isFile()?Xp:s.isDirectory()?Ke:s.isSymbolicLink()?Yt:s.isCharacterDevice()?Kp:s.isBlockDevice()?Yp:s.isSocket()?Jp:s.isFIFO()?Zp:Ce,"entToType"),Hp=new Map,xr=o(s=>{let e=Hp.get(s);if(e)return e;let t=s.normalize("NFKD");return Hp.set(s,t),t},"normalize"),zp=new Map,un=o(s=>{let e=zp.get(s);if(e)return e;let t=xr(s.toLowerCase());return zp.set(s,t),t},"normalizeNocase"),Br=class extends Gp.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};L.ResolveCache=Br;var dn=class extends Gp.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};L.ChildrenCache=dn;var Qp=Symbol("PathScurry setAsCwd"),J=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#c;get ino(){return this.#c}#p;get size(){return this.#p}#d;get blocks(){return this.#d}#h;get atimeMs(){return this.#h}#n;get mtimeMs(){return this.#n}#g;get ctimeMs(){return this.#g}#_;get birthtimeMs(){return this.#_}#S;get atime(){return this.#S}#y;get mtime(){return this.#y}#C;get ctime(){return this.#C}#E;get birthtime(){return this.#E}#R;#I;#w;#b;#T;#m;#o;#P;#A;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Ce,r,i,n,a,c){this.name=e,this.#R=n?un(e):xr(e),this.#o=t&uv,this.nocase=n,this.roots=i,this.root=r||this,this.#P=a,this.#w=c.fullpath,this.#T=c.relative,this.#m=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=Vp(c.fs)}depth(){return this.#I!==void 0?this.#I:this.parent?this.#I=this.parent.depth()+1:this.#I=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#U(i):this.#U(i)}#U(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#o&=~dc,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?un(e):xr(e);for(let h of r)if(h.#R===i)return h;let n=this.parent?this.sep:"",a=this.#w?this.#w+n+e:void 0,c=this.newChild(e,Ce,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=Me),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let e=this.name,t=this.parent;if(!t)return this.#T=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#w=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&Te)===Ce}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&Te)===Xp}isDirectory(){return(this.#o&Te)===Ke}isCharacterDevice(){return(this.#o&Te)===Kp}isBlockDevice(){return(this.#o&Te)===Yp}isFIFO(){return(this.#o&Te)===Zp}isSocket(){return(this.#o&Te)===Jp}isSymbolicLink(){return(this.#o&Yt)===Yt}lstatCached(){return this.#o&Up?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#o&Te;return!(e!==Ce&&e!==Yt||this.#o&hn||this.#o&Me)}calledReaddir(){return!!(this.#o&dc)}isENOENT(){return!!(this.#o&Me)}isNamed(e){return this.nocase?this.#R===un(e):this.#R===xr(e)}async readlink(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#A=r}catch(t){this.#j(t.code);return}}readlinkSync(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#A=r}catch(t){this.#j(t.code);return}}#v(e){this.#o|=dc;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#M()}}#M(){this.#o&Me||(this.#o=(this.#o|Me)&Ir,this.#L())}#L(){let e=this.children();e.provisional=0;for(let t of e)t.#M()}#$(){this.#o|=ln,this.#k()}#k(){if(this.#o&Ar)return;let e=this.#o;(e&Te)===Ke&&(e&=Ir),this.#o=e|Ar,this.#L()}#x(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#M():this.children().provisional=0}#N(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#M()}#j(e=""){let t=this.#o;t|=hn,e==="ENOENT"&&(t|=Me),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ir),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#D(e,t){return this.#u(e,t)||this.#H(e,t)}#H(e,t){let r=pc(e),i=this.newChild(e.name,r,{parent:this}),n=i.#o&Te;return n!==Ke&&n!==Yt&&n!==Ce&&(i.#o|=Ar),t.unshift(i),t.provisional++,i}#u(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?un(e.name):xr(e.name))===i.#R)return this.#z(e,i,r,t)}}#z(e,t,r,i){let n=t.name;return t.#o=t.#o&Ir|pc(e),n!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&Me)===0)try{return this.#F(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#N(e.code)}}lstatSync(){if((this.#o&Me)===0)try{return this.#F(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#N(e.code)}}#F(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:a,blocks:c,ctime:h,ctimeMs:u,dev:l,gid:f,ino:d,mode:p,mtime:y,mtimeMs:g,nlink:w,rdev:S,size:I,uid:T}=e;this.#S=t,this.#h=r,this.#E=i,this.#_=n,this.#f=a,this.#d=c,this.#C=h,this.#g=u,this.#t=l,this.#a=f,this.#c=d,this.#s=p,this.#y=y,this.#n=g,this.#r=w,this.#l=S,this.#p=I,this.#i=T;let _=pc(e);this.#o=this.#o&Ir|_|Up,_!==Ce&&_!==Ke&&_!==Yt&&(this.#o|=Ar)}#B=[];#q=!1;#V(e){this.#q=!1;let t=this.#B.slice();this.#B.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#B.push(e),this.#q)return;this.#q=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)this.#x(n.code),r.provisional=0;else{for(let c of a)this.#D(c,r);this.#v(r)}this.#V(r.slice(0,r.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#G)await this.#G;else{let r=o(()=>{},"resolve");this.#G=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#D(i,e);this.#v(e)}catch(i){this.#x(i.code),e.provisional=0}this.#G=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#D(r,e);this.#v(e)}catch(r){this.#x(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&jp)return!1;let e=Te&this.#o;return e===Ce||e===Ke||e===Yt}shouldWalk(e,t){return(this.#o&Ke)===Ke&&!(this.#o&jp)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((ln|hn|Me)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#O)return this.#O;if(!((ln|hn|Me)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#$()}}[Qp](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#T=r.join(this.sep),i.#m=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#T=void 0,i.#m=void 0,i=i.parent}};L.PathBase=J;var Nr=class s extends J{static{o(this,"PathWin32")}sep="\\";splitSep=hv;constructor(e,t=Ce,r,i,n,a,c){super(e,t,r,i,n,a,c)}newChild(e,t=Ce,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return fn.win32.parse(e).root}getRoot(e){if(e=cv(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new kr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Wp,"$1\\"),e===t}};L.PathWin32=Nr;var Pr=class s extends J{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Ce,r,i,n,a,c){super(e,t,r,i,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Ce,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};L.PathPosix=Pr;var Lr=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:n=16*1024,fs:a=Cr}={}){this.#r=Vp(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,nv.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Br,this.#t=new Br,this.#s=new dn(n);let h=c.substring(this.rootPath.length).split(r);if(h.length===1&&!h[0]&&h.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let u=this.root,l=h.length-1,f=t.sep,d=this.rootPath,p=!1;for(let y of h){let g=l--;u=u.child(y,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:d+=(p?"":f)+y}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#t.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set,u=o((f,d)=>{h.add(f),f.readdirCB((p,y)=>{if(p)return d(p);let g=y.length;if(!g)return d();let w=o(()=>{--g===0&&d()},"next");for(let S of y)(!n||n(S))&&c.push(r?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(I=>I?.isUnknown()?I.lstat():I).then(I=>I?.shouldWalk(h,a)?u(I,w):w()):S.shouldWalk(h,a)?u(S,w):w()},!0)},"walk"),l=e;return new Promise((f,d)=>{u(l,p=>{if(p)return d(p);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set([e]);for(let u of h){let l=u.readdirSync();for(let f of l){(!n||n(f))&&c.push(r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(h,a)&&h.add(d)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let h of c){let u=h.readdirSync();for(let l of u){(!n||n(l))&&(yield r?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(i&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new qp.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let h=new Set,u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let y=o((w,S,I=!1)=>{if(w)return c.emit("error",w);if(i&&!I){let T=[];for(let _ of S)_.isSymbolicLink()&&T.push(_.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(T.length){Promise.all(T).then(()=>y(null,S,!0));return}}for(let T of S)T&&(!n||n(T))&&(c.write(r?T:T.fullpath())||(d=!0));l--;for(let T of S){let _=T.realpathCached()||T;_.shouldWalk(h,a)&&u.push(_)}d&&!c.flowing?c.once("drain",f):g||f()},"onReaddir"),g=!0;p.readdirCB(y,!0),g=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new qp.Minipass({objectMode:!0}),h=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let y=p.readdirSync();for(let g of y)(!n||n(g))&&(c.write(r?g:g.fullpath())||(d=!0));l--;for(let g of y){let w=g;if(g.isSymbolicLink()){if(!(i&&(w=g.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(h,a)&&u.push(w)}}d&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Qp](t)}};L.PathScurryBase=Lr;var kr=class extends Lr{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,fn.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return fn.win32.parse(e).root.toUpperCase()}newRoot(e){return new Nr(this.rootPath,Ke,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};L.PathScurryWin32=kr;var Dr=class extends Lr{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,fn.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Pr(this.rootPath,Ke,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};L.PathScurryPosix=Dr;var pn=class extends Dr{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};L.PathScurryDarwin=pn;L.Path=process.platform==="win32"?Nr:Pr;L.PathScurry=process.platform==="win32"?kr:process.platform==="darwin"?pn:Dr});var gc=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.Pattern=void 0;var lv=At(),fv=o(s=>s.length>=1,"isPatternList"),dv=o(s=>s.length>=1,"isGlobList"),mc=class s{static{o(this,"Pattern")}#e;#t;#s;length;#r;#i;#a;#l;#f;#c;#p=!0;constructor(e,t,r,i){if(!fv(e))throw new TypeError("empty pattern list");if(!dv(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[n,a,c,h,...u]=this.#e,[l,f,d,p,...y]=this.#t;u[0]===""&&(u.shift(),y.shift());let g=[n,a,c,h,""].join("/"),w=[l,f,d,p,""].join("/");this.#e=[g,...u],this.#t=[w,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...h]=this.#t;a[0]===""&&(a.shift(),h.shift());let u=n+"/",l=c+"/";this.#e=[u,...a],this.#t=[l,...h],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===lv.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#a=this.#a||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new s(this.#e,this.#t,this.#s+1,this.#r),this.#i.#c=this.#c,this.#i.#f=this.#f,this.#i.#l=this.#l,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#p)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#p?!1:(this.#p=!1,!0)}};mn.Pattern=mc});var Ec=m(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.Ignore=void 0;var tm=At(),pv=gc(),mv=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yc=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:n,platform:a=mv}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new tm.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],n=t.globParts[r];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let a=new pv.Pattern(i,n,0,this.platform),c=new tm.Minimatch(a.globString(),this.mmopts),h=n[n.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),h&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};gn.Ignore=yc});var rm=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Processor=Ye.SubWalks=Ye.MatchRecord=Ye.HasWalkedCache=void 0;var sm=At(),yn=class s{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new s(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};Ye.HasWalkedCache=yn;var En=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};Ye.MatchRecord=En;var wn=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};Ye.SubWalks=wn;var wc=class s{static{o(this,"Processor")}hasWalkedCache;matches=new En;subwalks=new wn;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new yn}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,n]of r){this.hasWalkedCache.storeWalked(i,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let h,u,l=!1;for(;typeof(h=n.pattern())=="string"&&(u=n.rest());)i=i.resolve(h),n=u,l=!0;if(h=n.pattern(),u=n.rest(),l){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof h=="string"){let f=h===".."||h===""||h===".";this.matches.add(i.resolve(h),c,f);continue}else if(h===sm.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let f=u?.pattern(),d=u?.rest();if(!u||(f===""||f===".")&&!d)this.matches.add(i,c,f===""||f===".");else if(f===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else h instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new s(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),h=a.pattern(),u=a.rest();h===sm.GLOBSTAR?i.testGlobstar(n,a,u,c):h instanceof RegExp?i.testRegExp(n,h,u,c):i.testString(n,h,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),i);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};Ye.Processor=wc});var om=m(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.GlobStream=xt.GlobWalker=xt.GlobUtil=void 0;var gv=ee(),im=Ec(),nm=rm(),yv=o((s,e)=>typeof s=="string"?new im.Ignore([s],e):Array.isArray(s)?new im.Ignore(s,e):s,"makeIgnore"),Fr=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=yv(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(n?a+n+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new nm.Processor(this.opts),r)}walkCB2(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirCached();c.calledReaddir()?this.walkCB3(c,h,r,a):c.readdirCB((u,l)=>this.walkCB3(c,l,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let[c,h]of r.subwalks.entries())n++,this.walkCB2(c,h,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new nm.Processor(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirSync();this.walkCB3Sync(c,h,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let[c,h]of r.subwalks.entries())n++,this.walkCB2Sync(c,h,r.child(),a);a()}};xt.GlobUtil=Fr;var Sc=class extends Fr{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};xt.GlobWalker=Sc;var _c=class extends Fr{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new gv.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};xt.GlobStream=_c});var Rc=m(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.Glob=void 0;var Ev=At(),wv=require("node:url"),Sn=em(),Sv=gc(),_n=om(),_v=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",bc=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,wv.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=e,this.platform=t.platform||_v,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=t.platform==="win32"?Sn.PathScurryWin32:t.platform==="darwin"?Sn.PathScurryDarwin:t.platform?Sn.PathScurryPosix:Sn.PathScurry;this.scurry=new h(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new Ev.Minimatch(h,i)),[a,c]=n.reduce((h,u)=>(h[0].push(...u.set),h[1].push(...u.globParts),h),[[],[]]);this.patterns=a.map((h,u)=>{let l=c[u];if(!l)throw new Error("invalid pattern object");return new Sv.Pattern(h,l,0,this.platform)})}async walk(){return[...await new _n.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new _n.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new _n.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new _n.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};bn.Glob=bc});var Oc=m(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.hasMagic=void 0;var bv=At(),Rv=o((s,e={})=>{Array.isArray(s)||(s=[s]);for(let t of s)if(new bv.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Rn.hasMagic=Rv});var um=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.glob=N.sync=N.iterate=N.iterateSync=N.stream=N.streamSync=N.Ignore=N.hasMagic=N.Glob=N.unescape=N.escape=void 0;N.globStreamSync=Mr;N.globStream=vc;N.globSync=Ic;N.globIterateSync=$r;N.globIterate=Tc;var am=At(),Xt=Rc(),Ov=Oc(),hm=At();Object.defineProperty(N,"escape",{enumerable:!0,get:o(function(){return hm.escape},"get")});Object.defineProperty(N,"unescape",{enumerable:!0,get:o(function(){return hm.unescape},"get")});var vv=Rc();Object.defineProperty(N,"Glob",{enumerable:!0,get:o(function(){return vv.Glob},"get")});var Iv=Oc();Object.defineProperty(N,"hasMagic",{enumerable:!0,get:o(function(){return Iv.hasMagic},"get")});var Tv=Ec();Object.defineProperty(N,"Ignore",{enumerable:!0,get:o(function(){return Tv.Ignore},"get")});function Mr(s,e={}){return new Xt.Glob(s,e).streamSync()}o(Mr,"globStreamSync");function vc(s,e={}){return new Xt.Glob(s,e).stream()}o(vc,"globStream");function Ic(s,e={}){return new Xt.Glob(s,e).walkSync()}o(Ic,"globSync");async function cm(s,e={}){return new Xt.Glob(s,e).walk()}o(cm,"glob_");function $r(s,e={}){return new Xt.Glob(s,e).iterateSync()}o($r,"globIterateSync");function Tc(s,e={}){return new Xt.Glob(s,e).iterate()}o(Tc,"globIterate");N.streamSync=Mr;N.stream=Object.assign(vc,{sync:Mr});N.iterateSync=$r;N.iterate=Object.assign(Tc,{sync:$r});N.sync=Object.assign(Ic,{stream:Mr,iterate:$r});N.glob=Object.assign(cm,{glob:cm,globSync:Ic,sync:N.sync,globStream:vc,stream:N.stream,globStreamSync:Mr,streamSync:N.streamSync,globIterate:Tc,iterate:N.iterate,globIterateSync:$r,iterateSync:N.iterateSync,Glob:Xt.Glob,hasMagic:Ov.hasMagic,escape:am.escape,unescape:am.unescape});N.glob.glob=N.glob});var Cc=m((UN,fm)=>{"use strict";var{glob:Cv}=um(),lm=require("path"),Av=o(s=>s.split(lm.win32.sep).join(lm.posix.sep),"globify");fm.exports=(s,e)=>Cv(Av(s),e)});var pm=m((HN,dm)=>{"use strict";var xv=require("fs/promises"),Bv=gs(),{hasContent:Nv}=ec();dm.exports=Pv;async function Pv(s,e){let t=await Nv(s,e);return t&&t.sri?(await xv.rm(Bv(s,t.sri),{recursive:!0,force:!0}),!0):!1}o(Pv,"rm")});var gm=m((GN,qr)=>{"use strict";var{rm:Lv}=require("fs/promises"),kv=Cc(),Dv=Ss(),Ac=yr(),Fv=require("path"),Mv=pm();qr.exports=mm;qr.exports.entry=mm;function mm(s,e,t){return Ac.clearMemoized(),Dv.delete(s,e,t)}o(mm,"entry");qr.exports.content=$v;function $v(s,e){return Ac.clearMemoized(),Mv(s,e)}o($v,"content");qr.exports.all=qv;async function qv(s){Ac.clearMemoized();let e=await kv(Fv.join(s,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>Lv(t,{recursive:!0,force:!0})))}o(qv,"all")});var Em=m((WN,Pc)=>{"use strict";var{mkdir:Uv,readFile:jv,rm:Bc,stat:Nc,truncate:Hv,writeFile:zv}=require("fs/promises"),ym=gs(),Gv=Xi(),Vv=Cc(),Bs=Ss(),On=require("path"),xc=Ot(),Wv=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),Zv=o(s=>({concurrency:20,log:{silly(){}},...s}),"verifyOpts");Pc.exports=Kv;async function Kv(s,e){e=Zv(e),e.log.silly("verify","verifying cache at",s);let t=[Yv,Jv,Qv,tI,rI,iI,Xv],r={};for(let i of t){let n=i.name,a=new Date,c=await i(s,e);c&&Object.keys(c).forEach(u=>{r[u]=c[u]});let h=new Date;r.runTime||(r.runTime={}),r.runTime[n]=h-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",s,"in",`${r.runTime.total}ms`),r}o(Kv,"verify");async function Yv(){return{startTime:new Date}}o(Yv,"markStartTime");async function Xv(){return{endTime:new Date}}o(Xv,"markEndTime");async function Jv(s,e){return e.log.silly("verify","fixing cache permissions"),await Uv(s,{recursive:!0}),null}o(Jv,"fixPerms");async function Qv(s,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(Di(),ki)),r=Bs.lsStream(s),i=new Set;r.on("data",h=>{if(e.filter&&!e.filter(h))return;let u=xc.parse(h.integrity);for(let l in u)i.add(u[l].toString())}),await new Promise((h,u)=>{r.on("end",h).on("error",u)});let n=ym.contentDir(s),a=await Vv(On.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async h=>{let u=h.split(/[/\\]/),l=u.slice(u.length-3).join(""),f=u[u.length-4],d=xc.fromHex(l,f);if(i.has(d.toString())){let p=await eI(h,d);p.valid?(c.verifiedContent++,c.keptSize+=p.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=p.size)}else{c.reclaimedCount++;let p=await Nc(h);await Bc(h,{recursive:!0,force:!0}),c.reclaimedSize+=p.size}return c},{concurrency:e.concurrency}),c}o(Qv,"garbageCollect");async function eI(s,e){let t={};try{let{size:r}=await Nc(s);t.size=r,t.valid=!0,await xc.checkStream(new Gv.ReadStream(s),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await Bc(s,{recursive:!0,force:!0}),t.valid=!1}return t}o(eI,"verifyContent");async function tI(s,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(Di(),ki)),r=await Bs.ls(s),i={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(Wv(r,a)){let c=Bs.hashKey(a),h=r[a],u=e.filter&&!e.filter(h);u&&i.rejectedEntries++,n[c]&&!u?n[c].push(h):n[c]&&u||(u?(n[c]=[],n[c]._path=Bs.bucketPath(s,a)):(n[c]=[h],n[c]._path=Bs.bucketPath(s,a)))}return await t(Object.keys(n),a=>sI(s,n[a],i,e),{concurrency:e.concurrency}),i}o(tI,"rebuildIndex");async function sI(s,e,t){await Hv(e._path);for(let r of e){let i=ym(s,r.integrity);try{await Nc(i),await Bs.insert(s,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(sI,"rebuildBucket");function rI(s,e){return e.log.silly("verify","cleaning tmp directory"),Bc(On.join(s,"tmp"),{recursive:!0,force:!0})}o(rI,"cleanTmp");async function iI(s,e){let t=On.join(s,"_lastverified");return e.log.silly("verify","writing verifile to "+t),zv(t,`${Date.now()}`)}o(iI,"writeVerifile");Pc.exports.lastRun=nI;async function nI(s){let e=await jv(On.join(s,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(nI,"lastRun")});var Sm=m((KN,kc)=>{"use strict";var{withTempDir:oI}=Li(),wm=require("fs/promises"),Lc=require("path");kc.exports.mkdir=aI;async function aI(s,e={}){let{tmpPrefix:t}=e,r=Lc.join(s,"tmp");await wm.mkdir(r,{recursive:!0,owner:"inherit"});let i=`${r}${Lc.sep}${t||""}`;return wm.mkdtemp(i,{owner:"inherit"})}o(aI,"mktmpdir");kc.exports.withTmp=cI;function cI(s,e,t){return t||(t=e,e={}),oI(Lc.join(s,"tmp"),t,e)}o(cI,"withTmp")});var Om=m((XN,F)=>{"use strict";var Bt=cp(),_m=Ep(),Dc=gm(),bm=Em(),{clearMemoized:hI}=yr(),Rm=Sm(),vn=Ss();F.exports.index={};F.exports.index.compact=vn.compact;F.exports.index.insert=vn.insert;F.exports.ls=vn.ls;F.exports.ls.stream=vn.lsStream;F.exports.get=Bt;F.exports.get.byDigest=Bt.byDigest;F.exports.get.stream=Bt.stream;F.exports.get.stream.byDigest=Bt.stream.byDigest;F.exports.get.copy=Bt.copy;F.exports.get.copy.byDigest=Bt.copy.byDigest;F.exports.get.info=Bt.info;F.exports.get.hasContent=Bt.hasContent;F.exports.put=_m;F.exports.put.stream=_m.stream;F.exports.rm=Dc.entry;F.exports.rm.all=Dc.all;F.exports.rm.entry=F.exports.rm;F.exports.rm.content=Dc.content;F.exports.clearMemoized=hI;F.exports.tmp={};F.exports.tmp.mkdir=Rm.mkdir;F.exports.tmp.withTmp=Rm.withTmp;F.exports.verify=bm;F.exports.verify.lastRun=bm.lastRun});var Mc=m((JN,vm)=>{"use strict";var uI=ms(),Fc=class extends uI{static{o(this,"CachingMinipassPipeline")}#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}};vm.exports=Fc});var Tm=m((eP,Im)=>{var{URL:lI,format:fI}=require("url"),dI={auth:!1,fragment:!1,search:!0,unicode:!1},pI=o(s=>{let e=new lI(s.url);return`make-fetch-happen:request-cache:${fI(e,dI)}`},"cacheKey");Im.exports=pI});var xm=m((sP,Am)=>{"use strict";function Cm(s,e){for(let t in e)Object.defineProperty(s,t,{value:e[t],enumerable:!0,configurable:!0});return s}o(Cm,"assign");function mI(s,e,t){if(!s||typeof s=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=void 0),e!=null&&(t.code=e);try{return Cm(s,t)}catch{t.message=s.message,t.stack=s.stack;let i=o(function(){},"ErrClass");return i.prototype=Object.create(Object.getPrototypeOf(s)),Cm(new i,t)}}o(mI,"createError");Am.exports=mI});var Nm=m((iP,Bm)=>{function Ae(s,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(s)),this._timeouts=s,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(Ae,"RetryOperation");Bm.exports=Ae;Ae.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Ae.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Ae.prototype.retry=function(s){if(this._timeout&&clearTimeout(this._timeout),!s)return!1;var e=new Date().getTime();if(s&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(s);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&i.unref(),!0};Ae.prototype.attempt=function(s,e){this._fn=s,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Ae.prototype.try=function(s){this.attempt(s)};Ae.prototype.start=function(s){this.attempt(s)};Ae.prototype.start=Ae.prototype.try;Ae.prototype.errors=function(){return this._errors};Ae.prototype.attempts=function(){return this._attempts};Ae.prototype.mainError=function(){if(this._errors.length===0)return null;for(var s={},e=null,t=0,r=0;r<this._errors.length;r++){var i=this._errors[r],n=i.message,a=(s[n]||0)+1;s[n]=a,a>=t&&(e=i,t=a)}return e}});var Pm=m(Jt=>{var gI=Nm();Jt.operation=function(s){var e=Jt.timeouts(s);return new gI(e,{forever:s&&s.forever,unref:s&&s.unref,maxRetryTime:s&&s.maxRetryTime})};Jt.timeouts=function(s){if(s instanceof Array)return[].concat(s);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in s)e[t]=s[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],i=0;i<e.retries;i++)r.push(this.createTimeout(i,e));return s&&s.forever&&!r.length&&r.push(this.createTimeout(i,e)),r.sort(function(n,a){return n-a}),r};Jt.createTimeout=function(s,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,s));return r=Math.min(r,e.maxTimeout),r};Jt.wrap=function(s,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in s)typeof s[r]=="function"&&t.push(r)}for(var i=0;i<t.length;i++){var n=t[i],a=s[n];s[n]=o(function(h){var u=Jt.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(s,l)})},"retryWrapper").bind(s,a),s[n].options=e}}});var km=m((cP,Lm)=>{Lm.exports=Pm()});var Mm=m((hP,Fm)=>{"use strict";var yI=xm(),EI=km(),wI=Object.prototype.hasOwnProperty;function Dm(s){return s&&s.code==="EPROMISERETRY"&&wI.call(s,"retried")}o(Dm,"isRetryError");function SI(s,e){var t,r;return typeof s=="object"&&typeof e=="function"&&(t=e,e=s,s=t),r=EI.operation(e),new Promise(function(i,n){r.attempt(function(a){Promise.resolve().then(function(){return s(function(c){throw Dm(c)&&(c=c.retried),yI(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(i,function(c){Dm(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(SI,"promiseRetry");Fm.exports=SI});var qm=m((lP,$m)=>{var _I=Symbol("proc-log.meta");$m.exports={META:_I,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...s){return process.emit("output","standard",...s)},"standard"),error:o(function(...s){return process.emit("output","error",...s)},"error"),buffer:o(function(...s){return process.emit("output","buffer",...s)},"buffer"),flush:o(function(...s){return process.emit("output","flush",...s)},"flush")},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:o(function(...s){return process.emit("log","error",...s)},"error"),notice:o(function(...s){return process.emit("log","notice",...s)},"notice"),warn:o(function(...s){return process.emit("log","warn",...s)},"warn"),info:o(function(...s){return process.emit("log","info",...s)},"info"),verbose:o(function(...s){return process.emit("log","verbose",...s)},"verbose"),http:o(function(...s){return process.emit("log","http",...s)},"http"),silly:o(function(...s){return process.emit("log","silly",...s)},"silly"),timing:o(function(...s){return process.emit("log","timing",...s)},"timing"),pause:o(function(){return process.emit("log","pause")},"pause"),resume:o(function(){return process.emit("log","resume")},"resume")},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:o(function(s,e){process.emit("time","start",s);function t(){return process.emit("time","end",s)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(s){return process.emit("time","end",s)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(s){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof s=="function"){let t=s();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...s){let e,t,r=new Promise((i,n)=>{e=i,t=n});return process.emit("input","read",e,t,...s),r},"read")}}});var $c=m((dP,jm)=>{"use strict";var{LRUCache:bI}=bs(),Um=require("dns"),In=new bI({max:50}),RI=o(({family:s=0,hints:e=Um.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:i=300*1e3,lookup:n=Um.lookup})=>({hints:e,lookup:o((a,...c)=>{let h=c.pop(),u=c[0]??{},l={family:s,hints:e,all:t,verbatim:r,...typeof u=="number"?{family:u}:u},f=JSON.stringify({hostname:a,...l});if(In.has(f)){let d=In.get(f);return process.nextTick(h,null,...d)}n(a,l,(d,...p)=>d?h(d):(In.set(f,p,{ttl:i}),h(null,...p)))},"lookup")}),"getOptions");jm.exports={cache:In,getOptions:RI}});var qc=m((mP,zm)=>{"use strict";var OI=$c(),vI=o(s=>{let e=parseInt(s.family??"0",10),t=s.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:s.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...s,family:e,keepAlive:t,timeouts:{idle:s.timeout??0,connection:0,response:0,transfer:0,...s.timeouts},...OI.getOptions({family:e,...s.dns})};return delete r.timeout,r},"normalizeOptions"),Hm=o(s=>{let e="",t=Object.entries(s).sort((r,i)=>r[0]-i[0]);for(let[r,i]of t)i==null?i="null":i instanceof URL?i=i.toString():typeof i=="object"&&(i=Hm(i)),e+=`${r}:${i}:`;return e},"createKey"),II=o(({secureEndpoint:s,...e})=>Hm({secureEndpoint:!!s,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:s?!!e.rejectUnauthorized:!1,ca:s?e.ca:null,cert:s?e.cert:null,key:s?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy}),"cacheOptions");zm.exports={normalizeOptions:vI,cacheOptions:II}});var Vm=m((yP,Gm)=>{var Ns=1e3,Ps=Ns*60,Ls=Ps*60,Qt=Ls*24,TI=Qt*7,CI=Qt*365.25;Gm.exports=function(s,e){e=e||{};var t=typeof s;if(t==="string"&&s.length>0)return AI(s);if(t==="number"&&isFinite(s))return e.long?BI(s):xI(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};function AI(s){if(s=String(s),!(s.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*CI;case"weeks":case"week":case"w":return t*TI;case"days":case"day":case"d":return t*Qt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ls;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ps;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ns;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}o(AI,"parse");function xI(s){var e=Math.abs(s);return e>=Qt?Math.round(s/Qt)+"d":e>=Ls?Math.round(s/Ls)+"h":e>=Ps?Math.round(s/Ps)+"m":e>=Ns?Math.round(s/Ns)+"s":s+"ms"}o(xI,"fmtShort");function BI(s){var e=Math.abs(s);return e>=Qt?Tn(s,e,Qt,"day"):e>=Ls?Tn(s,e,Ls,"hour"):e>=Ps?Tn(s,e,Ps,"minute"):e>=Ns?Tn(s,e,Ns,"second"):s+" ms"}o(BI,"fmtLong");function Tn(s,e,t,r){var i=e>=t*1.5;return Math.round(s/t)+" "+r+(i?"s":"")}o(Tn,"plural")});var Uc=m((wP,Wm)=>{function NI(s){t.debug=t,t.default=t,t.coerce=h,t.disable=a,t.enable=i,t.enabled=c,t.humanize=Vm(),t.destroy=u,Object.keys(s).forEach(l=>{t[l]=s[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}o(e,"selectColor"),t.selectColor=e;function t(l){let f,d=null,p,y;function g(...w){if(!g.enabled)return;let S=g,I=Number(new Date),T=I-(f||I);S.diff=T,S.prev=f,S.curr=I,f=I,w[0]=t.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let _=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(A,P)=>{if(A==="%%")return"%";_++;let z=t.formatters[P];if(typeof z=="function"){let ue=w[_];A=z.call(S,ue),w.splice(_,1),_--}return A}),t.formatArgs.call(S,w),(S.log||t.log).apply(S,w)}return o(g,"debug"),g.namespace=l,g.useColors=t.useColors(),g.color=t.selectColor(l),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:o(()=>d!==null?d:(p!==t.namespaces&&(p=t.namespaces,y=t.enabled(l)),y),"get"),set:o(w=>{d=w},"set")}),typeof t.init=="function"&&t.init(g),g}o(t,"createDebug");function r(l,f){let d=t(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}o(r,"extend");function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let f=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?t.skips.push(d.slice(1)):t.names.push(d)}o(i,"enable");function n(l,f){let d=0,p=0,y=-1,g=0;for(;d<l.length;)if(p<f.length&&(f[p]===l[d]||f[p]==="*"))f[p]==="*"?(y=p,g=d,p++):(d++,p++);else if(y!==-1)p=y+1,g++,d=g;else return!1;for(;p<f.length&&f[p]==="*";)p++;return p===f.length}o(n,"matchesTemplate");function a(){let l=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),l}o(a,"disable");function c(l){for(let f of t.skips)if(n(l,f))return!1;for(let f of t.names)if(n(l,f))return!0;return!1}o(c,"enabled");function h(l){return l instanceof Error?l.stack||l.message:l}o(h,"coerce");function u(){}return o(u,"destroy"),t.enable(t.load()),t}o(NI,"setup");Wm.exports=NI});var Zm=m((pe,Cn)=>{pe.formatArgs=LI;pe.save=kI;pe.load=DI;pe.useColors=PI;pe.storage=FI();pe.destroy=(()=>{let s=!1;return()=>{s||(s=!0)}})();pe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function PI(){let s;return!1}o(PI,"useColors");function LI(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+Cn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;s.splice(1,0,e,"color: inherit");let t=0,r=0;s[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),s.splice(r,0,e)}o(LI,"formatArgs");pe.log=console.debug||console.log||(()=>{});function kI(s){try{s?pe.storage.setItem("debug",s):pe.storage.removeItem("debug")}catch{}}o(kI,"save");function DI(){let s;try{s=pe.storage.getItem("debug")||pe.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=void 0),s}o(DI,"load");function FI(){try{return}catch{}}o(FI,"localstorage");Cn.exports=Uc()(pe);var{formatters:MI}=Cn.exports;MI.j=function(s){try{return JSON.stringify(s)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ym=m((bP,Km)=>{"use strict";Km.exports=(s,e=process.argv)=>{let t=s.startsWith("-")?"":s.length===1?"-":"--",r=e.indexOf(t+s),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}});var Qm=m((RP,Jm)=>{"use strict";var $I=require("os"),Xm=require("tty"),xe=Ym(),{env:K}=process,Nt;xe("no-color")||xe("no-colors")||xe("color=false")||xe("color=never")?Nt=0:(xe("color")||xe("colors")||xe("color=true")||xe("color=always"))&&(Nt=1);"FORCE_COLOR"in K&&(K.FORCE_COLOR==="true"?Nt=1:K.FORCE_COLOR==="false"?Nt=0:Nt=K.FORCE_COLOR.length===0?1:Math.min(parseInt(K.FORCE_COLOR,10),3));function jc(s){return s===0?!1:{level:s,hasBasic:!0,has256:s>=2,has16m:s>=3}}o(jc,"translateLevel");function Hc(s,e){if(Nt===0)return 0;if(xe("color=16m")||xe("color=full")||xe("color=truecolor"))return 3;if(xe("color=256"))return 2;if(s&&!e&&Nt===void 0)return 0;let t=Nt||0;if(K.TERM==="dumb")return t;if(process.platform==="win32"){let r=$I.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in K)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in K)||K.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in K)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(K.TEAMCITY_VERSION)?1:0;if(K.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in K){let r=parseInt((K.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(K.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(K.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(K.TERM)||"COLORTERM"in K?1:t}o(Hc,"supportsColor");function qI(s){let e=Hc(s,s&&s.isTTY);return jc(e)}o(qI,"getSupportLevel");Jm.exports={supportsColor:qI,stdout:jc(Hc(!0,Xm.isatty(1))),stderr:jc(Hc(!0,Xm.isatty(2)))}});var tg=m((Y,xn)=>{var UI=require("tty"),An=require("util");Y.init=ZI;Y.log=GI;Y.formatArgs=HI;Y.save=VI;Y.load=WI;Y.useColors=jI;Y.destroy=An.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Y.colors=[6,2,3,4,5,1];try{let s=Qm();s&&(s.stderr||s).level>=2&&(Y.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Y.inspectOpts=Object.keys(process.env).filter(s=>/^debug_/i.test(s)).reduce((s,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,n)=>n.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),s[t]=r,s},{});function jI(){return"colors"in Y.inspectOpts?!!Y.inspectOpts.colors:UI.isatty(process.stderr.fd)}o(jI,"useColors");function HI(s){let{namespace:e,useColors:t}=this;if(t){let r=this.color,i="\x1B[3"+(r<8?r:"8;5;"+r),n=` ${i};1m${e} \x1B[0m`;s[0]=n+s[0].split(`
18
- `).join(`
19
- `+n),s.push(i+"m+"+xn.exports.humanize(this.diff)+"\x1B[0m")}else s[0]=zI()+e+" "+s[0]}o(HI,"formatArgs");function zI(){return Y.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(zI,"getDate");function GI(...s){return process.stderr.write(An.formatWithOptions(Y.inspectOpts,...s)+`
20
- `)}o(GI,"log");function VI(s){s?process.env.DEBUG=s:delete void 0}o(VI,"save");function WI(){}o(WI,"load");function ZI(s){s.inspectOpts={};let e=Object.keys(Y.inspectOpts);for(let t=0;t<e.length;t++)s.inspectOpts[e[t]]=Y.inspectOpts[e[t]]}o(ZI,"init");xn.exports=Uc()(Y);var{formatters:eg}=xn.exports;eg.o=function(s){return this.inspectOpts.colors=this.useColors,An.inspect(s,this.inspectOpts).split(`
21
- `).map(e=>e.trim()).join(" ")};eg.O=function(s){return this.inspectOpts.colors=this.useColors,An.inspect(s,this.inspectOpts)}});var Ur=m((IP,zc)=>{typeof process>"u"||process.type==="renderer"||process.__nwjs?zc.exports=Zm():zc.exports=tg()});var ig=m(me=>{"use strict";var KI=me&&me.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),YI=me&&me.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),sg=me&&me.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&KI(e,s,t);return YI(e,s),e};Object.defineProperty(me,"__esModule",{value:!0});me.req=me.json=me.toBuffer=void 0;var XI=sg(require("http")),JI=sg(require("https"));async function rg(s){let e=0,t=[];for await(let r of s)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(rg,"toBuffer");me.toBuffer=rg;async function QI(s){let t=(await rg(s)).toString("utf8");try{return JSON.parse(t)}catch(r){let i=r;throw i.message+=` (input: ${t})`,i}}o(QI,"json");me.json=QI;function eT(s,e={}){let r=((typeof s=="string"?s:s.href).startsWith("https:")?JI:XI).request(s,e),i=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=i.then.bind(i),r}o(eT,"req");me.req=eT});var jr=m(be=>{"use strict";var og=be&&be.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),tT=be&&be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ag=be&&be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&og(e,s,t);return tT(e,s),e},sT=be&&be.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&og(e,s,t)};Object.defineProperty(be,"__esModule",{value:!0});be.Agent=void 0;var rT=ag(require("net")),ng=ag(require("http")),iT=require("https");sT(ig(),be);var Xe=Symbol("AgentBaseInternalState"),Gc=class extends ng.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Xe]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
22
- `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new rT.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?iT.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(i),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,i)).then(c=>{if(this.decrementSockets(n,a),c instanceof ng.Agent)try{return c.addRequest(e,i)}catch(h){return r(h)}this[Xe].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[Xe].currentSocket;if(this[Xe].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Xe].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Xe]&&(this[Xe].defaultPort=e)}get protocol(){return this[Xe].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Xe]&&(this[Xe].protocol=e)}};be.Agent=Gc});var ug=m(Be=>{"use strict";var nT=Be&&Be.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),oT=Be&&Be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),hg=Be&&Be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&nT(e,s,t);return oT(e,s),e},aT=Be&&Be.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Be,"__esModule",{value:!0});Be.HttpProxyAgent=void 0;var cT=hg(require("net")),hT=hg(require("tls")),uT=aT(Ur()),lT=require("events"),fT=jr(),cg=require("url"),ks=(0,uT.default)("http-proxy-agent"),Bn=class extends fT.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new cg.URL(e):e,this.proxyHeaders=t?.headers??{},ks("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?dT(t,"headers"):null,host:r,port:i}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,i=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${i}//${n}`,c=new cg.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let h=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let u=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;h["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}h["Proxy-Connection"]||(h["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(h)){let l=h[u];l&&e.setHeader(u,l)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,i;ks("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(ks("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,i=r.indexOf(`\r
16
+ Found: ${e}`);return t.code="EINTEGRITY",t.expected=s,t.found=e,t}o(fR,"checksumError")});var rp=m((d1,Za)=>{"use strict";var Qd=ps(),ep=hr(),tp=Jd(),dR=ui(),{PassThrough:pR}=Zo(),mR=hs(),sp=o(s=>({algorithms:["sha512"],...s}),"putOpts");Za.exports=gR;async function gR(s,e,t,r={}){let{memoize:i}=r;r=sp(r);let n=await tp(s,t,r),a=await Qd.insert(s,e,n.integrity,{...r,size:n.size});return i&&ep.put(s,a,t,r),n.integrity}o(gR,"putData");Za.exports.stream=yR;function yR(s,e,t={}){let{memoize:r}=t;t=sp(t);let i,n,a,c,h=new mR;if(r){let l=new pR().on("collect",f=>{c=f});h.push(l)}let u=tp.stream(s,t).on("integrity",l=>{i=l}).on("size",l=>{n=l}).on("error",l=>{a=l});return h.push(u),h.push(new dR({async flush(){if(!a){let l=await Qd.insert(s,e,i,{...t,size:n});r&&c&&ep.put(s,l,c,t),h.emit("integrity",i),h.emit("size",n)}}})),h}o(yR,"putStream")});var np=m(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.range=Ht.balanced=void 0;var ER=o((s,e,t)=>{let r=s instanceof RegExp?ip(s,t):s,i=e instanceof RegExp?ip(e,t):e,n=r!==null&&i!=null&&(0,Ht.range)(r,i,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+i.length)}},"balanced");Ht.balanced=ER;var ip=o((s,e)=>{let t=e.match(s);return t?t[0]:null},"maybeMatch"),wR=o((s,e,t)=>{let r,i,n,a,c,h=t.indexOf(s),u=t.indexOf(e,h+1),l=h;if(h>=0&&u>0){if(s===e)return[h,u];for(r=[],n=t.length;l>=0&&!c;){if(l===h)r.push(l),h=t.indexOf(s,l+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,u])}else i=r.pop(),i!==void 0&&i<n&&(n=i,a=u),u=t.indexOf(e,l+1);l=h<u&&h>=0?h:u}r.length&&a!==void 0&&(c=[n,a])}return c},"range");Ht.range=wR});var fp=m(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.expand=NR;var op=np(),ap="\0SLASH"+Math.random()+"\0",cp="\0OPEN"+Math.random()+"\0",Ya="\0CLOSE"+Math.random()+"\0",hp="\0COMMA"+Math.random()+"\0",up="\0PERIOD"+Math.random()+"\0",SR=new RegExp(ap,"g"),_R=new RegExp(cp,"g"),bR=new RegExp(Ya,"g"),RR=new RegExp(hp,"g"),OR=new RegExp(up,"g"),IR=/\\\\/g,vR=/\\{/g,TR=/\\}/g,AR=/\\,/g,xR=/\\./g;function Ka(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}o(Ka,"numeric");function CR(s){return s.replace(IR,ap).replace(vR,cp).replace(TR,Ya).replace(AR,hp).replace(xR,up)}o(CR,"escapeBraces");function BR(s){return s.replace(SR,"\\").replace(_R,"{").replace(bR,"}").replace(RR,",").replace(OR,".")}o(BR,"unescapeBraces");function lp(s){if(!s)return[""];let e=[],t=(0,op.balanced)("{","}",s);if(!t)return s.split(",");let{pre:r,body:i,post:n}=t,a=r.split(",");a[a.length-1]+="{"+i+"}";let c=lp(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(lp,"parseCommaParts");function NR(s){return s?(s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),gr(CR(s),!0).map(BR)):[]}o(NR,"expand");function PR(s){return"{"+s+"}"}o(PR,"embrace");function LR(s){return/^-?0\d/.test(s)}o(LR,"isPadded");function kR(s,e){return s<=e}o(kR,"lte");function DR(s,e){return s>=e}o(DR,"gte");function gr(s,e){let t=[],r=(0,op.balanced)("{","}",s);if(!r)return[s];let i=r.pre,n=r.post.length?gr(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=i+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=a||c,u=r.body.indexOf(",")>=0;if(!h&&!u)return r.post.match(/,(?!,).*\}/)?(s=r.pre+"{"+r.body+Ya+r.post,gr(s)):[s];let l;if(h)l=r.body.split(/\.\./);else if(l=lp(r.body),l.length===1&&l[0]!==void 0&&(l=gr(l[0],!1).map(PR),l.length===1))return n.map(d=>r.pre+l[0]+d);let f;if(h&&l[0]!==void 0&&l[1]!==void 0){let d=Ka(l[0]),p=Ka(l[1]),g=Math.max(l[0].length,l[1].length),y=l.length===3&&l[2]!==void 0?Math.abs(Ka(l[2])):1,S=kR;p<d&&(y*=-1,S=DR);let T=l.some(LR);f=[];for(let v=d;S(v,p);v+=y){let R;if(c)R=String.fromCharCode(v),R==="\\"&&(R="");else if(R=String(v),T){let I=g-R.length;if(I>0){let C=new Array(I+1).join("0");v<0?R="-"+C+R.slice(1):R=C+R}}f.push(R)}}else{f=[];for(let d=0;d<l.length;d++)f.push.apply(f,gr(l[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<n.length;p++){let g=i+f[d]+n[p];(!e||h||g)&&t.push(g)}}return t}o(gr,"expand_")});var dp=m(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.assertValidPattern=void 0;var MR=1024*64,$R=o(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>MR)throw new TypeError("pattern is too long")},"assertValidPattern");Gi.assertValidPattern=$R});var mp=m(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.parseClass=void 0;var FR={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},yr=o(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),qR=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),pp=o(s=>s.join(""),"rangesToString"),UR=o((s,e)=>{let t=e;if(s.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],n=t+1,a=!1,c=!1,h=!1,u=!1,l=t,f="";e:for(;n<s.length;){let y=s.charAt(n);if((y==="!"||y==="^")&&n===t+1){u=!0,n++;continue}if(y==="]"&&a&&!h){l=n+1;break}if(a=!0,y==="\\"&&!h){h=!0,n++;continue}if(y==="["&&!h){for(let[S,[w,T,v]]of Object.entries(FR))if(s.startsWith(S,n)){if(f)return["$.",!1,s.length-t,!0];n+=S.length,v?i.push(w):r.push(w),c=c||T;continue e}}if(h=!1,f){y>f?r.push(yr(f)+"-"+yr(y)):y===f&&r.push(yr(y)),f="",n++;continue}if(s.startsWith("-]",n+1)){r.push(yr(y+"-")),n+=2;continue}if(s.startsWith("-",n+1)){f=y,n+=2;continue}r.push(yr(y)),n++}if(l<n)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,s.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[qR(y),!1,l-t,!1]}let d="["+(u?"^":"")+pp(r)+"]",p="["+(u?"":"^")+pp(i)+"]";return[r.length&&i.length?"("+d+"|"+p+")":r.length?d:p,c,l-t,!0]},"parseClass");Vi.parseClass=UR});var Zi=m(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.unescape=void 0;var jR=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");Wi.unescape=jR});var ec=m(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.AST=void 0;var HR=mp(),Ki=Zi(),zR=new Set(["!","?","+","*","@"]),gp=o(s=>zR.has(s),"isExtglobType"),GR="(?!(?:^|/)\\.\\.?(?:$|/))",Yi="(?!\\.)",VR=new Set(["[","."]),WR=new Set(["..","."]),ZR=new Set("().*{}+?[]^$\\!"),KR=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Qa="[^/]",yp=Qa+"*?",Ep=Qa+"+?",Ja=class s{static{o(this,"AST")}type;#e;#t;#s=!1;#r=[];#i;#a;#l;#f=!1;#c;#p;#d=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#p=this.#r.map(e=>String(e)).join("")}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#i;for(;r;){for(let i=t.#a+1;!r.type&&i<r.#r.length;i++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[i])}t=r,r=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof s&&t.#i===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let r=e.#r[t];if(!(r instanceof s&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new s(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#n(e,t,r,i){let n=!1,a=!1,c=-1,h=!1;if(t.type===null){let p=r,g="";for(;p<e.length;){let y=e.charAt(p++);if(n||y==="\\"){n=!n,g+=y;continue}if(a){p===c+1?(y==="^"||y==="!")&&(h=!0):y==="]"&&!(p===c+2&&h)&&(a=!1),g+=y;continue}else if(y==="["){a=!0,c=p,h=!1,g+=y;continue}if(!i.noext&&gp(y)&&e.charAt(p)==="("){t.push(g),g="";let S=new s(y,t);p=s.#n(e,S,p,i),t.push(S);continue}g+=y}return t.push(g),p}let u=r+1,l=new s(null,t),f=[],d="";for(;u<e.length;){let p=e.charAt(u++);if(n||p==="\\"){n=!n,d+=p;continue}if(a){u===c+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(u===c+2&&h)&&(a=!1),d+=p;continue}else if(p==="["){a=!0,c=u,h=!1,d+=p;continue}if(gp(p)&&e.charAt(u)==="("){l.push(d),d="";let g=new s(p,l);l.push(g),u=s.#n(e,g,u,i);continue}if(p==="|"){l.push(d),d="",f.push(l),l=new s(null,t);continue}if(p===")")return d===""&&t.#r.length===0&&(t.#d=!0),l.push(d),d="",t.push(...f,l),u;d+=p}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],u}static fromGlob(e,t={}){let r=new s(null,void 0,t);return s.#n(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,n]=this.toRegExpSource();if(!(i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&this.#h(),!this.type){let h=this.isStart()&&this.isEnd(),u=this.#r.map(p=>{let[g,y,S,w]=typeof p=="string"?s.#_(p,this.#t,h):p.toRegExpSource(e);return this.#t=this.#t||S,this.#s=this.#s||w,g}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&WR.has(this.#r[0]))){let g=VR,y=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),S=!t&&!e&&g.has(u.charAt(0));l=y?GR:S?Yi:""}let f="";return this.isEnd()&&this.#e.#f&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[l+u+f,(0,Ki.unescape)(u),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#g(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let h=this.toString();return this.#r=[h],this.type=null,this.#t=void 0,[h,(0,Ki.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!Yi?"":this.#g(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#d)c=(this.isStart()&&!t?Yi:"")+Ep;else{let h=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Yi:"")+yp+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+n+h}return[c,(0,Ki.unescape)(n),this.#t=!!this.#t,this.#s]}#g(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,n,a]=t.toRegExpSource(e);return this.#s=this.#s||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#_(e,t,r=!1){let i=!1,n="",a=!1;for(let c=0;c<e.length;c++){let h=e.charAt(c);if(i){i=!1,n+=(ZR.has(h)?"\\":"")+h;continue}if(h==="\\"){c===e.length-1?n+="\\\\":i=!0;continue}if(h==="["){let[u,l,f,d]=(0,HR.parseClass)(e,c);if(f){n+=u,a=a||l,c+=f-1,t=t||d;continue}}if(h==="*"){r&&e==="*"?n+=Ep:n+=yp,t=!0;continue}if(h==="?"){n+=Qa,t=!0;continue}n+=KR(h)}return[n,(0,Ki.unescape)(e),!!t,a]}};Xi.AST=Ja});var tc=m(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.escape=void 0;var YR=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");Ji.escape=YR});var It=m(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.unescape=O.escape=O.AST=O.Minimatch=O.match=O.makeRe=O.braceExpand=O.defaults=O.filter=O.GLOBSTAR=O.sep=O.minimatch=void 0;var XR=fp(),Qi=dp(),_p=ec(),JR=tc(),QR=Zi(),eO=o((s,e,t={})=>((0,Qi.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new zt(e,t).match(s)),"minimatch");O.minimatch=eO;var tO=/^\*+([^+@!?\*\[\(]*)$/,sO=o(s=>e=>!e.startsWith(".")&&e.endsWith(s),"starDotExtTest"),rO=o(s=>e=>e.endsWith(s),"starDotExtTestDot"),iO=o(s=>(s=s.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(s)),"starDotExtTestNocase"),nO=o(s=>(s=s.toLowerCase(),e=>e.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),oO=/^\*+\.\*+$/,aO=o(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),cO=o(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),hO=/^\.\*+$/,uO=o(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),lO=/^\*+$/,fO=o(s=>s.length!==0&&!s.startsWith("."),"starTest"),dO=o(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),pO=/^\?+([^+@!?\*\[\(]*)?$/,mO=o(([s,e=""])=>{let t=bp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),gO=o(([s,e=""])=>{let t=Rp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),yO=o(([s,e=""])=>{let t=Rp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),EO=o(([s,e=""])=>{let t=bp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),bp=o(([s])=>{let e=s.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Rp=o(([s])=>{let e=s.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),Op=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wp={win32:{sep:"\\"},posix:{sep:"/"}};O.sep=Op==="win32"?wp.win32.sep:wp.posix.sep;O.minimatch.sep=O.sep;O.GLOBSTAR=Symbol("globstar **");O.minimatch.GLOBSTAR=O.GLOBSTAR;var wO="[^/]",SO=wO+"*?",_O="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",bO="(?:(?!(?:\\/|^)\\.).)*?",RO=o((s,e={})=>t=>(0,O.minimatch)(t,s,e),"filter");O.filter=RO;O.minimatch.filter=O.filter;var Re=o((s,e={})=>Object.assign({},s,e),"ext"),OO=o(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return O.minimatch;let e=O.minimatch;return Object.assign(o((r,i,n={})=>e(r,i,Re(s,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,n={}){super(i,Re(s,n))}static defaults(i){return e.defaults(Re(s,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,n,a={}){super(i,n,Re(s,a))}static fromGlob(i,n={}){return e.AST.fromGlob(i,Re(s,n))}},unescape:o((r,i={})=>e.unescape(r,Re(s,i)),"unescape"),escape:o((r,i={})=>e.escape(r,Re(s,i)),"escape"),filter:o((r,i={})=>e.filter(r,Re(s,i)),"filter"),defaults:o(r=>e.defaults(Re(s,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,Re(s,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,Re(s,i)),"braceExpand"),match:o((r,i,n={})=>e.match(r,i,Re(s,n)),"match"),sep:e.sep,GLOBSTAR:O.GLOBSTAR})},"defaults");O.defaults=OO;O.minimatch.defaults=O.defaults;var IO=o((s,e={})=>((0,Qi.assertValidPattern)(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,XR.expand)(s)),"braceExpand");O.braceExpand=IO;O.minimatch.braceExpand=O.braceExpand;var vO=o((s,e={})=>new zt(s,e).makeRe(),"makeRe");O.makeRe=vO;O.minimatch.makeRe=O.makeRe;var TO=o((s,e,t={})=>{let r=new zt(e,t);return s=s.filter(i=>r.match(i)),r.options.nonull&&!s.length&&s.push(e),s},"match");O.match=TO;O.minimatch.match=O.match;var Sp=/[?*]|[+@!]\(.*?\)|\[|\]/,AO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zt=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,Qi.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Op,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!Sp.test(n[2]))&&!Sp.test(n[3]),u=/^[a-z]:/i.test(n[0]);if(h)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(u)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let n=r[r.length-1];return i==="**"&&n==="**"?r:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],h=r[i+2],u=r[i+3];if(c!==".."||!h||h==="."||h===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let h=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...h),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,n=0,a=[],c="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])a.push(c==="b"?t[n]:e[i]),i++,n++;else if(r&&e[i]==="**"&&t[n]===e[i+1])a.push(e[i]),i++;else if(r&&t[n]==="**"&&e[i]===t[n+1])a.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),i++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=this.options;if(this.isWindows){let y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),v=S?3:y?0:void 0,R=T?3:w?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[I,C]=[e[v],t[R]];I.toLowerCase()===C.toLowerCase()&&(t[R]=I,R>v?t=t.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,h=e.length,u=t.length;a<h&&c<u;a++,c++){this.debug("matchOne loop");var l=t[c],f=e[a];if(this.debug(t,l,f),l===!1)return!1;if(l===O.GLOBSTAR){this.debug("GLOBSTAR",[t,l,f]);var d=a,p=c+1;if(p===u){for(this.debug("** at the end");a<h;a++)if(e[a]==="."||e[a]===".."||!i.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<h;){var g=e[d];if(this.debug(`
17
+ globstar while`,e,d,t,p,g),this.matchOne(e.slice(d),t.slice(p),r))return this.debug("globstar found match!",d,h,g),!0;if(g==="."||g===".."||!i.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
18
+ >>> no match, partial?`,e,d,t,p),d===h))}let y;if(typeof l=="string"?(y=f===l,this.debug("string match",l,f,y)):(y=l.test(f),this.debug("pattern match",l,f,y)),!y)return!1}if(a===h&&c===u)return!0;if(a===h)return r;if(c===u)return a===h-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,O.braceExpand)(this.pattern,this.options)}parse(e){(0,Qi.assertValidPattern)(e);let t=this.options;if(e==="**")return O.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(lO))?i=t.dot?dO:fO:(r=e.match(tO))?i=(t.nocase?t.dot?nO:iO:t.dot?rO:sO)(r[1]):(r=e.match(pO))?i=(t.nocase?t.dot?gO:mO:t.dot?yO:EO)(r):(r=e.match(oO))?i=t.dot?cO:aO:(r=e.match(hO))&&(i=uO);let n=_p.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?SO:t.dot?_O:bO,i=new Set(t.nocase?["i"]:[]),n=e.map(h=>{let u=h.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))i.add(f);return typeof l=="string"?AO(l):l===O.GLOBSTAR?O.GLOBSTAR:l._src});return u.forEach((l,f)=>{let d=u[f+1],p=u[f-1];l!==O.GLOBSTAR||p===O.GLOBSTAR||(p===void 0?d!==void 0&&d!==O.GLOBSTAR?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=p+"(?:\\/|"+r+")?":d!==O.GLOBSTAR&&(u[f-1]=p+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=O.GLOBSTAR))}),u.filter(l=>l!==O.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<n.length;c++){let h=n[c],u=i;if(r.matchBase&&h.length===1&&(u=[a]),this.matchOne(u,h,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return O.minimatch.defaults(e).Minimatch}};O.Minimatch=zt;var xO=ec();Object.defineProperty(O,"AST",{enumerable:!0,get:o(function(){return xO.AST},"get")});var CO=tc();Object.defineProperty(O,"escape",{enumerable:!0,get:o(function(){return CO.escape},"get")});var BO=Zi();Object.defineProperty(O,"unescape",{enumerable:!0,get:o(function(){return BO.unescape},"get")});O.minimatch.AST=_p.AST;O.minimatch.Minimatch=zt;O.minimatch.escape=JR.escape;O.minimatch.unescape=QR.unescape});var Fp=m(L=>{"use strict";var NO=L&&L.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),PO=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),LO=L&&L.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&NO(e,s,t);return PO(e,s),e};Object.defineProperty(L,"__esModule",{value:!0});L.PathScurry=L.Path=L.PathScurryDarwin=L.PathScurryPosix=L.PathScurryWin32=L.PathScurryBase=L.PathPosix=L.PathWin32=L.PathBase=L.ChildrenCache=L.ResolveCache=void 0;var Cp=gs(),nn=require("node:path"),kO=require("node:url"),wr=require("fs"),DO=LO(require("node:fs")),MO=wr.realpathSync.native,en=require("node:fs/promises"),Ip=J(),Sr={lstatSync:wr.lstatSync,readdir:wr.readdir,readdirSync:wr.readdirSync,readlinkSync:wr.readlinkSync,realpathSync:MO,promises:{lstat:en.lstat,readdir:en.readdir,readlink:en.readlink,realpath:en.realpath}},Bp=o(s=>!s||s===Sr||s===DO?Sr:{...Sr,...s,promises:{...Sr.promises,...s.promises||{}}},"fsFromOption"),Np=/^\\\\\?\\([a-z]:)\\?$/i,$O=o(s=>s.replace(/\//g,"\\").replace(Np,"$1\\"),"uncToDrive"),FO=/[\\\/]/,Ie=0,Pp=1,Lp=2,Ge=4,kp=6,Dp=8,Gt=10,Mp=12,Oe=15,Er=~Oe,sc=16,vp=32,_r=64,Le=128,tn=256,rn=512,Tp=_r|Le|rn,qO=1023,rc=o(s=>s.isFile()?Dp:s.isDirectory()?Ge:s.isSymbolicLink()?Gt:s.isCharacterDevice()?Lp:s.isBlockDevice()?kp:s.isSocket()?Mp:s.isFIFO()?Pp:Ie,"entToType"),Ap=new Map,br=o(s=>{let e=Ap.get(s);if(e)return e;let t=s.normalize("NFKD");return Ap.set(s,t),t},"normalize"),xp=new Map,sn=o(s=>{let e=xp.get(s);if(e)return e;let t=br(s.toLowerCase());return xp.set(s,t),t},"normalizeNocase"),Rr=class extends Cp.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};L.ResolveCache=Rr;var on=class extends Cp.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};L.ChildrenCache=on;var $p=Symbol("PathScurry setAsCwd"),K=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#c;get ino(){return this.#c}#p;get size(){return this.#p}#d;get blocks(){return this.#d}#h;get atimeMs(){return this.#h}#n;get mtimeMs(){return this.#n}#g;get ctimeMs(){return this.#g}#_;get birthtimeMs(){return this.#_}#S;get atime(){return this.#S}#y;get mtime(){return this.#y}#A;get ctime(){return this.#A}#E;get birthtime(){return this.#E}#R;#v;#w;#b;#T;#m;#o;#P;#x;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Ie,r,i,n,a,c){this.name=e,this.#R=n?sn(e):br(e),this.#o=t&qO,this.nocase=n,this.roots=i,this.root=r||this,this.#P=a,this.#w=c.fullpath,this.#T=c.relative,this.#m=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=Bp(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#U(i):this.#U(i)}#U(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#o&=~sc,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?sn(e):br(e);for(let h of r)if(h.#R===i)return h;let n=this.parent?this.sep:"",a=this.#w?this.#w+n+e:void 0,c=this.newChild(e,Ie,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=Le),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let e=this.name,t=this.parent;if(!t)return this.#T=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#w=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&Oe)===Ie}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&Oe)===Dp}isDirectory(){return(this.#o&Oe)===Ge}isCharacterDevice(){return(this.#o&Oe)===Lp}isBlockDevice(){return(this.#o&Oe)===kp}isFIFO(){return(this.#o&Oe)===Pp}isSocket(){return(this.#o&Oe)===Mp}isSymbolicLink(){return(this.#o&Gt)===Gt}lstatCached(){return this.#o&vp?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#o&Oe;return!(e!==Ie&&e!==Gt||this.#o&tn||this.#o&Le)}calledReaddir(){return!!(this.#o&sc)}isENOENT(){return!!(this.#o&Le)}isNamed(e){return this.nocase?this.#R===sn(e):this.#R===br(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#x=r}catch(t){this.#j(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#x=r}catch(t){this.#j(t.code);return}}#I(e){this.#o|=sc;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#o&Le||(this.#o=(this.#o|Le)&Er,this.#L())}#L(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#F(){this.#o|=rn,this.#k()}#k(){if(this.#o&_r)return;let e=this.#o;(e&Oe)===Ge&&(e&=Er),this.#o=e|_r,this.#L()}#C(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#$():this.children().provisional=0}#N(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#$()}#j(e=""){let t=this.#o;t|=tn,e==="ENOENT"&&(t|=Le),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Er),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#D(e,t){return this.#u(e,t)||this.#H(e,t)}#H(e,t){let r=rc(e),i=this.newChild(e.name,r,{parent:this}),n=i.#o&Oe;return n!==Ge&&n!==Gt&&n!==Ie&&(i.#o|=_r),t.unshift(i),t.provisional++,i}#u(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?sn(e.name):br(e.name))===i.#R)return this.#z(e,i,r,t)}}#z(e,t,r,i){let n=t.name;return t.#o=t.#o&Er|rc(e),n!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&Le)===0)try{return this.#M(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#N(e.code)}}lstatSync(){if((this.#o&Le)===0)try{return this.#M(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#N(e.code)}}#M(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:a,blocks:c,ctime:h,ctimeMs:u,dev:l,gid:f,ino:d,mode:p,mtime:g,mtimeMs:y,nlink:S,rdev:w,size:T,uid:v}=e;this.#S=t,this.#h=r,this.#E=i,this.#_=n,this.#f=a,this.#d=c,this.#A=h,this.#g=u,this.#t=l,this.#a=f,this.#c=d,this.#s=p,this.#y=g,this.#n=y,this.#r=S,this.#l=w,this.#p=T,this.#i=v;let R=rc(e);this.#o=this.#o&Er|R|vp,R!==Ie&&R!==Ge&&R!==Gt&&(this.#o|=_r)}#B=[];#q=!1;#V(e){this.#q=!1;let t=this.#B.slice();this.#B.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#B.push(e),this.#q)return;this.#q=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)this.#C(n.code),r.provisional=0;else{for(let c of a)this.#D(c,r);this.#I(r)}this.#V(r.slice(0,r.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#G)await this.#G;else{let r=o(()=>{},"resolve");this.#G=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#D(i,e);this.#I(e)}catch(i){this.#C(i.code),e.provisional=0}this.#G=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#D(r,e);this.#I(e)}catch(r){this.#C(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&Tp)return!1;let e=Oe&this.#o;return e===Ie||e===Ge||e===Gt}shouldWalk(e,t){return(this.#o&Ge)===Ge&&!(this.#o&Tp)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((rn|tn|Le)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#F()}}realpathSync(){if(this.#O)return this.#O;if(!((rn|tn|Le)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#F()}}[$p](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#T=r.join(this.sep),i.#m=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#T=void 0,i.#m=void 0,i=i.parent}};L.PathBase=K;var Or=class s extends K{static{o(this,"PathWin32")}sep="\\";splitSep=FO;constructor(e,t=Ie,r,i,n,a,c){super(e,t,r,i,n,a,c)}newChild(e,t=Ie,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return nn.win32.parse(e).root}getRoot(e){if(e=$O(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Tr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Np,"$1\\"),e===t}};L.PathWin32=Or;var Ir=class s extends K{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Ie,r,i,n,a,c){super(e,t,r,i,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Ie,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};L.PathPosix=Ir;var vr=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:n=16*1024,fs:a=Sr}={}){this.#r=Bp(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,kO.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Rr,this.#t=new Rr,this.#s=new on(n);let h=c.substring(this.rootPath.length).split(r);if(h.length===1&&!h[0]&&h.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let u=this.root,l=h.length-1,f=t.sep,d=this.rootPath,p=!1;for(let g of h){let y=l--;u=u.child(g,{relative:new Array(y).fill("..").join(f),relativePosix:new Array(y).fill("..").join("/"),fullpath:d+=(p?"":f)+g}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#t.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set,u=o((f,d)=>{h.add(f),f.readdirCB((p,g)=>{if(p)return d(p);let y=g.length;if(!y)return d();let S=o(()=>{--y===0&&d()},"next");for(let w of g)(!n||n(w))&&c.push(r?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(h,a)?u(T,S):S()):w.shouldWalk(h,a)?u(w,S):S()},!0)},"walk"),l=e;return new Promise((f,d)=>{u(l,p=>{if(p)return d(p);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set([e]);for(let u of h){let l=u.readdirSync();for(let f of l){(!n||n(f))&&c.push(r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(h,a)&&h.add(d)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let h of c){let u=h.readdirSync();for(let l of u){(!n||n(l))&&(yield r?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(i&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new Ip.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let h=new Set,u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let g=o((S,w,T=!1)=>{if(S)return c.emit("error",S);if(i&&!T){let v=[];for(let R of w)R.isSymbolicLink()&&v.push(R.realpath().then(I=>I?.isUnknown()?I.lstat():I));if(v.length){Promise.all(v).then(()=>g(null,w,!0));return}}for(let v of w)v&&(!n||n(v))&&(c.write(r?v:v.fullpath())||(d=!0));l--;for(let v of w){let R=v.realpathCached()||v;R.shouldWalk(h,a)&&u.push(R)}d&&!c.flowing?c.once("drain",f):y||f()},"onReaddir"),y=!0;p.readdirCB(g,!0),y=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new Ip.Minipass({objectMode:!0}),h=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let g=p.readdirSync();for(let y of g)(!n||n(y))&&(c.write(r?y:y.fullpath())||(d=!0));l--;for(let y of g){let S=y;if(y.isSymbolicLink()){if(!(i&&(S=y.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(h,a)&&u.push(S)}}d&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[$p](t)}};L.PathScurryBase=vr;var Tr=class extends vr{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,nn.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return nn.win32.parse(e).root.toUpperCase()}newRoot(e){return new Or(this.rootPath,Ge,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};L.PathScurryWin32=Tr;var Ar=class extends vr{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,nn.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ir(this.rootPath,Ge,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};L.PathScurryPosix=Ar;var an=class extends Ar{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};L.PathScurryDarwin=an;L.Path=process.platform==="win32"?Or:Ir;L.PathScurry=process.platform==="win32"?Tr:process.platform==="darwin"?an:Ar});var nc=m(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.Pattern=void 0;var UO=It(),jO=o(s=>s.length>=1,"isPatternList"),HO=o(s=>s.length>=1,"isGlobList"),ic=class s{static{o(this,"Pattern")}#e;#t;#s;length;#r;#i;#a;#l;#f;#c;#p=!0;constructor(e,t,r,i){if(!jO(e))throw new TypeError("empty pattern list");if(!HO(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[n,a,c,h,...u]=this.#e,[l,f,d,p,...g]=this.#t;u[0]===""&&(u.shift(),g.shift());let y=[n,a,c,h,""].join("/"),S=[l,f,d,p,""].join("/");this.#e=[y,...u],this.#t=[S,...g],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...h]=this.#t;a[0]===""&&(a.shift(),h.shift());let u=n+"/",l=c+"/";this.#e=[u,...a],this.#t=[l,...h],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===UO.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#a=this.#a||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new s(this.#e,this.#t,this.#s+1,this.#r),this.#i.#c=this.#c,this.#i.#f=this.#f,this.#i.#l=this.#l,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#p)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#p?!1:(this.#p=!1,!0)}};cn.Pattern=ic});var ac=m(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.Ignore=void 0;var qp=It(),zO=nc(),GO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",oc=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:n,platform:a=GO}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new qp.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],n=t.globParts[r];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let a=new zO.Pattern(i,n,0,this.platform),c=new qp.Minimatch(a.globString(),this.mmopts),h=n[n.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),h&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};hn.Ignore=oc});var jp=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Processor=Ve.SubWalks=Ve.MatchRecord=Ve.HasWalkedCache=void 0;var Up=It(),un=class s{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new s(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};Ve.HasWalkedCache=un;var ln=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};Ve.MatchRecord=ln;var fn=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};Ve.SubWalks=fn;var cc=class s{static{o(this,"Processor")}hasWalkedCache;matches=new ln;subwalks=new fn;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new un}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,n]of r){this.hasWalkedCache.storeWalked(i,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let h,u,l=!1;for(;typeof(h=n.pattern())=="string"&&(u=n.rest());)i=i.resolve(h),n=u,l=!0;if(h=n.pattern(),u=n.rest(),l){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof h=="string"){let f=h===".."||h===""||h===".";this.matches.add(i.resolve(h),c,f);continue}else if(h===Up.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let f=u?.pattern(),d=u?.rest();if(!u||(f===""||f===".")&&!d)this.matches.add(i,c,f===""||f===".");else if(f===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else h instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new s(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),h=a.pattern(),u=a.rest();h===Up.GLOBSTAR?i.testGlobstar(n,a,u,c):h instanceof RegExp?i.testRegExp(n,h,u,c):i.testString(n,h,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),i);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};Ve.Processor=cc});var Gp=m(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.GlobStream=vt.GlobWalker=vt.GlobUtil=void 0;var VO=J(),Hp=ac(),zp=jp(),WO=o((s,e)=>typeof s=="string"?new Hp.Ignore([s],e):Array.isArray(s)?new Hp.Ignore(s,e):s,"makeIgnore"),xr=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=WO(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(n?a+n+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new zp.Processor(this.opts),r)}walkCB2(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirCached();c.calledReaddir()?this.walkCB3(c,h,r,a):c.readdirCB((u,l)=>this.walkCB3(c,l,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let[c,h]of r.subwalks.entries())n++,this.walkCB2(c,h,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new zp.Processor(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirSync();this.walkCB3Sync(c,h,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let[c,h]of r.subwalks.entries())n++,this.walkCB2Sync(c,h,r.child(),a);a()}};vt.GlobUtil=xr;var hc=class extends xr{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};vt.GlobWalker=hc;var uc=class extends xr{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new VO.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};vt.GlobStream=uc});var fc=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.Glob=void 0;var ZO=It(),KO=require("node:url"),dn=Fp(),YO=nc(),pn=Gp(),XO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",lc=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,KO.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=e,this.platform=t.platform||XO,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=t.platform==="win32"?dn.PathScurryWin32:t.platform==="darwin"?dn.PathScurryDarwin:t.platform?dn.PathScurryPosix:dn.PathScurry;this.scurry=new h(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new ZO.Minimatch(h,i)),[a,c]=n.reduce((h,u)=>(h[0].push(...u.set),h[1].push(...u.globParts),h),[[],[]]);this.patterns=a.map((h,u)=>{let l=c[u];if(!l)throw new Error("invalid pattern object");return new YO.Pattern(h,l,0,this.platform)})}async walk(){return[...await new pn.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new pn.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new pn.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new pn.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};mn.Glob=lc});var dc=m(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.hasMagic=void 0;var JO=It(),QO=o((s,e={})=>{Array.isArray(s)||(s=[s]);for(let t of s)if(new JO.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");gn.hasMagic=QO});var Kp=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.glob=N.sync=N.iterate=N.iterateSync=N.stream=N.streamSync=N.Ignore=N.hasMagic=N.Glob=N.unescape=N.escape=void 0;N.globStreamSync=Cr;N.globStream=pc;N.globSync=mc;N.globIterateSync=Br;N.globIterate=gc;var Vp=It(),Vt=fc(),eI=dc(),Zp=It();Object.defineProperty(N,"escape",{enumerable:!0,get:o(function(){return Zp.escape},"get")});Object.defineProperty(N,"unescape",{enumerable:!0,get:o(function(){return Zp.unescape},"get")});var tI=fc();Object.defineProperty(N,"Glob",{enumerable:!0,get:o(function(){return tI.Glob},"get")});var sI=dc();Object.defineProperty(N,"hasMagic",{enumerable:!0,get:o(function(){return sI.hasMagic},"get")});var rI=ac();Object.defineProperty(N,"Ignore",{enumerable:!0,get:o(function(){return rI.Ignore},"get")});function Cr(s,e={}){return new Vt.Glob(s,e).streamSync()}o(Cr,"globStreamSync");function pc(s,e={}){return new Vt.Glob(s,e).stream()}o(pc,"globStream");function mc(s,e={}){return new Vt.Glob(s,e).walkSync()}o(mc,"globSync");async function Wp(s,e={}){return new Vt.Glob(s,e).walk()}o(Wp,"glob_");function Br(s,e={}){return new Vt.Glob(s,e).iterateSync()}o(Br,"globIterateSync");function gc(s,e={}){return new Vt.Glob(s,e).iterate()}o(gc,"globIterate");N.streamSync=Cr;N.stream=Object.assign(pc,{sync:Cr});N.iterateSync=Br;N.iterate=Object.assign(gc,{sync:Br});N.sync=Object.assign(mc,{stream:Cr,iterate:Br});N.glob=Object.assign(Wp,{glob:Wp,globSync:mc,sync:N.sync,globStream:pc,stream:N.stream,globStreamSync:Cr,streamSync:N.streamSync,globIterate:gc,iterate:N.iterate,globIterateSync:Br,iterateSync:N.iterateSync,Glob:Vt.Glob,hasMagic:eI.hasMagic,escape:Vp.escape,unescape:Vp.unescape});N.glob.glob=N.glob});var yc=m((K1,Xp)=>{"use strict";var{glob:iI}=Kp(),Yp=require("path"),nI=o(s=>s.split(Yp.win32.sep).join(Yp.posix.sep),"globify");Xp.exports=(s,e)=>iI(nI(s),e)});var Qp=m((X1,Jp)=>{"use strict";var oI=require("fs/promises"),aI=us(),{hasContent:cI}=Ha();Jp.exports=hI;async function hI(s,e){let t=await cI(s,e);return t&&t.sri?(await oI.rm(aI(s,t.sri),{recursive:!0,force:!0}),!0):!1}o(hI,"rm")});var tm=m((Q1,Nr)=>{"use strict";var{rm:uI}=require("fs/promises"),lI=yc(),fI=ps(),Ec=hr(),dI=require("path"),pI=Qp();Nr.exports=em;Nr.exports.entry=em;function em(s,e,t){return Ec.clearMemoized(),fI.delete(s,e,t)}o(em,"entry");Nr.exports.content=mI;function mI(s,e){return Ec.clearMemoized(),pI(s,e)}o(mI,"content");Nr.exports.all=gI;async function gI(s){Ec.clearMemoized();let e=await lI(dI.join(s,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>uI(t,{recursive:!0,force:!0})))}o(gI,"all")});var rm=m((tN,bc)=>{"use strict";var{mkdir:yI,readFile:EI,rm:Sc,stat:_c,truncate:wI,writeFile:SI}=require("fs/promises"),sm=us(),_I=zi(),bI=yc(),Is=ps(),yn=require("path"),wc=St(),RI=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),OI=o(s=>({concurrency:20,log:{silly(){}},...s}),"verifyOpts");bc.exports=II;async function II(s,e){e=OI(e),e.log.silly("verify","verifying cache at",s);let t=[vI,AI,xI,BI,PI,LI,TI],r={};for(let i of t){let n=i.name,a=new Date,c=await i(s,e);c&&Object.keys(c).forEach(u=>{r[u]=c[u]});let h=new Date;r.runTime||(r.runTime={}),r.runTime[n]=h-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",s,"in",`${r.runTime.total}ms`),r}o(II,"verify");async function vI(){return{startTime:new Date}}o(vI,"markStartTime");async function TI(){return{endTime:new Date}}o(TI,"markEndTime");async function AI(s,e){return e.log.silly("verify","fixing cache permissions"),await yI(s,{recursive:!0}),null}o(AI,"fixPerms");async function xI(s,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(xi(),Ai)),r=Is.lsStream(s),i=new Set;r.on("data",h=>{if(e.filter&&!e.filter(h))return;let u=wc.parse(h.integrity);for(let l in u)i.add(u[l].toString())}),await new Promise((h,u)=>{r.on("end",h).on("error",u)});let n=sm.contentDir(s),a=await bI(yn.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async h=>{let u=h.split(/[/\\]/),l=u.slice(u.length-3).join(""),f=u[u.length-4],d=wc.fromHex(l,f);if(i.has(d.toString())){let p=await CI(h,d);p.valid?(c.verifiedContent++,c.keptSize+=p.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=p.size)}else{c.reclaimedCount++;let p=await _c(h);await Sc(h,{recursive:!0,force:!0}),c.reclaimedSize+=p.size}return c},{concurrency:e.concurrency}),c}o(xI,"garbageCollect");async function CI(s,e){let t={};try{let{size:r}=await _c(s);t.size=r,t.valid=!0,await wc.checkStream(new _I.ReadStream(s),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await Sc(s,{recursive:!0,force:!0}),t.valid=!1}return t}o(CI,"verifyContent");async function BI(s,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(xi(),Ai)),r=await Is.ls(s),i={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(RI(r,a)){let c=Is.hashKey(a),h=r[a],u=e.filter&&!e.filter(h);u&&i.rejectedEntries++,n[c]&&!u?n[c].push(h):n[c]&&u||(u?(n[c]=[],n[c]._path=Is.bucketPath(s,a)):(n[c]=[h],n[c]._path=Is.bucketPath(s,a)))}return await t(Object.keys(n),a=>NI(s,n[a],i,e),{concurrency:e.concurrency}),i}o(BI,"rebuildIndex");async function NI(s,e,t){await wI(e._path);for(let r of e){let i=sm(s,r.integrity);try{await _c(i),await Is.insert(s,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(NI,"rebuildBucket");function PI(s,e){return e.log.silly("verify","cleaning tmp directory"),Sc(yn.join(s,"tmp"),{recursive:!0,force:!0})}o(PI,"cleanTmp");async function LI(s,e){let t=yn.join(s,"_lastverified");return e.log.silly("verify","writing verifile to "+t),SI(t,`${Date.now()}`)}o(LI,"writeVerifile");bc.exports.lastRun=kI;async function kI(s){let e=await EI(yn.join(s,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(kI,"lastRun")});var nm=m((rN,Oc)=>{"use strict";var{withTempDir:DI}=Ti(),im=require("fs/promises"),Rc=require("path");Oc.exports.mkdir=MI;async function MI(s,e={}){let{tmpPrefix:t}=e,r=Rc.join(s,"tmp");await im.mkdir(r,{recursive:!0,owner:"inherit"});let i=`${r}${Rc.sep}${t||""}`;return im.mkdtemp(i,{owner:"inherit"})}o(MI,"mktmpdir");Oc.exports.withTmp=$I;function $I(s,e,t){return t||(t=e,e={}),DI(Rc.join(s,"tmp"),t,e)}o($I,"withTmp")});var hm=m((nN,M)=>{"use strict";var Tt=Wd(),om=rp(),Ic=tm(),am=rm(),{clearMemoized:FI}=hr(),cm=nm(),En=ps();M.exports.index={};M.exports.index.compact=En.compact;M.exports.index.insert=En.insert;M.exports.ls=En.ls;M.exports.ls.stream=En.lsStream;M.exports.get=Tt;M.exports.get.byDigest=Tt.byDigest;M.exports.get.stream=Tt.stream;M.exports.get.stream.byDigest=Tt.stream.byDigest;M.exports.get.copy=Tt.copy;M.exports.get.copy.byDigest=Tt.copy.byDigest;M.exports.get.info=Tt.info;M.exports.get.hasContent=Tt.hasContent;M.exports.put=om;M.exports.put.stream=om.stream;M.exports.rm=Ic.entry;M.exports.rm.all=Ic.all;M.exports.rm.entry=M.exports.rm;M.exports.rm.content=Ic.content;M.exports.clearMemoized=FI;M.exports.tmp={};M.exports.tmp.mkdir=cm.mkdir;M.exports.tmp.withTmp=cm.withTmp;M.exports.verify=am;M.exports.verify.lastRun=am.lastRun});var Tc=m((oN,um)=>{"use strict";var qI=hs(),vc=class extends qI{static{o(this,"CachingMinipassPipeline")}#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}};um.exports=vc});var fm=m((cN,lm)=>{var{URL:UI,format:jI}=require("url"),HI={auth:!1,fragment:!1,search:!0,unicode:!1},zI=o(s=>{let e=new UI(s.url);return`make-fetch-happen:request-cache:${jI(e,HI)}`},"cacheKey");lm.exports=zI});var mm=m((uN,pm)=>{"use strict";function dm(s,e){for(let t in e)Object.defineProperty(s,t,{value:e[t],enumerable:!0,configurable:!0});return s}o(dm,"assign");function GI(s,e,t){if(!s||typeof s=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=void 0),e!=null&&(t.code=e);try{return dm(s,t)}catch{t.message=s.message,t.stack=s.stack;let i=o(function(){},"ErrClass");return i.prototype=Object.create(Object.getPrototypeOf(s)),dm(new i,t)}}o(GI,"createError");pm.exports=GI});var ym=m((fN,gm)=>{function ve(s,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(s)),this._timeouts=s,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(ve,"RetryOperation");gm.exports=ve;ve.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};ve.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};ve.prototype.retry=function(s){if(this._timeout&&clearTimeout(this._timeout),!s)return!1;var e=new Date().getTime();if(s&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(s);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&i.unref(),!0};ve.prototype.attempt=function(s,e){this._fn=s,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ve.prototype.try=function(s){this.attempt(s)};ve.prototype.start=function(s){this.attempt(s)};ve.prototype.start=ve.prototype.try;ve.prototype.errors=function(){return this._errors};ve.prototype.attempts=function(){return this._attempts};ve.prototype.mainError=function(){if(this._errors.length===0)return null;for(var s={},e=null,t=0,r=0;r<this._errors.length;r++){var i=this._errors[r],n=i.message,a=(s[n]||0)+1;s[n]=a,a>=t&&(e=i,t=a)}return e}});var Em=m(Wt=>{var VI=ym();Wt.operation=function(s){var e=Wt.timeouts(s);return new VI(e,{forever:s&&s.forever,unref:s&&s.unref,maxRetryTime:s&&s.maxRetryTime})};Wt.timeouts=function(s){if(s instanceof Array)return[].concat(s);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in s)e[t]=s[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],i=0;i<e.retries;i++)r.push(this.createTimeout(i,e));return s&&s.forever&&!r.length&&r.push(this.createTimeout(i,e)),r.sort(function(n,a){return n-a}),r};Wt.createTimeout=function(s,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,s));return r=Math.min(r,e.maxTimeout),r};Wt.wrap=function(s,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in s)typeof s[r]=="function"&&t.push(r)}for(var i=0;i<t.length;i++){var n=t[i],a=s[n];s[n]=o(function(h){var u=Wt.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(s,l)})},"retryWrapper").bind(s,a),s[n].options=e}}});var Sm=m((gN,wm)=>{wm.exports=Em()});var Rm=m((yN,bm)=>{"use strict";var WI=mm(),ZI=Sm(),KI=Object.prototype.hasOwnProperty;function _m(s){return s&&s.code==="EPROMISERETRY"&&KI.call(s,"retried")}o(_m,"isRetryError");function YI(s,e){var t,r;return typeof s=="object"&&typeof e=="function"&&(t=e,e=s,s=t),r=ZI.operation(e),new Promise(function(i,n){r.attempt(function(a){Promise.resolve().then(function(){return s(function(c){throw _m(c)&&(c=c.retried),WI(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(i,function(c){_m(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(YI,"promiseRetry");bm.exports=YI});var Im=m((wN,Om)=>{var XI=Symbol("proc-log.meta");Om.exports={META:XI,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...s){return process.emit("output","standard",...s)},"standard"),error:o(function(...s){return process.emit("output","error",...s)},"error"),buffer:o(function(...s){return process.emit("output","buffer",...s)},"buffer"),flush:o(function(...s){return process.emit("output","flush",...s)},"flush")},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:o(function(...s){return process.emit("log","error",...s)},"error"),notice:o(function(...s){return process.emit("log","notice",...s)},"notice"),warn:o(function(...s){return process.emit("log","warn",...s)},"warn"),info:o(function(...s){return process.emit("log","info",...s)},"info"),verbose:o(function(...s){return process.emit("log","verbose",...s)},"verbose"),http:o(function(...s){return process.emit("log","http",...s)},"http"),silly:o(function(...s){return process.emit("log","silly",...s)},"silly"),timing:o(function(...s){return process.emit("log","timing",...s)},"timing"),pause:o(function(){return process.emit("log","pause")},"pause"),resume:o(function(){return process.emit("log","resume")},"resume")},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:o(function(s,e){process.emit("time","start",s);function t(){return process.emit("time","end",s)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(s){return process.emit("time","end",s)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(s){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof s=="function"){let t=s();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...s){let e,t,r=new Promise((i,n)=>{e=i,t=n});return process.emit("input","read",e,t,...s),r},"read")}}});var Ac=m((_N,Tm)=>{"use strict";var{LRUCache:JI}=gs(),vm=require("dns"),wn=new JI({max:50}),QI=o(({family:s=0,hints:e=vm.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:i=300*1e3,lookup:n=vm.lookup})=>({hints:e,lookup:o((a,...c)=>{let h=c.pop(),u=c[0]??{},l={family:s,hints:e,all:t,verbatim:r,...typeof u=="number"?{family:u}:u},f=JSON.stringify({hostname:a,...l});if(wn.has(f)){let d=wn.get(f);return process.nextTick(h,null,...d)}n(a,l,(d,...p)=>d?h(d):(wn.set(f,p,{ttl:i}),h(null,...p)))},"lookup")}),"getOptions");Tm.exports={cache:wn,getOptions:QI}});var xc=m((RN,xm)=>{"use strict";var ev=Ac(),tv=o(s=>{let e=parseInt(s.family??"0",10),t=s.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:s.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...s,family:e,keepAlive:t,timeouts:{idle:s.timeout??0,connection:0,response:0,transfer:0,...s.timeouts},...ev.getOptions({family:e,...s.dns})};return delete r.timeout,r},"normalizeOptions"),Am=o(s=>{let e="",t=Object.entries(s).sort((r,i)=>r[0]-i[0]);for(let[r,i]of t)i==null?i="null":i instanceof URL?i=i.toString():typeof i=="object"&&(i=Am(i)),e+=`${r}:${i}:`;return e},"createKey"),sv=o(({secureEndpoint:s,...e})=>Am({secureEndpoint:!!s,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:s?!!e.rejectUnauthorized:!1,ca:s?e.ca:null,cert:s?e.cert:null,key:s?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy}),"cacheOptions");xm.exports={normalizeOptions:tv,cacheOptions:sv}});var Lr=m((IN,Cm)=>{"use strict";function Pr(){return o(function(){},"noop")}o(Pr,"debug");Pr.enabled=!1;Pr.names=[];Pr.skips=[];Pr.formatters={};Cm.exports=Pr});var Pm=m(le=>{"use strict";var rv=le&&le.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),iv=le&&le.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Bm=le&&le.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&rv(e,s,t);return iv(e,s),e};Object.defineProperty(le,"__esModule",{value:!0});le.req=le.json=le.toBuffer=void 0;var nv=Bm(require("http")),ov=Bm(require("https"));async function Nm(s){let e=0,t=[];for await(let r of s)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(Nm,"toBuffer");le.toBuffer=Nm;async function av(s){let t=(await Nm(s)).toString("utf8");try{return JSON.parse(t)}catch(r){let i=r;throw i.message+=` (input: ${t})`,i}}o(av,"json");le.json=av;function cv(s,e={}){let r=((typeof s=="string"?s:s.href).startsWith("https:")?ov:nv).request(s,e),i=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=i.then.bind(i),r}o(cv,"req");le.req=cv});var kr=m(Ee=>{"use strict";var km=Ee&&Ee.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),hv=Ee&&Ee.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Dm=Ee&&Ee.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&km(e,s,t);return hv(e,s),e},uv=Ee&&Ee.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&km(e,s,t)};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.Agent=void 0;var lv=Dm(require("net")),Lm=Dm(require("http")),fv=require("https");uv(Pm(),Ee);var We=Symbol("AgentBaseInternalState"),Cc=class extends Lm.Agent{static{o(this,"Agent")}constructor(e){super(e),this[We]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
19
+ `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new lv.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?fv.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(i),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,i)).then(c=>{if(this.decrementSockets(n,a),c instanceof Lm.Agent)try{return c.addRequest(e,i)}catch(h){return r(h)}this[We].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[We].currentSocket;if(this[We].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[We].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[We]&&(this[We].defaultPort=e)}get protocol(){return this[We].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[We]&&(this[We].protocol=e)}};Ee.Agent=Cc});var Fm=m(Te=>{"use strict";var dv=Te&&Te.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),pv=Te&&Te.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),$m=Te&&Te.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&dv(e,s,t);return pv(e,s),e},mv=Te&&Te.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Te,"__esModule",{value:!0});Te.HttpProxyAgent=void 0;var gv=$m(require("net")),yv=$m(require("tls")),Ev=mv(Lr()),wv=require("events"),Sv=kr(),Mm=require("url"),vs=(0,Ev.default)("http-proxy-agent"),Sn=class extends Sv.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new Mm.URL(e):e,this.proxyHeaders=t?.headers??{},vs("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?_v(t,"headers"):null,host:r,port:i}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,i=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${i}//${n}`,c=new Mm.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let h=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let u=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;h["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}h["Proxy-Connection"]||(h["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(h)){let l=h[u];l&&e.setHeader(u,l)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,i;vs("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(vs("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,i=r.indexOf(`\r
23
20
  \r
24
- `)+4,e.outputData[0].data=e._header+r.substring(i),ks("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(ks("Creating `tls.Socket`: %o",this.connectOpts),n=hT.connect(this.connectOpts)):(ks("Creating `net.Socket`: %o",this.connectOpts),n=cT.connect(this.connectOpts)),await(0,lT.once)(n,"connect"),n}};Bn.protocols=["http","https"];Be.HttpProxyAgent=Bn;function dT(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(dT,"omit")});var lg=m(Ds=>{"use strict";var pT=Ds&&Ds.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.parseProxyResponse=void 0;var mT=pT(Ur()),Nn=(0,mT.default)("https-proxy-agent:parse-proxy-response");function gT(s){return new Promise((e,t)=>{let r=0,i=[];function n(){let l=s.read();l?u(l):s.once("readable",n)}o(n,"read");function a(){s.removeListener("end",c),s.removeListener("error",h),s.removeListener("readable",n)}o(a,"cleanup");function c(){a(),Nn("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function h(l){a(),Nn("onerror %o",l),t(l)}o(h,"onerror");function u(l){i.push(l),r+=l.length;let f=Buffer.concat(i,r),d=f.indexOf(`\r
21
+ `)+4,e.outputData[0].data=e._header+r.substring(i),vs("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(vs("Creating `tls.Socket`: %o",this.connectOpts),n=yv.connect(this.connectOpts)):(vs("Creating `net.Socket`: %o",this.connectOpts),n=gv.connect(this.connectOpts)),await(0,wv.once)(n,"connect"),n}};Sn.protocols=["http","https"];Te.HttpProxyAgent=Sn;function _v(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(_v,"omit")});var qm=m(Ts=>{"use strict";var bv=Ts&&Ts.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.parseProxyResponse=void 0;var Rv=bv(Lr()),_n=(0,Rv.default)("https-proxy-agent:parse-proxy-response");function Ov(s){return new Promise((e,t)=>{let r=0,i=[];function n(){let l=s.read();l?u(l):s.once("readable",n)}o(n,"read");function a(){s.removeListener("end",c),s.removeListener("error",h),s.removeListener("readable",n)}o(a,"cleanup");function c(){a(),_n("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function h(l){a(),_n("onerror %o",l),t(l)}o(h,"onerror");function u(l){i.push(l),r+=l.length;let f=Buffer.concat(i,r),d=f.indexOf(`\r
25
22
  \r
26
- `);if(d===-1){Nn("have not received end of HTTP headers yet..."),n();return}let p=f.slice(0,d).toString("ascii").split(`\r
27
- `),y=p.shift();if(!y)return s.destroy(),t(new Error("No header received from proxy CONNECT response"));let g=y.split(" "),w=+g[1],S=g.slice(2).join(" "),I={};for(let T of p){if(!T)continue;let _=T.indexOf(":");if(_===-1)return s.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${T}"`));let O=T.slice(0,_).toLowerCase(),A=T.slice(_+1).trimStart(),P=I[O];typeof P=="string"?I[O]=[P,A]:Array.isArray(P)?P.push(A):I[O]=A}Nn("got proxy server response: %o %o",y,I),a(),e({connect:{statusCode:w,statusText:S,headers:I},buffered:f})}o(u,"ondata"),s.on("error",h),s.on("end",c),n()})}o(gT,"parseProxyResponse");Ds.parseProxyResponse=gT});var yg=m(Ne=>{"use strict";var yT=Ne&&Ne.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),ET=Ne&&Ne.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),mg=Ne&&Ne.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&yT(e,s,t);return ET(e,s),e},gg=Ne&&Ne.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.HttpsProxyAgent=void 0;var Pn=mg(require("net")),fg=mg(require("tls")),wT=gg(require("assert")),ST=gg(Ur()),_T=jr(),bT=require("url"),RT=lg(),Hr=(0,ST.default)("https-proxy-agent"),dg=o(s=>s.servername===void 0&&s.host&&!Pn.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost"),Ln=class extends _T.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new bT.URL(e):e,this.proxyHeaders=t?.headers??{},Hr("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?pg(t,"headers"):null,host:r,port:i}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let i;r.protocol==="https:"?(Hr("Creating `tls.Socket`: %o",this.connectOpts),i=fg.connect(dg(this.connectOpts))):(Hr("Creating `net.Socket`: %o",this.connectOpts),i=Pn.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=Pn.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
23
+ `);if(d===-1){_n("have not received end of HTTP headers yet..."),n();return}let p=f.slice(0,d).toString("ascii").split(`\r
24
+ `),g=p.shift();if(!g)return s.destroy(),t(new Error("No header received from proxy CONNECT response"));let y=g.split(" "),S=+y[1],w=y.slice(2).join(" "),T={};for(let v of p){if(!v)continue;let R=v.indexOf(":");if(R===-1)return s.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${v}"`));let I=v.slice(0,R).toLowerCase(),C=v.slice(R+1).trimStart(),P=T[I];typeof P=="string"?T[I]=[P,C]:Array.isArray(P)?P.push(C):T[I]=C}_n("got proxy server response: %o %o",g,T),a(),e({connect:{statusCode:S,statusText:w,headers:T},buffered:f})}o(u,"ondata"),s.on("error",h),s.on("end",c),n()})}o(Ov,"parseProxyResponse");Ts.parseProxyResponse=Ov});var Vm=m(Ae=>{"use strict";var Iv=Ae&&Ae.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),vv=Ae&&Ae.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),zm=Ae&&Ae.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Iv(e,s,t);return vv(e,s),e},Gm=Ae&&Ae.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.HttpsProxyAgent=void 0;var bn=zm(require("net")),Um=zm(require("tls")),Tv=Gm(require("assert")),Av=Gm(Lr()),xv=kr(),Cv=require("url"),Bv=qm(),Dr=(0,Av.default)("https-proxy-agent"),jm=o(s=>s.servername===void 0&&s.host&&!bn.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost"),Rn=class extends xv.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new Cv.URL(e):e,this.proxyHeaders=t?.headers??{},Dr("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?Hm(t,"headers"):null,host:r,port:i}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let i;r.protocol==="https:"?(Dr("Creating `tls.Socket`: %o",this.connectOpts),i=Um.connect(jm(this.connectOpts))):(Dr("Creating `net.Socket`: %o",this.connectOpts),i=bn.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=bn.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
28
25
  `;if(r.username||r.password){let d=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;n["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}n.Host=`${a}:${t.port}`,n["Proxy-Connection"]||(n["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(n))c+=`${d}: ${n[d]}\r
29
- `;let h=(0,RT.parseProxyResponse)(i);i.write(`${c}\r
30
- `);let{connect:u,buffered:l}=await h;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",OT),t.secureEndpoint?(Hr("Upgrading socket connection to TLS"),fg.connect({...pg(dg(t),"host","path","port"),socket:i})):i;i.destroy();let f=new Pn.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{Hr("Replaying proxy buffer for failed request"),(0,wT.default)(d.listenerCount("data")>0),d.push(l),d.push(null)}),f}};Ln.protocols=["http","https"];Ne.HttpsProxyAgent=Ln;function OT(s){s.resume()}o(OT,"resume");function pg(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(pg,"omit")});var _g=m(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});var Eg=require("buffer"),es={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};wt.ERRORS=es;function vT(s){if(!Eg.Buffer.isEncoding(s))throw new Error(es.INVALID_ENCODING)}o(vT,"checkEncoding");wt.checkEncoding=vT;function wg(s){return typeof s=="number"&&isFinite(s)&&AT(s)}o(wg,"isFiniteInteger");wt.isFiniteInteger=wg;function Sg(s,e){if(typeof s=="number"){if(!wg(s)||s<0)throw new Error(e?es.INVALID_OFFSET:es.INVALID_LENGTH)}else throw new Error(e?es.INVALID_OFFSET_NON_NUMBER:es.INVALID_LENGTH_NON_NUMBER)}o(Sg,"checkOffsetOrLengthValue");function IT(s){Sg(s,!1)}o(IT,"checkLengthValue");wt.checkLengthValue=IT;function TT(s){Sg(s,!0)}o(TT,"checkOffsetValue");wt.checkOffsetValue=TT;function CT(s,e){if(s<0||s>e.length)throw new Error(es.INVALID_TARGET_OFFSET)}o(CT,"checkTargetOffset");wt.checkTargetOffset=CT;function AT(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}o(AT,"isInteger");function xT(s){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof Eg.Buffer.prototype[s]>"u")throw new Error(`Platform does not support Buffer.prototype.${s}.`)}o(xT,"bigIntAndBufferInt64Check");wt.bigIntAndBufferInt64Check=xT});var Rg=m(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var x=_g(),bg=4096,BT="utf8",Vc=class s{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=BT,this._writeOffset=0,this._readOffset=0,s.isSmartBufferOptions(e))if(e.encoding&&(x.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(x.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(bg);else{if(typeof e<"u")throw new Error(x.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(bg)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return x.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return x.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return x.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return x.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(x.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&x.checkEncoding(t);let i=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,i}insertString(e,t,r){return x.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&x.checkEncoding(e);let t=this.length;for(let i=this._readOffset;i<this.length;i++)if(this._buff[i]===0){t=i;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return x.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&x.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),i=this._buff.slice(this._readOffset,r);return this._readOffset=r,i}insertBuffer(e,t){return x.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return x.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&x.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){x.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return x.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,i){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(x.checkEncoding(r),a=r),typeof i=="string"&&(x.checkEncoding(i),a=i);let c=Buffer.byteLength(e,a);return t?this.ensureInsertable(c,n):this._ensureWriteable(c,n),this._buff.write(e,n,c,a),t?this._writeOffset+=c:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let i=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,i):this._ensureWriteable(e.length,i),e.copy(this._buff,i),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,i+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(x.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(x.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){x.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,i=t*3/2+1;i<e&&(i=e),this._buff=Buffer.allocUnsafe(i),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let i=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),i}_insertNumberValue(e,t,r,i){return x.checkOffsetValue(i),this.ensureInsertable(t,i),e.call(this._buff,r,i),this._writeOffset+=t,this}_writeNumberValue(e,t,r,i){if(typeof i=="number"){if(i<0)throw new Error(x.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);x.checkOffsetValue(i)}let n=typeof i=="number"?i:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof i=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Wc.SmartBuffer=Vc});var Zc=m(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.SOCKS5_NO_ACCEPTABLE_AUTH=M.SOCKS5_CUSTOM_AUTH_END=M.SOCKS5_CUSTOM_AUTH_START=M.SOCKS_INCOMING_PACKET_SIZES=M.SocksClientState=M.Socks5Response=M.Socks5HostType=M.Socks5Auth=M.Socks4Response=M.SocksCommand=M.ERRORS=M.DEFAULT_TIMEOUT=void 0;var NT=3e4;M.DEFAULT_TIMEOUT=NT;var PT={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};M.ERRORS=PT;var LT={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(s=>s+7,"Socks5ResponseHostname"),Socks4Response:8};M.SOCKS_INCOMING_PACKET_SIZES=LT;var Og;(function(s){s[s.connect=1]="connect",s[s.bind=2]="bind",s[s.associate=3]="associate"})(Og||(M.SocksCommand=Og={}));var vg;(function(s){s[s.Granted=90]="Granted",s[s.Failed=91]="Failed",s[s.Rejected=92]="Rejected",s[s.RejectedIdent=93]="RejectedIdent"})(vg||(M.Socks4Response=vg={}));var Ig;(function(s){s[s.NoAuth=0]="NoAuth",s[s.GSSApi=1]="GSSApi",s[s.UserPass=2]="UserPass"})(Ig||(M.Socks5Auth=Ig={}));var kT=128;M.SOCKS5_CUSTOM_AUTH_START=kT;var DT=254;M.SOCKS5_CUSTOM_AUTH_END=DT;var FT=255;M.SOCKS5_NO_ACCEPTABLE_AUTH=FT;var Tg;(function(s){s[s.Granted=0]="Granted",s[s.Failure=1]="Failure",s[s.NotAllowed=2]="NotAllowed",s[s.NetworkUnreachable=3]="NetworkUnreachable",s[s.HostUnreachable=4]="HostUnreachable",s[s.ConnectionRefused=5]="ConnectionRefused",s[s.TTLExpired=6]="TTLExpired",s[s.CommandNotSupported=7]="CommandNotSupported",s[s.AddressNotSupported=8]="AddressNotSupported"})(Tg||(M.Socks5Response=Tg={}));var Cg;(function(s){s[s.IPv4=1]="IPv4",s[s.Hostname=3]="Hostname",s[s.IPv6=4]="IPv6"})(Cg||(M.Socks5HostType=Cg={}));var Ag;(function(s){s[s.Created=0]="Created",s[s.Connecting=1]="Connecting",s[s.Connected=2]="Connected",s[s.SentInitialHandshake=3]="SentInitialHandshake",s[s.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",s[s.SentAuthentication=5]="SentAuthentication",s[s.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",s[s.SentFinalHandshake=7]="SentFinalHandshake",s[s.ReceivedFinalResponse=8]="ReceivedFinalResponse",s[s.BoundWaitingForConnection=9]="BoundWaitingForConnection",s[s.Established=10]="Established",s[s.Disconnected=11]="Disconnected",s[s.Error=99]="Error"})(Ag||(M.SocksClientState=Ag={}))});var Yc=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.shuffleArray=Fs.SocksClientError=void 0;var Kc=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};Fs.SocksClientError=Kc;function MT(s){for(let e=s.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[s[e],s[t]]=[s[t],s[e]]}}o(MT,"shuffleArray");Fs.shuffleArray=MT});var kn=m(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.isInSubnet=$T;ts.isCorrect=qT;ts.numberToPaddedHex=xg;ts.stringToPaddedHex=UT;ts.testBit=jT;function $T(s){return this.subnetMask<s.subnetMask?!1:this.mask(s.subnetMask)===s.mask()}o($T,"isInSubnet");function qT(s){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===s&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(qT,"isCorrect");function xg(s){return s.toString(16).padStart(2,"0")}o(xg,"numberToPaddedHex");function UT(s){return xg(parseInt(s,10))}o(UT,"stringToPaddedHex");function jT(s,e){let{length:t}=s;if(e>t)return!1;let r=t-e;return s.substring(r,r+1)==="1"}o(jT,"testBit")});var Xc=m(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.RE_SUBNET_STRING=Je.RE_ADDRESS=Je.GROUPS=Je.BITS=void 0;Je.BITS=32;Je.GROUPS=4;Je.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Je.RE_SUBNET_STRING=/\/\d{1,2}$/});var Fn=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.AddressError=void 0;var Jc=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};Dn.AddressError=Jc});var eh=m(Qe=>{"use strict";var HT=Qe&&Qe.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),zT=Qe&&Qe.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Ng=Qe&&Qe.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&HT(e,s,t);return zT(e,s),e};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Address4=void 0;var Ms=Ng(kn()),$e=Ng(Xc()),Bg=Fn(),Qc=class s{static{o(this,"Address4")}constructor(e){this.groups=$e.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Ms.isCorrect($e.BITS),this.isInSubnet=Ms.isInSubnet,this.address=e;let t=$e.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>$e.BITS)throw new Bg.AddressError("Invalid subnet mask.");e=e.replace($e.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new s(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match($e.RE_ADDRESS))throw new Bg.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],i;for(i=0;i<8;i+=2){let n=t.slice(i,i+2);r.push(parseInt(n,16))}return new s(r.join("."))}static fromInteger(e){return s.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new s(r)}toHex(){return this.parsedAddress.map(e=>Ms.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<$e.GROUPS;t+=2)e.push(`${Ms.stringToPaddedHex(this.parsedAddress[t])}${Ms.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>Ms.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat($e.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat($e.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return s.fromHex(e.toString(16))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(new s("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart($e.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace($e.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(".")}</span>`)}};Qe.Address4=Qc});var th=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.RE_URL_WITH_PORT=U.RE_URL=U.RE_ZONE_STRING=U.RE_SUBNET_STRING=U.RE_BAD_ADDRESS=U.RE_BAD_CHARACTERS=U.TYPES=U.SCOPES=U.GROUPS=U.BITS=void 0;U.BITS=128;U.GROUPS=8;U.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};U.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};U.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;U.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;U.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;U.RE_ZONE_STRING=/%.*$/;U.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;U.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var sh=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.spanAllZeroes=Pg;$s.spanAll=GT;$s.spanLeadingZeroes=VT;$s.simpleGroup=WT;function Pg(s){return s.replace(/(0+)/g,'<span class="zero">$1</span>')}o(Pg,"spanAllZeroes");function GT(s,e=0){return s.split("").map((r,i)=>`<span class="digit value-${r} position-${i+e}">${Pg(r)}</span>`).join("")}o(GT,"spanAll");function Lg(s){return s.replace(/^(0+)/,'<span class="zero">$1</span>')}o(Lg,"spanLeadingZeroesSimple");function VT(s){return s.split(":").map(t=>Lg(t)).join(":")}o(VT,"spanLeadingZeroes");function WT(s,e=0){return s.split(":").map((r,i)=>/group-v4/.test(r)?r:`<span class="hover-group group-${i+e}">${Lg(r)}</span>`)}o(WT,"simpleGroup")});var kg=m(ge=>{"use strict";var ZT=ge&&ge.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),KT=ge&&ge.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),YT=ge&&ge.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&ZT(e,s,t);return KT(e,s),e};Object.defineProperty(ge,"__esModule",{value:!0});ge.ADDRESS_BOUNDARY=void 0;ge.groupPossibilities=$n;ge.padGroup=Mn;ge.simpleRegularExpression=JT;ge.possibleElisions=QT;var XT=YT(th());function $n(s){return`(${s.join("|")})`}o($n,"groupPossibilities");function Mn(s){return s.length<4?`0{0,${4-s.length}}${s}`:s}o(Mn,"padGroup");ge.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function JT(s){let e=[];s.forEach((r,i)=>{parseInt(r,16)===0&&e.push(i)});let t=e.map(r=>s.map((i,n)=>{if(n===r){let a=n===0||n===XT.GROUPS-1?":":"";return $n([Mn(i),a])}return Mn(i)}).join(":"));return t.push(s.map(Mn).join(":")),$n(t)}o(JT,"simpleRegularExpression");function QT(s,e,t){let r=e?"":":",i=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${s-1}}`),n.push(`(0{1,4}:){1,${s-1}}${i}`),n.push(`(0{1,4}:){${s-1}}0{1,4}`);for(let a=1;a<s-1;a++)for(let c=1;c<s-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${s-c-a-1}}0{1,4}`);return $n(n)}o(QT,"possibleElisions")});var $g=m(et=>{"use strict";var eC=et&&et.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),tC=et&&et.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),jn=et&&et.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&eC(e,s,t);return tC(e,s),e};Object.defineProperty(et,"__esModule",{value:!0});et.Address6=void 0;var Dg=jn(kn()),rh=jn(Xc()),$=jn(th()),ih=jn(sh()),ss=eh(),rs=kg(),St=Fn(),qn=kn();function Un(s){if(!s)throw new Error("Assertion failed.")}o(Un,"assert");function sC(s){let e=/(\d+)(\d{3})/;for(;e.test(s);)s=s.replace(e,"$1,$2");return s}o(sC,"addCommas");function rC(s){return s=s.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),s=s.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),s}o(rC,"spanLeadingZeroes4");function iC(s,e){let t=[],r=[],i;for(i=0;i<s.length;i++)i<e[0]?t.push(s[i]):i>e[1]&&r.push(s[i]);return t.concat(["compact"]).concat(r)}o(iC,"compact");function Fg(s){return parseInt(s,16).toString(16).padStart(4,"0")}o(Fg,"paddedHex");function Mg(s){return s&255}o(Mg,"unsignByte");var nh=class s{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=Dg.isInSubnet,this.isCorrect=Dg.isCorrect($.BITS),t===void 0?this.groups=$.GROUPS:this.groups=t,this.address=e;let r=$.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>$.BITS)throw new St.AddressError("Invalid subnet mask.");e=e.replace($.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new St.AddressError("Invalid subnet mask.");let i=$.RE_ZONE_STRING.exec(e);i&&(this.zone=i[0],e=e.replace($.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new s(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],i;for(i=0;i<$.GROUPS;i++)r.push(t.slice(i*4,(i+1)*4));return new s(r.join(":"))}static fromURL(e){let t,r=null,i;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(i=$.RE_URL_WITH_PORT.exec(e),i===null)return{error:"failed to parse address with port",address:null,port:null};t=i[1],r=i[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),i=$.RE_URL.exec(e),i===null)return{error:"failed to parse address from URL",address:null,port:null};t=i[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new s(t),port:r}}static fromAddress4(e){let t=new ss.Address4(e),r=$.BITS-(rh.BITS-t.subnetMask);return new s(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new St.AddressError("Invalid 'ip6.arpa' form.");let i=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;i.splice(a,0,":")}return t=i.join(""),new s(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=$.BITS-this.subnetMask,r=Math.abs(e-$.BITS),i=t-r;return i<0?"0":sC((BigInt("2")**BigInt(i)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat($.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat($.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}getScope(){let e=$.SCOPES[parseInt(this.getBits(12,16).toString(10),10)];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys($.TYPES))if(this.isInSubnet(new s(e)))return $.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,$.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,i=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&i.push([e-r,e-1]),r=0)}r>1&&i.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let n=i.map(c=>c[1]-c[0]+1);if(i.length>0){let c=n.indexOf(Math.max(...n));t=iC(this.parsedAddress,i[c])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(":");return a=a.replace(/^compact$/,"::"),a=a.replace(/(^compact)|(compact$)/,":"),a=a.replace(/compact/,""),a}binaryZeroPad(){return this.bigInt().toString(2).padStart($.BITS,"0")}parse4in6(e){let t=e.split(":"),i=t.slice(-1)[0].match(rh.RE_ADDRESS);if(i){this.parsedAddress4=i[0],this.address4=new ss.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new St.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(rh.RE_ADDRESS,this.address4.parsedAddress.map(rC).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match($.RE_BAD_CHARACTERS);if(t)throw new St.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace($.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match($.RE_BAD_ADDRESS);if(r)throw new St.AddressError(`Address failed regex: ${r.join("")}`,e.replace($.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let i=[],n=e.split("::");if(n.length===2){let a=n[0].split(":"),c=n[1].split(":");a.length===1&&a[0]===""&&(a=[]),c.length===1&&c[0]===""&&(c=[]);let h=this.groups-(a.length+c.length);if(!h)throw new St.AddressError("Error parsing groups");this.elidedGroups=h,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,i=i.concat(a);for(let u=0;u<h;u++)i.push("0");i=i.concat(c)}else if(n.length===1)i=e.split(":"),this.elidedGroups=0;else throw new St.AddressError("Too many :: groups found");if(i=i.map(a=>parseInt(a,16).toString(16)),i.length!==this.groups)throw new St.AddressError("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(Fg).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(Fg).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return ss.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new s(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(r)||(i=":"),r+i+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),i=ss.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=ss.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),h=(0,qn.testBit)(c,15),u=(0,qn.testBit)(c,14),l=(0,qn.testBit)(c,8),f=(0,qn.testBit)(c,9),d=BigInt(`0b${c.slice(2,6)+c.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:i.address,client4:a.address,flags:c,coneNat:h,microsoft:{reserved:u,universalLocal:f,groupIndividual:l,nonce:d},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=ss.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new s(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,i=[];for(let n=0,a=r.length;n<a;n+=2)i.push(parseInt(r.substring(n,n+2),16));return i}toUnsignedByteArray(){return this.toByteArray().map(Mg)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(Mg))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),i=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=i*BigInt(e[n].toString(10)),i*=t;return s.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new s("2001::/32"))}is6to4(){return this.isInSubnet(new s("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return ih.simpleGroup(this.address).join(":");Un(typeof this.elidedGroups=="number"),Un(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...ih.simpleGroup(t)):e.push("");let i=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)i.push(`group-${n}`);return e.push(`<span class="${i.join(" ")}"></span>`),r.length?e.push(...ih.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Un(this.address4 instanceof ss.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new s(this.correctForm());if(r.elidedGroups===0)t.push((0,rs.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===$.GROUPS)t.push((0,rs.possibleElisions)($.GROUPS));else{let i=r.address.split("::");i[0].length&&t.push((0,rs.simpleRegularExpression)(i[0].split(":"))),Un(typeof r.elidedGroups=="number"),t.push((0,rs.possibleElisions)(r.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&t.push((0,rs.simpleRegularExpression)(i[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",rs.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",rs.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};et.Address6=nh});var oh=m(ie=>{"use strict";var nC=ie&&ie.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),oC=ie&&ie.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),aC=ie&&ie.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&nC(e,s,t);return oC(e,s),e};Object.defineProperty(ie,"__esModule",{value:!0});ie.v6=ie.AddressError=ie.Address6=ie.Address4=void 0;var cC=eh();Object.defineProperty(ie,"Address4",{enumerable:!0,get:o(function(){return cC.Address4},"get")});var hC=$g();Object.defineProperty(ie,"Address6",{enumerable:!0,get:o(function(){return hC.Address6},"get")});var uC=Fn();Object.defineProperty(ie,"AddressError",{enumerable:!0,get:o(function(){return uC.AddressError},"get")});var lC=aC(sh());ie.v6={helpers:lC}});var Gg=m(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ipToBuffer=Pe.int32ToIpv4=Pe.ipv4ToInt32=Pe.validateSocksClientChainOptions=Pe.validateSocksClientOptions=void 0;var he=Yc(),X=Zc(),fC=require("stream"),ah=oh(),qg=require("net");function dC(s,e=["connect","bind","associate"]){if(!X.SocksCommand[s.command])throw new he.SocksClientError(X.ERRORS.InvalidSocksCommand,s);if(e.indexOf(s.command)===-1)throw new he.SocksClientError(X.ERRORS.InvalidSocksCommandForOperation,s);if(!jg(s.destination))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsDestination,s);if(!Hg(s.proxy))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsProxy,s);if(Ug(s.proxy,s),s.timeout&&!zg(s.timeout))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsTimeout,s);if(s.existing_socket&&!(s.existing_socket instanceof fC.Duplex))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsExistingSocket,s)}o(dC,"validateSocksClientOptions");Pe.validateSocksClientOptions=dC;function pC(s){if(s.command!=="connect")throw new he.SocksClientError(X.ERRORS.InvalidSocksCommandChain,s);if(!jg(s.destination))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsDestination,s);if(!(s.proxies&&Array.isArray(s.proxies)&&s.proxies.length>=2))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsProxiesLength,s);if(s.proxies.forEach(e=>{if(!Hg(e))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsProxy,s);Ug(e,s)}),s.timeout&&!zg(s.timeout))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsTimeout,s)}o(pC,"validateSocksClientChainOptions");Pe.validateSocksClientChainOptions=pC;function Ug(s,e){if(s.custom_auth_method!==void 0){if(s.custom_auth_method<X.SOCKS5_CUSTOM_AUTH_START||s.custom_auth_method>X.SOCKS5_CUSTOM_AUTH_END)throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(s.custom_auth_request_handler===void 0||typeof s.custom_auth_request_handler!="function")throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_size===void 0)throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_handler===void 0||typeof s.custom_auth_response_handler!="function")throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(Ug,"validateCustomProxyAuth");function jg(s){return s&&typeof s.host=="string"&&Buffer.byteLength(s.host)<256&&typeof s.port=="number"&&s.port>=0&&s.port<=65535}o(jg,"isValidSocksRemoteHost");function Hg(s){return s&&(typeof s.host=="string"||typeof s.ipaddress=="string")&&typeof s.port=="number"&&s.port>=0&&s.port<=65535&&(s.type===4||s.type===5)}o(Hg,"isValidSocksProxy");function zg(s){return typeof s=="number"&&s>0}o(zg,"isValidTimeoutValue");function mC(s){return new ah.Address4(s).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(mC,"ipv4ToInt32");Pe.ipv4ToInt32=mC;function gC(s){let e=s>>>24&255,t=s>>>16&255,r=s>>>8&255,i=s&255;return[e,t,r,i].join(".")}o(gC,"int32ToIpv4");Pe.int32ToIpv4=gC;function yC(s){if(qg.isIPv4(s)){let e=new ah.Address4(s);return Buffer.from(e.toArray())}else if(qg.isIPv6(s)){let e=new ah.Address6(s);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(yC,"ipToBuffer");Pe.ipToBuffer=yC});var Vg=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ReceiveBuffer=void 0;var ch=class{static{o(this,"ReceiveBuffer")}constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};Hn.ReceiveBuffer=ch});var Wg=m(Pt=>{"use strict";var qs=Pt&&Pt.__awaiter||function(s,e,t,r){function i(n){return n instanceof t?n:new t(function(a){a(n)})}return o(i,"adopt"),new(t||(t=Promise))(function(n,a){function c(l){try{u(r.next(l))}catch(f){a(f)}}o(c,"fulfilled");function h(l){try{u(r.throw(l))}catch(f){a(f)}}o(h,"rejected");function u(l){l.done?n(l.value):i(l.value).then(c,h)}o(u,"step"),u((r=r.apply(s,e||[])).next())})};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SocksClientError=Pt.SocksClient=void 0;var EC=require("events"),Us=require("net"),ye=Rg(),E=Zc(),Re=Gg(),wC=Vg(),uh=Yc();Object.defineProperty(Pt,"SocksClientError",{enumerable:!0,get:o(function(){return uh.SocksClientError},"get")});var hh=oh(),lh=class s extends EC.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,Re.validateSocksClientOptions)(e),this.setState(E.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,i)=>{try{(0,Re.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):i(a)}let n=new s(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):i(a)})})}static createConnectionChain(e,t){return new Promise((r,i)=>qs(this,void 0,void 0,function*(){try{(0,Re.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):i(n)}e.randomizeChain&&(0,uh.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],h=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},u=yield s.createConnection({command:"connect",proxy:c,destination:h,existing_socket:n});n=n||u.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):i(n)}}))}static createUDPFrame(e){let t=new ye.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Us.isIPv4(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv4),t.writeUInt32BE((0,Re.ipv4ToInt32)(e.remoteHost.host))):Us.isIPv6(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv6),t.writeBuffer((0,Re.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(E.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=ye.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),i=t.readUInt8(),n;i===E.Socks5HostType.IPv4?n=(0,Re.int32ToIpv4)(t.readUInt32BE()):i===E.Socks5HostType.IPv6?n=hh.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==E.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||E.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Us.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(E.SocksClientState.Connecting),this.receiveBuffer=new wC.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let i=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",i)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.BoundWaitingForConnection&&this.closeSocket(E.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(E.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(E.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===E.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===E.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===E.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===E.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(E.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(E.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==E.SocksClientState.Error&&(this.setState(E.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new uh.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new ye.SmartBuffer;t.writeUInt8(4),t.writeUInt8(E.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Us.isIPv4(this.options.destination.host)?(t.writeBuffer((0,Re.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedConnection} - (${E.Socks4Response[e[1]]})`);else if(E.SocksCommand[this.options.command]===E.SocksCommand.bind){let t=ye.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Re.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(E.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${E.Socks4Response[e[1]]})`);else{let t=ye.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Re.int32ToIpv4)(t.readUInt32BE())};this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new ye.SmartBuffer,t=[E.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(E.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(E.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===E.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===E.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=E.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===E.Socks5Auth.UserPass?(this.socks5ChosenAuthType=E.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new ye.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(E.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return qs(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(E.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return qs(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return qs(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return qs(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return qs(this,void 0,void 0,function*(){this.setState(E.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===E.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===E.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(E.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new ye.SmartBuffer;e.writeUInt8(5),e.writeUInt8(E.SocksCommand[this.options.command]),e.writeUInt8(0),Us.isIPv4(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv4),e.writeBuffer((0,Re.ipToBuffer)(this.options.destination.host))):Us.isIPv6(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv6),e.writeBuffer((0,Re.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(E.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,Re.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:hh.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.ReceivedFinalResponse),E.SocksCommand[this.options.command]===E.SocksCommand.connect?(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.bind?(this.setState(E.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.associate&&(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,Re.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:hh.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Pt.SocksClient=lh});var Zg=m(is=>{"use strict";var SC=is&&is.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),_C=is&&is.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&SC(e,s,t)};Object.defineProperty(is,"__esModule",{value:!0});_C(Wg(),is)});var Kg=m(Le=>{"use strict";var bC=Le&&Le.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),RC=Le&&Le.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),fh=Le&&Le.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&bC(e,s,t);return RC(e,s),e},OC=Le&&Le.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Le,"__esModule",{value:!0});Le.SocksProxyAgent=void 0;var vC=Zg(),IC=jr(),TC=OC(Ur()),CC=fh(require("dns")),AC=fh(require("net")),xC=fh(require("tls")),BC=require("url"),zn=(0,TC.default)("socks-proxy-agent"),NC=o(s=>s.servername===void 0&&s.host&&!AC.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost");function PC(s){let e=!1,t=5,r=s.hostname,i=parseInt(s.port,10)||1080;switch(s.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(s.protocol)}`)}let n={host:r,port:i,type:t};return s.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(s.username),enumerable:!1}),s.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(s.password),enumerable:!1}),{lookup:e,proxy:n}}o(PC,"parseSocksURL");var Gn=class extends IC.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new BC.URL(e):e,{proxy:i,lookup:n}=PC(r);this.shouldLookup=n,this.proxy=i,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:i,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:h=CC.lookup}=t;r&&(a=await new Promise((d,p)=>{h(a,{},(y,g)=>{y?p(y):d(g)})}));let u={proxy:i,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},l=o(d=>{e.destroy(),f.destroy(),d&&d.destroy()},"cleanup");zn("Creating socks proxy connection: %o",u);let{socket:f}=await vC.SocksClient.createConnection(u);if(zn("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>l())),t.secureEndpoint){zn("Upgrading socket connection to TLS");let d=xC.connect({...LC(NC(t),"host","path","port"),socket:f});return d.once("error",p=>{zn("Socket TLS error",p.message),l(d)}),d}return f}};Gn.protocols=["socks","socks4","socks4a","socks5","socks5h"];Le.SocksProxyAgent=Gn;function LC(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(LC,"omit")});var Eh=m((yL,Yg)=>{"use strict";var dh=class extends Error{static{o(this,"InvalidProxyProtocolError")}constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code="EINVALIDPROXY",this.proxy=e}},ph=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},mh=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},gh=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},yh=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};Yg.exports={InvalidProxyProtocolError:dh,ConnectionTimeoutError:ph,IdleTimeoutError:mh,ResponseTimeoutError:gh,TransferTimeoutError:yh}});var wh=m((wL,Jg)=>{"use strict";var{HttpProxyAgent:kC}=ug(),{HttpsProxyAgent:DC}=yg(),{SocksProxyAgent:Xg}=Kg(),{LRUCache:FC}=bs(),{InvalidProxyProtocolError:MC}=Eh(),$C=new FC({max:20}),qC=new Set(Xg.protocols),UC=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),zr=Object.entries(process.env).reduce((s,[e,t])=>(e=e.toLowerCase(),UC.has(e)&&(s[e]=t),s),{}),jC=o(s=>{s=new URL(s);let e=s.protocol.slice(0,-1);if(qC.has(e))return Xg;if(e==="https"||e==="http")return[kC,DC];throw new MC(s)},"getProxyAgent"),HC=o((s,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=s.hostname.split(".").reverse();return e.some(r=>{let i=r.split(".").filter(Boolean).reverse();if(!i.length)return!1;for(let n=0;n<i.length;n++)if(t[n]!==i[n])return!1;return!0})},"isNoProxy"),zC=o((s,{proxy:e,noProxy:t})=>(s=new URL(s),e||(e=s.protocol==="https:"?zr.https_proxy:zr.https_proxy||zr.http_proxy||zr.proxy),t||(t=zr.no_proxy),!e||HC(s,t)?null:new URL(e)),"getProxy");Jg.exports={getProxyAgent:jC,getProxy:zC,proxyCache:$C}});var ty=m((bL,ey)=>{"use strict";var GC=require("net"),VC=require("tls"),{once:Qg}=require("events"),WC=require("timers/promises"),{normalizeOptions:ZC,cacheOptions:KC}=qc(),{getProxy:YC,getProxyAgent:XC,proxyCache:Sh}=wh(),Vn=Eh(),{Agent:JC}=jr();ey.exports=class extends JC{static{o(this,"Agent")}#e;#t;#s;#r;#i;constructor(e={}){let{timeouts:t,proxy:r,noProxy:i,...n}=ZC(e);super(n),this.#e=n,this.#t=t,r&&(this.#s=new URL(r),this.#r=i,this.#i=XC(r))}get proxy(){return this.#s?{url:this.#s}:{}}#a(e){if(!this.#s)return;let t=YC(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#s,noProxy:this.#r});if(!t)return;let r=KC({...e,...this.#e,timeouts:this.#t,proxy:t});if(Sh.has(r))return Sh.get(r);let i=this.#i;Array.isArray(i)&&(i=this.isSecureEndpoint(e)?i[1]:i[0]);let n=new i(t,{...this.#e,socketOptions:{family:this.#e.family}});return Sh.set(r,n),n}async#l({promises:e,options:t,timeout:r},i=new AbortController){if(r){let a=WC.setTimeout(r,null,{signal:i.signal}).then(()=>{throw new Vn.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),i.abort()}catch(a){throw i.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let r,i=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#a(t);if(a){let l=Date.now();r=await this.#l({options:t,timeout:i,promises:[a.connect(e,t)]}),i&&(i=i-(Date.now()-l))}else r=(n?VC:GC).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:h}=c,u=r[n?"secureConnecting":"connecting"]?Qg(r,n?"secureConnect":"connect",{signal:h}):Promise.resolve();return await this.#l({options:t,timeout:i,promises:[u,Qg(r,"error",{signal:h}).then(l=>{throw l[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new Vn.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#a(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let i;e.once("finish",()=>{setTimeout(()=>{e.destroy(new Vn.ResponseTimeoutError(e,this.#s))},this.#t.response)}),e.once("response",()=>{clearTimeout(i)})}if(this.#t.transfer){let i;e.once("response",n=>{setTimeout(()=>{n.destroy(new Vn.TransferTimeoutError(e,this.#s))},this.#t.transfer),n.once("close",()=>{clearTimeout(i)})})}return super.addRequest(e,t)}}});var ny=m((OL,iy)=>{"use strict";var{LRUCache:QC}=bs(),{normalizeOptions:eA,cacheOptions:tA}=qc(),{getProxy:sA,proxyCache:sy}=wh(),ry=$c(),Wn=ty(),Gr=new QC({max:20}),rA=o((s,{agent:e,proxy:t,noProxy:r,...i}={})=>{if(e!=null)return e;s=new URL(s);let n=sA(s,{proxy:t,noProxy:r}),a={...eA(i),proxy:n},c=tA({...a,secureEndpoint:s.protocol==="https:"});if(Gr.has(c))return Gr.get(c);let h=new Wn(a);return Gr.set(c,h),h},"getAgent");iy.exports={getAgent:rA,Agent:Wn,HttpAgent:Wn,HttpsAgent:Wn,cache:{proxy:sy,agent:Gr,dns:ry.cache,clear:o(()=>{sy.clear(),Gr.clear(),ry.cache.clear()},"clear")}}});var oy=m((IL,iA)=>{iA.exports={name:"make-fetch-happen",version:"15.0.2",description:"Opinionated, caching, retrying fetch client",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",posttest:"npm run lint",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/make-fetch-happen.git"},keywords:["http","request","fetch","mean girls","caching","cache","subresource integrity"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/agent":"^4.0.0",cacache:"^20.0.1","http-cache-semantics":"^4.1.1",minipass:"^7.0.2","minipass-fetch":"^4.0.0","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4",negotiator:"^1.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",ssri:"^12.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",nock:"^13.2.4","safe-buffer":"^5.2.1","standard-version":"^9.3.2",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},tap:{color:1,files:"test/*.js","check-coverage":!0,timeout:60,"nyc-arg":["--exclude","tap-snapshots/**"]},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Kn=m((TL,cy)=>{var{Minipass:nA}=ee(),Zn=sr(),oA=Mm(),aA=Ot(),{log:ay}=qm(),cA=Mc(),{getAgent:hA}=ny(),_h=oy(),uA=`${_h.name}/${_h.version} (+https://npm.im/${_h.name})`,lA=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],fA=["request-timeout"],dA=o((s,e)=>{let t=hA(s.url,{...e,signal:void 0});s.headers.has("connection")||s.headers.set("connection",t?"keep-alive":"close"),s.headers.has("user-agent")||s.headers.set("user-agent",uA);let r={...e,agent:t,redirect:"manual"};return oA(async(i,n)=>{let a=new Zn.Request(s,r);try{let c=await Zn(a,r);if(r.integrity&&c.status===200){let l=aA.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new cA({events:["integrity","size"]},c.body,l);l.on("integrity",d=>f.emit("integrity",d)),l.on("size",d=>f.emit("size",d)),c=new Zn.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let h=nA.isStream(a.body);return a.method!=="POST"&&!h&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),ay.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),i(c)):c}catch(c){let h=c.code==="EPROMISERETRY"?c.retried.code:c.code,u=c.retried instanceof Zn.Response||lA.includes(h)&&fA.includes(c.type);if(a.method==="POST"||u)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),ay.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),i(c)}},e.retry).catch(i=>{if(i.status>=400&&i.type!=="system")return i;throw i})},"remoteFetch");cy.exports=dA});var py=m((AL,dy)=>{var{Request:hy,Response:bh}=sr(),{Minipass:uy}=ee(),pA=yi(),ns=Om(),mA=require("url"),gA=Mc(),yA=Qo(),Rh=Tm(),EA=Kn(),Vr=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),wA=["accept-charset","accept-encoding","accept-language","accept","cache-control"],fy=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],ly=o((s,e,t)=>{let r={time:Date.now(),url:s.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:s.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of wA)s.headers.has(a)&&(r.reqHeaders[a]=s.headers.get(a));let i=s.headers.get("host"),n=new mA.URL(s.url);if(i&&n.host!==i&&(r.reqHeaders.host=i),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let h of c)s.headers.has(h)&&(r.reqHeaders[h]=s.headers.get(h))}}for(let a of fy)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),Yn=Symbol("request"),Xn=Symbol("response"),Jn=Symbol("policy"),Oh=class s{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:i}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=Rh(t),this.options=i,this[Yn]=t,this[Xn]=r,this[Jn]=null}static async find(e,t){try{var r=await ns.index.compact(t.cachePath,Rh(e),(n,a)=>{let c=new s({entry:n,options:t}),h=new s({entry:a,options:t});return c.policy.satisfies(h.request)},{validateEntry:o(n=>n.metadata&&n.metadata.resHeaders&&n.metadata.resHeaders["content-encoding"]===null?!1:n.integrity===null?!!(n.metadata&&n.metadata.status):!0,"validateEntry")})}catch{return}if(t.cache==="reload")return;let i;for(let n of r){let a=new s({entry:n,options:t});if(a.policy.satisfies(e)){i=a;break}}return i}static async invalidate(e,t){let r=Rh(e);try{await ns.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[Yn]||(this[Yn]=new hy(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[Yn]}get response(){return this[Xn]||(this[Xn]=new bh(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[Xn]}get policy(){return this[Jn]||(this[Jn]=new yA({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[Jn]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:ly(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},i=null;if(this.response.status===200){let a,c,h=new Promise((l,f)=>{a=l,c=f}).catch(l=>{i.emit("error",l)});i=new gA({events:["integrity","size"]},new pA({flush(){return h}})),i.hasIntegrityEmitter=!0;let u=o(()=>{let l=new uy,f=ns.put.stream(this.options.cachePath,this.key,r);f.on("integrity",d=>i.emit("integrity",d)),f.on("size",d=>i.emit("size",d)),l.pipe(f),f.promise().then(a,c),i.unshift(l),i.unshift(this.response.body)},"onResume");i.once("resume",u),i.once("end",()=>i.removeListener("resume",u))}else await ns.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new bh(i,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let i;if(e==="HEAD"||[301,308].includes(this.response.status))i=this.response;else{let n=new uy,a={...this.policy.responseHeaders()},c=o(()=>{let h=ns.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});h.on("error",async u=>{h.pause(),u.code==="EINTEGRITY"&&await ns.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(u.code==="ENOENT"||u.code==="EINTEGRITY")&&await s.invalidate(this.request,this.options),n.emit("error",u),h.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),h.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),i=new bh(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return i.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),i.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),i.headers.set("x-local-cache-key",encodeURIComponent(this.key)),i.headers.set("x-local-cache-mode","stream"),i.headers.set("x-local-cache-status",r),i.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),i}async revalidate(e,t){let r=new hy(e,{headers:this.policy.revalidationHeaders(e)});try{var i=await EA(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,i)){let a=ly(e,i,t);for(let c of fy)!Vr(a.resHeaders,c)&&Vr(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let h=Vr(a.resHeaders,c),u=Vr(this.entry.metadata.resHeaders,c),l=Vr(this.policy.response.headers,c);!h&&u&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!l&&h&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await ns.index.insert(t.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:a})}catch{}return this.respond(e.method,t,"revalidated")}return new s({request:e,response:i,options:t}).store("updated")}};dy.exports=Oh});var yy=m((BL,gy)=>{var{NotCachedError:SA}=Yu(),vh=py(),_A=Kn(),my=o(async(s,e)=>{let t=await vh.find(s,e);if(!t){if(e.cache==="only-if-cached")throw new SA(s.url);let i=await _A(s,e);return new vh({request:s,response:i,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(s,e);let r=t.policy.needsRevalidation(s);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(s.method,e,r?"stale":"hit"):t.revalidate(s,e)},"cacheFetch");my.invalidate=async(s,e)=>{if(e.cachePath)return vh.invalidate(s,e)};gy.exports=my});var _y=m((PL,Sy)=>{"use strict";var{FetchError:Ih,Request:bA,isRedirect:RA}=sr(),Th=require("url"),OA=Qo(),Ey=yy(),vA=Kn(),IA=o((s,e,t)=>{if(!RA(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new Ih(`redirect mode is set to error: ${s.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new Ih(`redirect location header missing for: ${s.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(s.counter>=s.follow)throw new Ih(`maximum redirect reached at: ${s.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),TA=o((s,e,t)=>{let r={...t},i=e.headers.get("location"),n=new Th.URL(i,/^https?:/.test(i)?void 0:s.url);return new Th.URL(s.url).hostname!==n.hostname&&(s.headers.delete("authorization"),s.headers.delete("cookie")),(e.status===303||s.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,s.headers.delete("content-length")),r.headers={},s.headers.forEach((c,h)=>{r.headers[h]=c}),r.counter=++s.counter,{request:new bA(Th.format(n),r),options:r}},"getRedirect"),wy=o(async(s,e)=>{let t=OA.storable(s,e)?await Ey(s,e):await vA(s,e);if(!["GET","HEAD"].includes(s.method)&&t.status>=200&&t.status<=399&&await Ey.invalidate(s,e),!IA(s,t,e))return t;let r=TA(s,t,e);return wy(r.request,r.options)},"fetch");Sy.exports=wy});var{FetchError:CA,Headers:AA,Request:by,Response:xA}=sr(),BA=wu(),NA=_y(),Qn=o((s,e)=>{let t=BA(e),r=new by(s,t);return NA(r,t)},"makeFetchHappen");Qn.defaults=(s,e={},t=Qn)=>{typeof s=="object"&&(e=s,s=null);let r=o((i,n={})=>{let a=i||s,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(i,n={})=>Qn.defaults(i,n,r),r};module.exports=Qn;module.exports.FetchError=CA;module.exports.Headers=AA;module.exports.Request=by;module.exports.Response=xA;
26
+ `;let h=(0,Bv.parseProxyResponse)(i);i.write(`${c}\r
27
+ `);let{connect:u,buffered:l}=await h;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",Nv),t.secureEndpoint?(Dr("Upgrading socket connection to TLS"),Um.connect({...Hm(jm(t),"host","path","port"),socket:i})):i;i.destroy();let f=new bn.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{Dr("Replaying proxy buffer for failed request"),(0,Tv.default)(d.listenerCount("data")>0),d.push(l),d.push(null)}),f}};Rn.protocols=["http","https"];Ae.HttpsProxyAgent=Rn;function Nv(s){s.resume()}o(Nv,"resume");function Hm(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(Hm,"omit")});var Ym=m(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});var Wm=require("buffer"),Zt={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};mt.ERRORS=Zt;function Pv(s){if(!Wm.Buffer.isEncoding(s))throw new Error(Zt.INVALID_ENCODING)}o(Pv,"checkEncoding");mt.checkEncoding=Pv;function Zm(s){return typeof s=="number"&&isFinite(s)&&Mv(s)}o(Zm,"isFiniteInteger");mt.isFiniteInteger=Zm;function Km(s,e){if(typeof s=="number"){if(!Zm(s)||s<0)throw new Error(e?Zt.INVALID_OFFSET:Zt.INVALID_LENGTH)}else throw new Error(e?Zt.INVALID_OFFSET_NON_NUMBER:Zt.INVALID_LENGTH_NON_NUMBER)}o(Km,"checkOffsetOrLengthValue");function Lv(s){Km(s,!1)}o(Lv,"checkLengthValue");mt.checkLengthValue=Lv;function kv(s){Km(s,!0)}o(kv,"checkOffsetValue");mt.checkOffsetValue=kv;function Dv(s,e){if(s<0||s>e.length)throw new Error(Zt.INVALID_TARGET_OFFSET)}o(Dv,"checkTargetOffset");mt.checkTargetOffset=Dv;function Mv(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}o(Mv,"isInteger");function $v(s){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof Wm.Buffer.prototype[s]>"u")throw new Error(`Platform does not support Buffer.prototype.${s}.`)}o($v,"bigIntAndBufferInt64Check");mt.bigIntAndBufferInt64Check=$v});var Jm=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var x=Ym(),Xm=4096,Fv="utf8",Bc=class s{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=Fv,this._writeOffset=0,this._readOffset=0,s.isSmartBufferOptions(e))if(e.encoding&&(x.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(x.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(Xm);else{if(typeof e<"u")throw new Error(x.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(Xm)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return x.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return x.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return x.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return x.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(x.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&x.checkEncoding(t);let i=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,i}insertString(e,t,r){return x.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&x.checkEncoding(e);let t=this.length;for(let i=this._readOffset;i<this.length;i++)if(this._buff[i]===0){t=i;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return x.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&x.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),i=this._buff.slice(this._readOffset,r);return this._readOffset=r,i}insertBuffer(e,t){return x.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return x.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&x.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){x.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return x.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,i){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(x.checkEncoding(r),a=r),typeof i=="string"&&(x.checkEncoding(i),a=i);let c=Buffer.byteLength(e,a);return t?this.ensureInsertable(c,n):this._ensureWriteable(c,n),this._buff.write(e,n,c,a),t?this._writeOffset+=c:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let i=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,i):this._ensureWriteable(e.length,i),e.copy(this._buff,i),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,i+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(x.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(x.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){x.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,i=t*3/2+1;i<e&&(i=e),this._buff=Buffer.allocUnsafe(i),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let i=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),i}_insertNumberValue(e,t,r,i){return x.checkOffsetValue(i),this.ensureInsertable(t,i),e.call(this._buff,r,i),this._writeOffset+=t,this}_writeNumberValue(e,t,r,i){if(typeof i=="number"){if(i<0)throw new Error(x.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);x.checkOffsetValue(i)}let n=typeof i=="number"?i:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof i=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Nc.SmartBuffer=Bc});var Pc=m($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.SOCKS5_NO_ACCEPTABLE_AUTH=$.SOCKS5_CUSTOM_AUTH_END=$.SOCKS5_CUSTOM_AUTH_START=$.SOCKS_INCOMING_PACKET_SIZES=$.SocksClientState=$.Socks5Response=$.Socks5HostType=$.Socks5Auth=$.Socks4Response=$.SocksCommand=$.ERRORS=$.DEFAULT_TIMEOUT=void 0;var qv=3e4;$.DEFAULT_TIMEOUT=qv;var Uv={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};$.ERRORS=Uv;var jv={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(s=>s+7,"Socks5ResponseHostname"),Socks4Response:8};$.SOCKS_INCOMING_PACKET_SIZES=jv;var Qm;(function(s){s[s.connect=1]="connect",s[s.bind=2]="bind",s[s.associate=3]="associate"})(Qm||($.SocksCommand=Qm={}));var eg;(function(s){s[s.Granted=90]="Granted",s[s.Failed=91]="Failed",s[s.Rejected=92]="Rejected",s[s.RejectedIdent=93]="RejectedIdent"})(eg||($.Socks4Response=eg={}));var tg;(function(s){s[s.NoAuth=0]="NoAuth",s[s.GSSApi=1]="GSSApi",s[s.UserPass=2]="UserPass"})(tg||($.Socks5Auth=tg={}));var Hv=128;$.SOCKS5_CUSTOM_AUTH_START=Hv;var zv=254;$.SOCKS5_CUSTOM_AUTH_END=zv;var Gv=255;$.SOCKS5_NO_ACCEPTABLE_AUTH=Gv;var sg;(function(s){s[s.Granted=0]="Granted",s[s.Failure=1]="Failure",s[s.NotAllowed=2]="NotAllowed",s[s.NetworkUnreachable=3]="NetworkUnreachable",s[s.HostUnreachable=4]="HostUnreachable",s[s.ConnectionRefused=5]="ConnectionRefused",s[s.TTLExpired=6]="TTLExpired",s[s.CommandNotSupported=7]="CommandNotSupported",s[s.AddressNotSupported=8]="AddressNotSupported"})(sg||($.Socks5Response=sg={}));var rg;(function(s){s[s.IPv4=1]="IPv4",s[s.Hostname=3]="Hostname",s[s.IPv6=4]="IPv6"})(rg||($.Socks5HostType=rg={}));var ig;(function(s){s[s.Created=0]="Created",s[s.Connecting=1]="Connecting",s[s.Connected=2]="Connected",s[s.SentInitialHandshake=3]="SentInitialHandshake",s[s.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",s[s.SentAuthentication=5]="SentAuthentication",s[s.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",s[s.SentFinalHandshake=7]="SentFinalHandshake",s[s.ReceivedFinalResponse=8]="ReceivedFinalResponse",s[s.BoundWaitingForConnection=9]="BoundWaitingForConnection",s[s.Established=10]="Established",s[s.Disconnected=11]="Disconnected",s[s.Error=99]="Error"})(ig||($.SocksClientState=ig={}))});var kc=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.shuffleArray=As.SocksClientError=void 0;var Lc=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};As.SocksClientError=Lc;function Vv(s){for(let e=s.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[s[e],s[t]]=[s[t],s[e]]}}o(Vv,"shuffleArray");As.shuffleArray=Vv});var On=m(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.isInSubnet=Wv;Kt.isCorrect=Zv;Kt.numberToPaddedHex=ng;Kt.stringToPaddedHex=Kv;Kt.testBit=Yv;function Wv(s){return this.subnetMask<s.subnetMask?!1:this.mask(s.subnetMask)===s.mask()}o(Wv,"isInSubnet");function Zv(s){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===s&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(Zv,"isCorrect");function ng(s){return s.toString(16).padStart(2,"0")}o(ng,"numberToPaddedHex");function Kv(s){return ng(parseInt(s,10))}o(Kv,"stringToPaddedHex");function Yv(s,e){let{length:t}=s;if(e>t)return!1;let r=t-e;return s.substring(r,r+1)==="1"}o(Yv,"testBit")});var Dc=m(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.RE_SUBNET_STRING=Ze.RE_ADDRESS=Ze.GROUPS=Ze.BITS=void 0;Ze.BITS=32;Ze.GROUPS=4;Ze.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Ze.RE_SUBNET_STRING=/\/\d{1,2}$/});var vn=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AddressError=void 0;var Mc=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};In.AddressError=Mc});var Fc=m(Ke=>{"use strict";var Xv=Ke&&Ke.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),Jv=Ke&&Ke.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ag=Ke&&Ke.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Xv(e,s,t);return Jv(e,s),e};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Address4=void 0;var xs=ag(On()),ke=ag(Dc()),og=vn(),$c=class s{static{o(this,"Address4")}constructor(e){this.groups=ke.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=xs.isCorrect(ke.BITS),this.isInSubnet=xs.isInSubnet,this.address=e;let t=ke.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>ke.BITS)throw new og.AddressError("Invalid subnet mask.");e=e.replace(ke.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new s(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(ke.RE_ADDRESS))throw new og.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],i;for(i=0;i<8;i+=2){let n=t.slice(i,i+2);r.push(parseInt(n,16))}return new s(r.join("."))}static fromInteger(e){return s.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new s(r)}toHex(){return this.parsedAddress.map(e=>xs.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<ke.GROUPS;t+=2)e.push(`${xs.stringToPaddedHex(this.parsedAddress[t])}${xs.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>xs.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(ke.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(ke.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return s.fromHex(e.toString(16))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(new s("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(ke.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(ke.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(".")}</span>`)}};Ke.Address4=$c});var qc=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.RE_URL_WITH_PORT=U.RE_URL=U.RE_ZONE_STRING=U.RE_SUBNET_STRING=U.RE_BAD_ADDRESS=U.RE_BAD_CHARACTERS=U.TYPES=U.SCOPES=U.GROUPS=U.BITS=void 0;U.BITS=128;U.GROUPS=8;U.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};U.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};U.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;U.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;U.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;U.RE_ZONE_STRING=/%.*$/;U.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;U.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var Uc=m(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.spanAllZeroes=cg;Cs.spanAll=Qv;Cs.spanLeadingZeroes=eT;Cs.simpleGroup=tT;function cg(s){return s.replace(/(0+)/g,'<span class="zero">$1</span>')}o(cg,"spanAllZeroes");function Qv(s,e=0){return s.split("").map((r,i)=>`<span class="digit value-${r} position-${i+e}">${cg(r)}</span>`).join("")}o(Qv,"spanAll");function hg(s){return s.replace(/^(0+)/,'<span class="zero">$1</span>')}o(hg,"spanLeadingZeroesSimple");function eT(s){return s.split(":").map(t=>hg(t)).join(":")}o(eT,"spanLeadingZeroes");function tT(s,e=0){return s.split(":").map((r,i)=>/group-v4/.test(r)?r:`<span class="hover-group group-${i+e}">${hg(r)}</span>`)}o(tT,"simpleGroup")});var ug=m(fe=>{"use strict";var sT=fe&&fe.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),rT=fe&&fe.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),iT=fe&&fe.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&sT(e,s,t);return rT(e,s),e};Object.defineProperty(fe,"__esModule",{value:!0});fe.ADDRESS_BOUNDARY=void 0;fe.groupPossibilities=An;fe.padGroup=Tn;fe.simpleRegularExpression=oT;fe.possibleElisions=aT;var nT=iT(qc());function An(s){return`(${s.join("|")})`}o(An,"groupPossibilities");function Tn(s){return s.length<4?`0{0,${4-s.length}}${s}`:s}o(Tn,"padGroup");fe.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function oT(s){let e=[];s.forEach((r,i)=>{parseInt(r,16)===0&&e.push(i)});let t=e.map(r=>s.map((i,n)=>{if(n===r){let a=n===0||n===nT.GROUPS-1?":":"";return An([Tn(i),a])}return Tn(i)}).join(":"));return t.push(s.map(Tn).join(":")),An(t)}o(oT,"simpleRegularExpression");function aT(s,e,t){let r=e?"":":",i=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${s-1}}`),n.push(`(0{1,4}:){1,${s-1}}${i}`),n.push(`(0{1,4}:){${s-1}}0{1,4}`);for(let a=1;a<s-1;a++)for(let c=1;c<s-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${s-c-a-1}}0{1,4}`);return An(n)}o(aT,"possibleElisions")});var pg=m(Ye=>{"use strict";var cT=Ye&&Ye.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),hT=Ye&&Ye.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Bn=Ye&&Ye.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&cT(e,s,t);return hT(e,s),e};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Address6=void 0;var lg=Bn(On()),jc=Bn(Dc()),F=Bn(qc()),Hc=Bn(Uc()),Yt=Fc(),Xt=ug(),gt=vn(),xn=On();function Cn(s){if(!s)throw new Error("Assertion failed.")}o(Cn,"assert");function uT(s){let e=/(\d+)(\d{3})/;for(;e.test(s);)s=s.replace(e,"$1,$2");return s}o(uT,"addCommas");function lT(s){return s=s.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),s=s.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),s}o(lT,"spanLeadingZeroes4");function fT(s,e){let t=[],r=[],i;for(i=0;i<s.length;i++)i<e[0]?t.push(s[i]):i>e[1]&&r.push(s[i]);return t.concat(["compact"]).concat(r)}o(fT,"compact");function fg(s){return parseInt(s,16).toString(16).padStart(4,"0")}o(fg,"paddedHex");function dg(s){return s&255}o(dg,"unsignByte");var zc=class s{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=lg.isInSubnet,this.isCorrect=lg.isCorrect(F.BITS),t===void 0?this.groups=F.GROUPS:this.groups=t,this.address=e;let r=F.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>F.BITS)throw new gt.AddressError("Invalid subnet mask.");e=e.replace(F.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new gt.AddressError("Invalid subnet mask.");let i=F.RE_ZONE_STRING.exec(e);i&&(this.zone=i[0],e=e.replace(F.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new s(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],i;for(i=0;i<F.GROUPS;i++)r.push(t.slice(i*4,(i+1)*4));return new s(r.join(":"))}static fromURL(e){let t,r=null,i;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(i=F.RE_URL_WITH_PORT.exec(e),i===null)return{error:"failed to parse address with port",address:null,port:null};t=i[1],r=i[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),i=F.RE_URL.exec(e),i===null)return{error:"failed to parse address from URL",address:null,port:null};t=i[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new s(t),port:r}}static fromAddress4(e){let t=new Yt.Address4(e),r=F.BITS-(jc.BITS-t.subnetMask);return new s(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new gt.AddressError("Invalid 'ip6.arpa' form.");let i=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;i.splice(a,0,":")}return t=i.join(""),new s(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=F.BITS-this.subnetMask,r=Math.abs(e-F.BITS),i=t-r;return i<0?"0":uT((BigInt("2")**BigInt(i)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(F.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(F.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}getScope(){let e=F.SCOPES[parseInt(this.getBits(12,16).toString(10),10)];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(F.TYPES))if(this.isInSubnet(new s(e)))return F.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,F.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,i=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&i.push([e-r,e-1]),r=0)}r>1&&i.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let n=i.map(c=>c[1]-c[0]+1);if(i.length>0){let c=n.indexOf(Math.max(...n));t=fT(this.parsedAddress,i[c])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(":");return a=a.replace(/^compact$/,"::"),a=a.replace(/(^compact)|(compact$)/,":"),a=a.replace(/compact/,""),a}binaryZeroPad(){return this.bigInt().toString(2).padStart(F.BITS,"0")}parse4in6(e){let t=e.split(":"),i=t.slice(-1)[0].match(jc.RE_ADDRESS);if(i){this.parsedAddress4=i[0],this.address4=new Yt.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new gt.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(jc.RE_ADDRESS,this.address4.parsedAddress.map(lT).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match(F.RE_BAD_CHARACTERS);if(t)throw new gt.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(F.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(F.RE_BAD_ADDRESS);if(r)throw new gt.AddressError(`Address failed regex: ${r.join("")}`,e.replace(F.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let i=[],n=e.split("::");if(n.length===2){let a=n[0].split(":"),c=n[1].split(":");a.length===1&&a[0]===""&&(a=[]),c.length===1&&c[0]===""&&(c=[]);let h=this.groups-(a.length+c.length);if(!h)throw new gt.AddressError("Error parsing groups");this.elidedGroups=h,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,i=i.concat(a);for(let u=0;u<h;u++)i.push("0");i=i.concat(c)}else if(n.length===1)i=e.split(":"),this.elidedGroups=0;else throw new gt.AddressError("Too many :: groups found");if(i=i.map(a=>parseInt(a,16).toString(16)),i.length!==this.groups)throw new gt.AddressError("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(fg).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(fg).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return Yt.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new s(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(r)||(i=":"),r+i+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),i=Yt.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=Yt.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),h=(0,xn.testBit)(c,15),u=(0,xn.testBit)(c,14),l=(0,xn.testBit)(c,8),f=(0,xn.testBit)(c,9),d=BigInt(`0b${c.slice(2,6)+c.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:i.address,client4:a.address,flags:c,coneNat:h,microsoft:{reserved:u,universalLocal:f,groupIndividual:l,nonce:d},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=Yt.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new s(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,i=[];for(let n=0,a=r.length;n<a;n+=2)i.push(parseInt(r.substring(n,n+2),16));return i}toUnsignedByteArray(){return this.toByteArray().map(dg)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(dg))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),i=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=i*BigInt(e[n].toString(10)),i*=t;return s.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new s("2001::/32"))}is6to4(){return this.isInSubnet(new s("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return Hc.simpleGroup(this.address).join(":");Cn(typeof this.elidedGroups=="number"),Cn(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...Hc.simpleGroup(t)):e.push("");let i=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)i.push(`group-${n}`);return e.push(`<span class="${i.join(" ")}"></span>`),r.length?e.push(...Hc.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Cn(this.address4 instanceof Yt.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new s(this.correctForm());if(r.elidedGroups===0)t.push((0,Xt.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===F.GROUPS)t.push((0,Xt.possibleElisions)(F.GROUPS));else{let i=r.address.split("::");i[0].length&&t.push((0,Xt.simpleRegularExpression)(i[0].split(":"))),Cn(typeof r.elidedGroups=="number"),t.push((0,Xt.possibleElisions)(r.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&t.push((0,Xt.simpleRegularExpression)(i[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",Xt.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",Xt.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Ye.Address6=zc});var Gc=m(se=>{"use strict";var dT=se&&se.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),pT=se&&se.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),mT=se&&se.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&dT(e,s,t);return pT(e,s),e};Object.defineProperty(se,"__esModule",{value:!0});se.v6=se.AddressError=se.Address6=se.Address4=void 0;var gT=Fc();Object.defineProperty(se,"Address4",{enumerable:!0,get:o(function(){return gT.Address4},"get")});var yT=pg();Object.defineProperty(se,"Address6",{enumerable:!0,get:o(function(){return yT.Address6},"get")});var ET=vn();Object.defineProperty(se,"AddressError",{enumerable:!0,get:o(function(){return ET.AddressError},"get")});var wT=mT(Uc());se.v6={helpers:wT}});var Sg=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.ipToBuffer=xe.int32ToIpv4=xe.ipv4ToInt32=xe.validateSocksClientChainOptions=xe.validateSocksClientOptions=void 0;var ae=kc(),Z=Pc(),ST=require("stream"),Vc=Gc(),mg=require("net");function _T(s,e=["connect","bind","associate"]){if(!Z.SocksCommand[s.command])throw new ae.SocksClientError(Z.ERRORS.InvalidSocksCommand,s);if(e.indexOf(s.command)===-1)throw new ae.SocksClientError(Z.ERRORS.InvalidSocksCommandForOperation,s);if(!yg(s.destination))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsDestination,s);if(!Eg(s.proxy))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsProxy,s);if(gg(s.proxy,s),s.timeout&&!wg(s.timeout))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsTimeout,s);if(s.existing_socket&&!(s.existing_socket instanceof ST.Duplex))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsExistingSocket,s)}o(_T,"validateSocksClientOptions");xe.validateSocksClientOptions=_T;function bT(s){if(s.command!=="connect")throw new ae.SocksClientError(Z.ERRORS.InvalidSocksCommandChain,s);if(!yg(s.destination))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsDestination,s);if(!(s.proxies&&Array.isArray(s.proxies)&&s.proxies.length>=2))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsProxiesLength,s);if(s.proxies.forEach(e=>{if(!Eg(e))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsProxy,s);gg(e,s)}),s.timeout&&!wg(s.timeout))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsTimeout,s)}o(bT,"validateSocksClientChainOptions");xe.validateSocksClientChainOptions=bT;function gg(s,e){if(s.custom_auth_method!==void 0){if(s.custom_auth_method<Z.SOCKS5_CUSTOM_AUTH_START||s.custom_auth_method>Z.SOCKS5_CUSTOM_AUTH_END)throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(s.custom_auth_request_handler===void 0||typeof s.custom_auth_request_handler!="function")throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_size===void 0)throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_handler===void 0||typeof s.custom_auth_response_handler!="function")throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(gg,"validateCustomProxyAuth");function yg(s){return s&&typeof s.host=="string"&&Buffer.byteLength(s.host)<256&&typeof s.port=="number"&&s.port>=0&&s.port<=65535}o(yg,"isValidSocksRemoteHost");function Eg(s){return s&&(typeof s.host=="string"||typeof s.ipaddress=="string")&&typeof s.port=="number"&&s.port>=0&&s.port<=65535&&(s.type===4||s.type===5)}o(Eg,"isValidSocksProxy");function wg(s){return typeof s=="number"&&s>0}o(wg,"isValidTimeoutValue");function RT(s){return new Vc.Address4(s).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(RT,"ipv4ToInt32");xe.ipv4ToInt32=RT;function OT(s){let e=s>>>24&255,t=s>>>16&255,r=s>>>8&255,i=s&255;return[e,t,r,i].join(".")}o(OT,"int32ToIpv4");xe.int32ToIpv4=OT;function IT(s){if(mg.isIPv4(s)){let e=new Vc.Address4(s);return Buffer.from(e.toArray())}else if(mg.isIPv6(s)){let e=new Vc.Address6(s);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(IT,"ipToBuffer");xe.ipToBuffer=IT});var _g=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ReceiveBuffer=void 0;var Wc=class{static{o(this,"ReceiveBuffer")}constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};Nn.ReceiveBuffer=Wc});var bg=m(At=>{"use strict";var Bs=At&&At.__awaiter||function(s,e,t,r){function i(n){return n instanceof t?n:new t(function(a){a(n)})}return o(i,"adopt"),new(t||(t=Promise))(function(n,a){function c(l){try{u(r.next(l))}catch(f){a(f)}}o(c,"fulfilled");function h(l){try{u(r.throw(l))}catch(f){a(f)}}o(h,"rejected");function u(l){l.done?n(l.value):i(l.value).then(c,h)}o(u,"step"),u((r=r.apply(s,e||[])).next())})};Object.defineProperty(At,"__esModule",{value:!0});At.SocksClientError=At.SocksClient=void 0;var vT=require("events"),Ns=require("net"),de=Jm(),E=Pc(),we=Sg(),TT=_g(),Kc=kc();Object.defineProperty(At,"SocksClientError",{enumerable:!0,get:o(function(){return Kc.SocksClientError},"get")});var Zc=Gc(),Yc=class s extends vT.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,we.validateSocksClientOptions)(e),this.setState(E.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,i)=>{try{(0,we.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):i(a)}let n=new s(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):i(a)})})}static createConnectionChain(e,t){return new Promise((r,i)=>Bs(this,void 0,void 0,function*(){try{(0,we.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):i(n)}e.randomizeChain&&(0,Kc.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],h=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},u=yield s.createConnection({command:"connect",proxy:c,destination:h,existing_socket:n});n=n||u.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):i(n)}}))}static createUDPFrame(e){let t=new de.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Ns.isIPv4(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv4),t.writeUInt32BE((0,we.ipv4ToInt32)(e.remoteHost.host))):Ns.isIPv6(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv6),t.writeBuffer((0,we.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(E.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=de.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),i=t.readUInt8(),n;i===E.Socks5HostType.IPv4?n=(0,we.int32ToIpv4)(t.readUInt32BE()):i===E.Socks5HostType.IPv6?n=Zc.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==E.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||E.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Ns.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(E.SocksClientState.Connecting),this.receiveBuffer=new TT.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let i=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",i)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.BoundWaitingForConnection&&this.closeSocket(E.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(E.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(E.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===E.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===E.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===E.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===E.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(E.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(E.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==E.SocksClientState.Error&&(this.setState(E.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new Kc.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new de.SmartBuffer;t.writeUInt8(4),t.writeUInt8(E.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Ns.isIPv4(this.options.destination.host)?(t.writeBuffer((0,we.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedConnection} - (${E.Socks4Response[e[1]]})`);else if(E.SocksCommand[this.options.command]===E.SocksCommand.bind){let t=de.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,we.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(E.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${E.Socks4Response[e[1]]})`);else{let t=de.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,we.int32ToIpv4)(t.readUInt32BE())};this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new de.SmartBuffer,t=[E.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(E.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(E.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===E.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===E.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=E.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===E.Socks5Auth.UserPass?(this.socks5ChosenAuthType=E.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new de.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(E.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Bs(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(E.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Bs(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Bs(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Bs(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Bs(this,void 0,void 0,function*(){this.setState(E.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===E.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===E.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(E.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new de.SmartBuffer;e.writeUInt8(5),e.writeUInt8(E.SocksCommand[this.options.command]),e.writeUInt8(0),Ns.isIPv4(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv4),e.writeBuffer((0,we.ipToBuffer)(this.options.destination.host))):Ns.isIPv6(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv6),e.writeBuffer((0,we.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(E.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,we.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:Zc.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.ReceivedFinalResponse),E.SocksCommand[this.options.command]===E.SocksCommand.connect?(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.bind?(this.setState(E.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.associate&&(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,we.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:Zc.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};At.SocksClient=Yc});var Rg=m(Jt=>{"use strict";var AT=Jt&&Jt.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),xT=Jt&&Jt.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AT(e,s,t)};Object.defineProperty(Jt,"__esModule",{value:!0});xT(bg(),Jt)});var Og=m(Ce=>{"use strict";var CT=Ce&&Ce.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),BT=Ce&&Ce.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Xc=Ce&&Ce.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&CT(e,s,t);return BT(e,s),e},NT=Ce&&Ce.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.SocksProxyAgent=void 0;var PT=Rg(),LT=kr(),kT=NT(Lr()),DT=Xc(require("dns")),MT=Xc(require("net")),$T=Xc(require("tls")),FT=require("url"),Pn=(0,kT.default)("socks-proxy-agent"),qT=o(s=>s.servername===void 0&&s.host&&!MT.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost");function UT(s){let e=!1,t=5,r=s.hostname,i=parseInt(s.port,10)||1080;switch(s.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(s.protocol)}`)}let n={host:r,port:i,type:t};return s.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(s.username),enumerable:!1}),s.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(s.password),enumerable:!1}),{lookup:e,proxy:n}}o(UT,"parseSocksURL");var Ln=class extends LT.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new FT.URL(e):e,{proxy:i,lookup:n}=UT(r);this.shouldLookup=n,this.proxy=i,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:i,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:h=DT.lookup}=t;r&&(a=await new Promise((d,p)=>{h(a,{},(g,y)=>{g?p(g):d(y)})}));let u={proxy:i,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},l=o(d=>{e.destroy(),f.destroy(),d&&d.destroy()},"cleanup");Pn("Creating socks proxy connection: %o",u);let{socket:f}=await PT.SocksClient.createConnection(u);if(Pn("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>l())),t.secureEndpoint){Pn("Upgrading socket connection to TLS");let d=$T.connect({...jT(qT(t),"host","path","port"),socket:f});return d.once("error",p=>{Pn("Socket TLS error",p.message),l(d)}),d}return f}};Ln.protocols=["socks","socks4","socks4a","socks5","socks5h"];Ce.SocksProxyAgent=Ln;function jT(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(jT,"omit")});var rh=m((yP,Ig)=>{"use strict";var Jc=class extends Error{static{o(this,"InvalidProxyProtocolError")}constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code="EINVALIDPROXY",this.proxy=e}},Qc=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},eh=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},th=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},sh=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};Ig.exports={InvalidProxyProtocolError:Jc,ConnectionTimeoutError:Qc,IdleTimeoutError:eh,ResponseTimeoutError:th,TransferTimeoutError:sh}});var ih=m((wP,Tg)=>{"use strict";var{HttpProxyAgent:HT}=Fm(),{HttpsProxyAgent:zT}=Vm(),{SocksProxyAgent:vg}=Og(),{LRUCache:GT}=gs(),{InvalidProxyProtocolError:VT}=rh(),WT=new GT({max:20}),ZT=new Set(vg.protocols),KT=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),Mr=Object.entries(process.env).reduce((s,[e,t])=>(e=e.toLowerCase(),KT.has(e)&&(s[e]=t),s),{}),YT=o(s=>{s=new URL(s);let e=s.protocol.slice(0,-1);if(ZT.has(e))return vg;if(e==="https"||e==="http")return[HT,zT];throw new VT(s)},"getProxyAgent"),XT=o((s,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=s.hostname.split(".").reverse();return e.some(r=>{let i=r.split(".").filter(Boolean).reverse();if(!i.length)return!1;for(let n=0;n<i.length;n++)if(t[n]!==i[n])return!1;return!0})},"isNoProxy"),JT=o((s,{proxy:e,noProxy:t})=>(s=new URL(s),e||(e=s.protocol==="https:"?Mr.https_proxy:Mr.https_proxy||Mr.http_proxy||Mr.proxy),t||(t=Mr.no_proxy),!e||XT(s,t)?null:new URL(e)),"getProxy");Tg.exports={getProxyAgent:YT,getProxy:JT,proxyCache:WT}});var Cg=m((bP,xg)=>{"use strict";var QT=require("net"),eA=require("tls"),{once:Ag}=require("events"),tA=require("timers/promises"),{normalizeOptions:sA,cacheOptions:rA}=xc(),{getProxy:iA,getProxyAgent:nA,proxyCache:nh}=ih(),kn=rh(),{Agent:oA}=kr();xg.exports=class extends oA{static{o(this,"Agent")}#e;#t;#s;#r;#i;constructor(e={}){let{timeouts:t,proxy:r,noProxy:i,...n}=sA(e);super(n),this.#e=n,this.#t=t,r&&(this.#s=new URL(r),this.#r=i,this.#i=nA(r))}get proxy(){return this.#s?{url:this.#s}:{}}#a(e){if(!this.#s)return;let t=iA(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#s,noProxy:this.#r});if(!t)return;let r=rA({...e,...this.#e,timeouts:this.#t,proxy:t});if(nh.has(r))return nh.get(r);let i=this.#i;Array.isArray(i)&&(i=this.isSecureEndpoint(e)?i[1]:i[0]);let n=new i(t,{...this.#e,socketOptions:{family:this.#e.family}});return nh.set(r,n),n}async#l({promises:e,options:t,timeout:r},i=new AbortController){if(r){let a=tA.setTimeout(r,null,{signal:i.signal}).then(()=>{throw new kn.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),i.abort()}catch(a){throw i.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let r,i=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#a(t);if(a){let l=Date.now();r=await this.#l({options:t,timeout:i,promises:[a.connect(e,t)]}),i&&(i=i-(Date.now()-l))}else r=(n?eA:QT).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:h}=c,u=r[n?"secureConnecting":"connecting"]?Ag(r,n?"secureConnect":"connect",{signal:h}):Promise.resolve();return await this.#l({options:t,timeout:i,promises:[u,Ag(r,"error",{signal:h}).then(l=>{throw l[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new kn.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#a(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let i;e.once("finish",()=>{setTimeout(()=>{e.destroy(new kn.ResponseTimeoutError(e,this.#s))},this.#t.response)}),e.once("response",()=>{clearTimeout(i)})}if(this.#t.transfer){let i;e.once("response",n=>{setTimeout(()=>{n.destroy(new kn.TransferTimeoutError(e,this.#s))},this.#t.transfer),n.once("close",()=>{clearTimeout(i)})})}return super.addRequest(e,t)}}});var Lg=m((OP,Pg)=>{"use strict";var{LRUCache:aA}=gs(),{normalizeOptions:cA,cacheOptions:hA}=xc(),{getProxy:uA,proxyCache:Bg}=ih(),Ng=Ac(),Dn=Cg(),$r=new aA({max:20}),lA=o((s,{agent:e,proxy:t,noProxy:r,...i}={})=>{if(e!=null)return e;s=new URL(s);let n=uA(s,{proxy:t,noProxy:r}),a={...cA(i),proxy:n},c=hA({...a,secureEndpoint:s.protocol==="https:"});if($r.has(c))return $r.get(c);let h=new Dn(a);return $r.set(c,h),h},"getAgent");Pg.exports={getAgent:lA,Agent:Dn,HttpAgent:Dn,HttpsAgent:Dn,cache:{proxy:Bg,agent:$r,dns:Ng.cache,clear:o(()=>{Bg.clear(),$r.clear(),Ng.cache.clear()},"clear")}}});var kg=m((vP,fA)=>{fA.exports={name:"make-fetch-happen",version:"15.0.2",description:"Opinionated, caching, retrying fetch client",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",posttest:"npm run lint",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/make-fetch-happen.git"},keywords:["http","request","fetch","mean girls","caching","cache","subresource integrity"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/agent":"^4.0.0",cacache:"^20.0.1","http-cache-semantics":"^4.1.1",minipass:"^7.0.2","minipass-fetch":"^4.0.0","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4",negotiator:"^1.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",ssri:"^12.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",nock:"^13.2.4","safe-buffer":"^5.2.1","standard-version":"^9.3.2",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},tap:{color:1,files:"test/*.js","check-coverage":!0,timeout:60,"nyc-arg":["--exclude","tap-snapshots/**"]},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var $n=m((TP,Mg)=>{var{Minipass:dA}=J(),Mn=Zs(),pA=Rm(),mA=St(),{log:Dg}=Im(),gA=Tc(),{getAgent:yA}=Lg(),oh=kg(),EA=`${oh.name}/${oh.version} (+https://npm.im/${oh.name})`,wA=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],SA=["request-timeout"],_A=o((s,e)=>{let t=yA(s.url,{...e,signal:void 0});s.headers.has("connection")||s.headers.set("connection",t?"keep-alive":"close"),s.headers.has("user-agent")||s.headers.set("user-agent",EA);let r={...e,agent:t,redirect:"manual"};return pA(async(i,n)=>{let a=new Mn.Request(s,r);try{let c=await Mn(a,r);if(r.integrity&&c.status===200){let l=mA.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new gA({events:["integrity","size"]},c.body,l);l.on("integrity",d=>f.emit("integrity",d)),l.on("size",d=>f.emit("size",d)),c=new Mn.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let h=dA.isStream(a.body);return a.method!=="POST"&&!h&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),Dg.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),i(c)):c}catch(c){let h=c.code==="EPROMISERETRY"?c.retried.code:c.code,u=c.retried instanceof Mn.Response||wA.includes(h)&&SA.includes(c.type);if(a.method==="POST"||u)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),Dg.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),i(c)}},e.retry).catch(i=>{if(i.status>=400&&i.type!=="system")return i;throw i})},"remoteFetch");Mg.exports=_A});var Hg=m((xP,jg)=>{var{Request:$g,Response:ah}=Zs(),{Minipass:Fg}=J(),bA=ui(),Qt=hm(),RA=require("url"),OA=Tc(),IA=jo(),ch=fm(),vA=$n(),Fr=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),TA=["accept-charset","accept-encoding","accept-language","accept","cache-control"],Ug=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],qg=o((s,e,t)=>{let r={time:Date.now(),url:s.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:s.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of TA)s.headers.has(a)&&(r.reqHeaders[a]=s.headers.get(a));let i=s.headers.get("host"),n=new RA.URL(s.url);if(i&&n.host!==i&&(r.reqHeaders.host=i),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let h of c)s.headers.has(h)&&(r.reqHeaders[h]=s.headers.get(h))}}for(let a of Ug)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),Fn=Symbol("request"),qn=Symbol("response"),Un=Symbol("policy"),hh=class s{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:i}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=ch(t),this.options=i,this[Fn]=t,this[qn]=r,this[Un]=null}static async find(e,t){try{var r=await Qt.index.compact(t.cachePath,ch(e),(n,a)=>{let c=new s({entry:n,options:t}),h=new s({entry:a,options:t});return c.policy.satisfies(h.request)},{validateEntry:o(n=>n.metadata&&n.metadata.resHeaders&&n.metadata.resHeaders["content-encoding"]===null?!1:n.integrity===null?!!(n.metadata&&n.metadata.status):!0,"validateEntry")})}catch{return}if(t.cache==="reload")return;let i;for(let n of r){let a=new s({entry:n,options:t});if(a.policy.satisfies(e)){i=a;break}}return i}static async invalidate(e,t){let r=ch(e);try{await Qt.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[Fn]||(this[Fn]=new $g(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[Fn]}get response(){return this[qn]||(this[qn]=new ah(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[qn]}get policy(){return this[Un]||(this[Un]=new IA({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[Un]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:qg(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},i=null;if(this.response.status===200){let a,c,h=new Promise((l,f)=>{a=l,c=f}).catch(l=>{i.emit("error",l)});i=new OA({events:["integrity","size"]},new bA({flush(){return h}})),i.hasIntegrityEmitter=!0;let u=o(()=>{let l=new Fg,f=Qt.put.stream(this.options.cachePath,this.key,r);f.on("integrity",d=>i.emit("integrity",d)),f.on("size",d=>i.emit("size",d)),l.pipe(f),f.promise().then(a,c),i.unshift(l),i.unshift(this.response.body)},"onResume");i.once("resume",u),i.once("end",()=>i.removeListener("resume",u))}else await Qt.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new ah(i,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let i;if(e==="HEAD"||[301,308].includes(this.response.status))i=this.response;else{let n=new Fg,a={...this.policy.responseHeaders()},c=o(()=>{let h=Qt.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});h.on("error",async u=>{h.pause(),u.code==="EINTEGRITY"&&await Qt.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(u.code==="ENOENT"||u.code==="EINTEGRITY")&&await s.invalidate(this.request,this.options),n.emit("error",u),h.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),h.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),i=new ah(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return i.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),i.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),i.headers.set("x-local-cache-key",encodeURIComponent(this.key)),i.headers.set("x-local-cache-mode","stream"),i.headers.set("x-local-cache-status",r),i.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),i}async revalidate(e,t){let r=new $g(e,{headers:this.policy.revalidationHeaders(e)});try{var i=await vA(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,i)){let a=qg(e,i,t);for(let c of Ug)!Fr(a.resHeaders,c)&&Fr(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let h=Fr(a.resHeaders,c),u=Fr(this.entry.metadata.resHeaders,c),l=Fr(this.policy.response.headers,c);!h&&u&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!l&&h&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await Qt.index.insert(t.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:a})}catch{}return this.respond(e.method,t,"revalidated")}return new s({request:e,response:i,options:t}).store("updated")}};jg.exports=hh});var Vg=m((BP,Gg)=>{var{NotCachedError:AA}=ku(),uh=Hg(),xA=$n(),zg=o(async(s,e)=>{let t=await uh.find(s,e);if(!t){if(e.cache==="only-if-cached")throw new AA(s.url);let i=await xA(s,e);return new uh({request:s,response:i,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(s,e);let r=t.policy.needsRevalidation(s);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(s.method,e,r?"stale":"hit"):t.revalidate(s,e)},"cacheFetch");zg.invalidate=async(s,e)=>{if(e.cachePath)return uh.invalidate(s,e)};Gg.exports=zg});var Yg=m((PP,Kg)=>{"use strict";var{FetchError:lh,Request:CA,isRedirect:BA}=Zs(),fh=require("url"),NA=jo(),Wg=Vg(),PA=$n(),LA=o((s,e,t)=>{if(!BA(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new lh(`redirect mode is set to error: ${s.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new lh(`redirect location header missing for: ${s.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(s.counter>=s.follow)throw new lh(`maximum redirect reached at: ${s.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),kA=o((s,e,t)=>{let r={...t},i=e.headers.get("location"),n=new fh.URL(i,/^https?:/.test(i)?void 0:s.url);return new fh.URL(s.url).hostname!==n.hostname&&(s.headers.delete("authorization"),s.headers.delete("cookie")),(e.status===303||s.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,s.headers.delete("content-length")),r.headers={},s.headers.forEach((c,h)=>{r.headers[h]=c}),r.counter=++s.counter,{request:new CA(fh.format(n),r),options:r}},"getRedirect"),Zg=o(async(s,e)=>{let t=NA.storable(s,e)?await Wg(s,e):await PA(s,e);if(!["GET","HEAD"].includes(s.method)&&t.status>=200&&t.status<=399&&await Wg.invalidate(s,e),!LA(s,t,e))return t;let r=kA(s,t,e);return Zg(r.request,r.options)},"fetch");Kg.exports=Zg});var Jg=m((kP,Ps)=>{var{FetchError:DA,Headers:MA,Request:Xg,Response:$A}=Zs(),FA=iu(),qA=Yg(),jn=o((s,e)=>{let t=FA(e),r=new Xg(s,t);return qA(r,t)},"makeFetchHappen");jn.defaults=(s,e={},t=jn)=>{typeof s=="object"&&(e=s,s=null);let r=o((i,n={})=>{let a=i||s,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(i,n={})=>jn.defaults(i,n,r),r};Ps.exports=jn;Ps.exports.FetchError=DA;Ps.exports.Headers=MA;Ps.exports.Request=Xg;Ps.exports.Response=$A});module.exports=Jg();
31
28
  /*! Bundled license information:
32
29
 
33
30
  negotiator/index.js: