@socketsecurity/lib 0.0.0 → 1.0.0

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 (555) hide show
  1. package/CHANGELOG.md +270 -0
  2. package/LICENSE +21 -0
  3. package/README.md +80 -2
  4. package/data/extensions.json +28 -0
  5. package/dist/abort.d.ts +11 -0
  6. package/dist/abort.js +62 -0
  7. package/dist/abort.js.map +7 -0
  8. package/dist/agent.d.ts +102 -0
  9. package/dist/agent.js +288 -0
  10. package/dist/agent.js.map +7 -0
  11. package/dist/ansi.d.ts +29 -0
  12. package/dist/ansi.js +62 -0
  13. package/dist/ansi.js.map +7 -0
  14. package/dist/argv/flags.d.ts +199 -0
  15. package/dist/argv/flags.js +284 -0
  16. package/dist/argv/flags.js.map +7 -0
  17. package/dist/argv/parse.d.ts +76 -0
  18. package/dist/argv/parse.js +173 -0
  19. package/dist/argv/parse.js.map +7 -0
  20. package/dist/arrays.d.ts +29 -0
  21. package/dist/arrays.js +87 -0
  22. package/dist/arrays.js.map +7 -0
  23. package/dist/bin.d.ts +50 -0
  24. package/dist/bin.js +405 -0
  25. package/dist/bin.js.map +7 -0
  26. package/dist/cacache.d.ts +86 -0
  27. package/dist/cacache.js +140 -0
  28. package/dist/cacache.js.map +7 -0
  29. package/dist/cache-with-ttl.d.ts +133 -0
  30. package/dist/cache-with-ttl.js +225 -0
  31. package/dist/cache-with-ttl.js.map +7 -0
  32. package/dist/constants/agents.d.ts +37 -0
  33. package/dist/constants/agents.js +128 -0
  34. package/dist/constants/agents.js.map +7 -0
  35. package/dist/constants/core.d.ts +22 -0
  36. package/dist/constants/core.js +59 -0
  37. package/dist/constants/core.js.map +7 -0
  38. package/dist/constants/encoding.d.ts +13 -0
  39. package/dist/constants/encoding.js +50 -0
  40. package/dist/constants/encoding.js.map +7 -0
  41. package/dist/constants/github.d.ts +7 -0
  42. package/dist/constants/github.js +32 -0
  43. package/dist/constants/github.js.map +7 -0
  44. package/dist/constants/licenses.d.ts +8 -0
  45. package/dist/constants/licenses.js +68 -0
  46. package/dist/constants/licenses.js.map +7 -0
  47. package/dist/constants/node.d.ts +29 -0
  48. package/dist/constants/node.js +173 -0
  49. package/dist/constants/node.js.map +7 -0
  50. package/dist/constants/packages.d.ts +19 -0
  51. package/dist/constants/packages.js +130 -0
  52. package/dist/constants/packages.js.map +7 -0
  53. package/dist/constants/paths.d.ts +51 -0
  54. package/dist/constants/paths.js +152 -0
  55. package/dist/constants/paths.js.map +7 -0
  56. package/dist/constants/platform.d.ts +6 -0
  57. package/dist/constants/platform.js +43 -0
  58. package/dist/constants/platform.js.map +7 -0
  59. package/dist/constants/process.d.ts +7 -0
  60. package/dist/constants/process.js +54 -0
  61. package/dist/constants/process.js.map +7 -0
  62. package/dist/constants/socket.d.ts +29 -0
  63. package/dist/constants/socket.js +83 -0
  64. package/dist/constants/socket.js.map +7 -0
  65. package/dist/constants/testing.d.ts +9 -0
  66. package/dist/constants/testing.js +38 -0
  67. package/dist/constants/testing.js.map +7 -0
  68. package/dist/constants/time.d.ts +11 -0
  69. package/dist/constants/time.js +41 -0
  70. package/dist/constants/time.js.map +7 -0
  71. package/dist/constants/typescript.d.ts +6 -0
  72. package/dist/constants/typescript.js +56 -0
  73. package/dist/constants/typescript.js.map +7 -0
  74. package/dist/cover/code.d.ts +8 -0
  75. package/dist/cover/code.js +137 -0
  76. package/dist/cover/code.js.map +7 -0
  77. package/dist/cover/formatters.d.ts +9 -0
  78. package/dist/cover/formatters.js +103 -0
  79. package/dist/cover/formatters.js.map +7 -0
  80. package/dist/cover/type.d.ts +7 -0
  81. package/dist/cover/type.js +65 -0
  82. package/dist/cover/type.js.map +7 -0
  83. package/dist/cover/types.d.ts +70 -0
  84. package/dist/cover/types.js +17 -0
  85. package/dist/cover/types.js.map +7 -0
  86. package/dist/debug.d.ts +99 -0
  87. package/dist/debug.js +345 -0
  88. package/dist/debug.js.map +7 -0
  89. package/dist/dlx-binary.d.ts +49 -0
  90. package/dist/dlx-binary.js +261 -0
  91. package/dist/dlx-binary.js.map +7 -0
  92. package/dist/dlx.d.ts +64 -0
  93. package/dist/dlx.js +168 -0
  94. package/dist/dlx.js.map +7 -0
  95. package/dist/download-lock.d.ts +48 -0
  96. package/dist/download-lock.js +139 -0
  97. package/dist/download-lock.js.map +7 -0
  98. package/dist/effects/pulse-frames.d.ts +23 -0
  99. package/dist/effects/pulse-frames.js +66 -0
  100. package/dist/effects/pulse-frames.js.map +7 -0
  101. package/dist/effects/text-shimmer.d.ts +37 -0
  102. package/dist/effects/text-shimmer.js +175 -0
  103. package/dist/effects/text-shimmer.js.map +7 -0
  104. package/dist/effects/types.d.ts +41 -0
  105. package/dist/effects/types.js +17 -0
  106. package/dist/effects/types.js.map +7 -0
  107. package/dist/effects/ultra.d.ts +16 -0
  108. package/dist/effects/ultra.js +63 -0
  109. package/dist/effects/ultra.js.map +7 -0
  110. package/dist/env/appdata.d.ts +1 -0
  111. package/dist/env/appdata.js +30 -0
  112. package/dist/env/appdata.js.map +7 -0
  113. package/dist/env/ci.d.ts +1 -0
  114. package/dist/env/ci.js +31 -0
  115. package/dist/env/ci.js.map +7 -0
  116. package/dist/env/comspec.d.ts +1 -0
  117. package/dist/env/comspec.js +30 -0
  118. package/dist/env/comspec.js.map +7 -0
  119. package/dist/env/debug.d.ts +1 -0
  120. package/dist/env/debug.js +30 -0
  121. package/dist/env/debug.js.map +7 -0
  122. package/dist/env/getters.d.ts +40 -0
  123. package/dist/env/getters.js +283 -0
  124. package/dist/env/getters.js.map +7 -0
  125. package/dist/env/github-api-url.d.ts +1 -0
  126. package/dist/env/github-api-url.js +30 -0
  127. package/dist/env/github-api-url.js.map +7 -0
  128. package/dist/env/github-base-ref.d.ts +1 -0
  129. package/dist/env/github-base-ref.js +30 -0
  130. package/dist/env/github-base-ref.js.map +7 -0
  131. package/dist/env/github-ref-name.d.ts +1 -0
  132. package/dist/env/github-ref-name.js +30 -0
  133. package/dist/env/github-ref-name.js.map +7 -0
  134. package/dist/env/github-ref-type.d.ts +1 -0
  135. package/dist/env/github-ref-type.js +30 -0
  136. package/dist/env/github-ref-type.js.map +7 -0
  137. package/dist/env/github-repository.d.ts +1 -0
  138. package/dist/env/github-repository.js +30 -0
  139. package/dist/env/github-repository.js.map +7 -0
  140. package/dist/env/github-server-url.d.ts +1 -0
  141. package/dist/env/github-server-url.js +30 -0
  142. package/dist/env/github-server-url.js.map +7 -0
  143. package/dist/env/github-token.d.ts +1 -0
  144. package/dist/env/github-token.js +30 -0
  145. package/dist/env/github-token.js.map +7 -0
  146. package/dist/env/helpers.d.ts +6 -0
  147. package/dist/env/helpers.js +49 -0
  148. package/dist/env/helpers.js.map +7 -0
  149. package/dist/env/home.d.ts +1 -0
  150. package/dist/env/home.js +30 -0
  151. package/dist/env/home.js.map +7 -0
  152. package/dist/env/jest-worker-id.d.ts +1 -0
  153. package/dist/env/jest-worker-id.js +30 -0
  154. package/dist/env/jest-worker-id.js.map +7 -0
  155. package/dist/env/lang.d.ts +1 -0
  156. package/dist/env/lang.js +30 -0
  157. package/dist/env/lang.js.map +7 -0
  158. package/dist/env/lc-all.d.ts +1 -0
  159. package/dist/env/lc-all.js +30 -0
  160. package/dist/env/lc-all.js.map +7 -0
  161. package/dist/env/lc-messages.d.ts +1 -0
  162. package/dist/env/lc-messages.js +30 -0
  163. package/dist/env/lc-messages.js.map +7 -0
  164. package/dist/env/localappdata.d.ts +1 -0
  165. package/dist/env/localappdata.js +30 -0
  166. package/dist/env/localappdata.js.map +7 -0
  167. package/dist/env/node-auth-token.d.ts +1 -0
  168. package/dist/env/node-auth-token.js +30 -0
  169. package/dist/env/node-auth-token.js.map +7 -0
  170. package/dist/env/node-env.d.ts +1 -0
  171. package/dist/env/node-env.js +30 -0
  172. package/dist/env/node-env.js.map +7 -0
  173. package/dist/env/npm-config-registry.d.ts +1 -0
  174. package/dist/env/npm-config-registry.js +30 -0
  175. package/dist/env/npm-config-registry.js.map +7 -0
  176. package/dist/env/npm-config-user-agent.d.ts +1 -0
  177. package/dist/env/npm-config-user-agent.js +30 -0
  178. package/dist/env/npm-config-user-agent.js.map +7 -0
  179. package/dist/env/npm-lifecycle-event.d.ts +1 -0
  180. package/dist/env/npm-lifecycle-event.js +30 -0
  181. package/dist/env/npm-lifecycle-event.js.map +7 -0
  182. package/dist/env/npm-registry.d.ts +1 -0
  183. package/dist/env/npm-registry.js +30 -0
  184. package/dist/env/npm-registry.js.map +7 -0
  185. package/dist/env/npm-token.d.ts +1 -0
  186. package/dist/env/npm-token.js +30 -0
  187. package/dist/env/npm-token.js.map +7 -0
  188. package/dist/env/path.d.ts +1 -0
  189. package/dist/env/path.js +30 -0
  190. package/dist/env/path.js.map +7 -0
  191. package/dist/env/pre-commit.d.ts +1 -0
  192. package/dist/env/pre-commit.js +31 -0
  193. package/dist/env/pre-commit.js.map +7 -0
  194. package/dist/env/shell.d.ts +1 -0
  195. package/dist/env/shell.js +30 -0
  196. package/dist/env/shell.js.map +7 -0
  197. package/dist/env/socket-accept-risks.d.ts +1 -0
  198. package/dist/env/socket-accept-risks.js +31 -0
  199. package/dist/env/socket-accept-risks.js.map +7 -0
  200. package/dist/env/socket-api-base-url.d.ts +1 -0
  201. package/dist/env/socket-api-base-url.js +30 -0
  202. package/dist/env/socket-api-base-url.js.map +7 -0
  203. package/dist/env/socket-api-proxy.d.ts +1 -0
  204. package/dist/env/socket-api-proxy.js +30 -0
  205. package/dist/env/socket-api-proxy.js.map +7 -0
  206. package/dist/env/socket-api-timeout.d.ts +1 -0
  207. package/dist/env/socket-api-timeout.js +31 -0
  208. package/dist/env/socket-api-timeout.js.map +7 -0
  209. package/dist/env/socket-api-token.d.ts +1 -0
  210. package/dist/env/socket-api-token.js +30 -0
  211. package/dist/env/socket-api-token.js.map +7 -0
  212. package/dist/env/socket-cacache-dir.d.ts +1 -0
  213. package/dist/env/socket-cacache-dir.js +30 -0
  214. package/dist/env/socket-cacache-dir.js.map +7 -0
  215. package/dist/env/socket-cli-accept-risks.d.ts +1 -0
  216. package/dist/env/socket-cli-accept-risks.js +33 -0
  217. package/dist/env/socket-cli-accept-risks.js.map +7 -0
  218. package/dist/env/socket-cli-api-base-url.d.ts +1 -0
  219. package/dist/env/socket-cli-api-base-url.js +30 -0
  220. package/dist/env/socket-cli-api-base-url.js.map +7 -0
  221. package/dist/env/socket-cli-api-proxy.d.ts +1 -0
  222. package/dist/env/socket-cli-api-proxy.js +30 -0
  223. package/dist/env/socket-cli-api-proxy.js.map +7 -0
  224. package/dist/env/socket-cli-api-timeout.d.ts +1 -0
  225. package/dist/env/socket-cli-api-timeout.js +31 -0
  226. package/dist/env/socket-cli-api-timeout.js.map +7 -0
  227. package/dist/env/socket-cli-api-token.d.ts +1 -0
  228. package/dist/env/socket-cli-api-token.js +30 -0
  229. package/dist/env/socket-cli-api-token.js.map +7 -0
  230. package/dist/env/socket-cli-config.d.ts +1 -0
  231. package/dist/env/socket-cli-config.js +30 -0
  232. package/dist/env/socket-cli-config.js.map +7 -0
  233. package/dist/env/socket-cli-fix.d.ts +1 -0
  234. package/dist/env/socket-cli-fix.js +30 -0
  235. package/dist/env/socket-cli-fix.js.map +7 -0
  236. package/dist/env/socket-cli-no-api-token.d.ts +1 -0
  237. package/dist/env/socket-cli-no-api-token.js +33 -0
  238. package/dist/env/socket-cli-no-api-token.js.map +7 -0
  239. package/dist/env/socket-cli-optimize.d.ts +1 -0
  240. package/dist/env/socket-cli-optimize.js +31 -0
  241. package/dist/env/socket-cli-optimize.js.map +7 -0
  242. package/dist/env/socket-cli-org-slug.d.ts +1 -0
  243. package/dist/env/socket-cli-org-slug.js +30 -0
  244. package/dist/env/socket-cli-org-slug.js.map +7 -0
  245. package/dist/env/socket-cli-shadow-accept-risks.d.ts +1 -0
  246. package/dist/env/socket-cli-shadow-accept-risks.js +33 -0
  247. package/dist/env/socket-cli-shadow-accept-risks.js.map +7 -0
  248. package/dist/env/socket-cli-shadow-api-token.d.ts +1 -0
  249. package/dist/env/socket-cli-shadow-api-token.js +30 -0
  250. package/dist/env/socket-cli-shadow-api-token.js.map +7 -0
  251. package/dist/env/socket-cli-shadow-bin.d.ts +1 -0
  252. package/dist/env/socket-cli-shadow-bin.js +30 -0
  253. package/dist/env/socket-cli-shadow-bin.js.map +7 -0
  254. package/dist/env/socket-cli-shadow-progress.d.ts +1 -0
  255. package/dist/env/socket-cli-shadow-progress.js +33 -0
  256. package/dist/env/socket-cli-shadow-progress.js.map +7 -0
  257. package/dist/env/socket-cli-shadow-silent.d.ts +1 -0
  258. package/dist/env/socket-cli-shadow-silent.js +33 -0
  259. package/dist/env/socket-cli-shadow-silent.js.map +7 -0
  260. package/dist/env/socket-cli-view-all-risks.d.ts +1 -0
  261. package/dist/env/socket-cli-view-all-risks.js +33 -0
  262. package/dist/env/socket-cli-view-all-risks.js.map +7 -0
  263. package/dist/env/socket-config.d.ts +1 -0
  264. package/dist/env/socket-config.js +30 -0
  265. package/dist/env/socket-config.js.map +7 -0
  266. package/dist/env/socket-debug.d.ts +1 -0
  267. package/dist/env/socket-debug.js +30 -0
  268. package/dist/env/socket-debug.js.map +7 -0
  269. package/dist/env/socket-home.d.ts +1 -0
  270. package/dist/env/socket-home.js +30 -0
  271. package/dist/env/socket-home.js.map +7 -0
  272. package/dist/env/socket-no-api-token.d.ts +1 -0
  273. package/dist/env/socket-no-api-token.js +31 -0
  274. package/dist/env/socket-no-api-token.js.map +7 -0
  275. package/dist/env/socket-npm-registry.d.ts +1 -0
  276. package/dist/env/socket-npm-registry.js +30 -0
  277. package/dist/env/socket-npm-registry.js.map +7 -0
  278. package/dist/env/socket-org-slug.d.ts +1 -0
  279. package/dist/env/socket-org-slug.js +30 -0
  280. package/dist/env/socket-org-slug.js.map +7 -0
  281. package/dist/env/socket-registry-url.d.ts +1 -0
  282. package/dist/env/socket-registry-url.js +30 -0
  283. package/dist/env/socket-registry-url.js.map +7 -0
  284. package/dist/env/socket-view-all-risks.d.ts +1 -0
  285. package/dist/env/socket-view-all-risks.js +31 -0
  286. package/dist/env/socket-view-all-risks.js.map +7 -0
  287. package/dist/env/temp.d.ts +1 -0
  288. package/dist/env/temp.js +30 -0
  289. package/dist/env/temp.js.map +7 -0
  290. package/dist/env/term.d.ts +1 -0
  291. package/dist/env/term.js +30 -0
  292. package/dist/env/term.js.map +7 -0
  293. package/dist/env/tmp.d.ts +1 -0
  294. package/dist/env/tmp.js +30 -0
  295. package/dist/env/tmp.js.map +7 -0
  296. package/dist/env/tmpdir.d.ts +1 -0
  297. package/dist/env/tmpdir.js +30 -0
  298. package/dist/env/tmpdir.js.map +7 -0
  299. package/dist/env/userprofile.d.ts +1 -0
  300. package/dist/env/userprofile.js +30 -0
  301. package/dist/env/userprofile.js.map +7 -0
  302. package/dist/env/vitest.d.ts +1 -0
  303. package/dist/env/vitest.js +31 -0
  304. package/dist/env/vitest.js.map +7 -0
  305. package/dist/env/xdg-cache-home.d.ts +1 -0
  306. package/dist/env/xdg-cache-home.js +30 -0
  307. package/dist/env/xdg-cache-home.js.map +7 -0
  308. package/dist/env/xdg-config-home.d.ts +1 -0
  309. package/dist/env/xdg-config-home.js +30 -0
  310. package/dist/env/xdg-config-home.js.map +7 -0
  311. package/dist/env/xdg-data-home.d.ts +1 -0
  312. package/dist/env/xdg-data-home.js +30 -0
  313. package/dist/env/xdg-data-home.js.map +7 -0
  314. package/dist/env.d.ts +15 -0
  315. package/dist/env.js +63 -0
  316. package/dist/env.js.map +7 -0
  317. package/dist/external/@inquirer/checkbox.js +4 -0
  318. package/dist/external/@inquirer/confirm.js +22 -0
  319. package/dist/external/@inquirer/core.js +4 -0
  320. package/dist/external/@inquirer/input.js +1 -0
  321. package/dist/external/@inquirer/password.js +1 -0
  322. package/dist/external/@inquirer/prompts.js +4 -0
  323. package/dist/external/@inquirer/search.js +1 -0
  324. package/dist/external/@inquirer/select.js +25 -0
  325. package/dist/external/@npmcli/package-json/index.js +1 -0
  326. package/dist/external/@npmcli/package-json/lib/read-package.js +1 -0
  327. package/dist/external/@npmcli/package-json/lib/sort.js +1 -0
  328. package/dist/external/@npmcli/promise-spawn.js +5 -0
  329. package/dist/external/@socketregistry/is-unicode-supported.d.ts +2 -0
  330. package/dist/external/@socketregistry/is-unicode-supported.js +5 -0
  331. package/dist/external/@socketregistry/packageurl-js.js +34 -0
  332. package/dist/external/@socketregistry/yocto-spinner.d.ts +12 -0
  333. package/dist/external/@socketregistry/yocto-spinner.js +8 -0
  334. package/dist/external/@yarnpkg/extensions.d.ts +5 -0
  335. package/dist/external/@yarnpkg/extensions.js +5 -0
  336. package/dist/external/cacache.d.ts +93 -0
  337. package/dist/external/cacache.js +32 -0
  338. package/dist/external/debug.d.ts +25 -0
  339. package/dist/external/debug.js +9 -0
  340. package/dist/external/del.d.ts +1 -0
  341. package/dist/external/del.js +54 -0
  342. package/dist/external/fast-glob.js +54 -0
  343. package/dist/external/fast-sort.d.ts +4 -0
  344. package/dist/external/fast-sort.js +5 -0
  345. package/dist/external/get-east-asian-width.d.ts +5 -0
  346. package/dist/external/get-east-asian-width.js +5 -0
  347. package/dist/external/libnpmpack.d.ts +3 -0
  348. package/dist/external/libnpmpack.js +225 -0
  349. package/dist/external/make-fetch-happen.d.ts +16 -0
  350. package/dist/external/make-fetch-happen.js +69 -0
  351. package/dist/external/normalize-package-data.js +6 -0
  352. package/dist/external/npm-package-arg.js +6 -0
  353. package/dist/external/pacote.d.ts +19 -0
  354. package/dist/external/pacote.js +105 -0
  355. package/dist/external/picomatch.js +5 -0
  356. package/dist/external/semver.d.ts +3 -0
  357. package/dist/external/semver.js +5 -0
  358. package/dist/external/spdx-correct.js +5 -0
  359. package/dist/external/spdx-expression-parse.js +5 -0
  360. package/dist/external/streaming-iterables.js +5 -0
  361. package/dist/external/validate-npm-package-name.js +5 -0
  362. package/dist/external/which.js +5 -0
  363. package/dist/external/yargs-parser.d.ts +3 -0
  364. package/dist/external/yargs-parser.js +26 -0
  365. package/dist/external/yoctocolors-cjs.d.ts +38 -0
  366. package/dist/external/yoctocolors-cjs.js +5 -0
  367. package/dist/external/zod.d.ts +1 -0
  368. package/dist/external/zod.js +27 -0
  369. package/dist/fs.d.ts +184 -0
  370. package/dist/fs.js +610 -0
  371. package/dist/fs.js.map +7 -0
  372. package/dist/functions.d.ts +27 -0
  373. package/dist/functions.js +70 -0
  374. package/dist/functions.js.map +7 -0
  375. package/dist/git.d.ts +93 -0
  376. package/dist/git.js +321 -0
  377. package/dist/git.js.map +7 -0
  378. package/dist/github.d.ts +121 -0
  379. package/dist/github.js +203 -0
  380. package/dist/github.js.map +7 -0
  381. package/dist/globs.d.ts +46 -0
  382. package/dist/globs.js +154 -0
  383. package/dist/globs.js.map +7 -0
  384. package/dist/http-request.d.ts +53 -0
  385. package/dist/http-request.js +315 -0
  386. package/dist/http-request.js.map +7 -0
  387. package/dist/index.d.ts +13 -0
  388. package/dist/index.js +64 -0
  389. package/dist/index.js.map +7 -0
  390. package/dist/ipc.d.ts +366 -0
  391. package/dist/ipc.js +234 -0
  392. package/dist/ipc.js.map +7 -0
  393. package/dist/json.d.ts +23 -0
  394. package/dist/json.js +75 -0
  395. package/dist/json.js.map +7 -0
  396. package/dist/logger.d.ts +183 -0
  397. package/dist/logger.js +653 -0
  398. package/dist/logger.js.map +7 -0
  399. package/dist/maintained-node-versions.d.ts +7 -0
  400. package/dist/maintained-node-versions.js +37 -0
  401. package/dist/maintained-node-versions.js.map +7 -0
  402. package/dist/memoization.d.ts +142 -0
  403. package/dist/memoization.js +212 -0
  404. package/dist/memoization.js.map +7 -0
  405. package/dist/objects.d.ts +146 -0
  406. package/dist/objects.js +321 -0
  407. package/dist/objects.js.map +7 -0
  408. package/dist/packages/editable.d.ts +107 -0
  409. package/dist/packages/editable.js +358 -0
  410. package/dist/packages/editable.js.map +7 -0
  411. package/dist/packages/exports.d.ts +30 -0
  412. package/dist/packages/exports.js +164 -0
  413. package/dist/packages/exports.js.map +7 -0
  414. package/dist/packages/isolation.d.ts +22 -0
  415. package/dist/packages/isolation.js +197 -0
  416. package/dist/packages/isolation.js.map +7 -0
  417. package/dist/packages/licenses.d.ts +68 -0
  418. package/dist/packages/licenses.js +216 -0
  419. package/dist/packages/licenses.js.map +7 -0
  420. package/dist/packages/manifest.d.ts +16 -0
  421. package/dist/packages/manifest.js +192 -0
  422. package/dist/packages/manifest.js.map +7 -0
  423. package/dist/packages/normalize.d.ts +21 -0
  424. package/dist/packages/normalize.js +122 -0
  425. package/dist/packages/normalize.js.map +7 -0
  426. package/dist/packages/operations.d.ts +54 -0
  427. package/dist/packages/operations.js +306 -0
  428. package/dist/packages/operations.js.map +7 -0
  429. package/dist/packages/paths.d.ts +10 -0
  430. package/dist/packages/paths.js +55 -0
  431. package/dist/packages/paths.js.map +7 -0
  432. package/dist/packages/provenance.d.ts +10 -0
  433. package/dist/packages/provenance.js +180 -0
  434. package/dist/packages/provenance.js.map +7 -0
  435. package/dist/packages/registry.d.ts +8 -0
  436. package/dist/packages/registry.js +30 -0
  437. package/dist/packages/registry.js.map +7 -0
  438. package/dist/packages/specs.d.ts +28 -0
  439. package/dist/packages/specs.js +85 -0
  440. package/dist/packages/specs.js.map +7 -0
  441. package/dist/packages/validation.d.ts +15 -0
  442. package/dist/packages/validation.js +53 -0
  443. package/dist/packages/validation.js.map +7 -0
  444. package/dist/packages.d.ts +154 -0
  445. package/dist/packages.js +131 -0
  446. package/dist/packages.js.map +7 -0
  447. package/dist/path.d.ts +74 -0
  448. package/dist/path.js +442 -0
  449. package/dist/path.js.map +7 -0
  450. package/dist/paths.d.ts +42 -0
  451. package/dist/paths.js +145 -0
  452. package/dist/paths.js.map +7 -0
  453. package/dist/performance.d.ts +178 -0
  454. package/dist/performance.js +219 -0
  455. package/dist/performance.js.map +7 -0
  456. package/dist/promise-queue.d.ts +35 -0
  457. package/dist/promise-queue.js +111 -0
  458. package/dist/promise-queue.js.map +7 -0
  459. package/dist/promises.d.ts +67 -0
  460. package/dist/promises.js +268 -0
  461. package/dist/promises.js.map +7 -0
  462. package/dist/prompts.d.ts +27 -0
  463. package/dist/prompts.js +60 -0
  464. package/dist/prompts.js.map +7 -0
  465. package/dist/regexps.d.ts +13 -0
  466. package/dist/regexps.js +32 -0
  467. package/dist/regexps.js.map +7 -0
  468. package/dist/sea.d.ts +10 -0
  469. package/dist/sea.js +46 -0
  470. package/dist/sea.js.map +7 -0
  471. package/dist/shadow.d.ts +17 -0
  472. package/dist/shadow.js +60 -0
  473. package/dist/shadow.js.map +7 -0
  474. package/dist/signal-exit.d.ts +23 -0
  475. package/dist/signal-exit.js +250 -0
  476. package/dist/signal-exit.js.map +7 -0
  477. package/dist/sorts.d.ts +28 -0
  478. package/dist/sorts.js +96 -0
  479. package/dist/sorts.js.map +7 -0
  480. package/dist/spawn.d.ts +207 -0
  481. package/dist/spawn.js +201 -0
  482. package/dist/spawn.js.map +7 -0
  483. package/dist/spinner.d.ts +208 -0
  484. package/dist/spinner.js +729 -0
  485. package/dist/spinner.js.map +7 -0
  486. package/dist/ssri.d.ts +95 -0
  487. package/dist/ssri.js +73 -0
  488. package/dist/ssri.js.map +7 -0
  489. package/dist/stdio/clear.d.ts +40 -0
  490. package/dist/stdio/clear.js +84 -0
  491. package/dist/stdio/clear.js.map +7 -0
  492. package/dist/stdio/divider.d.ts +48 -0
  493. package/dist/stdio/divider.js +81 -0
  494. package/dist/stdio/divider.js.map +7 -0
  495. package/dist/stdio/footer.d.ts +25 -0
  496. package/dist/stdio/footer.js +96 -0
  497. package/dist/stdio/footer.js.map +7 -0
  498. package/dist/stdio/header.d.ts +25 -0
  499. package/dist/stdio/header.js +102 -0
  500. package/dist/stdio/header.js.map +7 -0
  501. package/dist/stdio/mask.d.ts +72 -0
  502. package/dist/stdio/mask.js +187 -0
  503. package/dist/stdio/mask.js.map +7 -0
  504. package/dist/stdio/progress.d.ts +51 -0
  505. package/dist/stdio/progress.js +171 -0
  506. package/dist/stdio/progress.js.map +7 -0
  507. package/dist/stdio/prompts.d.ts +46 -0
  508. package/dist/stdio/prompts.js +90 -0
  509. package/dist/stdio/prompts.js.map +7 -0
  510. package/dist/stdio/stderr.d.ts +48 -0
  511. package/dist/stdio/stderr.js +91 -0
  512. package/dist/stdio/stderr.js.map +7 -0
  513. package/dist/stdio/stdout.d.ts +48 -0
  514. package/dist/stdio/stdout.js +105 -0
  515. package/dist/stdio/stdout.js.map +7 -0
  516. package/dist/streams.d.ts +20 -0
  517. package/dist/streams.js +80 -0
  518. package/dist/streams.js.map +7 -0
  519. package/dist/strings.d.ts +139 -0
  520. package/dist/strings.js +253 -0
  521. package/dist/strings.js.map +7 -0
  522. package/dist/suppress-warnings.d.ts +66 -0
  523. package/dist/suppress-warnings.js +100 -0
  524. package/dist/suppress-warnings.js.map +7 -0
  525. package/dist/tables.d.ts +69 -0
  526. package/dist/tables.js +130 -0
  527. package/dist/tables.js.map +7 -0
  528. package/dist/temporary-executor.d.ts +9 -0
  529. package/dist/temporary-executor.js +54 -0
  530. package/dist/temporary-executor.js.map +7 -0
  531. package/dist/types.d.ts +65 -0
  532. package/dist/types.js +74 -0
  533. package/dist/types.js.map +7 -0
  534. package/dist/url.d.ts +60 -0
  535. package/dist/url.js +144 -0
  536. package/dist/url.js.map +7 -0
  537. package/dist/utils/get-ipc.d.ts +16 -0
  538. package/dist/utils/get-ipc.js +60 -0
  539. package/dist/utils/get-ipc.js.map +7 -0
  540. package/dist/validation/json-parser.d.ts +10 -0
  541. package/dist/validation/json-parser.js +129 -0
  542. package/dist/validation/json-parser.js.map +7 -0
  543. package/dist/validation/types.d.ts +40 -0
  544. package/dist/validation/types.js +17 -0
  545. package/dist/validation/types.js.map +7 -0
  546. package/dist/versions.d.ts +87 -0
  547. package/dist/versions.js +155 -0
  548. package/dist/versions.js.map +7 -0
  549. package/dist/words.d.ts +22 -0
  550. package/dist/words.js +52 -0
  551. package/dist/words.js.map +7 -0
  552. package/dist/zod.d.ts +5 -0
  553. package/dist/zod.js +29 -0
  554. package/dist/zod.js.map +7 -0
  555. package/package.json +856 -7
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Bundled from libnpmpack
3
+ * This is a zero-dependency bundle created by esbuild.
4
+ */
5
+ "use strict";var gZ=Object.create;var Wf=Object.defineProperty;var mZ=Object.getOwnPropertyDescriptor;var yZ=Object.getOwnPropertyNames;var SZ=Object.getPrototypeOf,wZ=Object.prototype.hasOwnProperty;var o=(r,e)=>Wf(r,"name",{value:e,configurable:!0});var vZ=(r,e)=>()=>(r&&(e=r(r=0)),e);var g=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),EZ=(r,e)=>{for(var t in e)Wf(r,t,{get:e[t],enumerable:!0})},_Z=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of yZ(e))!wZ.call(r,s)&&s!==t&&Wf(r,s,{get:()=>e[s],enumerable:!(i=mZ(e,s))||i.enumerable});return r};var bZ=(r,e,t)=>(t=r!=null?gZ(SZ(r)):{},_Z(e||!r||!r.__esModule?Wf(t,"default",{value:r,enumerable:!0}):t,r));var ml=g((xMe,jP)=>{"use strict";var OZ=Symbol.for("indent"),IZ=Symbol.for("newline"),TZ=`
6
+ `,RZ=" ",AZ=/^\uFEFF/,CZ=/^\s*[{[]((?:\r?\n)+)([\s\t]*)/,kZ=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,FP=/^Unexpected token '?(.)'?(,)? /i,PZ=o(r=>{let e=r.charCodeAt(0).toString(16).toUpperCase();return`0x${e.length%2?"0":""}${e}`},"hexify"),BP=o(r=>String(r).replace(AZ,""),"stripBOM"),Hw=o((r,e,t=0)=>({message:`${r} while parsing ${e}`,position:t}),"makeParsedError"),NZ=o((r,e,t=20)=>{let i=r.message;if(!e)return Hw(i,"empty string");let s=i.match(FP),n=i.match(/ position\s+(\d+)/i);s&&(i=i.replace(FP,`Unexpected token ${JSON.stringify(s[1])} (${PZ(s[1])})$2 `));let a;if(n?a=+n[1]:i.match(/^Unexpected end of JSON.*/i)&&(a=e.length-1),a==null)return Hw(i,`'${e.slice(0,t*2)}'`);let c=a<=t?0:a-t,l=a+t>=e.length?e.length:a+t,u=`${c?"...":""}${e.slice(c,l)}${l===e.length?"":"..."}`;return Hw(i,`${e===u?"":"near "}${JSON.stringify(u)}`,a)},"parseError"),Jf=class extends SyntaxError{static{o(this,"JSONParseError")}constructor(e,t,i,s){let n=NZ(e,t,i);super(n.message),Object.assign(this,n),this.code="EJSONPARSE",this.systemError=e,Error.captureStackTrace(this,s||this.constructor)}get name(){return this.constructor.name}set name(e){}get[Symbol.toStringTag](){return this.constructor.name}},qP=o((r,e)=>{let t=JSON.parse(r,e);if(t&&typeof t=="object"){let i=r.match(kZ)||r.match(CZ)||[null,"",""];t[IZ]=i[1]??TZ,t[OZ]=i[2]??RZ}return t},"parseJson"),Kf=o((r,e,t)=>{let i=BP(r);try{return qP(i,e)}catch(s){if(typeof r!="string"&&!Buffer.isBuffer(r)){let n=Array.isArray(r)&&r.length===0?"an empty array":String(r);throw Object.assign(new TypeError(`Cannot parse ${n}`),{code:"EJSONPARSE",systemError:s})}throw new Jf(s,i,t,Kf)}},"parseJsonError");jP.exports=Kf;Kf.JSONParseError=Jf;Kf.noExceptions=(r,e)=>{try{return qP(BP(r),e)}catch{}}});var VP=g((LMe,UP)=>{var Ww=new Set(["dependencies","optionalDependencies","devDependencies","peerDependencies"]),xZ=o(r=>{for(let e of Ww)r&&r[e]&&(r[e]=Object.keys(r[e]).sort((t,i)=>t.localeCompare(i,"en")).reduce((t,i)=>(t[i]=r[e][i],t),{}));return r},"orderDeps"),$P=o(({content:r,originalContent:e})=>{let t=xZ({...r});if(t.dependencies&&t.optionalDependencies)for(let c of Object.keys(t.optionalDependencies))delete t.dependencies[c];let i={...e};for(let c of Ww)t[c]&&(i[c]=t[c]),t[c]&&typeof t=="object"&&Object.keys(t[c]).length===0&&delete i[c];let{dependencies:s,peerDependencies:n}=e||{},{peerDependencies:a}=i;if(s&&n&&a)for(let c of Object.keys(n))s[c]!==void 0&&a[c]!==void 0&&(i.dependencies=i.dependencies||{},i.dependencies[c]=a[c]);return i},"updateDependencies");$P.knownKeys=Ww;UP.exports=$P});var GP=g((FMe,zP)=>{var DZ=o(({content:r,originalContent:e={}})=>{let t=r.scripts;if(!t)return e;if(o(()=>Object.entries(t).some(([s,n])=>typeof s!="string"||typeof n!="string"),"hasInvalidScripts")())throw Object.assign(new TypeError("package.json scripts should be a key-value pair of strings."),{code:"ESCRIPTSINVALID"});return{...e,scripts:{...t}}},"updateScripts");zP.exports=DZ});var WP=g((qMe,HP)=>{var LZ=o(({content:r,originalContent:e={}})=>{let t=r.workspaces;if(!t)return e;let i=o(()=>t.some(s=>typeof s!="string"),"hasInvalidWorkspaces");if(!t.length||i())throw Object.assign(new TypeError("workspaces should be an array of strings."),{code:"EWORKSPACESINVALID"});return{...e,workspaces:[...t]}},"updateWorkspaces");HP.exports=LZ});var yl=g(($Me,JP)=>{"use strict";var MZ=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>{}:()=>{};JP.exports=MZ});var Sl=g((UMe,KP)=>{"use strict";var FZ="2.0.0",BZ=Number.MAX_SAFE_INTEGER||9007199254740991,qZ=16,jZ=250,$Z=["major","premajor","minor","preminor","patch","prepatch","prerelease"];KP.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:qZ,MAX_SAFE_BUILD_LENGTH:jZ,MAX_SAFE_INTEGER:BZ,RELEASE_TYPES:$Z,SEMVER_SPEC_VERSION:FZ,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ho=g((Gr,YP)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Jw,MAX_SAFE_BUILD_LENGTH:UZ,MAX_LENGTH:VZ}=Sl(),zZ=yl();Gr=YP.exports={};var GZ=Gr.re=[],HZ=Gr.safeRe=[],P=Gr.src=[],WZ=Gr.safeSrc=[],N=Gr.t={},JZ=0,Kw="[a-zA-Z0-9-]",KZ=[["\\s",1],["\\d",VZ],[Kw,UZ]],YZ=o(r=>{for(let[e,t]of KZ)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},"makeSafeRegex"),U=o((r,e,t)=>{let i=YZ(e),s=JZ++;zZ(r,s,e),N[r]=s,P[s]=e,WZ[s]=i,GZ[s]=new RegExp(e,t?"g":void 0),HZ[s]=new RegExp(i,t?"g":void 0)},"createToken");U("NUMERICIDENTIFIER","0|[1-9]\\d*");U("NUMERICIDENTIFIERLOOSE","\\d+");U("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Kw}*`);U("MAINVERSION",`(${P[N.NUMERICIDENTIFIER]})\\.(${P[N.NUMERICIDENTIFIER]})\\.(${P[N.NUMERICIDENTIFIER]})`);U("MAINVERSIONLOOSE",`(${P[N.NUMERICIDENTIFIERLOOSE]})\\.(${P[N.NUMERICIDENTIFIERLOOSE]})\\.(${P[N.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASEIDENTIFIER",`(?:${P[N.NONNUMERICIDENTIFIER]}|${P[N.NUMERICIDENTIFIER]})`);U("PRERELEASEIDENTIFIERLOOSE",`(?:${P[N.NONNUMERICIDENTIFIER]}|${P[N.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASE",`(?:-(${P[N.PRERELEASEIDENTIFIER]}(?:\\.${P[N.PRERELEASEIDENTIFIER]})*))`);U("PRERELEASELOOSE",`(?:-?(${P[N.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${P[N.PRERELEASEIDENTIFIERLOOSE]})*))`);U("BUILDIDENTIFIER",`${Kw}+`);U("BUILD",`(?:\\+(${P[N.BUILDIDENTIFIER]}(?:\\.${P[N.BUILDIDENTIFIER]})*))`);U("FULLPLAIN",`v?${P[N.MAINVERSION]}${P[N.PRERELEASE]}?${P[N.BUILD]}?`);U("FULL",`^${P[N.FULLPLAIN]}$`);U("LOOSEPLAIN",`[v=\\s]*${P[N.MAINVERSIONLOOSE]}${P[N.PRERELEASELOOSE]}?${P[N.BUILD]}?`);U("LOOSE",`^${P[N.LOOSEPLAIN]}$`);U("GTLT","((?:<|>)?=?)");U("XRANGEIDENTIFIERLOOSE",`${P[N.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);U("XRANGEIDENTIFIER",`${P[N.NUMERICIDENTIFIER]}|x|X|\\*`);U("XRANGEPLAIN",`[v=\\s]*(${P[N.XRANGEIDENTIFIER]})(?:\\.(${P[N.XRANGEIDENTIFIER]})(?:\\.(${P[N.XRANGEIDENTIFIER]})(?:${P[N.PRERELEASE]})?${P[N.BUILD]}?)?)?`);U("XRANGEPLAINLOOSE",`[v=\\s]*(${P[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[N.XRANGEIDENTIFIERLOOSE]})(?:${P[N.PRERELEASELOOSE]})?${P[N.BUILD]}?)?)?`);U("XRANGE",`^${P[N.GTLT]}\\s*${P[N.XRANGEPLAIN]}$`);U("XRANGELOOSE",`^${P[N.GTLT]}\\s*${P[N.XRANGEPLAINLOOSE]}$`);U("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Jw}})(?:\\.(\\d{1,${Jw}}))?(?:\\.(\\d{1,${Jw}}))?`);U("COERCE",`${P[N.COERCEPLAIN]}(?:$|[^\\d])`);U("COERCEFULL",P[N.COERCEPLAIN]+`(?:${P[N.PRERELEASE]})?(?:${P[N.BUILD]})?(?:$|[^\\d])`);U("COERCERTL",P[N.COERCE],!0);U("COERCERTLFULL",P[N.COERCEFULL],!0);U("LONETILDE","(?:~>?)");U("TILDETRIM",`(\\s*)${P[N.LONETILDE]}\\s+`,!0);Gr.tildeTrimReplace="$1~";U("TILDE",`^${P[N.LONETILDE]}${P[N.XRANGEPLAIN]}$`);U("TILDELOOSE",`^${P[N.LONETILDE]}${P[N.XRANGEPLAINLOOSE]}$`);U("LONECARET","(?:\\^)");U("CARETTRIM",`(\\s*)${P[N.LONECARET]}\\s+`,!0);Gr.caretTrimReplace="$1^";U("CARET",`^${P[N.LONECARET]}${P[N.XRANGEPLAIN]}$`);U("CARETLOOSE",`^${P[N.LONECARET]}${P[N.XRANGEPLAINLOOSE]}$`);U("COMPARATORLOOSE",`^${P[N.GTLT]}\\s*(${P[N.LOOSEPLAIN]})$|^$`);U("COMPARATOR",`^${P[N.GTLT]}\\s*(${P[N.FULLPLAIN]})$|^$`);U("COMPARATORTRIM",`(\\s*)${P[N.GTLT]}\\s*(${P[N.LOOSEPLAIN]}|${P[N.XRANGEPLAIN]})`,!0);Gr.comparatorTrimReplace="$1$2$3";U("HYPHENRANGE",`^\\s*(${P[N.XRANGEPLAIN]})\\s+-\\s+(${P[N.XRANGEPLAIN]})\\s*$`);U("HYPHENRANGELOOSE",`^\\s*(${P[N.XRANGEPLAINLOOSE]})\\s+-\\s+(${P[N.XRANGEPLAINLOOSE]})\\s*$`);U("STAR","(<|>)?=?\\s*\\*");U("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");U("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Yf=g((zMe,ZP)=>{"use strict";var ZZ=Object.freeze({loose:!0}),XZ=Object.freeze({}),QZ=o(r=>r?typeof r!="object"?ZZ:r:XZ,"parseOptions");ZP.exports=QZ});var Yw=g((HMe,e1)=>{"use strict";var XP=/^[0-9]+$/,QP=o((r,e)=>{let t=XP.test(r),i=XP.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:r<e?-1:1},"compareIdentifiers"),eX=o((r,e)=>QP(e,r),"rcompareIdentifiers");e1.exports={compareIdentifiers:QP,rcompareIdentifiers:eX}});var Qe=g((JMe,r1)=>{"use strict";var Zf=yl(),{MAX_LENGTH:t1,MAX_SAFE_INTEGER:Xf}=Sl(),{safeRe:Qf,t:ed}=Ho(),tX=Yf(),{compareIdentifiers:Wo}=Yw(),Zw=class r{static{o(this,"SemVer")}constructor(e,t){if(t=tX(t),e instanceof r){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>t1)throw new TypeError(`version is longer than ${t1} characters`);Zf("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?Qf[ed.LOOSE]:Qf[ed.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Xf||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Xf||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Xf||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<Xf)return n}return s}):this.prerelease=[],this.build=i[5]?i[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(Zf("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),Wo(this.major,e.major)||Wo(this.minor,e.minor)||Wo(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(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 i=this.prerelease[t],s=e.prerelease[t];if(Zf("prerelease compare",t,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return Wo(i,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let i=this.build[t],s=e.build[t];if(Zf("build compare",t,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return Wo(i,s)}while(++t)}inc(e,t,i){if(e.startsWith("pre")){if(!t&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Qf[ed.PRERELEASELOOSE]:Qf[ed.PRERELEASE]);if(!s||s[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,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,i),this.inc("pre",t,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,i),this.inc("pre",t,i);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 s=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[s];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(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let n=[t,s];i===!1&&(n=[t]),Wo(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}};r1.exports=Zw});var _n=g((YMe,s1)=>{"use strict";var i1=Qe(),rX=o((r,e,t=!1)=>{if(r instanceof i1)return r;try{return new i1(r,e)}catch(i){if(!t)return null;throw i}},"parse");s1.exports=rX});var Xw=g((XMe,n1)=>{"use strict";var iX=_n(),sX=o((r,e)=>{let t=iX(r,e);return t?t.version:null},"valid");n1.exports=sX});var Qw=g((eFe,o1)=>{"use strict";var nX=_n(),oX=o((r,e)=>{let t=nX(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");o1.exports=oX});var se=g((rFe,a1)=>{var aX=Symbol("proc-log.meta");a1.exports={META:aX,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...r){return process.emit("output","standard",...r)},"standard"),error:o(function(...r){return process.emit("output","error",...r)},"error"),buffer:o(function(...r){return process.emit("output","buffer",...r)},"buffer"),flush:o(function(...r){return process.emit("output","flush",...r)},"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(...r){return process.emit("log","error",...r)},"error"),notice:o(function(...r){return process.emit("log","notice",...r)},"notice"),warn:o(function(...r){return process.emit("log","warn",...r)},"warn"),info:o(function(...r){return process.emit("log","info",...r)},"info"),verbose:o(function(...r){return process.emit("log","verbose",...r)},"verbose"),http:o(function(...r){return process.emit("log","http",...r)},"http"),silly:o(function(...r){return process.emit("log","silly",...r)},"silly"),timing:o(function(...r){return process.emit("log","timing",...r)},"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(r,e){process.emit("time","start",r);function t(){return process.emit("time","end",r)}if(o(t,"end"),typeof e=="function"){let i=e();return i&&i.finally?i.finally(t):(t(),i)}return t},"start"),end:o(function(r){return process.emit("time","end",r)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(r){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof r=="function"){let t=r();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...r){let e,t,i=new Promise((s,n)=>{e=s,t=n});return process.emit("input","read",e,t,...r),i},"read")}}});var Pi=g(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.LRUCache=void 0;var cX=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,l1=new Set,ev=typeof process=="object"&&process?process:{},u1=o((r,e,t,i)=>{typeof ev.emitWarning=="function"&&ev.emitWarning(r,e,t,i)},"emitWarning"),td=globalThis.AbortController,c1=globalThis.AbortSignal;if(typeof td>"u"){c1=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},td=class{static{o(this,"AbortController")}constructor(){e()}signal=new c1;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let r=ev.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{r&&(r=!1,u1("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 lX=o(r=>!l1.has(r),"shouldWarn"),oFe=Symbol("type"),ys=o(r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),"isPosInt"),h1=o(r=>ys(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Jo:null:null,"getUintArray"),Jo=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},tv=class r{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=h1(e);if(!t)return[];r.#e=!0;let i=new r(e,t);return r.#e=!1,i}constructor(e,t){if(!r.#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]}},rv=class r{static{o(this,"LRUCache")}#e;#t;#r;#i;#s;#o;#n;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#h;#l;#f;#u;#p;#g;#w;#m;#A;#E;#_;#b;#O;#v;#C;#I;#d;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#O,sizes:e.#_,keyMap:e.#l,keyList:e.#f,valList:e.#u,next:e.#p,prev:e.#g,get head(){return e.#w},get tail(){return e.#m},free:e.#A,isBackgroundFetch:o(t=>e.#y(t),"isBackgroundFetch"),backgroundFetch:o((t,i,s,n)=>e.#$(t,i,s,n),"backgroundFetch"),moveToTail:o(t=>e.#U(t),"moveToTail"),indexes:o(t=>e.#x(t),"indexes"),rindexes:o(t=>e.#D(t),"rindexes"),isStale:o(t=>e.#R(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#n}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#s}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:h,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:w,fetchMethod:S,memoMethod:v,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:O,ignoreFetchAbort:T,perf:I}=e;if(I!==void 0&&typeof I?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=I??cX,t!==0&&!ys(t))throw new TypeError("max option must be a nonnegative integer");let L=t?h1(t):Array;if(!L)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=y||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(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#n=v,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=S,this.#C=!!S,this.#l=new Map,this.#f=new Array(t).fill(void 0),this.#u=new Array(t).fill(void 0),this.#p=new L(t),this.#g=new L(t),this.#w=0,this.#m=0,this.#A=tv.create(t),this.#a=0,this.#h=0,typeof u=="function"&&(this.#r=u),typeof h=="function"&&(this.#i=h),typeof f=="function"?(this.#s=f,this.#E=[]):(this.#s=void 0,this.#E=void 0),this.#v=!!this.#r,this.#d=!!this.#i,this.#I=!!this.#s,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#t!==0&&!ys(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ys(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=ys(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ys(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#B()}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 F="LRU_CACHE_UNBOUNDED";lX(F)&&(l1.add(F),u1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,r))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#B(){let e=new Jo(this.#e),t=new Jo(this.#e);this.#O=e,this.#b=t,this.#L=(n,a,c=this.#c.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#R(n)&&this.#F(this.#f[n],"expire")},a+1);l.unref&&l.unref()}},this.#T=n=>{t[n]=e[n]!==0?this.#c.now():0},this.#k=(n,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;n.ttl=c,n.start=l,n.now=i||s();let u=n.now-l;n.remainingTTL=c-u}};let i=0,s=o(()=>{let n=this.#c.now();if(this.ttlResolution>0){i=n;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#l.get(n);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(i||s())-l;return c-u},this.#R=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(i||s())-a>c}}#T=o(()=>{},"#updateItemAge");#k=o(()=>{},"#statusTTL");#L=o(()=>{},"#setItemTTL");#R=o(()=>!1,"#isStale");#q(){let e=new Jo(this.#e);this.#h=0,this.#_=e,this.#P=t=>{this.#h-=e[t],e[t]=0},this.#M=(t,i,s,n)=>{if(this.#y(i))return 0;if(!ys(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ys(s))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 s},this.#N=(t,i,s)=>{if(e[t]=i,this.#t){let n=this.#t-e[t];for(;this.#h>n;)this.#j(!0)}this.#h+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#h)}}#P=o(e=>{},"#removeItemSize");#N=o((e,t,i)=>{},"#addItemSize");#M=o((e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#x({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;!(!this.#S(t)||((e||!this.#R(t))&&(yield t),t===this.#w));)t=this.#g[t]}*#D({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#w;!(!this.#S(t)||((e||!this.#R(t))&&(yield t),t===this.#m));)t=this.#p[t]}#S(e){return e!==void 0&&this.#l.get(this.#f[e])===e}*entries(){for(let e of this.#x())this.#u[e]!==void 0&&this.#f[e]!==void 0&&!this.#y(this.#u[e])&&(yield[this.#f[e],this.#u[e]])}*rentries(){for(let e of this.#D())this.#u[e]!==void 0&&this.#f[e]!==void 0&&!this.#y(this.#u[e])&&(yield[this.#f[e],this.#u[e]])}*keys(){for(let e of this.#x()){let t=this.#f[e];t!==void 0&&!this.#y(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#D()){let t=this.#f[e];t!==void 0&&!this.#y(this.#u[e])&&(yield t)}}*values(){for(let e of this.#x())this.#u[e]!==void 0&&!this.#y(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#D())this.#u[e]!==void 0&&!this.#y(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#x()){let s=this.#u[i],n=this.#y(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#f[i],this))return this.get(this.#f[i],t)}}forEach(e,t=this){for(let i of this.#x()){let s=this.#u[i],n=this.#y(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#f[i],this)}}rforEach(e,t=this){for(let i of this.#D()){let s=this.#u[i],n=this.#y(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#f[i],this)}}purgeStale(){let e=!1;for(let t of this.#D({allowStale:!0}))this.#R(t)&&(this.#F(this.#f[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let i=this.#u[t],s=this.#y(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#O&&this.#b){let a=this.#O[t],c=this.#b[t];if(a&&c){let l=a-(this.#c.now()-c);n.ttl=l,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#x({allowStale:!0})){let i=this.#f[t],s=this.#u[t],n=this.#y(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let a={value:n};if(this.#O&&this.#b){a.ttl=this.#O[t];let c=this.#c.now()-this.#b[t];a.start=Math.floor(Date.now()-c)}this.#_&&(a.size=this.#_[t]),e.unshift([i,a])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#c.now()-s}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=i,{noUpdateTTL:u=this.noUpdateTTL}=i,h=this.#M(e,t,i.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#F(e,"set"),this;let f=this.#a===0?void 0:this.#l.get(e);if(f===void 0)f=this.#a===0?this.#m:this.#A.length!==0?this.#A.pop():this.#a===this.#e?this.#j(!1):this.#a,this.#f[f]=e,this.#u[f]=t,this.#l.set(e,f),this.#p[this.#m]=f,this.#g[f]=this.#m,this.#m=f,this.#a++,this.#N(f,h,l),l&&(l.set="add"),u=!1,this.#d&&this.#i?.(t,e,"add");else{this.#U(f);let d=this.#u[f];if(t!==d){if(this.#C&&this.#y(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#v&&this.#r?.(p,e,"set"),this.#I&&this.#E?.push([p,e,"set"]))}else a||(this.#v&&this.#r?.(d,e,"set"),this.#I&&this.#E?.push([d,e,"set"]));if(this.#P(f),this.#N(f,h,l),this.#u[f]=t,l){l.set="replace";let p=d&&this.#y(d)?d.__staleWhileFetching:d;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update");this.#d&&this.onInsert?.(t,e,t===d?"update":"replace")}if(s!==0&&!this.#O&&this.#B(),this.#O&&(u||this.#L(f,s,n),l&&this.#k(l,f)),!a&&this.#I&&this.#E){let d=this.#E,p;for(;p=d?.shift();)this.#s?.(...p)}return this}pop(){try{for(;this.#a;){let e=this.#u[this.#w];if(this.#j(!0),this.#y(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#I&&this.#E){let e=this.#E,t;for(;t=e?.shift();)this.#s?.(...t)}}}#j(e){let t=this.#w,i=this.#f[t],s=this.#u[t];return this.#C&&this.#y(s)?s.__abortController.abort(new Error("evicted")):(this.#v||this.#I)&&(this.#v&&this.#r?.(s,i,"evict"),this.#I&&this.#E?.push([s,i,"evict"])),this.#P(t),e&&(this.#f[t]=void 0,this.#u[t]=void 0,this.#A.push(t)),this.#a===1?(this.#w=this.#m=0,this.#A.length=0):this.#w=this.#p[t],this.#l.delete(i),this.#a--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#l.get(e);if(n!==void 0){let a=this.#u[n];if(this.#y(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#k(s,n));else return i&&this.#T(n),s&&(s.has="hit",this.#k(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#R(s))return;let n=this.#u[s];return this.#y(n)?n.__staleWhileFetching:n}#$(e,t,i,s){let n=t===void 0?void 0:this.#u[t];if(this.#y(n))return n;let a=new td,{signal:c}=i;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:s},u=o((y,w=!1)=>{let{aborted:S}=a.signal,v=i.ignoreFetchAbort&&y!==void 0;if(i.status&&(S&&!w?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),S&&!v&&!w)return f(a.signal.reason);let _=p,E=this.#u[t];return(E===p||v&&w&&E===void 0)&&(y===void 0?_.__staleWhileFetching!==void 0?this.#u[t]=_.__staleWhileFetching:this.#F(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,y,l.options))),y},"cb"),h=o(y=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=y),f(y)),"eb"),f=o(y=>{let{aborted:w}=a.signal,S=w&&i.allowStaleOnFetchAbort,v=S||i.allowStaleOnFetchRejection,_=v||i.noDeleteOnFetchRejection,E=p;if(this.#u[t]===p&&(!_||E.__staleWhileFetching===void 0?this.#F(e,"fetch"):S||(this.#u[t]=E.__staleWhileFetching)),v)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw y},"fetchFail"),d=o((y,w)=>{let S=this.#o?.(e,n,l);S&&S instanceof Promise&&S.then(v=>y(v===void 0?void 0:v),w),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(y(void 0),i.allowStaleOnFetchAbort&&(y=o(v=>u(v,!0),"res")))})},"pcall");i.status&&(i.status.fetchDispatched=!0);let p=new Promise(d).then(u,h),m=Object.assign(p,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...l.options,status:void 0}),t=this.#l.get(e)):this.#u[t]=m,m}#y(e){if(!this.#C)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof td}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:y,forceRefresh:w=!1,status:S,signal:v}=t;if(!this.#C)return S&&(S.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:S});let _={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:S,signal:v},E=this.#l.get(e);if(E===void 0){S&&(S.fetch="miss");let b=this.#$(e,E,_,y);return b.__returned=b}else{let b=this.#u[E];if(this.#y(b)){let F=i&&b.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",F&&(S.returnedStale=!0)),F?b.__staleWhileFetching:b.__returned=b}let O=this.#R(E);if(!w&&!O)return S&&(S.fetch="hit"),this.#U(E),s&&this.#T(E),S&&this.#k(S,E),b;let T=this.#$(e,E,_,y),L=T.__staleWhileFetching!==void 0&&i;return S&&(S.fetch=O?"stale":"refresh",L&&O&&(S.returnedStale=!0)),L?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#n;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let l=i(e,c,{options:a,context:s});return this.set(e,l,a),l}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#l.get(e);if(c!==void 0){let l=this.#u[c],u=this.#y(l);return a&&this.#k(a,c),this.#R(c)?(a&&(a.get="stale"),u?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(n||this.#F(e,"expire"),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#U(c),s&&this.#T(c),l))}else a&&(a.get="miss")}#V(e,t){this.#g[t]=e,this.#p[e]=t}#U(e){e!==this.#m&&(e===this.#w?this.#w=this.#p[e]:this.#V(this.#g[e],this.#p[e]),this.#V(this.#m,e),this.#m=e)}delete(e){return this.#F(e,"delete")}#F(e,t){let i=!1;if(this.#a!==0){let s=this.#l.get(e);if(s!==void 0)if(i=!0,this.#a===1)this.#z(t);else{this.#P(s);let n=this.#u[s];if(this.#y(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#I)&&(this.#v&&this.#r?.(n,e,t),this.#I&&this.#E?.push([n,e,t])),this.#l.delete(e),this.#f[s]=void 0,this.#u[s]=void 0,s===this.#m)this.#m=this.#g[s];else if(s===this.#w)this.#w=this.#p[s];else{let a=this.#g[s];this.#p[a]=this.#p[s];let c=this.#p[s];this.#g[c]=this.#g[s]}this.#a--,this.#A.push(s)}}if(this.#I&&this.#E?.length){let s=this.#E,n;for(;n=s?.shift();)this.#s?.(...n)}return i}clear(){return this.#z("delete")}#z(e){for(let t of this.#D({allowStale:!0})){let i=this.#u[t];if(this.#y(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#f[t];this.#v&&this.#r?.(i,s,e),this.#I&&this.#E?.push([i,s,e])}}if(this.#l.clear(),this.#u.fill(void 0),this.#f.fill(void 0),this.#O&&this.#b&&(this.#O.fill(0),this.#b.fill(0)),this.#_&&this.#_.fill(0),this.#w=0,this.#m=0,this.#A.length=0,this.#h=0,this.#a=0,this.#I&&this.#E){let t=this.#E,i;for(;i=t?.shift();)this.#s?.(...i)}}};rd.LRUCache=rv});var p1=g((lFe,d1)=>{"use strict";var Q=o((...r)=>r.every(e=>e)?r.join(""):"","maybeJoin"),Ne=o(r=>r?encodeURIComponent(r):"","maybeEncode"),f1=o(r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),uX={sshtemplate:o(({domain:r,user:e,project:t,committish:i})=>`git@${r}:${e}/${t}.git${Q("#",i)}`,"sshtemplate"),sshurltemplate:o(({domain:r,user:e,project:t,committish:i})=>`git+ssh://git@${r}/${e}/${t}.git${Q("#",i)}`,"sshurltemplate"),edittemplate:o(({domain:r,user:e,project:t,committish:i,editpath:s,path:n})=>`https://${r}/${e}/${t}${Q("/",s,"/",Ne(i||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:r,user:e,project:t,committish:i,treepath:s})=>`https://${r}/${e}/${t}${Q("/",s,"/",Ne(i))}`,"browsetemplate"),browsetreetemplate:o(({domain:r,user:e,project:t,committish:i,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${r}/${e}/${t}/${s}/${Ne(i||"HEAD")}/${n}${Q("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:r,user:e,project:t,committish:i,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${r}/${e}/${t}/${s}/${Ne(i||"HEAD")}/${n}${Q("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:r,user:e,project:t,treepath:i,committish:s})=>`https://${r}/${e}/${t}${Q("/",i,"/",Ne(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:r,domain:e,user:t,project:i,committish:s})=>`git+https://${Q(r,"@")}${e}/${t}/${i}.git${Q("#",s)}`,"httpstemplate"),filetemplate:o(({domain:r,user:e,project:t,committish:i,path:s})=>`https://${r}/${e}/${t}/raw/${Ne(i||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:r,user:e,project:t,committish:i})=>`${r}:${e}/${t}${Q("#",i)}`,"shortcuttemplate"),pathtemplate:o(({user:r,project:e,committish:t})=>`${r}/${e}${Q("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:r,user:e,project:t})=>`https://${r}/${e}/${t}/issues`,"bugstemplate"),hashformat:f1},Ss={};Ss.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:r,user:e,project:t,committish:i,path:s})=>`https://${Q(r,"@")}raw.githubusercontent.com/${e}/${t}/${Ne(i||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:r,domain:e,user:t,project:i,committish:s})=>`git://${Q(r,"@")}${e}/${t}/${i}.git${Q("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://codeload.${r}/${e}/${t}/tar.gz/${Ne(i||"HEAD")}`,"tarballtemplate"),extract:o(r=>{let[,e,t,i,s]=r.pathname.split("/",5);if(!(i&&i!=="tree")&&(i||(s=r.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};Ss.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:r,user:e,project:t,committish:i,treepath:s,path:n,editpath:a})=>`https://${r}/${e}/${t}${Q("/",s,"/",Ne(i||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}/get/${Ne(i||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(r=>{let[,e,t,i]=r.pathname.split("/",4);if(!["get"].includes(i)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:r.hash.slice(1)}},"extract")};Ss.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}/repository/archive.tar.gz?ref=${Ne(i||"HEAD")}`,"tarballtemplate"),extract:o(r=>{let e=r.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),i=t.pop();i.endsWith(".git")&&(i=i.slice(0,-4));let s=t.join("/");if(!(!s||!i))return{user:s,project:i,committish:r.hash.slice(1)}},"extract")};Ss.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:r,project:e,committish:t})=>`git@${r}:${e}.git${Q("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:r,project:e,committish:t})=>`git+ssh://git@${r}/${e}.git${Q("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:r,user:e,project:t,committish:i,editpath:s})=>`https://${r}/${e}/${t}${Q("/",Ne(i))}/${s}`,"edittemplate"),browsetemplate:o(({domain:r,project:e,committish:t})=>`https://${r}/${e}${Q("/",Ne(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:r,project:e,committish:t,path:i,hashformat:s})=>`https://${r}/${e}${Q("/",Ne(t))}${Q("#",s(i))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:r,project:e,committish:t,path:i,hashformat:s})=>`https://${r}/${e}${Q("/",Ne(t))}${Q("#",s(i))}`,"browseblobtemplate"),docstemplate:o(({domain:r,project:e,committish:t})=>`https://${r}/${e}${Q("/",Ne(t))}`,"docstemplate"),httpstemplate:o(({domain:r,project:e,committish:t})=>`git+https://${r}/${e}.git${Q("#",t)}`,"httpstemplate"),filetemplate:o(({user:r,project:e,committish:t,path:i})=>`https://gist.githubusercontent.com/${r}/${e}/raw${Q("/",Ne(t))}/${i}`,"filetemplate"),shortcuttemplate:o(({type:r,project:e,committish:t})=>`${r}:${e}${Q("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:r,committish:e})=>`${r}${Q("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:r,project:e})=>`https://${r}/${e}`,"bugstemplate"),gittemplate:o(({domain:r,project:e,committish:t})=>`git://${r}/${e}.git${Q("#",t)}`,"gittemplate"),tarballtemplate:o(({project:r,committish:e})=>`https://codeload.github.com/gist/${r}/tar.gz/${Ne(e||"HEAD")}`,"tarballtemplate"),extract:o(r=>{let[,e,t,i]=r.pathname.split("/",4);if(i!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:r.hash.slice(1)}}},"extract"),hashformat:o(function(r){return r&&"file-"+f1(r)},"hashformat")};Ss.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:r,user:e,project:t,committish:i,path:s})=>`https://${r}/${e}/${t}/blob/${Ne(i)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}.git${Q("#",i)}`,"httpstemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}/archive/${Ne(i)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(r=>{let[,e,t,i]=r.pathname.split("/",4);if(!["archive"].includes(i)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:r.hash.slice(1)}},"extract")};for(let[r,e]of Object.entries(Ss))Ss[r]=Object.assign({},uX,e);d1.exports=Ss});var sv=g((hFe,m1)=>{var hX=require("url"),iv=o((r,e,t)=>{let i=r.indexOf(t);return r.lastIndexOf(e,i>-1?i:1/0)},"lastIndexOfBefore"),g1=o(r=>{try{return new hX.URL(r)}catch{}},"safeUrl"),fX=o((r,e)=>{let t=r.indexOf(":"),i=r.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,i)||r.substr(t,3)==="://")return r;let s=r.indexOf("@");return s>-1?s>t?`git+ssh://${r}`:r:`${r.slice(0,t+1)}//${r.slice(t+1)}`},"correctProtocol"),dX=o(r=>{let e=iv(r,"@","#"),t=iv(r,":","#");return t>e&&(r=r.slice(0,t)+"/"+r.slice(t+1)),iv(r,":","#")===-1&&r.indexOf("//")===-1&&(r=`git+ssh://${r}`),r},"correctUrl");m1.exports=(r,e)=>{let t=e?fX(r,e):r;return g1(t)||g1(dX(t))}});var S1=g((dFe,y1)=>{"use strict";var pX=sv(),gX=o(r=>{let e=r.indexOf("#"),t=r.indexOf("/"),i=r.indexOf("/",t+1),s=r.indexOf(":"),n=/\s/.exec(r),a=r.indexOf("@"),c=!n||e>-1&&n.index>e,l=a===-1||e>-1&&a>e,u=s===-1||e>-1&&s>e,h=i===-1||e>-1&&i>e,f=t>0,d=e>-1?r[e-1]!=="/":!r.endsWith("/"),p=!r.startsWith(".");return c&&f&&d&&p&&l&&u&&h},"isGitHubShorthand");y1.exports=(r,e,{gitHosts:t,protocols:i})=>{if(!r)return;let s=gX(r)?`github:${r}`:r,n=pX(s,i);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],l=a||c;if(!l)return;let u=t[a||c],h=null;i[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,d=null,p=null,m=null;try{if(a){let y=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,w=y.indexOf("@");w>-1&&(y=y.slice(w+1));let S=y.lastIndexOf("/");S>-1?(d=decodeURIComponent(y.slice(0,S)),d||(d=null),p=decodeURIComponent(y.slice(S+1))):p=decodeURIComponent(y),p.endsWith(".git")&&(p=p.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),m="shortcut"}else{if(!u.protocols.includes(n.protocol))return;let y=u.extract(n);if(!y)return;d=y.user&&decodeURIComponent(y.user),p=decodeURIComponent(y.project),f=decodeURIComponent(y.committish),m=i[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(y){if(y instanceof URIError)return;throw y}return[l,d,h,p,f,m,e]}});var wl=g((gFe,w1)=>{"use strict";var{LRUCache:mX}=Pi(),yX=p1(),SX=S1(),wX=sv(),nv=new mX({max:1e3});function vX(r){try{let{protocol:e,hostname:t,pathname:i}=new URL(r);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=i.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(vX,"unknownHostedUrl");var id=class r{static{o(this,"GitHost")}constructor(e,t,i,s,n,a,c={}){Object.assign(this,r.#e[e],{type:e,user:t,auth:i,project:s,committish:n,default:a,opts:c})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){r.#e[e]=t,r.#e.byDomain[t.domain]=e,r.#e.byShortcut[`${e}:`]=e,r.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let i=e+JSON.stringify(t||{});if(!nv.has(i)){let s=SX(e,t,{gitHosts:r.#e,protocols:r.#t});nv.set(i,s?new r(...s):void 0)}return nv.get(i)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let i=e.repository,s=i&&(typeof i=="string"?i:typeof i=="object"&&typeof i.url=="string"?i.url:null);if(!s)throw new Error("no repository");let n=s&&r.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=vX(s);return r.fromUrl(a,t)||a}static parseUrl(e){return wX(e)}#r(e,t){if(typeof e!="function")return null;let i={...this,...this.opts,...t};i.path||(i.path=""),i.path.startsWith("/")&&(i.path=i.path.slice(1)),i.noCommittish&&(i.committish=null);let s=e(i);return i.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#r(this.sshtemplate,e)}sshurl(e){return this.#r(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#r(this.browsetemplate,e):typeof t[0]!="string"?this.#r(this.browsetreetemplate,{...t[0],path:e}):this.#r(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#r(this.browseblobtemplate,{...t[0],path:e}):this.#r(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#r(this.docstemplate,e)}bugs(e){return this.#r(this.bugstemplate,e)}https(e){return this.#r(this.httpstemplate,e)}git(e){return this.#r(this.gittemplate,e)}shortcut(e){return this.#r(this.shortcuttemplate,e)}path(e){return this.#r(this.pathtemplate,e)}tarball(e){return this.#r(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#r(this.filetemplate,{...t,path:e})}edit(e,t){return this.#r(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[r,e]of Object.entries(yX))id.addHost(r,e);w1.exports=id});var E1=g(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.range=bn.balanced=void 0;var EX=o((r,e,t)=>{let i=r instanceof RegExp?v1(r,t):r,s=e instanceof RegExp?v1(e,t):e,n=i!==null&&s!=null&&(0,bn.range)(i,s,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+i.length,n[1]),post:t.slice(n[1]+s.length)}},"balanced");bn.balanced=EX;var v1=o((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),_X=o((r,e,t)=>{let i,s,n,a,c,l=t.indexOf(r),u=t.indexOf(e,l+1),h=l;if(l>=0&&u>0){if(r===e)return[l,u];for(i=[],n=t.length;h>=0&&!c;){if(h===l)i.push(h),l=t.indexOf(r,h+1);else if(i.length===1){let f=i.pop();f!==void 0&&(c=[f,u])}else s=i.pop(),s!==void 0&&s<n&&(n=s,a=u),u=t.indexOf(e,h+1);h=l<u&&l>=0?l:u}i.length&&a!==void 0&&(c=[n,a])}return c},"range");bn.range=_X});var A1=g(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});cv.expand=LX;var _1=E1(),b1="\0SLASH"+Math.random()+"\0",O1="\0OPEN"+Math.random()+"\0",av="\0CLOSE"+Math.random()+"\0",I1="\0COMMA"+Math.random()+"\0",T1="\0PERIOD"+Math.random()+"\0",bX=new RegExp(b1,"g"),OX=new RegExp(O1,"g"),IX=new RegExp(av,"g"),TX=new RegExp(I1,"g"),RX=new RegExp(T1,"g"),AX=/\\\\/g,CX=/\\{/g,kX=/\\}/g,PX=/\\,/g,NX=/\\./g;function ov(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}o(ov,"numeric");function xX(r){return r.replace(AX,b1).replace(CX,O1).replace(kX,av).replace(PX,I1).replace(NX,T1)}o(xX,"escapeBraces");function DX(r){return r.replace(bX,"\\").replace(OX,"{").replace(IX,"}").replace(TX,",").replace(RX,".")}o(DX,"unescapeBraces");function R1(r){if(!r)return[""];let e=[],t=(0,_1.balanced)("{","}",r);if(!t)return r.split(",");let{pre:i,body:s,post:n}=t,a=i.split(",");a[a.length-1]+="{"+s+"}";let c=R1(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(R1,"parseCommaParts");function LX(r){return r?(r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),vl(xX(r),!0).map(DX)):[]}o(LX,"expand");function MX(r){return"{"+r+"}"}o(MX,"embrace");function FX(r){return/^-?0\d/.test(r)}o(FX,"isPadded");function BX(r,e){return r<=e}o(BX,"lte");function qX(r,e){return r>=e}o(qX,"gte");function vl(r,e){let t=[],i=(0,_1.balanced)("{","}",r);if(!i)return[r];let s=i.pre,n=i.post.length?vl(i.post,!1):[""];if(/\$$/.test(i.pre))for(let a=0;a<n.length;a++){let c=s+"{"+i.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=a||c,u=i.body.indexOf(",")>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(r=i.pre+"{"+i.body+av+i.post,vl(r)):[r];let h;if(l)h=i.body.split(/\.\./);else if(h=R1(i.body),h.length===1&&h[0]!==void 0&&(h=vl(h[0],!1).map(MX),h.length===1))return n.map(d=>i.pre+h[0]+d);let f;if(l&&h[0]!==void 0&&h[1]!==void 0){let d=ov(h[0]),p=ov(h[1]),m=Math.max(h[0].length,h[1].length),y=h.length===3&&h[2]!==void 0?Math.abs(ov(h[2])):1,w=BX;p<d&&(y*=-1,w=qX);let v=h.some(FX);f=[];for(let _=d;w(_,p);_+=y){let E;if(c)E=String.fromCharCode(_),E==="\\"&&(E="");else if(E=String(_),v){let b=m-E.length;if(b>0){let O=new Array(b+1).join("0");_<0?E="-"+O+E.slice(1):E=O+E}}f.push(E)}}else{f=[];for(let d=0;d<h.length;d++)f.push.apply(f,vl(h[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<n.length;p++){let m=s+f[d]+n[p];(!e||l||m)&&t.push(m)}}return t}o(vl,"expand_")});var C1=g(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.assertValidPattern=void 0;var jX=1024*64,$X=o(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>jX)throw new TypeError("pattern is too long")},"assertValidPattern");sd.assertValidPattern=$X});var P1=g(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.parseClass=void 0;var UX={"[: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]},El=o(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VX=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),k1=o(r=>r.join(""),"rangesToString"),zX=o((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],s=[],n=t+1,a=!1,c=!1,l=!1,u=!1,h=t,f="";e:for(;n<r.length;){let y=r.charAt(n);if((y==="!"||y==="^")&&n===t+1){u=!0,n++;continue}if(y==="]"&&a&&!l){h=n+1;break}if(a=!0,y==="\\"&&!l){l=!0,n++;continue}if(y==="["&&!l){for(let[w,[S,v,_]]of Object.entries(UX))if(r.startsWith(w,n)){if(f)return["$.",!1,r.length-t,!0];n+=w.length,_?s.push(S):i.push(S),c=c||v;continue e}}if(l=!1,f){y>f?i.push(El(f)+"-"+El(y)):y===f&&i.push(El(y)),f="",n++;continue}if(r.startsWith("-]",n+1)){i.push(El(y+"-")),n+=2;continue}if(r.startsWith("-",n+1)){f=y,n+=2;continue}i.push(El(y)),n++}if(h<n)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,r.length-t,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let y=i[0].length===2?i[0].slice(-1):i[0];return[VX(y),!1,h-t,!1]}let d="["+(u?"^":"")+k1(i)+"]",p="["+(u?"":"^")+k1(s)+"]";return[i.length&&s.length?"("+d+"|"+p+")":i.length?d:p,c,h-t,!0]},"parseClass");nd.parseClass=zX});var ad=g(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.unescape=void 0;var GX=o((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");od.unescape=GX});var hv=g(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.AST=void 0;var HX=P1(),cd=ad(),WX=new Set(["!","?","+","*","@"]),N1=o(r=>WX.has(r),"isExtglobType"),JX="(?!(?:^|/)\\.\\.?(?:$|/))",ld="(?!\\.)",KX=new Set(["[","."]),YX=new Set(["..","."]),ZX=new Set("().*{}+?[]^$\\!"),XX=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),uv="[^/]",x1=uv+"*?",D1=uv+"+?",lv=class r{static{o(this,"AST")}type;#e;#t;#r=!1;#i=[];#s;#o;#n;#c=!1;#a;#h;#l=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#n=this.#e===this?[]:this.#e.#n,e==="!"&&!this.#e.#c&&this.#n.push(this),this.#o=this.#s?this.#s.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#h=this.#i.map(e=>String(e)).join("")}#f(){if(this!==this.#e)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#n.pop();){if(e.type!=="!")continue;let t=e,i=t.#s;for(;i;){for(let s=t.#o+1;!i.type&&s<i.#i.length;s++)for(let n of e.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(i.#i[s])}t=i,i=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof r&&t.#s===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#c&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#o===0)return!0;let e=this.#s;for(let t=0;t<this.#o;t++){let i=e.#i[t];if(!(i instanceof r&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#s?.type==="!")return!0;if(!this.#s?.isEnd())return!1;if(!this.type)return this.#s?.isEnd();let e=this.#s?this.#s.#i.length:0;return this.#o===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new r(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#u(e,t,i,s){let n=!1,a=!1,c=-1,l=!1;if(t.type===null){let p=i,m="";for(;p<e.length;){let y=e.charAt(p++);if(n||y==="\\"){n=!n,m+=y;continue}if(a){p===c+1?(y==="^"||y==="!")&&(l=!0):y==="]"&&!(p===c+2&&l)&&(a=!1),m+=y;continue}else if(y==="["){a=!0,c=p,l=!1,m+=y;continue}if(!s.noext&&N1(y)&&e.charAt(p)==="("){t.push(m),m="";let w=new r(y,t);p=r.#u(e,w,p,s),t.push(w);continue}m+=y}return t.push(m),p}let u=i+1,h=new r(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==="!")&&(l=!0):p==="]"&&!(u===c+2&&l)&&(a=!1),d+=p;continue}else if(p==="["){a=!0,c=u,l=!1,d+=p;continue}if(N1(p)&&e.charAt(u)==="("){h.push(d),d="";let m=new r(p,h);h.push(m),u=r.#u(e,m,u,s);continue}if(p==="|"){h.push(d),d="",f.push(h),h=new r(null,t);continue}if(p===")")return d===""&&t.#i.length===0&&(t.#l=!0),h.push(d),d="",t.push(...f,h),u;d+=p}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],u}static fromGlob(e,t={}){let i=new r(null,void 0,t);return r.#u(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let c=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#f(),!this.type){let l=this.isStart()&&this.isEnd(),u=this.#i.map(p=>{let[m,y,w,S]=typeof p=="string"?r.#g(p,this.#t,l):p.toRegExpSource(e);return this.#t=this.#t||w,this.#r=this.#r||S,m}).join(""),h="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&YX.has(this.#i[0]))){let m=KX,y=t&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),w=!t&&!e&&m.has(u.charAt(0));h=y?JX:w?ld:""}let f="";return this.isEnd()&&this.#e.#c&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+u+f,(0,cd.unescape)(u),this.#t=!!this.#t,this.#r]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let l=this.toString();return this.#i=[l],this.type=null,this.#t=void 0,[l,(0,cd.unescape)(this.toString()),!1,!1]}let a=!i||e||t||!ld?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?ld:"")+D1;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?ld:"")+x1+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+l}return[c,(0,cd.unescape)(n),this.#t=!!this.#t,this.#r]}#p(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,s,n,a]=t.toRegExpSource(e);return this.#r=this.#r||a,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#g(e,t,i=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let l=e.charAt(c);if(s){s=!1,n+=(ZX.has(l)?"\\":"")+l;continue}if(l==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(l==="["){let[u,h,f,d]=(0,HX.parseClass)(e,c);if(f){n+=u,a=a||h,c+=f-1,t=t||d;continue}}if(l==="*"){i&&e==="*"?n+=D1:n+=x1,t=!0;continue}if(l==="?"){n+=uv,t=!0;continue}n+=XX(l)}return[n,(0,cd.unescape)(e),!!t,a]}};ud.AST=lv});var fv=g(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.escape=void 0;var QX=o((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape");hd.escape=QX});var Rr=g(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.unescape=M.escape=M.AST=M.Minimatch=M.match=M.makeRe=M.braceExpand=M.defaults=M.filter=M.GLOBSTAR=M.sep=M.minimatch=void 0;var e9=A1(),fd=C1(),F1=hv(),t9=fv(),r9=ad(),i9=o((r,e,t={})=>((0,fd.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new On(e,t).match(r)),"minimatch");M.minimatch=i9;var s9=/^\*+([^+@!?\*\[\(]*)$/,n9=o(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),o9=o(r=>e=>e.endsWith(r),"starDotExtTestDot"),a9=o(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),c9=o(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),l9=/^\*+\.\*+$/,u9=o(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),h9=o(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),f9=/^\.\*+$/,d9=o(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),p9=/^\*+$/,g9=o(r=>r.length!==0&&!r.startsWith("."),"starTest"),m9=o(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),y9=/^\?+([^+@!?\*\[\(]*)?$/,S9=o(([r,e=""])=>{let t=B1([r]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),w9=o(([r,e=""])=>{let t=q1([r]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),v9=o(([r,e=""])=>{let t=q1([r]);return e?i=>t(i)&&i.endsWith(e):t},"qmarksTestDot"),E9=o(([r,e=""])=>{let t=B1([r]);return e?i=>t(i)&&i.endsWith(e):t},"qmarksTest"),B1=o(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),q1=o(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),j1=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",L1={win32:{sep:"\\"},posix:{sep:"/"}};M.sep=j1==="win32"?L1.win32.sep:L1.posix.sep;M.minimatch.sep=M.sep;M.GLOBSTAR=Symbol("globstar **");M.minimatch.GLOBSTAR=M.GLOBSTAR;var _9="[^/]",b9=_9+"*?",O9="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",I9="(?:(?!(?:\\/|^)\\.).)*?",T9=o((r,e={})=>t=>(0,M.minimatch)(t,r,e),"filter");M.filter=T9;M.minimatch.filter=M.filter;var Jt=o((r,e={})=>Object.assign({},r,e),"ext"),R9=o(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return M.minimatch;let e=M.minimatch;return Object.assign(o((i,s,n={})=>e(i,s,Jt(r,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Jt(r,n))}static defaults(s){return e.defaults(Jt(r,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Jt(r,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Jt(r,n))}},unescape:o((i,s={})=>e.unescape(i,Jt(r,s)),"unescape"),escape:o((i,s={})=>e.escape(i,Jt(r,s)),"escape"),filter:o((i,s={})=>e.filter(i,Jt(r,s)),"filter"),defaults:o(i=>e.defaults(Jt(r,i)),"defaults"),makeRe:o((i,s={})=>e.makeRe(i,Jt(r,s)),"makeRe"),braceExpand:o((i,s={})=>e.braceExpand(i,Jt(r,s)),"braceExpand"),match:o((i,s,n={})=>e.match(i,s,Jt(r,n)),"match"),sep:e.sep,GLOBSTAR:M.GLOBSTAR})},"defaults");M.defaults=R9;M.minimatch.defaults=M.defaults;var A9=o((r,e={})=>((0,fd.assertValidPattern)(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,e9.expand)(r)),"braceExpand");M.braceExpand=A9;M.minimatch.braceExpand=M.braceExpand;var C9=o((r,e={})=>new On(r,e).makeRe(),"makeRe");M.makeRe=C9;M.minimatch.makeRe=M.makeRe;var k9=o((r,e,t={})=>{let i=new On(e,t);return r=r.filter(s=>i.match(s)),i.options.nonull&&!r.length&&r.push(e),r},"match");M.match=k9;M.minimatch.match=M.match;var M1=/[?*]|[+@!]\(.*?\)|\[|\]/,P9=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),On=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,fd.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||j1,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 i=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=n[0]===""&&n[1]===""&&(n[2]==="?"||!M1.test(n[2]))&&!M1.test(n[3]),u=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(u)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(l=>this.parse(l))});if(this.debug(this.pattern,s),this.set=s.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 i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");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 i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let s=i;for(;t[s+1]==="**";)s++;s!==i&&t.splice(i,s-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,s)=>{let n=i[i.length-1];return s==="**"&&n==="**"?i:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(i.pop(),i):(i.push(s),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let a=s;for(;i[a+1]==="**";)a++;a>s&&i.splice(s+1,a-s);let c=i[s+1],l=i[s+2],u=i[s+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,i.splice(s,1);let h=i.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let c=i[a];a===1&&c===""&&i[0]===""||(c==="."||c==="")&&(t=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let n=0;for(;(n=i.indexOf("..",n+1))!==-1;){let a=i[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let l=n===1&&i[n+1]==="**"?["."]:[];i.splice(n-1,2,...l),i.length===0&&i.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let s=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(s){e[t]=[],e[i]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let s=0,n=0,a=[],c="";for(;s<e.length&&n<t.length;)if(e[s]===t[n])a.push(c==="b"?t[n]:e[s]),s++,n++;else if(i&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(i&&t[n]==="**"&&e[s]===t[n+1])a.push(t[n]),n++;else if(e[s]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[s]),s++,n++}else if(t[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),s++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let s=this.options;if(this.isWindows){let y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!S&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),_=w?3:y?0:void 0,E=v?3:S?0:void 0;if(typeof _=="number"&&typeof E=="number"){let[b,O]=[e[_],t[E]];b.toLowerCase()===O.toLowerCase()&&(t[E]=b,E>_?t=t.slice(E):_>E&&(e=e.slice(_)))}}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,l=e.length,u=t.length;a<l&&c<u;a++,c++){this.debug("matchOne loop");var h=t[c],f=e[a];if(this.debug(t,h,f),h===!1)return!1;if(h===M.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var d=a,p=c+1;if(p===u){for(this.debug("** at the end");a<l;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<l;){var m=e[d];if(this.debug(`
7
+ globstar while`,e,d,t,p,m),this.matchOne(e.slice(d),t.slice(p),i))return this.debug("globstar found match!",d,l,m),!0;if(m==="."||m===".."||!s.dot&&m.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(i&&(this.debug(`
8
+ >>> no match, partial?`,e,d,t,p),d===l))}let y;if(typeof h=="string"?(y=f===h,this.debug("string match",h,f,y)):(y=h.test(f),this.debug("pattern match",h,f,y)),!y)return!1}if(a===l&&c===u)return!0;if(a===l)return i;if(c===u)return a===l-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,M.braceExpand)(this.pattern,this.options)}parse(e){(0,fd.assertValidPattern)(e);let t=this.options;if(e==="**")return M.GLOBSTAR;if(e==="")return"";let i,s=null;(i=e.match(p9))?s=t.dot?m9:g9:(i=e.match(s9))?s=(t.nocase?t.dot?c9:a9:t.dot?o9:n9)(i[1]):(i=e.match(y9))?s=(t.nocase?t.dot?w9:S9:t.dot?v9:E9)(i):(i=e.match(l9))?s=t.dot?h9:u9:(i=e.match(f9))&&(s=d9);let n=F1.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),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,i=t.noglobstar?b9:t.dot?O9:I9,s=new Set(t.nocase?["i"]:[]),n=e.map(l=>{let u=l.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?P9(h):h===M.GLOBSTAR?M.GLOBSTAR:h._src});return u.forEach((h,f)=>{let d=u[f+1],p=u[f-1];h!==M.GLOBSTAR||p===M.GLOBSTAR||(p===void 0?d!==void 0&&d!==M.GLOBSTAR?u[f+1]="(?:\\/|"+i+"\\/)?"+d:u[f]=i:d===void 0?u[f-1]=p+"(?:\\/|"+i+")?":d!==M.GLOBSTAR&&(u[f-1]=p+"(?:\\/|\\/"+i+"\\/)"+d,u[f+1]=M.GLOBSTAR))}),u.filter(h=>h!==M.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].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 i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<n.length;c++){let l=n[c],u=s;if(i.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return M.minimatch.defaults(e).Minimatch}};M.Minimatch=On;var N9=hv();Object.defineProperty(M,"AST",{enumerable:!0,get:o(function(){return N9.AST},"get")});var x9=fv();Object.defineProperty(M,"escape",{enumerable:!0,get:o(function(){return x9.escape},"get")});var D9=ad();Object.defineProperty(M,"unescape",{enumerable:!0,get:o(function(){return D9.unescape},"get")});M.minimatch.AST=F1.AST;M.minimatch.Minimatch=On;M.minimatch.escape=t9.escape;M.minimatch.unescape=r9.unescape});var ee=g(ht=>{"use strict";var L9=ht&&ht.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ht,"__esModule",{value:!0});ht.Minipass=ht.isWritable=ht.isReadable=ht.isStream=void 0;var $1=typeof process=="object"&&process?process:{stdout:null,stderr:null},wv=require("node:events"),G1=L9(require("node:stream")),M9=require("node:string_decoder"),F9=o(r=>!!r&&typeof r=="object"&&(r instanceof wd||r instanceof G1.default||(0,ht.isReadable)(r)||(0,ht.isWritable)(r)),"isStream");ht.isStream=F9;var B9=o(r=>!!r&&typeof r=="object"&&r instanceof wv.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==G1.default.Writable.prototype.pipe,"isReadable");ht.isReadable=B9;var q9=o(r=>!!r&&typeof r=="object"&&r instanceof wv.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable");ht.isWritable=q9;var Ni=Symbol("EOF"),xi=Symbol("maybeEmitEnd"),ws=Symbol("emittedEnd"),dd=Symbol("emittingEnd"),_l=Symbol("emittedError"),pd=Symbol("closed"),U1=Symbol("read"),gd=Symbol("flush"),V1=Symbol("flushChunk"),Ar=Symbol("encoding"),Ko=Symbol("decoder"),Ue=Symbol("flowing"),bl=Symbol("paused"),Yo=Symbol("resume"),Ve=Symbol("buffer"),ut=Symbol("pipes"),ze=Symbol("bufferLength"),dv=Symbol("bufferPush"),md=Symbol("bufferShift"),et=Symbol("objectMode"),ke=Symbol("destroyed"),pv=Symbol("error"),gv=Symbol("emitData"),z1=Symbol("emitEnd"),mv=Symbol("emitEnd2"),Hr=Symbol("async"),yv=Symbol("abort"),yd=Symbol("aborted"),Ol=Symbol("signal"),In=Symbol("dataListeners"),Dt=Symbol("discarded"),Il=o(r=>Promise.resolve().then(r),"defer"),j9=o(r=>r(),"nodefer"),$9=o(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),U9=o(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),V9=o(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),Sd=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[Yo](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Sv=class extends Sd{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},z9=o(r=>!!r.objectMode,"isObjectModeOptions"),G9=o(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),wd=class extends wv.EventEmitter{static{o(this,"Minipass")}[Ue]=!1;[bl]=!1;[ut]=[];[Ve]=[];[et];[Ar];[Hr];[Ko];[Ni]=!1;[ws]=!1;[dd]=!1;[pd]=!1;[_l]=null;[ze]=0;[ke]=!1;[Ol];[yd]=!1;[In]=0;[Dt]=!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");z9(t)?(this[et]=!0,this[Ar]=null):G9(t)?(this[Ar]=t.encoding,this[et]=!1):(this[et]=!1,this[Ar]=null),this[Hr]=!!t.async,this[Ko]=this[Ar]?new M9.StringDecoder(this[Ar]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Ve],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[ut],"get")});let{signal:i}=t;i&&(this[Ol]=i,i.aborted?this[yv]():i.addEventListener("abort",()=>this[yv]()))}get bufferLength(){return this[ze]}get encoding(){return this[Ar]}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[et]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Hr]}set async(e){this[Hr]=this[Hr]||!!e}[yv](){this[yd]=!0,this.emit("abort",this[Ol]?.reason),this.destroy(this[Ol]?.reason)}get aborted(){return this[yd]}set aborted(e){}write(e,t,i){if(this[yd])return!1;if(this[Ni])throw new Error("write after end");if(this[ke])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let s=this[Hr]?Il:j9;if(!this[et]&&!Buffer.isBuffer(e)){if(V9(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(U9(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[et]?(this[Ue]&&this[ze]!==0&&this[gd](!0),this[Ue]?this.emit("data",e):this[dv](e),this[ze]!==0&&this.emit("readable"),i&&s(i),this[Ue]):e.length?(typeof e=="string"&&!(t===this[Ar]&&!this[Ko]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Ar]&&(e=this[Ko].write(e)),this[Ue]&&this[ze]!==0&&this[gd](!0),this[Ue]?this.emit("data",e):this[dv](e),this[ze]!==0&&this.emit("readable"),i&&s(i),this[Ue]):(this[ze]!==0&&this.emit("readable"),i&&s(i),this[Ue])}read(e){if(this[ke])return null;if(this[Dt]=!1,this[ze]===0||e===0||e&&e>this[ze])return this[xi](),null;this[et]&&(e=null),this[Ve].length>1&&!this[et]&&(this[Ve]=[this[Ar]?this[Ve].join(""):Buffer.concat(this[Ve],this[ze])]);let t=this[U1](e||null,this[Ve][0]);return this[xi](),t}[U1](e,t){if(this[et])this[md]();else{let i=t;e===i.length||e===null?this[md]():typeof i=="string"?(this[Ve][0]=i.slice(e),t=i.slice(0,e),this[ze]-=e):(this[Ve][0]=i.subarray(e),t=i.subarray(0,e),this[ze]-=e)}return this.emit("data",t),!this[Ve].length&&!this[Ni]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[Ni]=!0,this.writable=!1,(this[Ue]||!this[bl])&&this[xi](),this}[Yo](){this[ke]||(!this[In]&&!this[ut].length&&(this[Dt]=!0),this[bl]=!1,this[Ue]=!0,this.emit("resume"),this[Ve].length?this[gd]():this[Ni]?this[xi]():this.emit("drain"))}resume(){return this[Yo]()}pause(){this[Ue]=!1,this[bl]=!0,this[Dt]=!1}get destroyed(){return this[ke]}get flowing(){return this[Ue]}get paused(){return this[bl]}[dv](e){this[et]?this[ze]+=1:this[ze]+=e.length,this[Ve].push(e)}[md](){return this[et]?this[ze]-=1:this[ze]-=this[Ve][0].length,this[Ve].shift()}[gd](e=!1){do;while(this[V1](this[md]())&&this[Ve].length);!e&&!this[Ve].length&&!this[Ni]&&this.emit("drain")}[V1](e){return this.emit("data",e),this[Ue]}pipe(e,t){if(this[ke])return e;this[Dt]=!1;let i=this[ws];return t=t||{},e===$1.stdout||e===$1.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[ut].push(t.proxyErrors?new Sv(this,e,t):new Sd(this,e,t)),this[Hr]?Il(()=>this[Yo]()):this[Yo]()),e}unpipe(e){let t=this[ut].find(i=>i.dest===e);t&&(this[ut].length===1?(this[Ue]&&this[In]===0&&(this[Ue]=!1),this[ut]=[]):this[ut].splice(this[ut].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[Dt]=!1,this[In]++,!this[ut].length&&!this[Ue]&&this[Yo]();else if(e==="readable"&&this[ze]!==0)super.emit("readable");else if($9(e)&&this[ws])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[_l]){let s=t;this[Hr]?Il(()=>s.call(this,this[_l])):s.call(this,this[_l])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[In]=this.listeners("data").length,this[In]===0&&!this[Dt]&&!this[ut].length&&(this[Ue]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[In]=0,!this[Dt]&&!this[ut].length&&(this[Ue]=!1)),t}get emittedEnd(){return this[ws]}[xi](){!this[dd]&&!this[ws]&&!this[ke]&&this[Ve].length===0&&this[Ni]&&(this[dd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[pd]&&this.emit("close"),this[dd]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==ke&&this[ke])return!1;if(e==="data")return!this[et]&&!i?!1:this[Hr]?(Il(()=>this[gv](i)),!0):this[gv](i);if(e==="end")return this[z1]();if(e==="close"){if(this[pd]=!0,!this[ws]&&!this[ke])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[_l]=i,super.emit(pv,i);let n=!this[Ol]||this.listeners("error").length?super.emit("error",i):!1;return this[xi](),n}else if(e==="resume"){let n=super.emit("resume");return this[xi](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...t);return this[xi](),s}[gv](e){for(let i of this[ut])i.dest.write(e)===!1&&this.pause();let t=this[Dt]?!1:super.emit("data",e);return this[xi](),t}[z1](){return this[ws]?!1:(this[ws]=!0,this.readable=!1,this[Hr]?(Il(()=>this[mv]()),!0):this[mv]())}[mv](){if(this[Ko]){let t=this[Ko].end();if(t){for(let i of this[ut])i.dest.write(t);this[Dt]||super.emit("data",t)}}for(let t of this[ut])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[et]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[et]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[et])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ar]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(ke,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Dt]=!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 s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Ni])return t();let n,a,c=o(f=>{this.off("data",l),this.off("end",u),this.off(ke,h),t(),a(f)},"onerr"),l=o(f=>{this.off("error",c),this.off("end",u),this.off(ke,h),this.pause(),n({value:f,done:!!this[Ni]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",l),this.off(ke,h),t(),n({done:!0,value:void 0})},"onend"),h=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,d)=>{a=d,n=f,this.once(ke,h),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Dt]=!1;let e=!1,t=o(()=>(this.pause(),this.off(pv,t),this.off(ke,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),i=o(()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}},"next");return this.once("end",t),this.once(pv,t),this.once(ke,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[ke])return e?this.emit("error",e):this.emit(ke),this;this[ke]=!0,this[Dt]=!0,this[Ve].length=0,this[ze]=0;let t=this;return typeof t.close=="function"&&!this[pd]&&t.close(),e?this.emit("error",e):this.emit(ke),this}static get isStream(){return ht.isStream}};ht.Minipass=wd});var oN=g(te=>{"use strict";var H9=te&&te.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),W9=te&&te.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),J9=te&&te.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&H9(e,r,t);return W9(e,r),e};Object.defineProperty(te,"__esModule",{value:!0});te.PathScurry=te.Path=te.PathScurryDarwin=te.PathScurryPosix=te.PathScurryWin32=te.PathScurryBase=te.PathPosix=te.PathWin32=te.PathBase=te.ChildrenCache=te.ResolveCache=void 0;var Z1=Pi(),Od=require("node:path"),K9=require("node:url"),Rl=require("fs"),Y9=J9(require("node:fs")),Z9=Rl.realpathSync.native,vd=require("node:fs/promises"),H1=ee(),Al={lstatSync:Rl.lstatSync,readdir:Rl.readdir,readdirSync:Rl.readdirSync,readlinkSync:Rl.readlinkSync,realpathSync:Z9,promises:{lstat:vd.lstat,readdir:vd.readdir,readlink:vd.readlink,realpath:vd.realpath}},X1=o(r=>!r||r===Al||r===Y9?Al:{...Al,...r,promises:{...Al.promises,...r.promises||{}}},"fsFromOption"),Q1=/^\\\\\?\\([a-z]:)\\?$/i,X9=o(r=>r.replace(/\//g,"\\").replace(Q1,"$1\\"),"uncToDrive"),Q9=/[\\\/]/,Yt=0,eN=1,tN=2,Wr=4,rN=6,iN=8,Tn=10,sN=12,Kt=15,Tl=~Kt,vv=16,W1=32,Cl=64,Cr=128,Ed=256,bd=512,J1=Cl|Cr|bd,e8=1023,Ev=o(r=>r.isFile()?iN:r.isDirectory()?Wr:r.isSymbolicLink()?Tn:r.isCharacterDevice()?tN:r.isBlockDevice()?rN:r.isSocket()?sN:r.isFIFO()?eN:Yt,"entToType"),K1=new Map,kl=o(r=>{let e=K1.get(r);if(e)return e;let t=r.normalize("NFKD");return K1.set(r,t),t},"normalize"),Y1=new Map,_d=o(r=>{let e=Y1.get(r);if(e)return e;let t=kl(r.toLowerCase());return Y1.set(r,t),t},"normalizeNocase"),Pl=class extends Z1.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};te.ResolveCache=Pl;var Id=class extends Z1.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};te.ChildrenCache=Id;var nN=Symbol("PathScurry setAsCwd"),Ye=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#s;get uid(){return this.#s}#o;get gid(){return this.#o}#n;get rdev(){return this.#n}#c;get blksize(){return this.#c}#a;get ino(){return this.#a}#h;get size(){return this.#h}#l;get blocks(){return this.#l}#f;get atimeMs(){return this.#f}#u;get mtimeMs(){return this.#u}#p;get ctimeMs(){return this.#p}#g;get birthtimeMs(){return this.#g}#w;get atime(){return this.#w}#m;get mtime(){return this.#m}#A;get ctime(){return this.#A}#E;get birthtime(){return this.#E}#_;#b;#O;#v;#C;#I;#d;#B;#T;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Yt,i,s,n,a,c){this.name=e,this.#_=n?_d(e):kl(e),this.#d=t&e8,this.nocase=n,this.roots=s,this.root=i||this,this.#B=a,this.#O=c.fullpath,this.#C=c.relative,this.#I=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=X1(c.fs)}depth(){return this.#b!==void 0?this.#b:this.parent?this.#b=this.parent.depth()+1:this.#b=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#L(s):this.#L(s)}#L(e){let t=this;for(let i of e)t=t.child(i);return t}children(){let e=this.#B.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#B.set(this,t),this.#d&=~vv,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?_d(e):kl(e);for(let l of i)if(l.#_===s)return l;let n=this.parent?this.sep:"",a=this.#O?this.#O+n+e:void 0,c=this.newChild(e,Yt,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#d|=Cr),i.push(c),c}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.fullpathPosix();let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(this.#O!==void 0)return this.#O;let e=this.name,t=this.parent;if(!t)return this.#O=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#O=s}fullpathPosix(){if(this.#v!==void 0)return this.#v;if(this.sep==="/")return this.#v=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#v=`//?/${s}`:this.#v=s}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return this.#v=i}isUnknown(){return(this.#d&Kt)===Yt}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.#d&Kt)===iN}isDirectory(){return(this.#d&Kt)===Wr}isCharacterDevice(){return(this.#d&Kt)===tN}isBlockDevice(){return(this.#d&Kt)===rN}isFIFO(){return(this.#d&Kt)===eN}isSocket(){return(this.#d&Kt)===sN}isSymbolicLink(){return(this.#d&Tn)===Tn}lstatCached(){return this.#d&W1?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#k}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let e=this.#d&Kt;return!(e!==Yt&&e!==Tn||this.#d&Ed||this.#d&Cr)}calledReaddir(){return!!(this.#d&vv)}isENOENT(){return!!(this.#d&Cr)}isNamed(e){return this.nocase?this.#_===_d(e):this.#_===kl(e)}async readlink(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return this.#T=i}catch(t){this.#S(t.code);return}}readlinkSync(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return this.#T=i}catch(t){this.#S(t.code);return}}#R(e){this.#d|=vv;for(let t=e.provisional;t<e.length;t++){let i=e[t];i&&i.#q()}}#q(){this.#d&Cr||(this.#d=(this.#d|Cr)&Tl,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#q()}#N(){this.#d|=bd,this.#M()}#M(){if(this.#d&Cl)return;let e=this.#d;(e&Kt)===Wr&&(e&=Tl),this.#d=e|Cl,this.#P()}#x(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#q():this.children().provisional=0}#D(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#q()}#S(e=""){let t=this.#d;t|=Ed,e==="ENOENT"&&(t|=Cr),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Tl),this.#d=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#j(e,t){return this.#y(e,t)||this.#$(e,t)}#$(e,t){let i=Ev(e),s=this.newChild(e.name,i,{parent:this}),n=s.#d&Kt;return n!==Wr&&n!==Tn&&n!==Yt&&(s.#d|=Cl),t.unshift(s),t.provisional++,s}#y(e,t){for(let i=t.provisional;i<t.length;i++){let s=t[i];if((this.nocase?_d(e.name):kl(e.name))===s.#_)return this.#V(e,s,i,t)}}#V(e,t,i,s){let n=t.name;return t.#d=t.#d&Tl|Ev(e),n!==e.name&&(t.name=e.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#d&Cr)===0)try{return this.#U(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#D(e.code)}}lstatSync(){if((this.#d&Cr)===0)try{return this.#U(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#D(e.code)}}#U(e){let{atime:t,atimeMs:i,birthtime:s,birthtimeMs:n,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:h,gid:f,ino:d,mode:p,mtime:m,mtimeMs:y,nlink:w,rdev:S,size:v,uid:_}=e;this.#w=t,this.#f=i,this.#E=s,this.#g=n,this.#c=a,this.#l=c,this.#A=l,this.#p=u,this.#t=h,this.#o=f,this.#a=d,this.#r=p,this.#m=m,this.#u=y,this.#i=w,this.#n=S,this.#h=v,this.#s=_;let E=Ev(e);this.#d=this.#d&Tl|E|W1,E!==Yt&&E!==Wr&&E!==Tn&&(this.#d|=Cl)}#F=[];#z=!1;#H(e){this.#z=!1;let t=this.#F.slice();this.#F.length=0,t.forEach(i=>i(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let n=i.slice(0,i.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#F.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#x(n.code),i.provisional=0;else{for(let c of a)this.#j(c,i);this.#R(i)}this.#H(i.slice(0,i.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 i=o(()=>{},"resolve");this.#G=new Promise(s=>i=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#j(s,e);this.#R(e)}catch(s){this.#x(s.code),e.provisional=0}this.#G=void 0,i()}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 i of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(i,e);this.#R(e)}catch(i){this.#x(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&J1)return!1;let e=Kt&this.#d;return e===Yt||e===Wr||e===Tn}shouldWalk(e,t){return(this.#d&Wr)===Wr&&!(this.#d&J1)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#k)return this.#k;if(!((bd|Ed|Cr)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#k=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#k)return this.#k;if(!((bd|Ed|Cr)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#k=this.resolve(e)}catch{this.#N()}}[nN](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),i=[],s=this;for(;s&&s.parent;)t.add(s),s.#C=i.join(this.sep),s.#I=i.join("/"),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#C=void 0,s.#I=void 0,s=s.parent}};te.PathBase=Ye;var Nl=class r extends Ye{static{o(this,"PathWin32")}sep="\\";splitSep=Q9;constructor(e,t=Yt,i,s,n,a,c){super(e,t,i,s,n,a,c)}newChild(e,t=Yt,i={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Od.win32.parse(e).root}getRoot(e){if(e=X9(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new Ll(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Q1,"$1\\"),e===t}};te.PathWin32=Nl;var xl=class r extends Ye{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Yt,i,s,n,a,c){super(e,t,i,s,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Yt,i={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}};te.PathPosix=xl;var Dl=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#i;constructor(e=process.cwd(),t,i,{nocase:s,childrenCacheSize:n=16*1024,fs:a=Al}={}){this.#i=X1(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,K9.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Pl,this.#t=new Pl,this.#r=new Id(n);let l=c.substring(this.rootPath.length).split(i);if(l.length===1&&!l[0]&&l.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let u=this.root,h=l.length-1,f=t.sep,d=this.rootPath,p=!1;for(let m of l){let y=h--;u=u.child(m,{relative:new Array(y).fill("..").join(f),relativePosix:new Array(y).fill("..").join("/"),fullpath:d+=(p?"":f)+m}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}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 i=this.#e.get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}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 i=this.#t.get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}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 Ye||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e,e=this.cwd);let{withFileTypes:i=!0}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.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 Ye||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(i?e:e.fullpath());let l=new Set,u=o((f,d)=>{l.add(f),f.readdirCB((p,m)=>{if(p)return d(p);let y=m.length;if(!y)return d();let w=o(()=>{--y===0&&d()},"next");for(let S of m)(!n||n(S))&&c.push(i?S:S.fullpath()),s&&S.isSymbolicLink()?S.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(l,a)?u(v,w):w()):S.shouldWalk(l,a)?u(S,w):w()},!0)},"walk"),h=e;return new Promise((f,d)=>{u(h,p=>{if(p)return d(p);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(i?e:e.fullpath());let l=new Set([e]);for(let u of l){let h=u.readdirSync();for(let f of h){(!n||n(f))&&c.push(i?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(s&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,a)&&l.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 Ye||(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 Ye||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let h of u){(!n||n(h))&&(yield i?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(s&&(f=h.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 Ye||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new H1.Minipass({objectMode:!0});(!n||n(e))&&c.write(i?e:e.fullpath());let l=new Set,u=[e],h=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){h===0&&c.end();return}h++,l.add(p);let m=o((w,S,v=!1)=>{if(w)return c.emit("error",w);if(s&&!v){let _=[];for(let E of S)E.isSymbolicLink()&&_.push(E.realpath().then(b=>b?.isUnknown()?b.lstat():b));if(_.length){Promise.all(_).then(()=>m(null,S,!0));return}}for(let _ of S)_&&(!n||n(_))&&(c.write(i?_:_.fullpath())||(d=!0));h--;for(let _ of S){let E=_.realpathCached()||_;E.shouldWalk(l,a)&&u.push(E)}d&&!c.flowing?c.once("drain",f):y||f()},"onReaddir"),y=!0;p.readdirCB(m,!0),y=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ye||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new H1.Minipass({objectMode:!0}),l=new Set;(!n||n(e))&&c.write(i?e:e.fullpath());let u=[e],h=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){h===0&&c.end();return}h++,l.add(p);let m=p.readdirSync();for(let y of m)(!n||n(y))&&(c.write(i?y:y.fullpath())||(d=!0));h--;for(let y of m){let w=y;if(y.isSymbolicLink()){if(!(s&&(w=y.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(l,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[nN](t)}};te.PathScurryBase=Dl;var Ll=class extends Dl{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,Od.win32,"\\",{...t,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Od.win32.parse(e).root.toUpperCase()}newRoot(e){return new Nl(this.rootPath,Wr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};te.PathScurryWin32=Ll;var Ml=class extends Dl{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:i=!1}=t;super(e,Od.posix,"/",{...t,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new xl(this.rootPath,Wr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};te.PathScurryPosix=Ml;var Td=class extends Ml{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,{...t,nocase:i})}};te.PathScurryDarwin=Td;te.Path=process.platform==="win32"?Nl:xl;te.PathScurry=process.platform==="win32"?Ll:process.platform==="darwin"?Td:Ml});var bv=g(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.Pattern=void 0;var t8=Rr(),r8=o(r=>r.length>=1,"isPatternList"),i8=o(r=>r.length>=1,"isGlobList"),_v=class r{static{o(this,"Pattern")}#e;#t;#r;length;#i;#s;#o;#n;#c;#a;#h=!0;constructor(e,t,i,s){if(!r8(e))throw new TypeError("empty pattern list");if(!i8(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,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#r=i,this.#i=s,this.#r===0){if(this.isUNC()){let[n,a,c,l,...u]=this.#e,[h,f,d,p,...m]=this.#t;u[0]===""&&(u.shift(),m.shift());let y=[n,a,c,l,""].join("/"),w=[h,f,d,p,""].join("/");this.#e=[y,...u],this.#t=[w,...m],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...l]=this.#t;a[0]===""&&(a.shift(),l.shift());let u=n+"/",h=c+"/";this.#e=[u,...a],this.#t=[h,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===t8.GLOBSTAR}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new r(this.#e,this.#t,this.#r+1,this.#i),this.#s.#a=this.#a,this.#s.#c=this.#c,this.#s.#n=this.#n,this.#s):this.#s=null}isUNC(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#i==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#n!==void 0?this.#n:this.#n=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};Rd.Pattern=_v});var Iv=g(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.Ignore=void 0;var aN=Rr(),s8=bv(),n8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ov=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:i,noext:s,noglobstar:n,platform:a=n8}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:i,noext:s,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new aN.Minimatch(e,this.mmopts);for(let i=0;i<t.set.length;i++){let s=t.set[i],n=t.globParts[i];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new s8.Pattern(s,n,0,this.platform),c=new aN.Minimatch(a.globString(),this.mmopts),l=n[n.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),i=`${t}/`,s=e.relative()||".",n=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(i))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};Ad.Ignore=Ov});var lN=g(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.Processor=Jr.SubWalks=Jr.MatchRecord=Jr.HasWalkedCache=void 0;var cN=Rr(),Cd=class r{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),s=this.store.get(i);s?s.add(t.globString()):this.store.set(i,new Set([t.globString()]))}};Jr.HasWalkedCache=Cd;var kd=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,i){let s=(t?2:0)|(i?1:0),n=this.store.get(e);this.store.set(e,n===void 0?s:s&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};Jr.MatchRecord=kd;var Pd=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===t.globString())||i.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())}};Jr.SubWalks=Pd;var Tv=class r{static{o(this,"Processor")}hasWalkedCache;matches=new kd;subwalks=new Pd;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Cd}processPatterns(e,t){this.patterns=t;let i=t.map(s=>[e,s]);for(let[s,n]of i){this.hasWalkedCache.storeWalked(s,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let l,u,h=!1;for(;typeof(l=n.pattern())=="string"&&(u=n.rest());)s=s.resolve(l),n=u,h=!0;if(l=n.pattern(),u=n.rest(),h){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof l=="string"){let f=l===".."||l===""||l===".";this.matches.add(s.resolve(l),c,f);continue}else if(l===cN.GLOBSTAR){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let f=u?.pattern(),d=u?.rest();if(!u||(f===""||f===".")&&!d)this.matches.add(s,c,f===""||f===".");else if(f===".."){let p=s.parent||s;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else l instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),s=this.child();for(let n of t)for(let a of i){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===cN.GLOBSTAR?s.testGlobstar(n,a,u,c):l instanceof RegExp?s.testRegExp(n,l,u,c):s.testString(n,l,u,c)}return s}testGlobstar(e,t,i,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let n=i.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,i.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,i)}else n instanceof RegExp&&this.testRegExp(e,n,i.rest(),s)}}testRegExp(e,t,i,s){t.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}testString(e,t,i,s){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}};Jr.Processor=Tv});var fN=g(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.GlobStream=vs.GlobWalker=vs.GlobUtil=void 0;var o8=ee(),uN=Iv(),hN=lN(),a8=o((r,e)=>typeof r=="string"?new uN.Ignore([r],e):Array.isArray(r)?new uN.Ignore(r,e):r,"makeIgnore"),Fl=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,t,i){if(this.patterns=e,this.path=t,this.opts=i,this.#r=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=a8(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#s(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 i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}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.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}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.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+s)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,t,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,t)}matchSync(e,t,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,t)}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new hN.Processor(this.opts),i)}walkCB2(e,t,i,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,s));return}i.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,l,u]of i.matches.entries())this.#i(c)||(n++,this.match(c,l,u).then(()=>a()));for(let c of i.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,i,a):c.readdirCB((u,h)=>this.walkCB3(c,h,i,a),!0)}a()}walkCB3(e,t,i,s){i=i.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,l,u]of i.matches.entries())this.#i(c)||(n++,this.match(c,l,u).then(()=>a()));for(let[c,l]of i.subwalks.entries())n++,this.walkCB2(c,l,i.child(),a);a()}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new hN.Processor(this.opts),i)}walkCB2Sync(e,t,i,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,s));return}i.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,l,u]of i.matches.entries())this.#i(c)||this.matchSync(c,l,u);for(let c of i.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let l=c.readdirSync();this.walkCB3Sync(c,l,i,a)}a()}walkCB3Sync(e,t,i,s){i=i.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,l,u]of i.matches.entries())this.#i(c)||this.matchSync(c,l,u);for(let[c,l]of i.subwalks.entries())n++,this.walkCB2Sync(c,l,i.child(),a);a()}};vs.GlobUtil=Fl;var Rv=class extends Fl{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,i){super(e,t,i)}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}};vs.GlobWalker=Rv;var Av=class extends Fl{static{o(this,"GlobStream")}results;constructor(e,t,i){super(e,t,i),this.results=new o8.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}};vs.GlobStream=Av});var kv=g(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.Glob=void 0;var c8=Rr(),l8=require("node:url"),Nd=oN(),u8=bv(),xd=fN(),h8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Cv=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,l8.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(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||h8,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 l=t.platform==="win32"?Nd.PathScurryWin32:t.platform==="darwin"?Nd.PathScurryDarwin:t.platform?Nd.PathScurryPosix:Nd.PathScurry;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(l=>new c8.Minimatch(l,s)),[a,c]=n.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let h=c[u];if(!h)throw new Error("invalid pattern object");return new u8.Pattern(l,h,0,this.platform)})}async walk(){return[...await new xd.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 xd.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 xd.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 xd.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()}};Dd.Glob=Cv});var Pv=g(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.hasMagic=void 0;var f8=Rr(),d8=o((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new f8.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Ld.hasMagic=d8});var Md=g(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.glob=W.sync=W.iterate=W.iterateSync=W.stream=W.streamSync=W.Ignore=W.hasMagic=W.Glob=W.unescape=W.escape=void 0;W.globStreamSync=Bl;W.globStream=Nv;W.globSync=xv;W.globIterateSync=ql;W.globIterate=Dv;var dN=Rr(),Rn=kv(),p8=Pv(),gN=Rr();Object.defineProperty(W,"escape",{enumerable:!0,get:o(function(){return gN.escape},"get")});Object.defineProperty(W,"unescape",{enumerable:!0,get:o(function(){return gN.unescape},"get")});var g8=kv();Object.defineProperty(W,"Glob",{enumerable:!0,get:o(function(){return g8.Glob},"get")});var m8=Pv();Object.defineProperty(W,"hasMagic",{enumerable:!0,get:o(function(){return m8.hasMagic},"get")});var y8=Iv();Object.defineProperty(W,"Ignore",{enumerable:!0,get:o(function(){return y8.Ignore},"get")});function Bl(r,e={}){return new Rn.Glob(r,e).streamSync()}o(Bl,"globStreamSync");function Nv(r,e={}){return new Rn.Glob(r,e).stream()}o(Nv,"globStream");function xv(r,e={}){return new Rn.Glob(r,e).walkSync()}o(xv,"globSync");async function pN(r,e={}){return new Rn.Glob(r,e).walk()}o(pN,"glob_");function ql(r,e={}){return new Rn.Glob(r,e).iterateSync()}o(ql,"globIterateSync");function Dv(r,e={}){return new Rn.Glob(r,e).iterate()}o(Dv,"globIterate");W.streamSync=Bl;W.stream=Object.assign(Nv,{sync:Bl});W.iterateSync=ql;W.iterate=Object.assign(Dv,{sync:ql});W.sync=Object.assign(xv,{stream:Bl,iterate:ql});W.glob=Object.assign(pN,{glob:pN,globSync:xv,sync:W.sync,globStream:Nv,stream:W.stream,globStreamSync:Bl,streamSync:W.streamSync,globIterate:Dv,iterate:W.iterate,globIterateSync:ql,iterateSync:W.iterateSync,Glob:Rn.Glob,hasMagic:p8.hasMagic,escape:dN.escape,unescape:dN.unescape});W.glob.glob=W.glob});var Lv=g((QFe,S8)=>{S8.exports=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]});var mN=g((eBe,w8)=>{w8.exports=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]});var yN=g((tBe,v8)=>{v8.exports=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]});var wN=g((rBe,SN)=>{"use strict";var E8=[].concat(Lv()).concat(mN()),_8=yN();SN.exports=function(r){var e=0;function t(){return e<r.length}o(t,"hasMore");function i(m){if(m instanceof RegExp){var y=r.slice(e),w=y.match(m);if(w)return e+=w[0].length,w[0]}else if(r.indexOf(m,e)===e)return e+=m.length,m}o(i,"read");function s(){i(/[ ]*/)}o(s,"skipWhitespace");function n(){for(var m,y=["WITH","AND","OR","(",")",":","+"],w=0;w<y.length&&(m=i(y[w]),!m);w++);if(m==="+"&&e>1&&r[e-2]===" ")throw new Error("Space before `+`");return m&&{type:"OPERATOR",string:m}}o(n,"operator");function a(){return i(/[A-Za-z0-9-.]+/)}o(a,"idstring");function c(){var m=a();if(!m)throw new Error("Expected idstring at offset "+e);return m}o(c,"expectIdstring");function l(){if(i("DocumentRef-")){var m=c();return{type:"DOCUMENTREF",string:m}}}o(l,"documentRef");function u(){if(i("LicenseRef-")){var m=c();return{type:"LICENSEREF",string:m}}}o(u,"licenseRef");function h(){var m=e,y=a();if(E8.indexOf(y)!==-1)return{type:"LICENSE",string:y};if(_8.indexOf(y)!==-1)return{type:"EXCEPTION",string:y};e=m}o(h,"identifier");function f(){return n()||l()||u()||h()}o(f,"parseToken");for(var d=[];t()&&(s(),!!t());){var p=f();if(!p)throw new Error("Unexpected `"+r[e]+"` at offset "+e);d.push(p)}return d}});var EN=g((sBe,vN)=>{"use strict";vN.exports=function(r){var e=0;function t(){return e<r.length}o(t,"hasMore");function i(){return t()?r[e]:null}o(i,"token");function s(){if(!t())throw new Error;e++}o(s,"next");function n(y){var w=i();if(w&&w.type==="OPERATOR"&&y===w.string)return s(),w.string}o(n,"parseOperator");function a(){if(n("WITH")){var y=i();if(y&&y.type==="EXCEPTION")return s(),y.string;throw new Error("Expected exception after `WITH`")}}o(a,"parseWith");function c(){var y=e,w="",S=i();if(S.type==="DOCUMENTREF"&&(s(),w+="DocumentRef-"+S.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(S=i(),S.type==="LICENSEREF")return s(),w+="LicenseRef-"+S.string,{license:w};e=y}o(c,"parseLicenseRef");function l(){var y=i();if(y&&y.type==="LICENSE"){s();var w={license:y.string};n("+")&&(w.plus=!0);var S=a();return S&&(w.exception=S),w}}o(l,"parseLicense");function u(){var y=n("(");if(y){var w=p();if(!n(")"))throw new Error("Expected `)`");return w}}o(u,"parseParenthesizedExpression");function h(){return u()||c()||l()}o(h,"parseAtom");function f(y,w){return o(function S(){var v=w();if(v){if(!n(y))return v;var _=S();if(!_)throw new Error("Expected expression");return{left:v,conjunction:y.toLowerCase(),right:_}}},"parseBinaryOp")}o(f,"makeBinaryOpParser");var d=f("AND",h),p=f("OR",d),m=p();if(!m||t())throw new Error("Syntax error");return m}});var Mv=g((oBe,_N)=>{"use strict";var b8=wN(),O8=EN();_N.exports=function(r){return O8(b8(r))}});var PN=g((aBe,kN)=>{var I8=Mv(),T8=Lv();function Fd(r){try{return I8(r),!0}catch{return!1}}o(Fd,"valid");function CN(r,e){var t=e[0].length-r[0].length;return t!==0?t:r[0].toUpperCase().localeCompare(e[0].toUpperCase())}o(CN,"sortTranspositions");var bN=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(CN),R8=0,A8=1,ON=[function(r){return r.toUpperCase()},function(r){return r.trim()},function(r){return r.replace(/\./g,"")},function(r){return r.replace(/\s+/g,"")},function(r){return r.replace(/\s+/g,"-")},function(r){return r.replace("v","-")},function(r){return r.replace(/,?\s*(\d)/,"-$1")},function(r){return r.replace(/,?\s*(\d)/,"-$1.0")},function(r){return r.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(r){return r.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(r){return r[0].toUpperCase()+r.slice(1)},function(r){return r.replace("/","-")},function(r){return r.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(r){return r.indexOf("3.0")!==-1?r+"-or-later":r+"-only"},function(r){return r+"only"},function(r){return r.replace(/(\d)$/,"-$1.0")},function(r){return r.replace(/(-| )?(\d)$/,"-$2-Clause")},function(r){return r.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(r){return r.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(r){return r.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(r){return r.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(r){return r.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(r){return r.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(r){return"CC-"+r},function(r){return"CC-"+r+"-4.0"},function(r){return r.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(r){return"CC-"+r.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],Fv=T8.map(function(r){var e=/^(.*)-\d+\.\d+$/.exec(r);return e?[e[0],e[1]]:[r,null]}).reduce(function(r,e){var t=e[1];return r[t]=r[t]||[],r[t].push(e[0]),r},{}),C8=Object.keys(Fv).map(o(function(e){return[e,Fv[e]]},"makeEntries")).filter(o(function(e){return e[1].length===1&&e[0]!==null&&e[0]!=="APL"},"identifySoleVersions")).map(o(function(e){return[e[0],e[1][0]]},"createLastResorts"));Fv=void 0;var IN=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(C8).sort(CN),k8=0,P8=1,TN=o(function(r){for(var e=0;e<ON.length;e++){var t=ON[e](r).trim();if(t!==r&&Fd(t))return t}return null},"validTransformation"),RN=o(function(r){for(var e=r.toUpperCase(),t=0;t<IN.length;t++){var i=IN[t];if(e.indexOf(i[k8])>-1)return i[P8]}return null},"validLastResort"),AN=o(function(r,e){for(var t=0;t<bN.length;t++){var i=bN[t],s=i[R8];if(r.indexOf(s)>-1){var n=r.replace(s,i[A8]),a=e(n);if(a!==null)return a}}return null},"anyCorrection");kN.exports=function(r,e){e=e||{};var t=e.upgrade===void 0?!0:!!e.upgrade;function i(c){return t?N8(c):c}o(i,"postprocess");var s=typeof r=="string"&&r.trim().length!==0;if(!s)throw Error("Invalid argument. Expected non-empty string.");if(r=r.trim(),Fd(r))return i(r);var n=r.replace(/\+$/,"").trim();if(Fd(n))return i(n);var a=TN(r);return a!==null||(a=AN(r,function(c){return Fd(c)?c:TN(c)}),a!==null)||(a=RN(r),a!==null)||(a=AN(r,RN),a!==null)?i(a):null};function N8(r){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(r)!==-1?r+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(r)!==-1?r.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(r)!==-1?r+"-or-later":r}o(N8,"upgradeGPLs")});var LN=g((lBe,DN)=>{var x8=Mv(),D8=PN(),NN='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',L8=/^SEE LICEN[CS]E IN (.+)$/;function xN(r,e){return e.slice(0,r.length)===r}o(xN,"startsWith");function Bv(r){if(r.hasOwnProperty("license")){var e=r.license;return xN("LicenseRef",e)||xN("DocumentRef",e)}else return Bv(r.left)||Bv(r.right)}o(Bv,"usesLicenseRef");DN.exports=function(r){var e;try{e=x8(r)}catch{var t;if(r==="UNLICENSED"||r==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(t=L8.exec(r))return{validForOldPackages:!0,validForNewPackages:!0,inFile:t[1]};var i={validForOldPackages:!1,validForNewPackages:!1,warnings:[NN]};if(r.trim().length!==0){var s=D8(r);s&&i.warnings.push('license is similar to the valid expression "'+s+'"')}return i}return Bv(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[NN]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var $N=g((hBe,jN)=>{var{URL:qv}=require("node:url"),MN=wl(),M8=LN(),FN={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},BN=o(r=>r.includes("@")&&r.indexOf("@")<r.lastIndexOf("."),"isEmail");function F8(r){let e=r.trim().split(`
9
+ `),t=0;for(;e[t]?.trim().match(/^(#|$)/);)t++;let i=t+1;for(;i<e.length&&e[i].trim();)i++;return e.slice(t,i).join(" ").trim()}o(F8,"extractDescription");function qN(r){if(typeof r!="string"){let n=r.name||"",a=r.url||r.web,c=a?" ("+a+")":"",l=r.email||r.mail,u=l?" <"+l+">":"";r=n+u+c}let e=r.match(/^([^(<]+)/),t=r.match(/\(([^()]+)\)/),i=r.match(/<([^<>]+)>/),s={};return e?.[0].trim()&&(s.name=e[0].trim()),i&&(s.email=i[1]),t&&(s.url=t[1]),s}o(qN,"stringifyPerson");function B8(r,e){r.description&&typeof r.description!="string"&&(e?.push("'description' field should be a string"),delete r.description),r.readme&&!r.description&&r.readme!=="ERROR: No README data found!"&&(r.description=F8(r.readme)),r.description===void 0&&delete r.description,r.description||e?.push("No description"),r.modules&&(e?.push("modules field is deprecated"),delete r.modules);let t=r.files;if(t&&!Array.isArray(t)?(e?.push("Invalid 'files' member"),delete r.files):r.files&&(r.files=r.files.filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid filename in 'files' list: ${a}`),!1):!0})),r.man&&typeof r.man=="string"&&(r.man=[r.man]),!r.bugs&&r.repository?.url){let a=MN.fromUrl(r.repository.url);a&&a.bugs()&&(r.bugs={url:a.bugs()})}else if(r.bugs){if(typeof r.bugs=="string")BN(r.bugs)?r.bugs={email:r.bugs}:qv.canParse(r.bugs)?r.bugs={url:r.bugs}:e?.push("Bug string field must be url, email, or {email,url}");else{for(let c in r.bugs)["web","name"].includes(c)&&(e?.push(`bugs['${c}'] should probably be bugs['url'].`),r.bugs.url=r.bugs[c],delete r.bugs[c]);let a=r.bugs;r.bugs={},a.url&&(qv.canParse(a.url)?r.bugs.url=a.url:e?.push("bugs.url field must be a string url. Deleted.")),a.email&&(typeof a.email=="string"&&BN(a.email)?r.bugs.email=a.email:e?.push("bugs.email field must be a string email. Deleted."))}!r.bugs.email&&!r.bugs.url&&(delete r.bugs,e?.push("Normalized value of bugs field is an empty object. Deleted."))}typeof r.keywords=="string"&&(r.keywords=r.keywords.split(/,\s+/)),r.keywords&&!Array.isArray(r.keywords)?(delete r.keywords,e?.push("keywords should be an array of strings")):r.keywords&&(r.keywords=r.keywords.filter(function(a){return typeof a!="string"||!a?(e?.push("keywords should be an array of strings"),!1):!0}));let i="bundledDependencies",s="bundleDependencies";if(r[i]&&!r[s]&&(r[s]=r[i],delete r[i]),r[s]&&!Array.isArray(r[s])?(e?.push("Invalid 'bundleDependencies' list. Must be array of package names"),delete r[s]):r[s]&&(r[s]=r[s].filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid bundleDependencies member: ${a}`),!1):(r.dependencies||(r.dependencies={}),Object.prototype.hasOwnProperty.call(r.dependencies,a)||(e?.push(`Non-dependency in bundleDependencies: ${a}`),r.dependencies[a]="*"),!0)})),!r.homepage&&r.repository&&r.repository.url){let a=MN.fromUrl(r.repository.url);a&&(r.homepage=a.docs())}r.homepage&&(typeof r.homepage!="string"?(e?.push("homepage field must be a string url. Deleted."),delete r.homepage):qv.canParse(r.homepage)||(r.homepage="http://"+r.homepage)),r.readme||(e?.push("No README data"),r.readme="ERROR: No README data found!");let n=r.license||r.licence;n?typeof n!="string"||n.length<1||n.trim()===""?e?.push("license should be a valid SPDX license expression"):M8(n).validForNewPackages||e?.push("license should be a valid SPDX license expression"):e?.push("No license field."),r.author&&(r.author=qN(r.author)),["maintainers","contributors"].forEach(function(a){Array.isArray(r[a])&&(r[a]=r[a].map(qN))});for(let a in FN)Object.prototype.hasOwnProperty.call(r,a)&&e?.push(`${a} should probably be ${FN[a]}.`)}o(B8,"normalizeData");jN.exports={normalizeData:B8}});var VN=g(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.sync=Zo.isexe=void 0;var q8=require("fs"),j8=require("fs/promises"),$8=o(async(r,e={})=>{let{ignoreErrors:t=!1}=e;try{return UN(await(0,j8.stat)(r),e)}catch(i){let s=i;if(t||s.code==="EACCES")return!1;throw s}},"isexe");Zo.isexe=$8;var U8=o((r,e={})=>{let{ignoreErrors:t=!1}=e;try{return UN((0,q8.statSync)(r),e)}catch(i){let s=i;if(t||s.code==="EACCES")return!1;throw s}},"sync");Zo.sync=U8;var UN=o((r,e)=>r.isFile()&&V8(r,e),"checkStat"),V8=o((r,e)=>{let t=e.uid??process.getuid?.(),i=e.groups??process.getgroups?.()??[],s=e.gid??process.getgid?.()??i[0];if(t===void 0||s===void 0)throw new Error("cannot get uid or gid");let n=new Set([s,...i]),a=r.mode,c=r.uid,l=r.gid,u=parseInt("100",8),h=parseInt("010",8),f=parseInt("001",8),d=u|h;return!!(a&f||a&h&&n.has(l)||a&u&&c===t||a&d&&t===0)},"checkMode")});var GN=g(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.sync=Xo.isexe=void 0;var z8=require("fs"),G8=require("fs/promises"),H8=o(async(r,e={})=>{let{ignoreErrors:t=!1}=e;try{return zN(await(0,G8.stat)(r),r,e)}catch(i){let s=i;if(t||s.code==="EACCES")return!1;throw s}},"isexe");Xo.isexe=H8;var W8=o((r,e={})=>{let{ignoreErrors:t=!1}=e;try{return zN((0,z8.statSync)(r),r,e)}catch(i){let s=i;if(t||s.code==="EACCES")return!1;throw s}},"sync");Xo.sync=W8;var J8=o((r,e)=>{let{pathExt:t=process.env.PATHEXT||""}=e,i=t.split(";");if(i.indexOf("")!==-1)return!0;for(let s=0;s<i.length;s++){let n=i[s].toLowerCase(),a=r.substring(r.length-n.length).toLowerCase();if(n&&a===n)return!0}return!1},"checkPathExt"),zN=o((r,e,t)=>r.isFile()&&J8(e,t),"checkStat")});var WN=g(HN=>{"use strict";Object.defineProperty(HN,"__esModule",{value:!0})});var QN=g(je=>{"use strict";var JN=je&&je.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),K8=je&&je.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),KN=je&&je.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&JN(e,r,t);return K8(e,r),e},Y8=je&&je.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&JN(e,r,t)};Object.defineProperty(je,"__esModule",{value:!0});je.sync=je.isexe=je.posix=je.win32=void 0;var YN=KN(VN());je.posix=YN;var ZN=KN(GN());je.win32=ZN;Y8(WN(),je);var Z8=process.env._ISEXE_TEST_PLATFORM_||process.platform,XN=Z8==="win32"?ZN:YN;je.isexe=XN.isexe;je.sync=XN.sync});var Bd=g((vBe,cx)=>{var{isexe:X8,sync:Q8}=QN(),{join:eQ,delimiter:tQ,sep:ex,posix:tx}=require("path"),rx=process.platform==="win32",ix=new RegExp(`[${tx.sep}${ex===tx.sep?"":ex}]`.replace(/(\\)/g,"\\$1")),rQ=new RegExp(`^\\.${ix.source}`),sx=o(r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),"getNotFoundError"),nx=o((r,{path:e=process.env.PATH,pathExt:t=process.env.PATHEXT,delimiter:i=tQ})=>{let s=r.match(ix)?[""]:[...rx?[process.cwd()]:[],...(e||"").split(i)];if(rx){let n=t||[".EXE",".CMD",".BAT",".COM"].join(i),a=n.split(i).flatMap(c=>[c,c.toLowerCase()]);return r.includes(".")&&a[0]!==""&&a.unshift(""),{pathEnv:s,pathExt:a,pathExtExe:n}}return{pathEnv:s,pathExt:[""]}},"getPathInfo"),ox=o((r,e)=>{let t=/^".*"$/.test(r)?r.slice(1,-1):r;return(!t&&rQ.test(e)?e.slice(0,2):"")+eQ(t,e)},"getPathPart"),ax=o(async(r,e={})=>{let{pathEnv:t,pathExt:i,pathExtExe:s}=nx(r,e),n=[];for(let a of t){let c=ox(a,r);for(let l of i){let u=c+l;if(await X8(u,{pathExt:s,ignoreErrors:!0})){if(!e.all)return u;n.push(u)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw sx(r)},"which"),iQ=o((r,e={})=>{let{pathEnv:t,pathExt:i,pathExtExe:s}=nx(r,e),n=[];for(let a of t){let c=ox(a,r);for(let l of i){let u=c+l;if(Q8(u,{pathExt:s,ignoreErrors:!0})){if(!e.all)return u;n.push(u)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw sx(r)},"whichSync");cx.exports=ax;ax.sync=iQ});var ux=g((_Be,lx)=>{"use strict";var sQ=o((r,e)=>{if(!r.length)return'""';let t;if(!/[ \t\n\v"]/.test(r))t=r;else{t='"';for(let i=0;i<=r.length;++i){let s=0;for(;r[i]==="\\";)++i,++s;if(i===r.length){t+="\\".repeat(s*2);break}r[i]==='"'?(t+="\\".repeat(s*2+1),t+=r[i]):(t+="\\".repeat(s),t+=r[i])}t+='"'}return t=t.replace(/[ !%^&()<>|"]/g,"^$&"),e&&(t=t.replace(/[ !%^&()<>|"]/g,"^$&")),t},"cmd"),nQ=o(r=>r.length?/[\t\n\r "#$&'()*;<>?\\`|~]/.test(r)?`'${r.replace(/'/g,"'\\''")}'`.replace(/^(?:'')+(?!$)/,"").replace(/\\'''/g,"\\'"):r:"''","sh");lx.exports={cmd:sQ,sh:nQ}});var Qo=g((OBe,px)=>{"use strict";var{spawn:oQ}=require("child_process"),aQ=require("os"),cQ=Bd(),hx=ux(),$v=o((r,e,t={},i={})=>{if(t.shell)return dx(r,e,t,i);let s,n,a=new Promise((p,m)=>{s=p,n=m}),c=new Error("command failed"),l=[],u=[],h=o(p=>({cmd:r,args:e,...p,...uQ(l,u,t),...i}),"getResult"),f=o((p,m)=>{let y=h(m);n(Object.assign(p,y))},"rejectWithOpts"),d=oQ(r,e,t);return a.stdin=d.stdin,a.process=d,d.on("error",f),d.stdout&&(d.stdout.on("data",p=>l.push(p)),d.stdout.on("error",f)),d.stderr&&(d.stderr.on("data",p=>u.push(p)),d.stderr.on("error",f)),d.on("close",(p,m)=>{p||m?f(c,{code:p,signal:m}):s(h({code:p,signal:m}))}),a},"promiseSpawn"),dx=o((r,e,t,i)=>{let s=t.shell;s===!0&&(s=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"sh");let n={...t,shell:!1},a=[],c=r;if(/(?:^|\\)cmd(?:\.exe)?$/i.test(s)){let u=!1,h="",f=!1;for(let p=0;p<r.length;++p){let m=r.charAt(p);if(m===" "&&!f)break;h+=m,(m==='"'||m==="'")&&(f=!f)}let d;try{d=cQ.sync(h,{path:n.env&&fx(n.env,"PATH")||process.env.PATH,pathext:n.env&&fx(n.env,"PATHEXT")||process.env.PATHEXT}).toLowerCase()}catch{d=h.toLowerCase()}u=d.endsWith(".cmd")||d.endsWith(".bat");for(let p of e)c+=` ${hx.cmd(p,u)}`;a.push("/d","/s","/c",c),n.windowsVerbatimArguments=!0}else{for(let u of e)c+=` ${hx.sh(u)}`;a.push("-c",c)}return $v(s,a,n,i)},"spawnWithShell"),lQ=o((r,e={},t={})=>{let i={...e,shell:!0},s=[].concat(r),n=process.platform;if(n==="linux"&&aQ.release().toLowerCase().includes("microsoft")&&(n="wsl",!process.env.BROWSER))return Promise.reject(new Error("Set the BROWSER environment variable to your desired browser."));let a=i.command;return a||(n==="win32"?(i.shell=process.env.ComSpec,a='start ""'):n==="wsl"?a="sensible-browser":n==="darwin"?a="open":a="xdg-open"),dx(a,s,i,t)},"open");$v.open=lQ;var jv=o((r="pipe",e)=>r==="pipe"||r===null?!0:Array.isArray(r)?jv(r[e],e):!1,"isPipe"),uQ=o((r,e,{stdioString:t=!0,stdio:i})=>{let s={stdout:null,stderr:null};return jv(i,1)&&(s.stdout=Buffer.concat(r),t&&(s.stdout=s.stdout.toString().trim())),jv(i,2)&&(s.stderr=Buffer.concat(e),t&&(s.stderr=s.stderr.toString().trim())),s},"stdioResult"),fx=o((r,e)=>{e=e.toLowerCase();for(let t of Object.keys(r).sort())if(t.toLowerCase()===e)return r[t]},"findInObject");px.exports=$v});var yx=g((TBe,mx)=>{"use strict";function gx(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}o(gx,"assign");function hQ(r,e,t){if(!r||typeof r=="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 gx(r,t)}catch{t.message=r.message,t.stack=r.stack;let s=o(function(){},"ErrClass");return s.prototype=Object.create(Object.getPrototypeOf(r)),gx(new s,t)}}o(hQ,"createError");mx.exports=hQ});var wx=g((ABe,Sx)=>{function Zt(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,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(Zt,"RetryOperation");Sx.exports=Zt;Zt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Zt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Zt.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);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 i=this,s=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},t);return this._options.unref&&s.unref(),!0};Zt.prototype.attempt=function(r,e){this._fn=r,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)};Zt.prototype.try=function(r){this.attempt(r)};Zt.prototype.start=function(r){this.attempt(r)};Zt.prototype.start=Zt.prototype.try;Zt.prototype.errors=function(){return this._errors};Zt.prototype.attempts=function(){return this._attempts};Zt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,i=0;i<this._errors.length;i++){var s=this._errors[i],n=s.message,a=(r[n]||0)+1;r[n]=a,a>=t&&(e=s,t=a)}return e}});var vx=g(An=>{var fQ=wx();An.operation=function(r){var e=An.timeouts(r);return new fQ(e,{forever:r&&r.forever,unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};An.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<e.retries;s++)i.push(this.createTimeout(s,e));return r&&r.forever&&!i.length&&i.push(this.createTimeout(s,e)),i.sort(function(n,a){return n-a}),i};An.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,i=Math.round(t*e.minTimeout*Math.pow(e.factor,r));return i=Math.min(i,e.maxTimeout),i};An.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var i in r)typeof r[i]=="function"&&t.push(i)}for(var s=0;s<t.length;s++){var n=t[s],a=r[n];r[n]=o(function(l){var u=An.operation(e),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){l.apply(r,h)})},"retryWrapper").bind(r,a),r[n].options=e}}});var _x=g((NBe,Ex)=>{Ex.exports=vx()});var Cn=g((xBe,Ox)=>{"use strict";var dQ=yx(),pQ=_x(),gQ=Object.prototype.hasOwnProperty;function bx(r){return r&&r.code==="EPROMISERETRY"&&gQ.call(r,"retried")}o(bx,"isRetryError");function mQ(r,e){var t,i;return typeof r=="object"&&typeof e=="function"&&(t=e,e=r,r=t),i=pQ.operation(e),new Promise(function(s,n){i.attempt(function(a){Promise.resolve().then(function(){return r(function(c){throw bx(c)&&(c=c.retried),dQ(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(s,function(c){bx(c)&&(c=c.retried,i.retry(c||new Error))||n(c)})})})}o(mQ,"promiseRetry");Ox.exports=mQ});var Gv=g((LBe,Ix)=>{var jl=class extends Error{static{o(this,"GitError")}shouldRetry(){return!1}},Uv=class extends jl{static{o(this,"GitConnectionError")}constructor(){super("A git connection error occurred")}shouldRetry(e){return e<3}},Vv=class extends jl{static{o(this,"GitPathspecError")}constructor(){super("The git reference could not be found")}},zv=class extends jl{static{o(this,"GitUnknownError")}constructor(){super("An unknown git error occurred")}};Ix.exports={GitConnectionError:Uv,GitPathspecError:Vv,GitUnknownError:zv}});var Rx=g((FBe,Tx)=>{var{GitConnectionError:yQ,GitPathspecError:SQ,GitUnknownError:wQ}=Gv(),vQ=new RegExp(["remote error: Internal Server Error","The remote end hung up unexpectedly","Connection timed out","Operation timed out","Failed to connect to .* Timed out","Connection reset by peer","SSL_ERROR_SYSCALL","The requested URL returned error: 503"].join("|")),EQ=/pathspec .* did not match any file\(s\) known to git/;function _Q(r){let e=r.stderr,t;return vQ.test(e)?t=new yQ(e):EQ.test(e)?t=new SQ(e):t=new wQ(e),Object.assign(t,r)}o(_Q,"makeError");Tx.exports=_Q});var Jv=g((qBe,Px)=>{var{hasOwnProperty:Hv}=Object.prototype,Wv=o((r,e={})=>{typeof e=="string"&&(e={section:e}),e.align=e.align===!0,e.newline=e.newline===!0,e.sort=e.sort===!0,e.whitespace=e.whitespace===!0||e.align===!0,e.platform=e.platform||typeof process<"u"&&process.platform,e.bracketedArray=e.bracketedArray!==!1;let t=e.platform==="win32"?`\r
10
+ `:`
11
+ `,i=e.whitespace?" = ":"=",s=[],n=e.sort?Object.keys(r).sort():Object.keys(r),a=0;e.align&&(a=Di(n.filter(u=>r[u]===null||Array.isArray(r[u])||typeof r[u]!="object").map(u=>Array.isArray(r[u])?`${u}[]`:u).concat([""]).reduce((u,h)=>Di(u).length>=Di(h).length?u:h)).length);let c="",l=e.bracketedArray?"[]":"";for(let u of n){let h=r[u];if(h&&Array.isArray(h))for(let f of h)c+=Di(`${u}${l}`).padEnd(a," ")+i+Di(f)+t;else h&&typeof h=="object"?s.push(u):c+=Di(u).padEnd(a," ")+i+Di(h)+t}e.section&&c.length&&(c="["+Di(e.section)+"]"+(e.newline?t+t:t)+c);for(let u of s){let h=Cx(u,".").join("\\."),f=(e.section?e.section+".":"")+h,d=Wv(r[u],{...e,section:f});c.length&&d.length&&(c+=t),c+=d}return c},"encode");function Cx(r,e){var t=0,i=0,s=0,n=[];do if(s=r.indexOf(e,t),s!==-1){if(t=s+e.length,s>0&&r[s-1]==="\\")continue;n.push(r.slice(i,s)),i=s+e.length}while(s!==-1);return n.push(r.slice(i)),n}o(Cx,"splitSections");var Ax=o((r,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),i=t,s=null,n=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,a=r.split(/[\r\n]+/g),c={};for(let u of a){if(!u||u.match(/^\s*[;#]/)||u.match(/^\s*$/))continue;let h=u.match(n);if(!h)continue;if(h[1]!==void 0){if(s=qd(h[1]),s==="__proto__"){i=Object.create(null);continue}i=t[s]=t[s]||Object.create(null);continue}let f=qd(h[2]),d;e.bracketedArray?d=f.length>2&&f.slice(-2)==="[]":(c[f]=(c?.[f]||0)+1,d=c[f]>1);let p=d&&f.endsWith("[]")?f.slice(0,-2):f;if(p==="__proto__")continue;let m=h[3]?qd(h[4]):!0,y=m==="true"||m==="false"||m==="null"?JSON.parse(m):m;d&&(Hv.call(i,p)?Array.isArray(i[p])||(i[p]=[i[p]]):i[p]=[]),Array.isArray(i[p])?i[p].push(y):i[p]=y}let l=[];for(let u of Object.keys(t)){if(!Hv.call(t,u)||typeof t[u]!="object"||Array.isArray(t[u]))continue;let h=Cx(u,".");i=t;let f=h.pop(),d=f.replace(/\\\./g,".");for(let p of h)p!=="__proto__"&&((!Hv.call(i,p)||typeof i[p]!="object")&&(i[p]=Object.create(null)),i=i[p]);i===t&&d===f||(i[d]=t[u],l.push(u))}for(let u of l)delete t[u];return t},"decode"),kx=o(r=>r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"),"isQuoted"),Di=o(r=>typeof r!="string"||r.match(/[=\r\n]/)||r.match(/^\[/)||r.length>1&&kx(r)||r!==r.trim()?JSON.stringify(r):r.split(";").join("\\;").split("#").join("\\#"),"safe"),qd=o(r=>{if(r=(r||"").trim(),kx(r)){r.charAt(0)==="'"&&(r=r.slice(1,-1));try{r=JSON.parse(r)}catch{}}else{let e=!1,t="";for(let i=0,s=r.length;i<s;i++){let n=r.charAt(i);if(e)"\\;#".indexOf(n)!==-1?t+=n:t+="\\"+n,e=!1;else{if(";#".indexOf(n)!==-1)break;n==="\\"?e=!0:t+=n}}return e&&(t+="\\"),t.trim()}return r},"unsafe");Px.exports={parse:Ax,decode:Ax,stringify:Wv,encode:Wv,safe:Di,unsafe:qd}});var Lx=g(($Be,Kv)=>{var Nx=require("node:fs"),bQ=require("node:os"),OQ=require("node:path"),IQ=Jv(),xx=OQ.join(bQ.homedir(),".gitconfig"),$l=null,Dx=o(()=>{if($l===null)try{if($l={},Nx.existsSync(xx)){let r=Nx.readFileSync(xx,"utf-8");$l=IQ.parse(r)}}catch{$l={}}return $l},"loadGitConfig"),TQ=o(()=>{let r=Dx();return{sshCommandSetInConfig:r?.core?.sshCommand!==void 0,askPassSetInConfig:r?.core?.askpass!==void 0}},"checkGitConfigs"),RQ=process.env.GIT_SSH_COMMAND!==void 0,AQ=process.env.GIT_ASKPASS!==void 0,{sshCommandSetInConfig:CQ,askPassSetInConfig:kQ}=TQ(),PQ={...AQ||kQ?{}:{GIT_ASKPASS:"echo"},...RQ||CQ?{}:{GIT_SSH_COMMAND:"ssh -oStrictHostKeyChecking=accept-new"}};Kv.exports=(r={})=>({stdioString:!0,...r,shell:!1,env:r.env||{...PQ,...process.env}});Kv.exports.loadGitConfig=Dx});var Fx=g((VBe,Mx)=>{var NQ=Bd(),Yv;try{Yv=NQ.sync("git")}catch{}Mx.exports=(r={})=>r.git?r.git:!Yv||r.git===!1?Object.assign(new Error("No git binary found in $PATH"),{code:"ENOGIT"}):Yv});var Ul=g((zBe,Bx)=>{var xQ=Qo(),DQ=Cn(),{log:LQ}=se(),MQ=Rx(),FQ=Lx();Bx.exports=(r,e={})=>{let i=Fx()(e);if(i instanceof Error)return Promise.reject(i);let s=e.allowReplace||r[0]==="--no-replace-objects"?r:["--no-replace-objects",...r],n=e.retry;return n==null&&(n={retries:e.fetchRetries||2,factor:e.fetchRetryFactor||10,maxTimeout:e.fetchRetryMaxtimeout||6e4,minTimeout:e.fetchRetryMintimeout||1e3}),DQ((a,c)=>(c!==1&&LQ.silly("git",`Retrying git command: ${s.join(" ")} attempt # ${c}`),xQ(i,s,FQ(e)).catch(l=>{let u=MQ(l);if(!u.shouldRetry(c))throw u;a(u)})),n)}});var eE=g($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.LRUCache=void 0;var ea=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,jx=new Set,Zv=typeof process=="object"&&process?process:{},$x=o((r,e,t,i)=>{typeof Zv.emitWarning=="function"&&Zv.emitWarning(r,e,t,i)},"emitWarning"),jd=globalThis.AbortController,qx=globalThis.AbortSignal;if(typeof jd>"u"){qx=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},jd=class{static{o(this,"AbortController")}constructor(){e()}signal=new qx;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let r=Zv.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{r&&(r=!1,$x("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 BQ=o(r=>!jx.has(r),"shouldWarn"),WBe=Symbol("type"),Es=o(r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),"isPosInt"),Ux=o(r=>Es(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?ta:null:null,"getUintArray"),ta=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Xv=class r{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=Ux(e);if(!t)return[];r.#e=!0;let i=new r(e,t);return r.#e=!1,i}constructor(e,t){if(!r.#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]}},Qv=class r{static{o(this,"LRUCache")}#e;#t;#r;#i;#s;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#c;#a;#h;#l;#f;#u;#p;#g;#w;#m;#A;#E;#_;#b;#O;#v;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#_,sizes:e.#A,keyMap:e.#a,keyList:e.#h,valList:e.#l,next:e.#f,prev:e.#u,get head(){return e.#p},get tail(){return e.#g},free:e.#w,isBackgroundFetch:o(t=>e.#S(t),"isBackgroundFetch"),backgroundFetch:o((t,i,s,n)=>e.#D(t,i,s,n),"backgroundFetch"),moveToTail:o(t=>e.#$(t),"moveToTail"),indexes:o(t=>e.#P(t),"indexes"),rindexes:o(t=>e.#N(t),"rindexes"),isStale:o(t=>e.#T(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#c}get size(){return this.#n}get fetchMethod(){return this.#s}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:d,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:y,fetchMethod:w,memoMethod:S,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:b,ignoreFetchAbort:O}=e;if(t!==0&&!Es(t))throw new TypeError("max option must be a nonnegative integer");let T=t?Ux(t):Array;if(!T)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=y,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=S,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=w,this.#O=!!w,this.#a=new Map,this.#h=new Array(t).fill(void 0),this.#l=new Array(t).fill(void 0),this.#f=new T(t),this.#u=new T(t),this.#p=0,this.#g=0,this.#w=Xv.create(t),this.#n=0,this.#c=0,typeof u=="function"&&(this.#r=u),typeof h=="function"?(this.#i=h,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#b=!!this.#r,this.#v=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!b,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#t!==0&&!Es(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Es(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Es(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Es(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}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 I="LRU_CACHE_UNBOUNDED";BQ(I)&&(jx.add(I),$x("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,r))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new ta(this.#e),t=new ta(this.#e);this.#_=e,this.#E=t,this.#B=(n,a,c=ea.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#T(n)&&this.#y(this.#h[n],"expire")},a+1);l.unref&&l.unref()}},this.#I=n=>{t[n]=e[n]!==0?ea.now():0},this.#d=(n,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;n.ttl=c,n.start=l,n.now=i||s();let u=n.now-l;n.remainingTTL=c-u}};let i=0,s=o(()=>{let n=ea.now();if(this.ttlResolution>0){i=n;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#a.get(n);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(i||s())-l;return c-u},this.#T=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(i||s())-a>c}}#I=o(()=>{},"#updateItemAge");#d=o(()=>{},"#statusTTL");#B=o(()=>{},"#setItemTTL");#T=o(()=>!1,"#isStale");#k(){let e=new ta(this.#e);this.#c=0,this.#A=e,this.#L=t=>{this.#c-=e[t],e[t]=0},this.#q=(t,i,s,n)=>{if(this.#S(i))return 0;if(!Es(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!Es(s))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 s},this.#R=(t,i,s)=>{if(e[t]=i,this.#t){let n=this.#t-e[t];for(;this.#c>n;)this.#x(!0)}this.#c+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#c)}}#L=o(e=>{},"#removeItemSize");#R=o((e,t,i)=>{},"#addItemSize");#q=o((e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#P({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#g;!(!this.#M(t)||((e||!this.#T(t))&&(yield t),t===this.#p));)t=this.#u[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#p;!(!this.#M(t)||((e||!this.#T(t))&&(yield t),t===this.#g));)t=this.#f[t]}#M(e){return e!==void 0&&this.#a.get(this.#h[e])===e}*entries(){for(let e of this.#P())this.#l[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#l[e])&&(yield[this.#h[e],this.#l[e]])}*rentries(){for(let e of this.#N())this.#l[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#l[e])&&(yield[this.#h[e],this.#l[e]])}*keys(){for(let e of this.#P()){let t=this.#h[e];t!==void 0&&!this.#S(this.#l[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#h[e];t!==void 0&&!this.#S(this.#l[e])&&(yield t)}}*values(){for(let e of this.#P())this.#l[e]!==void 0&&!this.#S(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#N())this.#l[e]!==void 0&&!this.#S(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#P()){let s=this.#l[i],n=this.#S(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#h[i],this))return this.get(this.#h[i],t)}}forEach(e,t=this){for(let i of this.#P()){let s=this.#l[i],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[i],this)}}rforEach(e,t=this){for(let i of this.#N()){let s=this.#l[i],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[i],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#T(t)&&(this.#y(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let i=this.#l[t],s=this.#S(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#_&&this.#E){let a=this.#_[t],c=this.#E[t];if(a&&c){let l=a-(ea.now()-c);n.ttl=l,n.start=Date.now()}}return this.#A&&(n.size=this.#A[t]),n}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let i=this.#h[t],s=this.#l[t],n=this.#S(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let a={value:n};if(this.#_&&this.#E){a.ttl=this.#_[t];let c=ea.now()-this.#E[t];a.start=Math.floor(Date.now()-c)}this.#A&&(a.size=this.#A[t]),e.unshift([i,a])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=ea.now()-s}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=i,{noUpdateTTL:u=this.noUpdateTTL}=i,h=this.#q(e,t,i.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#y(e,"set"),this;let f=this.#n===0?void 0:this.#a.get(e);if(f===void 0)f=this.#n===0?this.#g:this.#w.length!==0?this.#w.pop():this.#n===this.#e?this.#x(!1):this.#n,this.#h[f]=e,this.#l[f]=t,this.#a.set(e,f),this.#f[this.#g]=f,this.#u[f]=this.#g,this.#g=f,this.#n++,this.#R(f,h,l),l&&(l.set="add"),u=!1;else{this.#$(f);let d=this.#l[f];if(t!==d){if(this.#O&&this.#S(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#b&&this.#r?.(p,e,"set"),this.#v&&this.#m?.push([p,e,"set"]))}else a||(this.#b&&this.#r?.(d,e,"set"),this.#v&&this.#m?.push([d,e,"set"]));if(this.#L(f),this.#R(f,h,l),this.#l[f]=t,l){l.set="replace";let p=d&&this.#S(d)?d.__staleWhileFetching:d;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(s!==0&&!this.#_&&this.#C(),this.#_&&(u||this.#B(f,s,n),l&&this.#d(l,f)),!a&&this.#v&&this.#m){let d=this.#m,p;for(;p=d?.shift();)this.#i?.(...p)}return this}pop(){try{for(;this.#n;){let e=this.#l[this.#p];if(this.#x(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#v&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#i?.(...t)}}}#x(e){let t=this.#p,i=this.#h[t],s=this.#l[t];return this.#O&&this.#S(s)?s.__abortController.abort(new Error("evicted")):(this.#b||this.#v)&&(this.#b&&this.#r?.(s,i,"evict"),this.#v&&this.#m?.push([s,i,"evict"])),this.#L(t),e&&(this.#h[t]=void 0,this.#l[t]=void 0,this.#w.push(t)),this.#n===1?(this.#p=this.#g=0,this.#w.length=0):this.#p=this.#f[t],this.#a.delete(i),this.#n--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#a.get(e);if(n!==void 0){let a=this.#l[n];if(this.#S(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#T(n))s&&(s.has="stale",this.#d(s,n));else return i&&this.#I(n),s&&(s.has="hit",this.#d(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!i&&this.#T(s))return;let n=this.#l[s];return this.#S(n)?n.__staleWhileFetching:n}#D(e,t,i,s){let n=t===void 0?void 0:this.#l[t];if(this.#S(n))return n;let a=new jd,{signal:c}=i;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:s},u=o((y,w=!1)=>{let{aborted:S}=a.signal,v=i.ignoreFetchAbort&&y!==void 0;if(i.status&&(S&&!w?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),S&&!v&&!w)return f(a.signal.reason);let _=p;return this.#l[t]===p&&(y===void 0?_.__staleWhileFetching?this.#l[t]=_.__staleWhileFetching:this.#y(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,y,l.options))),y},"cb"),h=o(y=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=y),f(y)),"eb"),f=o(y=>{let{aborted:w}=a.signal,S=w&&i.allowStaleOnFetchAbort,v=S||i.allowStaleOnFetchRejection,_=v||i.noDeleteOnFetchRejection,E=p;if(this.#l[t]===p&&(!_||E.__staleWhileFetching===void 0?this.#y(e,"fetch"):S||(this.#l[t]=E.__staleWhileFetching)),v)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw y},"fetchFail"),d=o((y,w)=>{let S=this.#s?.(e,n,l);S&&S instanceof Promise&&S.then(v=>y(v===void 0?void 0:v),w),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(y(void 0),i.allowStaleOnFetchAbort&&(y=o(v=>u(v,!0),"res")))})},"pcall");i.status&&(i.status.fetchDispatched=!0);let p=new Promise(d).then(u,h),m=Object.assign(p,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...l.options,status:void 0}),t=this.#a.get(e)):this.#l[t]=m,m}#S(e){if(!this.#O)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof jd}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:y,forceRefresh:w=!1,status:S,signal:v}=t;if(!this.#O)return S&&(S.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:S});let _={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:S,signal:v},E=this.#a.get(e);if(E===void 0){S&&(S.fetch="miss");let b=this.#D(e,E,_,y);return b.__returned=b}else{let b=this.#l[E];if(this.#S(b)){let F=i&&b.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",F&&(S.returnedStale=!0)),F?b.__staleWhileFetching:b.__returned=b}let O=this.#T(E);if(!w&&!O)return S&&(S.fetch="hit"),this.#$(E),s&&this.#I(E),S&&this.#d(S,E),b;let T=this.#D(e,E,_,y),L=T.__staleWhileFetching!==void 0&&i;return S&&(S.fetch=O?"stale":"refresh",L&&O&&(S.returnedStale=!0)),L?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let l=i(e,c,{options:a,context:s});return this.set(e,l,a),l}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#a.get(e);if(c!==void 0){let l=this.#l[c],u=this.#S(l);return a&&this.#d(a,c),this.#T(c)?(a&&(a.get="stale"),u?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(n||this.#y(e,"expire"),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#$(c),s&&this.#I(c),l))}else a&&(a.get="miss")}#j(e,t){this.#u[t]=e,this.#f[e]=t}#$(e){e!==this.#g&&(e===this.#p?this.#p=this.#f[e]:this.#j(this.#u[e],this.#f[e]),this.#j(this.#g,e),this.#g=e)}delete(e){return this.#y(e,"delete")}#y(e,t){let i=!1;if(this.#n!==0){let s=this.#a.get(e);if(s!==void 0)if(i=!0,this.#n===1)this.#V(t);else{this.#L(s);let n=this.#l[s];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#v)&&(this.#b&&this.#r?.(n,e,t),this.#v&&this.#m?.push([n,e,t])),this.#a.delete(e),this.#h[s]=void 0,this.#l[s]=void 0,s===this.#g)this.#g=this.#u[s];else if(s===this.#p)this.#p=this.#f[s];else{let a=this.#u[s];this.#f[a]=this.#f[s];let c=this.#f[s];this.#u[c]=this.#u[s]}this.#n--,this.#w.push(s)}}if(this.#v&&this.#m?.length){let s=this.#m,n;for(;n=s?.shift();)this.#i?.(...n)}return i}clear(){return this.#V("delete")}#V(e){for(let t of this.#N({allowStale:!0})){let i=this.#l[t];if(this.#S(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#h[t];this.#b&&this.#r?.(i,s,e),this.#v&&this.#m?.push([i,s,e])}}if(this.#a.clear(),this.#l.fill(void 0),this.#h.fill(void 0),this.#_&&this.#E&&(this.#_.fill(0),this.#E.fill(0)),this.#A&&this.#A.fill(0),this.#p=0,this.#g=0,this.#w.length=0,this.#c=0,this.#n=0,this.#v&&this.#m){let t=this.#m,i;for(;i=t?.shift();)this.#i?.(...i)}}};$d.LRUCache=Qv});var Gx=g((YBe,zx)=>{"use strict";var Vx=Qe(),qQ=o((r,e,t,i,s)=>{typeof t=="string"&&(s=i,i=t,t=void 0);try{return new Vx(r instanceof Vx?r.version:r,t).inc(e,i,s).version}catch{return null}},"inc");zx.exports=qQ});var Jx=g((XBe,Wx)=>{"use strict";var Hx=_n(),jQ=o((r,e)=>{let t=Hx(r,null,!0),i=Hx(e,null,!0),s=t.compare(i);if(s===0)return null;let n=s>0,a=n?t:i,c=n?i:t,l=!!a.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let h=l?"pre":"";return t.major!==i.major?h+"major":t.minor!==i.minor?h+"minor":t.patch!==i.patch?h+"patch":"prerelease"},"diff");Wx.exports=jQ});var Yx=g((eqe,Kx)=>{"use strict";var $Q=Qe(),UQ=o((r,e)=>new $Q(r,e).major,"major");Kx.exports=UQ});var Xx=g((rqe,Zx)=>{"use strict";var VQ=Qe(),zQ=o((r,e)=>new VQ(r,e).minor,"minor");Zx.exports=zQ});var eD=g((sqe,Qx)=>{"use strict";var GQ=Qe(),HQ=o((r,e)=>new GQ(r,e).patch,"patch");Qx.exports=HQ});var rD=g((oqe,tD)=>{"use strict";var WQ=_n(),JQ=o((r,e)=>{let t=WQ(r,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");tD.exports=JQ});var Xt=g((cqe,sD)=>{"use strict";var iD=Qe(),KQ=o((r,e,t)=>new iD(r,t).compare(new iD(e,t)),"compare");sD.exports=KQ});var oD=g((uqe,nD)=>{"use strict";var YQ=Xt(),ZQ=o((r,e,t)=>YQ(e,r,t),"rcompare");nD.exports=ZQ});var cD=g((fqe,aD)=>{"use strict";var XQ=Xt(),QQ=o((r,e)=>XQ(r,e,!0),"compareLoose");aD.exports=QQ});var Ud=g((pqe,uD)=>{"use strict";var lD=Qe(),e7=o((r,e,t)=>{let i=new lD(r,t),s=new lD(e,t);return i.compare(s)||i.compareBuild(s)},"compareBuild");uD.exports=e7});var fD=g((mqe,hD)=>{"use strict";var t7=Ud(),r7=o((r,e)=>r.sort((t,i)=>t7(t,i,e)),"sort");hD.exports=r7});var pD=g((Sqe,dD)=>{"use strict";var i7=Ud(),s7=o((r,e)=>r.sort((t,i)=>i7(i,t,e)),"rsort");dD.exports=s7});var Vl=g((vqe,gD)=>{"use strict";var n7=Xt(),o7=o((r,e,t)=>n7(r,e,t)>0,"gt");gD.exports=o7});var Vd=g((_qe,mD)=>{"use strict";var a7=Xt(),c7=o((r,e,t)=>a7(r,e,t)<0,"lt");mD.exports=c7});var tE=g((Oqe,yD)=>{"use strict";var l7=Xt(),u7=o((r,e,t)=>l7(r,e,t)===0,"eq");yD.exports=u7});var rE=g((Tqe,SD)=>{"use strict";var h7=Xt(),f7=o((r,e,t)=>h7(r,e,t)!==0,"neq");SD.exports=f7});var zd=g((Aqe,wD)=>{"use strict";var d7=Xt(),p7=o((r,e,t)=>d7(r,e,t)>=0,"gte");wD.exports=p7});var Gd=g((kqe,vD)=>{"use strict";var g7=Xt(),m7=o((r,e,t)=>g7(r,e,t)<=0,"lte");vD.exports=m7});var iE=g((Nqe,ED)=>{"use strict";var y7=tE(),S7=rE(),w7=Vl(),v7=zd(),E7=Vd(),_7=Gd(),b7=o((r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return y7(r,t,i);case"!=":return S7(r,t,i);case">":return w7(r,t,i);case">=":return v7(r,t,i);case"<":return E7(r,t,i);case"<=":return _7(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");ED.exports=b7});var bD=g((Dqe,_D)=>{"use strict";var O7=Qe(),I7=_n(),{safeRe:Hd,t:Wd}=Ho(),T7=o((r,e)=>{if(r instanceof O7)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?Hd[Wd.COERCEFULL]:Hd[Wd.COERCE]);else{let l=e.includePrerelease?Hd[Wd.COERCERTLFULL]:Hd[Wd.COERCERTL],u;for(;(u=l.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(t===null)return null;let i=t[2],s=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return I7(`${i}.${s}.${n}${a}${c}`,e)},"coerce");_D.exports=T7});var ID=g((Mqe,OD)=>{"use strict";var sE=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 s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};OD.exports=sE});var Qt=g((Bqe,CD)=>{"use strict";var R7=/\s+/g,nE=class r{static{o(this,"Range")}constructor(e,t){if(t=C7(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof oE)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(R7," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(s=>!RD(s[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&M7(s[0])){this.set=[s];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 i=0;i<t.length;i++)i>0&&(this.formatted+=" "),this.formatted+=t[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&D7)|(this.options.loose&&L7))+":"+e,s=TD.get(i);if(s)return s;let n=this.options.loose,a=n?St[ft.HYPHENRANGELOOSE]:St[ft.HYPHENRANGE];e=e.replace(a,H7(this.options.includePrerelease)),ge("hyphen replace",e),e=e.replace(St[ft.COMPARATORTRIM],P7),ge("comparator trim",e),e=e.replace(St[ft.TILDETRIM],N7),ge("tilde trim",e),e=e.replace(St[ft.CARETTRIM],x7),ge("caret trim",e);let c=e.split(" ").map(f=>F7(f,this.options)).join(" ").split(/\s+/).map(f=>G7(f,this.options));n&&(c=c.filter(f=>(ge("loose invalid filter",f,this.options),!!f.match(St[ft.COMPARATORLOOSE])))),ge("range list",c);let l=new Map,u=c.map(f=>new oE(f,this.options));for(let f of u){if(RD(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let h=[...l.values()];return TD.set(i,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(i=>AD(i,t)&&e.set.some(s=>AD(s,t)&&i.every(n=>s.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new k7(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(W7(this.set[t],e,this.options))return!0;return!1}};CD.exports=nE;var A7=ID(),TD=new A7,C7=Yf(),oE=zl(),ge=yl(),k7=Qe(),{safeRe:St,t:ft,comparatorTrimReplace:P7,tildeTrimReplace:N7,caretTrimReplace:x7}=Ho(),{FLAG_INCLUDE_PRERELEASE:D7,FLAG_LOOSE:L7}=Sl(),RD=o(r=>r.value==="<0.0.0-0","isNullSet"),M7=o(r=>r.value==="","isAny"),AD=o((r,e)=>{let t=!0,i=r.slice(),s=i.pop();for(;t&&i.length;)t=i.every(n=>s.intersects(n,e)),s=i.pop();return t},"isSatisfiable"),F7=o((r,e)=>(ge("comp",r,e),r=j7(r,e),ge("caret",r),r=B7(r,e),ge("tildes",r),r=U7(r,e),ge("xrange",r),r=z7(r,e),ge("stars",r),r),"parseComparator"),dt=o(r=>!r||r.toLowerCase()==="x"||r==="*","isX"),B7=o((r,e)=>r.trim().split(/\s+/).map(t=>q7(t,e)).join(" "),"replaceTildes"),q7=o((r,e)=>{let t=e.loose?St[ft.TILDELOOSE]:St[ft.TILDE];return r.replace(t,(i,s,n,a,c)=>{ge("tilde",r,i,s,n,a,c);let l;return dt(s)?l="":dt(n)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:dt(a)?l=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:c?(ge("replaceTilde pr",c),l=`>=${s}.${n}.${a}-${c} <${s}.${+n+1}.0-0`):l=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,ge("tilde return",l),l})},"replaceTilde"),j7=o((r,e)=>r.trim().split(/\s+/).map(t=>$7(t,e)).join(" "),"replaceCarets"),$7=o((r,e)=>{ge("caret",r,e);let t=e.loose?St[ft.CARETLOOSE]:St[ft.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(s,n,a,c,l)=>{ge("caret",r,s,n,a,c,l);let u;return dt(n)?u="":dt(a)?u=`>=${n}.0.0${i} <${+n+1}.0.0-0`:dt(c)?n==="0"?u=`>=${n}.${a}.0${i} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.0${i} <${+n+1}.0.0-0`:l?(ge("replaceCaret pr",l),n==="0"?a==="0"?u=`>=${n}.${a}.${c}-${l} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}-${l} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c}-${l} <${+n+1}.0.0-0`):(ge("no pr"),n==="0"?a==="0"?u=`>=${n}.${a}.${c}${i} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}${i} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),ge("caret return",u),u})},"replaceCaret"),U7=o((r,e)=>(ge("replaceXRanges",r,e),r.split(/\s+/).map(t=>V7(t,e)).join(" ")),"replaceXRanges"),V7=o((r,e)=>{r=r.trim();let t=e.loose?St[ft.XRANGELOOSE]:St[ft.XRANGE];return r.replace(t,(i,s,n,a,c,l)=>{ge("xRange",r,i,s,n,a,c,l);let u=dt(n),h=u||dt(a),f=h||dt(c),d=f;return s==="="&&d&&(s=""),l=e.includePrerelease?"-0":"",u?s===">"||s==="<"?i="<0.0.0-0":i="*":s&&d?(h&&(a=0),c=0,s===">"?(s=">=",h?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):s==="<="&&(s="<",h?n=+n+1:a=+a+1),s==="<"&&(l="-0"),i=`${s+n}.${a}.${c}${l}`):h?i=`>=${n}.0.0${l} <${+n+1}.0.0-0`:f&&(i=`>=${n}.${a}.0${l} <${n}.${+a+1}.0-0`),ge("xRange return",i),i})},"replaceXRange"),z7=o((r,e)=>(ge("replaceStars",r,e),r.trim().replace(St[ft.STAR],"")),"replaceStars"),G7=o((r,e)=>(ge("replaceGTE0",r,e),r.trim().replace(St[e.includePrerelease?ft.GTE0PRE:ft.GTE0],"")),"replaceGTE0"),H7=o(r=>(e,t,i,s,n,a,c,l,u,h,f,d)=>(dt(i)?t="":dt(s)?t=`>=${i}.0.0${r?"-0":""}`:dt(n)?t=`>=${i}.${s}.0${r?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,dt(u)?l="":dt(h)?l=`<${+u+1}.0.0-0`:dt(f)?l=`<${u}.${+h+1}.0-0`:d?l=`<=${u}.${h}.${f}-${d}`:r?l=`<${u}.${h}.${+f+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),"hyphenReplace"),W7=o((r,e,t)=>{for(let i=0;i<r.length;i++)if(!r[i].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let i=0;i<r.length;i++)if(ge(r[i].semver),r[i].semver!==oE.ANY&&r[i].semver.prerelease.length>0){let s=r[i].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var zl=g((jqe,LD)=>{"use strict";var Gl=Symbol("SemVer ANY"),lE=class r{static{o(this,"Comparator")}static get ANY(){return Gl}constructor(e,t){if(t=kD(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),cE("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Gl?this.value="":this.value=this.operator+this.semver.version,cE("comp",this)}parse(e){let t=this.options.loose?PD[ND.COMPARATORLOOSE]:PD[ND.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new xD(i[2],this.options.loose):this.semver=Gl}toString(){return this.value}test(e){if(cE("Comparator.test",e,this.options.loose),this.semver===Gl||e===Gl)return!0;if(typeof e=="string")try{e=new xD(e,this.options)}catch{return!1}return aE(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new DD(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new DD(this.value,t).test(e.semver):(t=kD(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("=")||aE(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||aE(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};LD.exports=lE;var kD=Yf(),{safeRe:PD,t:ND}=Ho(),aE=iE(),cE=yl(),xD=Qe(),DD=Qt()});var ra=g((Uqe,MD)=>{"use strict";var J7=Qt(),K7=o((r,e,t)=>{try{e=new J7(e,t)}catch{return!1}return e.test(r)},"satisfies");MD.exports=K7});var BD=g((zqe,FD)=>{"use strict";var Y7=Qt(),Z7=o((r,e)=>new Y7(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" ")),"toComparators");FD.exports=Z7});var jD=g((Hqe,qD)=>{"use strict";var X7=Qe(),Q7=Qt(),eee=o((r,e,t)=>{let i=null,s=null,n=null;try{n=new Q7(e,t)}catch{return null}return r.forEach(a=>{n.test(a)&&(!i||s.compare(a)===-1)&&(i=a,s=new X7(i,t))}),i},"maxSatisfying");qD.exports=eee});var UD=g((Jqe,$D)=>{"use strict";var tee=Qe(),ree=Qt(),iee=o((r,e,t)=>{let i=null,s=null,n=null;try{n=new ree(e,t)}catch{return null}return r.forEach(a=>{n.test(a)&&(!i||s.compare(a)===1)&&(i=a,s=new tee(i,t))}),i},"minSatisfying");$D.exports=iee});var GD=g((Yqe,zD)=>{"use strict";var uE=Qe(),see=Qt(),VD=Vl(),nee=o((r,e)=>{r=new see(r,e);let t=new uE("0.0.0");if(r.test(t)||(t=new uE("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i<r.set.length;++i){let s=r.set[i],n=null;s.forEach(a=>{let c=new uE(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||VD(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||VD(t,n))&&(t=n)}return t&&r.test(t)?t:null},"minVersion");zD.exports=nee});var hE=g((Xqe,HD)=>{"use strict";var oee=Qt(),aee=o((r,e)=>{try{return new oee(r,e).range||"*"}catch{return null}},"validRange");HD.exports=aee});var Jd=g((eje,YD)=>{"use strict";var cee=Qe(),KD=zl(),{ANY:lee}=KD,uee=Qt(),hee=ra(),WD=Vl(),JD=Vd(),fee=Gd(),dee=zd(),pee=o((r,e,t,i)=>{r=new cee(r,i),e=new uee(e,i);let s,n,a,c,l;switch(t){case">":s=WD,n=fee,a=JD,c=">",l=">=";break;case"<":s=JD,n=dee,a=WD,c="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hee(r,e,i))return!1;for(let u=0;u<e.set.length;++u){let h=e.set[u],f=null,d=null;if(h.forEach(p=>{p.semver===lee&&(p=new KD(">=0.0.0")),f=f||p,d=d||p,s(p.semver,f.semver,i)?f=p:a(p.semver,d.semver,i)&&(d=p)}),f.operator===c||f.operator===l||(!d.operator||d.operator===c)&&n(r,d.semver))return!1;if(d.operator===l&&a(r,d.semver))return!1}return!0},"outside");YD.exports=pee});var XD=g((rje,ZD)=>{"use strict";var gee=Jd(),mee=o((r,e,t)=>gee(r,e,">",t),"gtr");ZD.exports=mee});var eL=g((sje,QD)=>{"use strict";var yee=Jd(),See=o((r,e,t)=>yee(r,e,"<",t),"ltr");QD.exports=See});var iL=g((oje,rL)=>{"use strict";var tL=Qt(),wee=o((r,e,t)=>(r=new tL(r,t),e=new tL(e,t),r.intersects(e,t)),"intersects");rL.exports=wee});var nL=g((cje,sL)=>{"use strict";var vee=ra(),Eee=Xt();sL.exports=(r,e,t)=>{let i=[],s=null,n=null,a=r.sort((h,f)=>Eee(h,f,t));for(let h of a)vee(h,e,t)?(n=h,s||(s=h)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let c=[];for(let[h,f]of i)h===f?c.push(h):!f&&h===a[0]?c.push("*"):f?h===a[0]?c.push(`<=${f}`):c.push(`${h} - ${f}`):c.push(`>=${h}`);let l=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var hL=g((lje,uL)=>{"use strict";var oL=Qt(),dE=zl(),{ANY:fE}=dE,Hl=ra(),pE=Xt(),_ee=o((r,e,t={})=>{if(r===e)return!0;r=new oL(r,t),e=new oL(e,t);let i=!1;e:for(let s of r.set){for(let n of e.set){let a=Oee(s,n,t);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},"subset"),bee=[new dE(">=0.0.0-0")],aL=[new dE(">=0.0.0")],Oee=o((r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===fE){if(e.length===1&&e[0].semver===fE)return!0;t.includePrerelease?r=bee:r=aL}if(e.length===1&&e[0].semver===fE){if(t.includePrerelease)return!0;e=aL}let i=new Set,s,n;for(let p of r)p.operator===">"||p.operator===">="?s=cL(s,p,t):p.operator==="<"||p.operator==="<="?n=lL(n,p,t):i.add(p.semver);if(i.size>1)return null;let a;if(s&&n){if(a=pE(s.semver,n.semver,t),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let p of i){if(s&&!Hl(p,String(s),t)||n&&!Hl(p,String(n),t))return null;for(let m of e)if(!Hl(p,String(m),t))return!1;return!0}let c,l,u,h,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,d=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let p of e){if(h=h||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",s){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=cL(s,p,t),c===p&&c!==s)return!1}else if(s.operator===">="&&!Hl(s.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(l=lL(n,p,t),l===p&&l!==n)return!1}else if(n.operator==="<="&&!Hl(n.semver,String(p),t))return!1}if(!p.operator&&(n||s)&&a!==0)return!1}return!(s&&u&&!n&&a!==0||n&&h&&!s&&a!==0||d||f)},"simpleSubset"),cL=o((r,e,t)=>{if(!r)return e;let i=pE(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},"higherGT"),lL=o((r,e,t)=>{if(!r)return e;let i=pE(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r},"lowerLT");uL.exports=_ee});var $e=g((hje,pL)=>{"use strict";var gE=Ho(),fL=Sl(),Iee=Qe(),dL=Yw(),Tee=_n(),Ree=Xw(),Aee=Qw(),Cee=Gx(),kee=Jx(),Pee=Yx(),Nee=Xx(),xee=eD(),Dee=rD(),Lee=Xt(),Mee=oD(),Fee=cD(),Bee=Ud(),qee=fD(),jee=pD(),$ee=Vl(),Uee=Vd(),Vee=tE(),zee=rE(),Gee=zd(),Hee=Gd(),Wee=iE(),Jee=bD(),Kee=zl(),Yee=Qt(),Zee=ra(),Xee=BD(),Qee=jD(),ete=UD(),tte=GD(),rte=hE(),ite=Jd(),ste=XD(),nte=eL(),ote=iL(),ate=nL(),cte=hL();pL.exports={parse:Tee,valid:Ree,clean:Aee,inc:Cee,diff:kee,major:Pee,minor:Nee,patch:xee,prerelease:Dee,compare:Lee,rcompare:Mee,compareLoose:Fee,compareBuild:Bee,sort:qee,rsort:jee,gt:$ee,lt:Uee,eq:Vee,neq:zee,gte:Gee,lte:Hee,cmp:Wee,coerce:Jee,Comparator:Kee,Range:Yee,satisfies:Zee,toComparators:Xee,maxSatisfying:Qee,minSatisfying:ete,minVersion:tte,validRange:rte,outside:ite,gtr:ste,ltr:nte,intersects:ote,simplifyRange:ate,subset:cte,SemVer:Iee,re:gE.re,src:gE.src,tokens:gE.t,SEMVER_SPEC_VERSION:fL.SEMVER_SPEC_VERSION,RELEASE_TYPES:fL.RELEASE_TYPES,compareIdentifiers:dL.compareIdentifiers,rcompareIdentifiers:dL.rcompareIdentifiers}});var yL=g((fje,mL)=>{var gL=$e();mL.exports=r=>lte(r.reduce(gte,{versions:{},"dist-tags":{},refs:{},shas:{}}));var lte=o(r=>fte(ute(hte(r))),"finish"),ute=o(r=>(Object.keys(r.refs).forEach(e=>{let t=r.refs[e];r.shas[t.sha]?r.shas[t.sha].push(e):r.shas[t.sha]=[e]}),r),"shaList"),hte=o(r=>(Object.keys(r.refs).filter(e=>e.endsWith("^{}")).forEach(e=>{let t=r.refs[e],i=r.refs[e.replace(/\^\{\}$/,"")];i&&(i.sha=t.sha,delete r.refs[e])}),r),"peelTags"),fte=o(r=>{let e=r.refs.HEAD||{};return Object.keys(r.versions).forEach(i=>{let s=r.versions[i];r.refs.latest&&s.sha===r.refs.latest.sha?r["dist-tags"].latest=i:s.sha===e.sha&&(r["dist-tags"].HEAD=i,r.refs.latest||(r["dist-tags"].latest=i))}),r},"distTags"),dte=o(r=>r.startsWith("refs/tags/")?"tag":r.startsWith("refs/heads/")?"branch":r.startsWith("refs/pull/")?"pull":r==="HEAD"?"head":"other","refType"),pte=o(r=>{let e=r.trim().split(/\s+/,2);if(e.length<2)return null;let t=e[0].trim(),i=e[1].trim(),s=dte(i);if(s==="tag"){let n=i.slice(10);return{sha:t,ref:n,rawRef:i,type:s}}if(s==="branch"){let n=i.slice(11);return{sha:t,ref:n,rawRef:i,type:s}}if(s==="pull"){let n=i.slice(5).replace(/\/head$/,"");return{sha:t,ref:n,rawRef:i,type:s}}return s==="head"?{sha:t,ref:"HEAD",rawRef:i,type:s}:{sha:t,ref:i,rawRef:i,type:s}},"lineToRevDoc"),gte=o((r,e)=>{let t=pte(e);if(!t)return r;if(r.refs[t.ref]=t,r.refs[t.rawRef]=t,t.type==="tag"){let i=!t.ref.endsWith("^{}")&&t.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);i&&gL.valid(i[1],!0)&&(r.versions[gL.clean(i[1],!0)]=t)}return r},"linesToRevsReducer")});var mE=g((pje,wL)=>{var mte=Ul(),{LRUCache:yte}=eE(),Ste=yL(),SL=new yte({max:100,ttl:300*1e3});wL.exports=async(r,e={})=>{if(!e.noGitRevCache){let s=SL.get(r);if(s)return s}let{stdout:t}=await mte(["ls-remote",r],e),i=Ste(t.trim().split(`
12
+ `));return SL.set(r,i),i}});var EL=g(vL=>{var wte=o(r=>(r.fakePlatform||process.platform)==="win32","isWindows");vL.isWindows=wte});var OL=g((yje,bL)=>{"use strict";var K=o((...r)=>r.every(e=>e)?r.join(""):"","maybeJoin"),xe=o(r=>r?encodeURIComponent(r):"","maybeEncode"),_L=o(r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),vte={sshtemplate:o(({domain:r,user:e,project:t,committish:i})=>`git@${r}:${e}/${t}.git${K("#",i)}`,"sshtemplate"),sshurltemplate:o(({domain:r,user:e,project:t,committish:i})=>`git+ssh://git@${r}/${e}/${t}.git${K("#",i)}`,"sshurltemplate"),edittemplate:o(({domain:r,user:e,project:t,committish:i,editpath:s,path:n})=>`https://${r}/${e}/${t}${K("/",s,"/",xe(i||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:r,user:e,project:t,committish:i,treepath:s})=>`https://${r}/${e}/${t}${K("/",s,"/",xe(i))}`,"browsetemplate"),browsetreetemplate:o(({domain:r,user:e,project:t,committish:i,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${r}/${e}/${t}/${s}/${xe(i||"HEAD")}/${n}${K("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:r,user:e,project:t,committish:i,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${r}/${e}/${t}/${s}/${xe(i||"HEAD")}/${n}${K("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:r,user:e,project:t,treepath:i,committish:s})=>`https://${r}/${e}/${t}${K("/",i,"/",xe(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:r,domain:e,user:t,project:i,committish:s})=>`git+https://${K(r,"@")}${e}/${t}/${i}.git${K("#",s)}`,"httpstemplate"),filetemplate:o(({domain:r,user:e,project:t,committish:i,path:s})=>`https://${r}/${e}/${t}/raw/${xe(i||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:r,user:e,project:t,committish:i})=>`${r}:${e}/${t}${K("#",i)}`,"shortcuttemplate"),pathtemplate:o(({user:r,project:e,committish:t})=>`${r}/${e}${K("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:r,user:e,project:t})=>`https://${r}/${e}/${t}/issues`,"bugstemplate"),hashformat:_L},_s={};_s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:r,user:e,project:t,committish:i,path:s})=>`https://${K(r,"@")}raw.githubusercontent.com/${e}/${t}/${xe(i||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:r,domain:e,user:t,project:i,committish:s})=>`git://${K(r,"@")}${e}/${t}/${i}.git${K("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://codeload.${r}/${e}/${t}/tar.gz/${xe(i||"HEAD")}`,"tarballtemplate"),extract:o(r=>{let[,e,t,i,s]=r.pathname.split("/",5);if(!(i&&i!=="tree")&&(i||(s=r.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};_s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:r,user:e,project:t,committish:i,treepath:s,path:n,editpath:a})=>`https://${r}/${e}/${t}${K("/",s,"/",xe(i||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}/get/${xe(i||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(r=>{let[,e,t,i]=r.pathname.split("/",4);if(!["get"].includes(i)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:r.hash.slice(1)}},"extract")};_s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:o(({auth:r,domain:e,user:t,project:i,committish:s})=>`git+https://${K(r,"@")}${e}/${t}/${i}.git${K("#",s)}`,"httpstemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}/repository/archive.tar.gz?ref=${xe(i||"HEAD")}`,"tarballtemplate"),extract:o(r=>{let e=r.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),i=t.pop();i.endsWith(".git")&&(i=i.slice(0,-4));let s=t.join("/");if(!(!s||!i))return{user:s,project:i,committish:r.hash.slice(1)}},"extract")};_s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:r,project:e,committish:t})=>`git@${r}:${e}.git${K("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:r,project:e,committish:t})=>`git+ssh://git@${r}/${e}.git${K("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:r,user:e,project:t,committish:i,editpath:s})=>`https://${r}/${e}/${t}${K("/",xe(i))}/${s}`,"edittemplate"),browsetemplate:o(({domain:r,project:e,committish:t})=>`https://${r}/${e}${K("/",xe(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:r,project:e,committish:t,path:i,hashformat:s})=>`https://${r}/${e}${K("/",xe(t))}${K("#",s(i))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:r,project:e,committish:t,path:i,hashformat:s})=>`https://${r}/${e}${K("/",xe(t))}${K("#",s(i))}`,"browseblobtemplate"),docstemplate:o(({domain:r,project:e,committish:t})=>`https://${r}/${e}${K("/",xe(t))}`,"docstemplate"),httpstemplate:o(({domain:r,project:e,committish:t})=>`git+https://${r}/${e}.git${K("#",t)}`,"httpstemplate"),filetemplate:o(({user:r,project:e,committish:t,path:i})=>`https://gist.githubusercontent.com/${r}/${e}/raw${K("/",xe(t))}/${i}`,"filetemplate"),shortcuttemplate:o(({type:r,project:e,committish:t})=>`${r}:${e}${K("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:r,committish:e})=>`${r}${K("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:r,project:e})=>`https://${r}/${e}`,"bugstemplate"),gittemplate:o(({domain:r,project:e,committish:t})=>`git://${r}/${e}.git${K("#",t)}`,"gittemplate"),tarballtemplate:o(({project:r,committish:e})=>`https://codeload.github.com/gist/${r}/tar.gz/${xe(e||"HEAD")}`,"tarballtemplate"),extract:o(r=>{let[,e,t,i]=r.pathname.split("/",4);if(i!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:r.hash.slice(1)}}},"extract"),hashformat:o(function(r){return r&&"file-"+_L(r)},"hashformat")};_s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:r,user:e,project:t,committish:i,path:s})=>`https://${r}/${e}/${t}/blob/${xe(i)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}.git${K("#",i)}`,"httpstemplate"),tarballtemplate:o(({domain:r,user:e,project:t,committish:i})=>`https://${r}/${e}/${t}/archive/${xe(i)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(r=>{let[,e,t,i]=r.pathname.split("/",4);if(!["archive"].includes(i)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:r.hash.slice(1)}},"extract")};for(let[r,e]of Object.entries(_s))_s[r]=Object.assign({},vte,e);bL.exports=_s});var SE=g((wje,TL)=>{var Ete=require("url"),yE=o((r,e,t)=>{let i=r.indexOf(t);return r.lastIndexOf(e,i>-1?i:1/0)},"lastIndexOfBefore"),IL=o(r=>{try{return new Ete.URL(r)}catch{}},"safeUrl"),_te=o((r,e)=>{let t=r.indexOf(":"),i=r.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,i))return r;let s=r.indexOf("@");return s>-1?s>t?`git+ssh://${r}`:r:r.indexOf("//")===t+1?r:`${r.slice(0,t+1)}//${r.slice(t+1)}`},"correctProtocol"),bte=o(r=>{let e=yE(r,"@","#"),t=yE(r,":","#");return t>e&&(r=r.slice(0,t)+"/"+r.slice(t+1)),yE(r,":","#")===-1&&r.indexOf("//")===-1&&(r=`git+ssh://${r}`),r},"correctUrl");TL.exports=(r,e)=>{let t=e?_te(r,e):r;return IL(t)||IL(bte(t))}});var AL=g((Eje,RL)=>{"use strict";var Ote=SE(),Ite=o(r=>{let e=r.indexOf("#"),t=r.indexOf("/"),i=r.indexOf("/",t+1),s=r.indexOf(":"),n=/\s/.exec(r),a=r.indexOf("@"),c=!n||e>-1&&n.index>e,l=a===-1||e>-1&&a>e,u=s===-1||e>-1&&s>e,h=i===-1||e>-1&&i>e,f=t>0,d=e>-1?r[e-1]!=="/":!r.endsWith("/"),p=!r.startsWith(".");return c&&f&&d&&p&&l&&u&&h},"isGitHubShorthand");RL.exports=(r,e,{gitHosts:t,protocols:i})=>{if(!r)return;let s=Ite(r)?`github:${r}`:r,n=Ote(s,i);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],l=a||c;if(!l)return;let u=t[a||c],h=null;i[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,d=null,p=null,m=null;try{if(a){let y=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,w=y.indexOf("@");w>-1&&(y=y.slice(w+1));let S=y.lastIndexOf("/");S>-1?(d=decodeURIComponent(y.slice(0,S)),d||(d=null),p=decodeURIComponent(y.slice(S+1))):p=decodeURIComponent(y),p.endsWith(".git")&&(p=p.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),m="shortcut"}else{if(!u.protocols.includes(n.protocol))return;let y=u.extract(n);if(!y)return;d=y.user&&decodeURIComponent(y.user),p=decodeURIComponent(y.project),f=decodeURIComponent(y.committish),m=i[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(y){if(y instanceof URIError)return;throw y}return[l,d,h,p,f,m,e]}});var kL=g((bje,CL)=>{"use strict";var{LRUCache:Tte}=eE(),Rte=OL(),Ate=AL(),Cte=SE(),wE=new Tte({max:1e3});function kte(r){try{let{protocol:e,hostname:t,pathname:i}=new URL(r);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=i.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(kte,"unknownHostedUrl");var Kd=class r{static{o(this,"GitHost")}constructor(e,t,i,s,n,a,c={}){Object.assign(this,r.#e[e],{type:e,user:t,auth:i,project:s,committish:n,default:a,opts:c})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){r.#e[e]=t,r.#e.byDomain[t.domain]=e,r.#e.byShortcut[`${e}:`]=e,r.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let i=e+JSON.stringify(t||{});if(!wE.has(i)){let s=Ate(e,t,{gitHosts:r.#e,protocols:r.#t});wE.set(i,s?new r(...s):void 0)}return wE.get(i)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let i=e.repository,s=i&&(typeof i=="string"?i:typeof i=="object"&&typeof i.url=="string"?i.url:null);if(!s)throw new Error("no repository");let n=s&&r.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=kte(s);return r.fromUrl(a,t)||a}static parseUrl(e){return Cte(e)}#r(e,t){if(typeof e!="function")return null;let i={...this,...this.opts,...t};i.path||(i.path=""),i.path.startsWith("/")&&(i.path=i.path.slice(1)),i.noCommittish&&(i.committish=null);let s=e(i);return i.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#r(this.sshtemplate,e)}sshurl(e){return this.#r(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#r(this.browsetemplate,e):typeof t[0]!="string"?this.#r(this.browsetreetemplate,{...t[0],path:e}):this.#r(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#r(this.browseblobtemplate,{...t[0],path:e}):this.#r(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#r(this.docstemplate,e)}bugs(e){return this.#r(this.bugstemplate,e)}https(e){return this.#r(this.httpstemplate,e)}git(e){return this.#r(this.gittemplate,e)}shortcut(e){return this.#r(this.shortcuttemplate,e)}path(e){return this.#r(this.pathtemplate,e)}tarball(e){return this.#r(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#r(this.filetemplate,{...t,path:e})}edit(e,t){return this.#r(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[r,e]of Object.entries(Rte))Kd.addHost(r,e);CL.exports=Kd});var vE=g((Ije,PL)=>{"use strict";var{builtinModules:Pte}=require("module"),Nte=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),xte=["node_modules","favicon.ico"];function Dte(r){var e=[],t=[];if(r===null)return t.push("name cannot be null"),Wl(e,t);if(r===void 0)return t.push("name cannot be undefined"),Wl(e,t);if(typeof r!="string")return t.push("name must be a string"),Wl(e,t);if(r.length||t.push("name length must be greater than zero"),r.startsWith(".")&&t.push("name cannot start with a period"),r.match(/^_/)&&t.push("name cannot start with an underscore"),r.trim()!==r&&t.push("name cannot contain leading or trailing spaces"),xte.forEach(function(a){r.toLowerCase()===a&&t.push(a+" is not a valid package name")}),Pte.includes(r.toLowerCase())&&e.push(r+" is a core module name"),r.length>214&&e.push("name can no longer contain more than 214 characters"),r.toLowerCase()!==r&&e.push("name can no longer contain capital letters"),/[~'!()*]/.test(r.split("/").slice(-1)[0])&&e.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(r)!==r){var i=r.match(Nte);if(i){var s=i[1],n=i[2];if(n.startsWith(".")&&t.push("name cannot start with a period"),encodeURIComponent(s)===s&&encodeURIComponent(n)===n)return Wl(e,t)}t.push("name can only contain URL-friendly characters")}return Wl(e,t)}o(Dte,"validate");var Wl=o(function(r,e){var t={validForNewPackages:e.length===0&&r.length===0,validForOldPackages:e.length===0,warnings:r,errors:e};return t.warnings.length||delete t.warnings,t.errors.length||delete t.errors,t},"done");PL.exports=Dte});var jL=g((Rje,Zl)=>{"use strict";var Yl=process.platform==="win32",{URL:EE}=require("node:url"),ia=Yl?require("node:path/win32"):require("node:path"),{homedir:Lte}=require("node:os"),Mte=kL(),NL=$e(),ML=vE(),{log:Fte}=se(),FL=Yl?/\\|[/]/:/[/]/,BL=/^(?:git[+])?[a-z]+:/i,Bte=/^[^@]+@[^:.]+\.[^:]+:.+$/i,bE=/[.](?:tgz|tar.gz|tar)$/i,qte=/:[0-9]+(\/|$)/i,jte=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,$te=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,xL="https://registry.npmjs.org";function Jl(r,e){let t,i;if(typeof r=="object")return r instanceof Kl&&(!e||e===r.where)?r:r.name&&r.rawSpec?Jl.resolve(r.name,r.rawSpec,e||r.where):Jl(r.raw,e||r.where);let s=r.indexOf("@",1),n=s>0?r.slice(0,s):r;return BL.test(r)?i=r:Bte.test(r)?i=`git+ssh://${r}`:!n.startsWith("@")&&(FL.test(n)||bE.test(n))?i=r:s>0?(t=n,i=r.slice(s+1)||"*"):ML(r).validForOldPackages?(t=r,i="*"):i=r,qL(t,i,e,r)}o(Jl,"npa");function Ute(r){return r?r.toLowerCase().startsWith("file:")?!0:Yl?jte.test(r):$te.test(r):!1}o(Ute,"isFileSpec");function Vte(r){return r?r.toLowerCase().startsWith("npm:"):!1}o(Vte,"isAliasSpec");function qL(r,e,t,i){let s=new Kl({raw:i,name:r,rawSpec:e,fromArgument:i!=null});if(r&&(s.name=r),t||(t=process.cwd()),Ute(e))return LL(s,t);if(Vte(e))return Xte(s,t);let n=Mte.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?Kte(s,n):e&&BL.test(e)?Zte(s):e&&(FL.test(e)||bE.test(e))?LL(s,t):Qte(s)}o(qL,"resolve");function zte(r,e=xL){let t=Jl(r);if(t.type!=="version")throw Wte(t.type,t.raw);let i="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==xL&&(i+="?repository_url="+e),i}o(zte,"toPurl");function Gte(r,e,t){let i=new Error(`Invalid package name "${r}" of package "${t}": ${e.errors.join("; ")}.`);return i.code="EINVALIDPACKAGENAME",i}o(Gte,"invalidPackageName");function Hte(r,e){let t=new Error(`Invalid tag name "${r}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(Hte,"invalidTagName");function Wte(r,e){let t=new Error(`Invalid type "${r}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(Wte,"invalidPurlType");var Kl=class{static{o(this,"Result")}constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||"",this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=ML(e);if(!t.validForOldPackages)throw Gte(e,t,this.raw);return this.name=e,this.scope=e[0]==="@"?e.slice(0,e.indexOf("/")):void 0,this.escapedName=e.replace("/","%2f"),this}toString(){let e=[];this.name!=null&&this.name!==""&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==""&&e.push(t),e.length?e.join("@"):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function _E(r,e){if(!e){r.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(r.gitRange)throw new Error("cannot override existing semver range with a committish");if(r.gitCommittish)throw new Error("cannot override existing committish with a second committish");r.gitCommittish=t;continue}let[i,s]=t.split(":");if(i==="semver"){if(r.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(r.gitRange)throw new Error("cannot override existing semver range with a second semver range");r.gitRange=decodeURIComponent(s);continue}if(i==="path"){if(r.gitSubdir)throw new Error("cannot override existing path with a second path");r.gitSubdir=`/${s}`;continue}Fte.warn("npm-package-arg",`ignoring unknown key "${i}"`)}}o(_E,"setGitAttrs");var Jte=new Map([["\0","%00"],[" ","%09"],[`
13
+ `,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",Yl?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function DL(r){let e="";for(let t=0;t<r.length;t++)e=`${e}${Jte.get(r[t])??r[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(DL,"pathToFileURL");function LL(r,e){r.type=bE.test(r.rawSpec)?"file":"directory",r.where=e;let t=DL(r.rawSpec);t.startsWith("file:/")&&(/^file:\/\/[^/]/.test(t)&&(t=`file:/${t.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(t.slice(5))&&(t=t.replace(/^file:\/{1,3}/,"file:")));let i,s;try{i=new EE(t,`${DL(ia.resolve(e))}/`),s=new EE(t)}catch(c){let l=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(l,{raw:r.rawSpec,spec:r,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(i.pathname);return Yl&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(r.saveSpec=`file:${n.substr(1)}`,a=ia.resolve(Lte(),n.substr(3))):ia.isAbsolute(t.slice(5))?r.saveSpec=`file:${ia.resolve(a)}`:r.saveSpec=`file:${ia.relative(e,a)}`,r.fetchSpec=ia.resolve(e,a),r.saveSpec=r.saveSpec.split("\\").join("/"),r.saveSpec.startsWith("file://")&&(r.saveSpec=`file:/${r.saveSpec.slice(7)}`),r}o(LL,"fromFile");function Kte(r,e){return r.type="git",r.hosted=e,r.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),r.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),_E(r,e.committish),r}o(Kte,"fromHostedGit");function Yte(r,e){let t=new Error(`Unsupported URL Type "${r}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(Yte,"unsupportedURLType");function Zte(r){let e=r.rawSpec;if(r.saveSpec=e,e.startsWith("git+ssh:")){let i=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(i&&!i[1].match(qte))return r.type="git",_E(r,i[2]),r.fetchSpec=i[1],r}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new EE(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":r.type="git",_E(r,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?r.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",r.fetchSpec=t.toString()),r.fetchSpec.startsWith("git+")&&(r.fetchSpec=r.fetchSpec.slice(4));break;case"http:":case"https:":r.type="remote",r.fetchSpec=r.saveSpec;break;default:throw Yte(t.protocol,e)}return r}o(Zte,"fromURL");function Xte(r,e){let t=Jl(r.rawSpec.substr(4),e);if(t.type==="alias")throw new Error("nested aliases not supported");if(!t.registry)throw new Error("aliases only work for registry deps");if(!t.name)throw new Error("aliases must have a name");return r.subSpec=t,r.registry=!0,r.type="alias",r.saveSpec=null,r.fetchSpec=null,r}o(Xte,"fromAlias");function Qte(r){r.registry=!0;let e=r.rawSpec.trim();r.saveSpec=null,r.fetchSpec=e;let t=NL.valid(e,!0),i=NL.validRange(e,!0);if(t)r.type="version";else if(i)r.type="range";else{if(encodeURIComponent(e)!==e)throw Hte(e,r.raw);r.type="tag"}return r}o(Qte,"fromRegistry");Zl.exports=Jl;Zl.exports.resolve=qL;Zl.exports.toPurl=zte;Zl.exports.Result=Kl});var GL=g((Cje,zL)=>{var kn=require("node:process"),ere=require("node:os"),tre=require("node:fs");function rre(r){return r.includes("libc.musl-")||r.includes("ld-musl-")}o(rre,"isMusl");function $L(){return kn.platform}o($L,"os");function UL(){return kn.arch}o(UL,"cpu");var ire="/usr/bin/ldd";function sre(){try{let r=tre.readFileSync(ire,"utf-8");return r.includes("musl")?"musl":r.includes("GNU C Library")?"glibc":null}catch{return}}o(sre,"getFamilyFromFilesystem");function nre(){let r=kn.report.excludeNetwork;kn.report.excludeNetwork=!0;let e=kn.report.getReport();return kn.report.excludeNetwork=r,e.header?.glibcVersionRuntime?Li="glibc":Array.isArray(e.sharedObjects)&&e.sharedObjects.some(rre)?Li="musl":Li=null,Li}o(nre,"getFamilyFromReport");var Li;function VL(r){if(r==="linux")return Li===void 0&&(Li=sre(),Li===void 0&&(Li=nre())),Li}o(VL,"libc");function ore(r={}){let e=r.os||$L();return{cpu:{name:r.cpu||UL()},libc:{name:r.libc||VL(e)},os:{name:e,version:r.osVersion||ere.release()},packageManager:{name:"npm",version:r.npmVersion},runtime:{name:"node",version:r.nodeVersion||kn.version}}}o(ore,"devEngines");zL.exports={cpu:UL,libc:VL,os:$L,devEngines:ore}});var WL=g((Pje,HL)=>{var are=ra(),cre=hE(),lre=["ignore","warn","error","download"],ure=["name","version","onFail"],hre=["packageManager","runtime","cpu","libc","os"];function fre(r,e,t){let{engine:i}=t;if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`Invalid non-object value for "${i}"`);let s=Object.keys(r);for(let n of s)if(!ure.includes(n))throw new Error(`Invalid property "${n}" for "${i}"`);if(!s.includes("name"))throw new Error(`Missing "name" property for "${i}"`);if(typeof r.name!="string")throw new Error(`Invalid non-string value for "name" within "${i}"`);if(typeof e.name!="string"||e.name==="")throw new Error(`Unable to determine "name" for "${i}"`);if(s.includes("onFail")){if(typeof r.onFail!="string")throw new Error(`Invalid non-string value for "onFail" within "${i}"`);if(!lre.includes(r.onFail))throw new Error(`Invalid onFail value "${r.onFail}" for "${i}"`)}if(r.name!==e.name)return new Error(`Invalid name "${r.name}" does not match "${e.name}" for "${i}"`);if(s.includes("version")){if(typeof r.version!="string")throw new Error(`Invalid non-string value for "version" within "${i}"`);if(typeof e.version!="string"||e.version==="")throw new Error(`Unable to determine "version" for "${i}" "${r.name}"`);if(cre(r.version)){if(!are(e.version,r.version,t.semver))return new Error(`Invalid semver version "${r.version}" does not match "${e.version}" for "${i}"`)}else if(r.version!==e.version)return new Error(`Invalid version "${r.version}" does not match "${e.version}" for "${i}"`)}}o(fre,"checkDependency");function dre(r,e={},t={}){if(typeof r!="object"||r===null||Array.isArray(r))throw new Error('Invalid non-object value for "devEngines"');let i=[];for(let s of Object.keys(r)){if(!hre.includes(s))throw new Error(`Invalid property "devEngines.${s}"`);let n=r[s],a=[n].flat(),c=e[s]||{};if(a.length===0)continue;let l=[];for(let h of a){let f=fre(h,c,{...t,engine:s});f&&l.push(f)}if(l.length===a.length){let f=a[a.length-1].onFail||"error";f==="download"&&(f="error");let d=Object.assign(new Error(`Invalid devEngines.${s}`),{errors:l,engine:s,isWarn:f==="warn",isError:f==="error",current:c,required:n});i.push(d)}}return i}o(dre,"checkDevEngines");HL.exports={checkDevEngines:dre}});var Zd=g((xje,KL)=>{var JL=$e(),Yd=GL(),{checkDevEngines:pre}=WL(),gre=o((r,e,t,i=!1)=>{let s=i?null:t,n=r.engines,a={includePrerelease:!0};if(!n)return;let c=s&&n.node&&!JL.satisfies(s,n.node,a),l=e&&n.npm&&!JL.satisfies(e,n.npm,a);if(c||l)throw Object.assign(new Error("Unsupported engine"),{pkgid:r._id,current:{node:t,npm:e},required:n,code:"EBADENGINE"})},"checkEngine"),mre=o((r,e=!1,t={})=>{if(e)return;let i=t.os||Yd.os(),s=t.cpu||Yd.cpu(),n=t.libc||Yd.libc(i),a=r.os?OE(i,r.os):!0,c=r.cpu?OE(s,r.cpu):!0,l=r.libc?OE(n,r.libc):!0;if(r.libc&&!n&&(l=!1),!a||!c||!l)throw Object.assign(new Error("Unsupported platform"),{pkgid:r._id,current:{os:i,cpu:s,libc:n},required:{os:r.os,cpu:r.cpu,libc:r.libc},code:"EBADPLATFORM"})},"checkPlatform"),OE=o((r,e)=>{if(typeof e=="string"&&(e=[e]),e.length===1&&e[0]==="any")return!0;let t=0,i=!1;for(let s of e){let n=s.charAt(0)==="!",a=n?s.slice(1):s;if(n){if(t++,r===a)return!1}else i=i||r===a}return i||t===e.length},"checkList");KL.exports={checkEngine:gre,checkPlatform:mre,checkDevEngines:pre,currentEnv:Yd}});var Pn=g((Lje,XL)=>{var{join:YL,basename:ZL}=require("path"),yre=o(r=>r.bin?typeof r.bin=="string"?Sre(r):Array.isArray(r.bin)?wre(r):typeof r.bin=="object"?TE(r):IE(r):IE(r),"normalize"),Sre=o(r=>r.name?(r.bin={[r.name]:r.bin},TE(r)):IE(r),"normalizeString"),wre=o(r=>(r.bin=r.bin.reduce((e,t)=>(e[ZL(t)]=t,e),{}),TE(r)),"normalizeArray"),IE=o(r=>(delete r.bin,r),"removeBin"),TE=o(r=>{let e=r.bin,t={},i=!1;return Object.keys(e).forEach(s=>{let n=YL("/",ZL(s.replace(/\\|:/g,"/"))).slice(1);if(typeof e[s]!="string"||!n)return;let a=YL("/",e[s].replace(/\\/g,"/")).replace(/\\/g,"/").slice(1);a&&(t[n]=a,i=!0)}),i?r.bin=t:delete r.bin,r},"normalizeObject");XL.exports=yre});var ep=g((Fje,eM)=>{"use strict";var QL=jL(),Xl=$e(),{checkEngine:vre}=Zd(),Ere=Pn(),RE=o((r,e,t)=>{try{return vre(r,e,t),!0}catch{return!1}},"engineOk"),Xd=o((r,e,t)=>!r||!r[e]||Date.parse(r[e])<=t,"isBefore"),_re={includePrerelease:!0,loose:!0},Qd=o((r,e)=>e&&Xl.satisfies(r,e,_re),"shouldAvoid"),AE=o((r,e)=>r&&Qd(r.version,e)?{...r,_shouldAvoid:!0}:r,"decorateAvoid"),Ql=o((r,e,t)=>{let{defaultTag:i="latest",before:s=null,nodeVersion:n=process.version,npmVersion:a=null,includeStaged:c=!1,avoid:l=null,avoidStrict:u=!1}=t,{name:h,time:f}=r,d=r.versions||{};if(u){let I={...t,avoidStrict:!1},L=Ql(r,e,I);if(!L||!L._shouldAvoid)return L;let F=Ql(r,`^${L.version}`,I);if(!F||!F._shouldAvoid)return{...F,_outsideDependencyRange:!0,_isSemVerMajor:!1};let X=Ql(r,"*",I);if(!X||!X._shouldAvoid)return{...X,_outsideDependencyRange:!0,_isSemVerMajor:!0};throw Object.assign(new Error(`No avoidable versions for ${h}`),{code:"ETARGET",name:h,wanted:e,avoid:l,before:s,versions:Object.keys(d)})}let p=c&&r.stagedVersions&&r.stagedVersions.versions||{},m=r.policyRestrictions&&r.policyRestrictions.versions||{},y=s&&f?+new Date(s):1/0,S=QL.resolve(h,e||i).type,v=r["dist-tags"]||{};if(S!=="tag"&&S!=="version"&&S!=="range")throw new Error("Only tag, version, and range are supported");if(e&&S==="tag"){let I=v[e];return Xd(f,I,y)?AE(d[I]||p[I]||m[I],l):Ql(r,`<=${I}`,t)}if(e&&S==="version"){let I=Xl.clean(e,{loose:!0}),L=d[I]||p[I]||m[I];return Xd(f,I,y)?AE(L,l):null}let _=S==="range"?e:"*",E=v[i];if(E&&(_==="*"||Xl.satisfies(E,_,{loose:!0}))&&!m[E]&&!Qd(E,l)){let I=d[E];if(I&&Xd(f,E,y)&&RE(I,a,n)&&!I.deprecated&&!p[E])return I}let b=Object.entries(d).concat(Object.entries(p)).concat(Object.entries(m)).filter(([I])=>Xd(f,I,y));if(!b.length)throw Object.assign(new Error(`No versions available for ${h}`),{code:"ENOVERSIONS",name:h,type:S,wanted:e,before:s,versions:Object.keys(d)});let O={loose:!0},T=b.filter(([I])=>Xl.satisfies(I,_,{loose:!0})).sort((I,L)=>{let[F,X]=I,[Ce,Wt]=L,Ie=!Qd(F,l),ki=!Qd(Ce,l),Uo=!m[F],Vo=!m[Ce],zo=!p[F],Go=!p[Ce],ds=!X.deprecated,ps=!Wt.deprecated,gs=RE(X,a,n),ms=RE(Wt,a,n);return ki-Ie||Vo-Uo||Go-zo||(ps&&ms)-(ds&&gs)||ms-gs||ps-ds||Xl.rcompare(F,Ce,O)});return AE(T[0]&&T[0][1],l)},"pickManifest");eM.exports=(r,e,t={})=>{let i=Ql(r,e,t),s=i&&Ere(i),n=r.policyRestrictions,a=n&&n.versions||{};if(s&&!a[s.version])return s;let{before:c=null,defaultTag:l="latest"}=t,u=c?new Date(c).toLocaleString():"",{name:h}=r,f=`${h}@${e}`+(c?` with a date before ${u}`:""),d=s&&!!a[s.version],p=d?n.message:"",m=d?`Could not download ${f} due to policy violations:
14
+ ${p}`:`No matching version found for ${f}.`,y=d?"E403":"ETARGET";throw Object.assign(new Error(m),{code:y,type:QL.resolve(r.name,e).type,wanted:e,versions:Object.keys(r.versions??{}),name:h,distTags:r["dist-tags"],defaultTag:l})}});var sM=g((qje,iM)=>{var bre=new Set(["github.com","gist.github.com","gitlab.com","bitbucket.com","bitbucket.org"]),{parse:Ore}=require("url"),tM=require("path"),Ire=mE(),eu=Ul(),{isWindows:tp}=EL(),Tre=ep(),CE=require("fs/promises");iM.exports=(r,e="HEAD",t=null,i={})=>Ire(r,i).then(s=>Are(r,s,e,Cre(s,e,i),t||Rre(r,i.cwd),i));var kE=o((r,e)=>e.gitShallow===!1||e.gitShallow?e.gitShallow:bre.has(Ore(r).host),"maybeShallow"),Rre=o((r,e=process.cwd())=>tM.resolve(e,tM.basename(r.replace(/[/\\]?\.git$/,""))),"defaultTarget"),Are=o((r,e,t,i,s,n)=>i?i.sha===e.refs.HEAD.sha?Nre(r,i,s,n):i.type==="tag"||i.type==="branch"?Pre(r,i,s,n):kre(r,i,s,n):xre(r,t,s,n),"clone"),Cre=o((r,e,t)=>{let{spec:i={}}=t;return e=i.gitCommittish||e,r?i.gitRange?Tre(r,i.gitRange,t):e?r.refs[e]?r.refs[e]:r.shas[e]?r.refs[r.shas[e][0]]:null:r.refs.HEAD:null},"resolveRef"),kre=o((r,e,t,i)=>{let s=kE(r,i),n=["fetch","origin",e.rawRef].concat(s?["--depth=1"]:[]),a=o(c=>eu(c,{...i,cwd:t}),"git");return CE.mkdir(t,{recursive:!0}).then(()=>a(["init"])).then(()=>tp(i)?a(["config","--local","--add","core.longpaths","true"]):null).then(()=>a(["remote","add","origin",r])).then(()=>a(n)).then(()=>a(["checkout",e.sha])).then(()=>rM(t,i)).then(()=>e.sha)},"other"),Pre=o((r,e,t,i)=>{let s=["clone","-b",e.ref,r,t,"--recurse-submodules"];return kE(r,i)&&s.push("--depth=1"),tp(i)&&s.push("--config","core.longpaths=true"),eu(s,i).then(()=>e.sha)},"branch"),Nre=o((r,e,t,i)=>{let s=["clone",r,t,"--recurse-submodules"];return kE(r,i)&&s.push("--depth=1"),tp(i)&&s.push("--config","core.longpaths=true"),eu(s,i).then(()=>e.sha)},"plain"),rM=o(async(r,e)=>await CE.stat(`${r}/.gitmodules`).then(()=>!0).catch(()=>!1)?eu(["submodule","update","-q","--init","--recursive"],{...e,cwd:r}):null,"updateSubmodules"),xre=o((r,e,t,i)=>{let s=tp(i)?["--config","core.longpaths=true"]:[],n=["clone","--mirror","-q",r,t+"/.git"],a=o(c=>eu(c,{...i,cwd:t}),"git");return CE.mkdir(t,{recursive:!0}).then(()=>a(n.concat(s))).then(()=>a(["init"])).then(()=>a(["checkout",e])).then(()=>rM(t,i)).then(()=>a(["rev-parse","--revs-only","HEAD"])).then(({stdout:c})=>c.trim())},"unresolved")});var PE=g(($je,nM)=>{var{stat:Dre}=require("fs/promises");nM.exports=({cwd:r=process.cwd()}={})=>Dre(r+"/.git").then(()=>!0,()=>!1)});var aM=g((Uje,oM)=>{var Lre=PE(),{dirname:Mre}=require("path");oM.exports=async({cwd:r=process.cwd(),root:e}={})=>{for(;;){if(await Lre({cwd:r}))return r;let t=Mre(r);if(r===e||r===t)return null;r=t}}});var lM=g((Vje,cM)=>{var Fre=Ul();cM.exports=(r={})=>Fre(["status","--porcelain=v1","-uno"],r).then(e=>!e.stdout.trim().split(/\r?\n+/).map(t=>t.trim()).filter(t=>t).length)});var NE=g((zje,uM)=>{uM.exports={clone:sM(),revs:mE(),spawn:Ul(),is:PE(),find:aM(),isClean:lM(),errors:Gv()}});var mM=g((Gje,gM)=>{var Bre=Xw(),qre=Qw(),bs=require("node:fs/promises"),me=require("node:path"),{log:dM}=se(),jre=require("node:module"),xE;function hM(){return xE||(xE=wl()),xE}o(hM,"lazyHostedGitInfo");var DE;function rp(){return DE||(DE=Md().glob),DE}o(rp,"lazyLoadGlob");function $re(r,e){if(r.bin&&(typeof r.bin=="string"&&r.name?(e?.push('"bin" was converted to an object'),r.bin={[r.name]:r.bin}):Array.isArray(r.bin)&&(e?.push('"bin" was converted to an object'),r.bin=r.bin.reduce((t,i)=>(t[me.basename(i)]=i,t),{})),typeof r.bin=="object")){for(let t in r.bin){if(typeof r.bin[t]!="string"){delete r.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let i=me.basename(sa(t));if(!i){delete r.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let s=sa(r.bin[t]);if(!s){delete r.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}i!==t&&(delete r.bin[t],e?.push(`"bin[${t}]" was renamed to "bin[${i}]"`)),s!==r.bin[t]&&e?.push(`"bin[${i}]" script name ${s} was invalid and removed`),r.bin[i]=s}return Object.keys(r.bin).length===0&&(e?.push('empty "bin" was removed'),delete r.bin),r}delete r.bin}o($re,"normalizePackageBin");function Ure(r,e){if(r.man){let t=[];for(let i of Array.isArray(r.man)?r.man:[r.man])typeof i!="string"?e?.push(`removed invalid "man [${i}]"`):t.push(sa(i));if(!t.length)e?.push('empty "man" was removed');else return r.man=t,r}delete r.man}o(Ure,"normalizePackageMan");function Vre(r){return!r.match(/[/@\s+%:]/)&&r===encodeURIComponent(r)}o(Vre,"isCorrectlyEncodedName");function zre(r){if(r.charAt(0)!=="@")return!1;let e=r.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}o(zre,"isValidScopedPackageName");function fM(r){return r.replace(/\\|:/g,"/")}o(fM,"unixifyPath");function sa(r){let e=fM(me.join(".",me.join("/",fM(r))));return e.startsWith("./")?"":e}o(sa,"secureAndUnixifyPath");function pM(r,{strict:e,steps:t,changes:i,allowLegacyCase:s}){let n=r.content,a=`${n.name??""}@${n.version??""}`;if(t.includes("fixName")||t.includes("fixNameField")||t.includes("normalizeData"))if(!n.name&&!e)i?.push('Missing "name" field was set to an empty string'),n.name="";else{if(typeof n.name!="string")throw new Error("name field must be a string.");if(!e){let c=n.name.trim();n.name!==c&&(i?.push('Whitespace was trimmed from "name"'),n.name=c)}if(n.name.startsWith(".")||!(zre(n.name)||Vre(n.name))||e&&!s&&n.name!==n.name.toLowerCase()||n.name.toLowerCase()==="node_modules"||n.name.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(n.name))}if(t.includes("fixName")&&jre.builtinModules.includes(n.name)&&dM.warn("package-json",a,`Package name "${n.name}" conflicts with a Node.js built-in module name`),t.includes("fixVersionField")||t.includes("normalizeData")){let c=!e;if(!n.version)n.version="";else{if(!Bre(n.version,c))throw new Error(`Invalid version: "${n.version}"`);let l=qre(n.version,c);l!==n.version&&(i?.push(`"version" was cleaned and set to "${l}"`),n.version=l)}}if(t.includes("_attributes"))for(let c in n)c.startsWith("_")&&(i?.push(`"${c}" was removed`),delete r.content[c]);if(t.includes("_id")&&n.name&&n.version&&(i?.push(`"_id" was set to ${a}`),n._id=a),t.includes("bundledDependencies")&&(n.bundleDependencies===void 0&&n.bundledDependencies!==void 0&&(n.bundleDependencies=n.bundledDependencies,i?.push('Deleted incorrect "bundledDependencies"')),delete n.bundledDependencies),t.includes("bundleDependencies")){let c=n.bundleDependencies;c===!1&&!t.includes("bundleDependenciesDeleteFalse")?(i?.push('"bundleDependencies" was changed from "false" to "[]"'),n.bundleDependencies=[]):c===!0?(i?.push('"bundleDependencies" was auto-populated from "dependencies"'),n.bundleDependencies=Object.keys(n.dependencies||{})):c&&typeof c=="object"?Array.isArray(c)||(i?.push('"bundleDependencies" was changed from an object to an array'),n.bundleDependencies=Object.keys(c)):"bundleDependencies"in n&&(i?.push('"bundleDependencies" was removed'),delete n.bundleDependencies)}if(t.includes("optionalDedupe")&&n.dependencies&&n.optionalDependencies&&typeof n.optionalDependencies=="object"){for(let c in n.optionalDependencies)i?.push(`optionalDependencies."${c}" was removed`),delete n.dependencies[c];Object.keys(n.dependencies).length||(i?.push('Empty "optionalDependencies" was removed'),delete n.dependencies)}if((t.includes("scripts")||t.includes("scriptpath"))&&n.scripts!==void 0){let c=/^(\.[/\\])?node_modules[/\\].bin[\\/]/;if(typeof n.scripts=="object")for(let l in n.scripts)typeof n.scripts[l]!="string"?(delete n.scripts[l],i?.push(`Invalid scripts."${l}" was removed`)):t.includes("scriptpath")&&c.test(n.scripts[l])&&(n.scripts[l]=n.scripts[l].replace(c,""),i?.push(`scripts entry "${l}" was fixed to remove node_modules/.bin reference`));else i?.push('Removed invalid "scripts"'),delete n.scripts}if(t.includes("funding")&&n.funding&&typeof n.funding=="string"&&(n.funding={url:n.funding},i?.push('"funding" was changed to an object with a url attribute')),(t.includes("fixRepositoryField")||t.includes("normalizeData"))&&(n.repositories&&(i?.push(`"repository" was set to the first entry in "repositories" (${n.repository})`),n.repository=n.repositories[0]),n.repository&&(typeof n.repository=="string"&&(i?.push('"repository" was changed from a string to an object'),n.repository={type:"git",url:n.repository}),n.repository.url))){let c=hM().fromUrl(n.repository.url),l;c&&(c.getDefaultRepresentation()==="shortcut"?l=c.https():l=c.toString(),l!==n.repository.url&&(i?.push(`"repository.url" was normalized to "${l}"`),n.repository.url=l))}if(t.includes("fixDependencies")||t.includes("normalizeData")){for(let c of["dependencies","devDependencies","optionalDependencies"])if(n[c]){let l=!0;if(typeof n[c]=="string"&&(i?.push(`"${c}" was converted from a string into an object`),n[c]=n[c].trim().split(/[\n\r\s\t ,]+/),l=!1),Array.isArray(n[c])){l&&i?.push(`"${c}" was converted from an array into an object`);let u={};for(let h of n[c])if(typeof h=="string"){let f=h.trim().split(/(:?[@\s><=])/),d=f.shift(),p=f.join("").replace(/^@/,"").trim();u[d]=p}n[c]=u}}for(let c of["dependencies","devDependencies"])if(c in n)if(!n[c]||typeof n[c]!="object")i?.push(`Removed invalid "${c}"`),delete n[c];else for(let l in n[c]){typeof n[c][l]!="string"&&(i?.push(`Removed invalid "${c}.${l}"`),delete n[c][l]);let h=hM().fromUrl(n[c][l])?.toString();h&&h!==n[c][l]&&(i?.push(`Normalized git reference to "${c}.${l}"`),n[c][l]=h.toString())}}if(t.includes("normalizeData")){let{normalizeData:c}=$N();c(n,i)}}o(pM,"syncSteps");async function Gre(r,{steps:e,root:t,changes:i}){let s=r.content,n=s.scripts||{},a=`${s.name??""}@${s.version??""}`;if(e.includes("gypfile")&&!n.install&&!n.preinstall&&s.gypfile!==!1&&(await rp()("*.gyp",{cwd:r.path})).length&&(n.install="node-gyp rebuild",s.scripts=n,s.gypfile=!0,i?.push('"scripts.install" was set to "node-gyp rebuild"'),i?.push('"gypfile" was set to "true"')),e.includes("serverjs")&&!n.start)try{await bs.access(me.join(r.path,"server.js")),n.start="node server.js",s.scripts=n,i?.push('"scripts.start" was set to "node server.js"')}catch{}if(e.includes("authors")&&!s.contributors)try{let l=(await bs.readFile(me.join(r.path,"AUTHORS"),"utf8")).split(/\r?\n/g).map(u=>u.replace(/^\s*#.*$/,"").trim()).filter(u=>u);s.contributors=l,i?.push('"contributors" was auto-populated with the contents of the "AUTHORS" file')}catch{}if(e.includes("readme")&&!s.readme){let c=/\.m?a?r?k?d?o?w?n?$/i,l=await rp()("{README,README.*}",{cwd:r.path,nocase:!0,mark:!0}),u;for(let h of l)if(!h.endsWith(me.sep)){if(h.match(c)){u=h;break}h.endsWith("README")&&(u=h)}if(u){let h=await bs.readFile(me.join(r.path,u),"utf8");s.readme=h,s.readmeFilename=u,i?.push(`"readme" was set to the contents of ${u}`),i?.push(`"readmeFilename" was set to ${u}`)}s.readme||(s.readme="ERROR: No README data found!")}if(e.includes("mans")){if(s.directories?.man&&!s.man){let c=sa(s.directories.man),l=me.resolve(r.path,c),u=await rp()("**/*.[0-9]",{cwd:l});s.man=u.map(h=>me.relative(r.path,me.join(l,h)).split(me.sep).join("/"))}Ure(s,i)}if(e.includes("binDir")&&s.directories?.bin&&!s.bin){let c=sa(s.directories.bin),l=await rp()("**",{cwd:me.resolve(r.path,c)});s.bin=l.reduce((u,h)=>{if(h&&!h.startsWith(".")){let f=me.basename(h);u[f]=`${c}/${sa(h)}`}return u},{})}else(e.includes("bin")||e.includes("binDir")||e.includes("binRefs"))&&$re(s,i);if(e.includes("gitHead")&&!s.gitHead){let l=await NE().find({cwd:r.path,root:t}),u;if(l)try{u=await bs.readFile(me.resolve(l,".git/HEAD"),"utf8")}catch{}let h;if(u)if(u.startsWith("ref: ")){let f=u.replace(/^ref: /,"").trim(),d=me.resolve(l,".git",f);try{h=await bs.readFile(d,"utf8"),h=h.replace(/^ref: /,"").trim()}catch{}if(!h){let p=me.resolve(l,".git/packed-refs");try{let m=await bs.readFile(p,"utf8");if(m){m=m.split(`
15
+ `);for(let y=0;y<m.length;y++){let w=m[y].match(/^([0-9a-f]{40}) (.+)$/);if(w&&w[2].trim()===f){h=w[1];break}}}}catch{}}}else h=u.trim();h&&(s.gitHead=h)}if(e.includes("fillTypes")){let c=s.main||"index.js";if(typeof c!="string")throw new TypeError('The "main" attribute must be of type string.');let u=`./${me.join(me.dirname(c),me.basename(c,me.extname(c)))}.d.ts`;if(!("types"in s||"typings"in s))try{await bs.access(me.join(r.path,u)),s.types=u.split(me.sep).join("/")}catch{}}if(e.includes("binRefs")&&s.bin instanceof Object)for(let c in s.bin)try{await bs.access(me.resolve(r.path,s.bin[c]))}catch{dM.warn("package-json",a,`No bin file found at ${s.bin[c]}`)}}o(Gre,"asyncSteps");async function Hre(r,e){if(!r.content)throw new Error("Can not normalize without content");await Gre(r,e),pM(r,e)}o(Hre,"normalize");function Wre(r,e){pM(r,e)}o(Wre,"syncNormalize");gM.exports={normalize:Hre,syncNormalize:Wre}});var vM=g((Wje,wM)=>{var{readFile:Jre}=require("fs/promises"),Kre=ml();async function yM(r){try{return await Jre(r,"utf8")}catch(e){throw e.message=`Could not read package.json: ${e}`,e}}o(yM,"read");function SM(r){try{return Kre(r)}catch(e){throw e.message=`Invalid package.json: ${e}`,e}}o(SM,"parse");async function Yre(r){let e=await yM(r);return SM(e)}o(Yre,"readPackage");wM.exports={read:yM,parse:SM,readPackage:Yre}});var _M=g((Kje,EM)=>{function Zre(r){let{name:e,version:t,private:i,description:s,keywords:n,homepage:a,bugs:c,repository:l,funding:u,license:h,author:f,maintainers:d,contributors:p,type:m,imports:y,exports:w,main:S,browser:v,types:_,bin:E,man:b,directories:O,files:T,workspaces:I,scripts:L,config:F,dependencies:X,devDependencies:Ce,peerDependencies:Wt,peerDependenciesMeta:Ie,optionalDependencies:ki,bundledDependencies:Uo,bundleDependencies:Vo,engines:zo,os:Go,cpu:ds,publishConfig:ps,devEngines:gs,licenses:ms,overrides:MP,...pZ}=r;return{...typeof e<"u"?{name:e}:{},...typeof t<"u"?{version:t}:{},...typeof i<"u"?{private:i}:{},...typeof s<"u"?{description:s}:{},...typeof n<"u"?{keywords:n}:{},...typeof a<"u"?{homepage:a}:{},...typeof c<"u"?{bugs:c}:{},...typeof l<"u"?{repository:l}:{},...typeof u<"u"?{funding:u}:{},...typeof h<"u"?{license:h}:{},...typeof f<"u"?{author:f}:{},...typeof d<"u"?{maintainers:d}:{},...typeof p<"u"?{contributors:p}:{},...typeof m<"u"?{type:m}:{},...typeof y<"u"?{imports:y}:{},...typeof w<"u"?{exports:w}:{},...typeof S<"u"?{main:S}:{},...typeof v<"u"?{browser:v}:{},...typeof _<"u"?{types:_}:{},...typeof E<"u"?{bin:E}:{},...typeof b<"u"?{man:b}:{},...typeof O<"u"?{directories:O}:{},...typeof T<"u"?{files:T}:{},...typeof I<"u"?{workspaces:I}:{},...typeof L<"u"?{scripts:L}:{},...typeof F<"u"?{config:F}:{},...typeof X<"u"?{dependencies:X}:{},...typeof Ce<"u"?{devDependencies:Ce}:{},...typeof Wt<"u"?{peerDependencies:Wt}:{},...typeof Ie<"u"?{peerDependenciesMeta:Ie}:{},...typeof ki<"u"?{optionalDependencies:ki}:{},...typeof Uo<"u"?{bundledDependencies:Uo}:{},...typeof Vo<"u"?{bundleDependencies:Vo}:{},...typeof zo<"u"?{engines:zo}:{},...typeof Go<"u"?{os:Go}:{},...typeof ds<"u"?{cpu:ds}:{},...typeof ps<"u"?{publishConfig:ps}:{},...typeof gs<"u"?{devEngines:gs}:{},...typeof ms<"u"?{licenses:ms}:{},...typeof MP<"u"?{overrides:MP}:{},...pZ}}o(Zre,"packageSort");EM.exports={packageSort:Zre}});var wt=g((Zje,IM)=>{var{readFile:Xre,writeFile:Qre}=require("node:fs/promises"),{resolve:bM}=require("node:path"),eie=ml(),OM=VP(),tie=GP(),rie=WP(),{normalize:LE,syncNormalize:iie}=mM(),{read:sie,parse:nie}=vM(),{packageSort:oie}=_M(),aie=new Set([OM,tie,rie]),cie=new Set([...OM.knownKeys,"scripts","workspaces"]),ME=class r{static{o(this,"PackageJson")}static fixSteps=Object.freeze(["binRefs","bundleDependencies","fixName","fixVersionField","fixRepositoryField","fixDependencies","devDependencies","scriptpath"]);static normalizeSteps=Object.freeze(["_id","_attributes","bundledDependencies","bundleDependencies","optionalDedupe","scripts","funding","bin","binDir"]);static prepareSteps=Object.freeze(["_id","_attributes","bundledDependencies","bundleDependencies","bundleDependenciesDeleteFalse","gypfile","serverjs","scriptpath","authors","readme","mans","binDir","gitHead","fillTypes","normalizeData","binRefs"]);static async create(e,t={}){let i=new r;return await i.create(e),t.data?i.update(t.data):i}static async load(e,t={}){let i=new r;if(!t.create)return i.load(e);try{return await i.load(e)}catch(s){if(!s.message.startsWith("Could not read package.json"))throw s;return await i.create(e)}}static async fix(e,t){let i=new r;return await i.load(e,!0),i.fix(t)}static async prepare(e,t){let i=new r;return await i.load(e,!0),i.prepare(t)}static async normalize(e,t){let i=new r;return await i.load(e),i.normalize(t)}#e;#t;#r="";#i=!0;async load(e,t){this.#e=e;let i;try{this.#r=await sie(this.filename)}catch(s){if(!t)throw s;i=s}if(i){let s=bM(this.path,"index.js"),n;try{n=await Xre(s,"utf8")}catch{throw i}try{this.fromComment(n)}catch{throw i}return this.#i=!1,this}return this.fromJSON(this.#r)}fromJSON(e){return this.#t=nie(e),this}fromContent(e){if(!e||typeof e!="object")throw new Error("Content data must be an object");return this.#t=e,this.#i=!1,this}fromComment(e){if(e=e.split(/^\/\*\*package(?:\s|$)/m),e.length<2)throw new Error("File has no package in comments");if(e=e[1],e=e.split(/\*\*\/$/m),e.length<2)throw new Error("File has no package in comments");return e=e[0],e=e.replace(/^\s*\*/mg,""),this.#t=eie(e),this}get content(){return this.#t}get path(){return this.#e}get filename(){if(this.path)return bM(this.path,"package.json")}create(e){return this.#e=e,this.#t={},this}update(e){if(!this.content)throw new Error("Can not update without content. Please `load` or `create`");for(let t of aie)this.#t=t({content:e,originalContent:this.content});for(let[t,i]of Object.entries(e))cie.has(t)||(this.content[t]=i);return this}async save({sort:e}={}){if(!this.#i)throw new Error("No package.json to save to");let{[Symbol.for("indent")]:t,[Symbol.for("newline")]:i,...s}=this.content,n=t===void 0?" ":t,a=i===void 0?`
16
+ `:i,c=e?oie(s):s,l=`${JSON.stringify(c,null,n)}
17
+ `.replace(/\n/g,a);if(l.trim()!==this.#r.trim()){let u=await Qre(this.filename,l);return this.#r=l,u}}syncNormalize(e={}){return e.steps=this.constructor.normalizeSteps.filter(t=>t!=="_attributes"),iie(this,e),this}async normalize(e={}){return e.steps||(e.steps=this.constructor.normalizeSteps),await LE(this,e),this}async prepare(e={}){return e.steps||(e.steps=this.constructor.prepareSteps),await LE(this,e),this}async fix(e={}){return e.steps=this.constructor.fixSteps,await LE(this,e),this}};IM.exports=ME});var jE=g((Qje,qE)=>{var{Minipass:TM}=ee(),na=Symbol("_data"),oa=Symbol("_length"),FE=class extends TM{static{o(this,"Collect")}constructor(e){super(e),this[na]=[],this[oa]=0}write(e,t,i){typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[na].push(s),this[oa]+=s.length,i&&i(),!0}end(e,t,i){typeof e=="function"&&(i=e,e=null),typeof t=="function"&&(i=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[na],this[oa]);return super.write(s),super.end(i)}};qE.exports=FE;var BE=class extends TM{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[na]=[],this[oa]=0}write(e,t,i){typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[na].push(s),this[oa]+=s.length,super.write(e,t,i)}end(e,t,i){typeof e=="function"&&(i=e,e=null),typeof t=="function"&&(i=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[na],this[oa]);return this.emit("collect",s),super.end(i)}};qE.exports.PassThrough=BE});var cp=g((t$e,LM)=>{"use strict";var RM=typeof process=="object"&&process?process:{stdout:null,stderr:null},lie=require("events"),AM=require("stream"),CM=require("string_decoder").StringDecoder,Mi=Symbol("EOF"),Fi=Symbol("maybeEmitEnd"),Os=Symbol("emittedEnd"),ip=Symbol("emittingEnd"),tu=Symbol("emittedError"),sp=Symbol("closed"),kM=Symbol("read"),np=Symbol("flush"),PM=Symbol("flushChunk"),vt=Symbol("encoding"),Bi=Symbol("decoder"),op=Symbol("flowing"),ru=Symbol("paused"),aa=Symbol("resume"),Ge=Symbol("bufferLength"),$E=Symbol("bufferPush"),UE=Symbol("bufferShift"),tt=Symbol("objectMode"),rt=Symbol("destroyed"),VE=Symbol("emitData"),NM=Symbol("emitEnd"),zE=Symbol("emitEnd2"),qi=Symbol("async"),iu=o(r=>Promise.resolve().then(r),"defer"),xM=global._MP_NO_ITERATOR_SYMBOLS_!=="1",uie=xM&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),hie=xM&&Symbol.iterator||Symbol("iterator not implemented"),fie=o(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),die=o(r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBuffer"),pie=o(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),ap=class{static{o(this,"Pipe")}constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[aa](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},GE=class extends ap{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}};LM.exports=class DM extends AM{static{o(this,"Minipass")}constructor(e){super(),this[op]=!1,this[ru]=!1,this.pipes=[],this.buffer=[],this[tt]=e&&e.objectMode||!1,this[tt]?this[vt]=null:this[vt]=e&&e.encoding||null,this[vt]==="buffer"&&(this[vt]=null),this[qi]=e&&!!e.async||!1,this[Bi]=this[vt]?new CM(this[vt]):null,this[Mi]=!1,this[Os]=!1,this[ip]=!1,this[sp]=!1,this[tu]=null,this.writable=!0,this.readable=!0,this[Ge]=0,this[rt]=!1}get bufferLength(){return this[Ge]}get encoding(){return this[vt]}set encoding(e){if(this[tt])throw new Error("cannot set encoding in objectMode");if(this[vt]&&e!==this[vt]&&(this[Bi]&&this[Bi].lastNeed||this[Ge]))throw new Error("cannot change encoding");this[vt]!==e&&(this[Bi]=e?new CM(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Bi].write(t)))),this[vt]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[tt]}set objectMode(e){this[tt]=this[tt]||!!e}get async(){return this[qi]}set async(e){this[qi]=this[qi]||!!e}write(e,t,i){if(this[Mi])throw new Error("write after end");if(this[rt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let s=this[qi]?iu:n=>n();return!this[tt]&&!Buffer.isBuffer(e)&&(pie(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):die(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[tt]?(this.flowing&&this[Ge]!==0&&this[np](!0),this.flowing?this.emit("data",e):this[$E](e),this[Ge]!==0&&this.emit("readable"),i&&s(i),this.flowing):e.length?(typeof e=="string"&&!(t===this[vt]&&!this[Bi].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[vt]&&(e=this[Bi].write(e)),this.flowing&&this[Ge]!==0&&this[np](!0),this.flowing?this.emit("data",e):this[$E](e),this[Ge]!==0&&this.emit("readable"),i&&s(i),this.flowing):(this[Ge]!==0&&this.emit("readable"),i&&s(i),this.flowing)}read(e){if(this[rt])return null;if(this[Ge]===0||e===0||e>this[Ge])return this[Fi](),null;this[tt]&&(e=null),this.buffer.length>1&&!this[tt]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Ge])]);let t=this[kM](e||null,this.buffer[0]);return this[Fi](),t}[kM](e,t){return e===t.length||e===null?this[UE]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Ge]-=e),this.emit("data",t),!this.buffer.length&&!this[Mi]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=null),typeof t=="function"&&(i=t,t="utf8"),e&&this.write(e,t),i&&this.once("end",i),this[Mi]=!0,this.writable=!1,(this.flowing||!this[ru])&&this[Fi](),this}[aa](){this[rt]||(this[ru]=!1,this[op]=!0,this.emit("resume"),this.buffer.length?this[np]():this[Mi]?this[Fi]():this.emit("drain"))}resume(){return this[aa]()}pause(){this[op]=!1,this[ru]=!0}get destroyed(){return this[rt]}get flowing(){return this[op]}get paused(){return this[ru]}[$E](e){this[tt]?this[Ge]+=1:this[Ge]+=e.length,this.buffer.push(e)}[UE](){return this.buffer.length&&(this[tt]?this[Ge]-=1:this[Ge]-=this.buffer[0].length),this.buffer.shift()}[np](e){do;while(this[PM](this[UE]()));!e&&!this.buffer.length&&!this[Mi]&&this.emit("drain")}[PM](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[rt])return;let i=this[Os];return t=t||{},e===RM.stdout||e===RM.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this.pipes.push(t.proxyErrors?new GE(this,e,t):new ap(this,e,t)),this[qi]?iu(()=>this[aa]()):this[aa]()),e}unpipe(e){let t=this.pipes.find(i=>i.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 i=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[aa]():e==="readable"&&this[Ge]!==0?super.emit("readable"):fie(e)&&this[Os]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[tu]&&(this[qi]?iu(()=>t.call(this,this[tu])):t.call(this,this[tu])),i}get emittedEnd(){return this[Os]}[Fi](){!this[ip]&&!this[Os]&&!this[rt]&&this.buffer.length===0&&this[Mi]&&(this[ip]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[sp]&&this.emit("close"),this[ip]=!1)}emit(e,t,...i){if(e!=="error"&&e!=="close"&&e!==rt&&this[rt])return;if(e==="data")return t?this[qi]?iu(()=>this[VE](t)):this[VE](t):!1;if(e==="end")return this[NM]();if(e==="close"){if(this[sp]=!0,!this[Os]&&!this[rt])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[tu]=t;let n=super.emit("error",t);return this[Fi](),n}else if(e==="resume"){let n=super.emit("resume");return this[Fi](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,t,...i);return this[Fi](),s}[VE](e){for(let i of this.pipes)i.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Fi](),t}[NM](){this[Os]||(this[Os]=!0,this.readable=!1,this[qi]?iu(()=>this[zE]()):this[zE]())}[zE](){if(this[Bi]){let t=this[Bi].end();if(t){for(let i of this.pipes)i.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[tt]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[tt]||(e.dataLength+=i.length)}),t.then(()=>e)}concat(){return this[tt]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[tt]?Promise.reject(new Error("cannot concat in objectMode")):this[vt]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(rt,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[uie](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Mi])return Promise.resolve({done:!0});let i=null,s=null,n=o(u=>{this.removeListener("data",a),this.removeListener("end",c),s(u)},"onerr"),a=o(u=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),i({value:u,done:!!this[Mi]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),i({done:!0})},"onend"),l=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((u,h)=>{s=h,i=u,this.once(rt,l),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[hie](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[rt]?(e?this.emit("error",e):this.emit(rt),this):(this[rt]=!0,this.buffer.length=0,this[Ge]=0,typeof this.close=="function"&&!this[sp]&&this.close(),e?this.emit("error",e):this.emit(rt),this)}static isStream(e){return!!e&&(e instanceof DM||e instanceof AM||e instanceof lie&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var ca=g((i$e,qM)=>{var gie=cp(),mie=require("events"),yie=o(r=>r&&r instanceof mie&&(typeof r.pipe=="function"||typeof r.write=="function"&&typeof r.end=="function"),"isStream"),Nn=Symbol("_head"),Lt=Symbol("_tail"),HE=Symbol("_linkStreams"),WE=Symbol("_setHead"),JE=Symbol("_setTail"),MM=Symbol("_onError"),FM=Symbol("_onData"),KE=Symbol("_onEnd"),BM=Symbol("_onDrain"),lp=Symbol("_streams"),YE=class extends gie{static{o(this,"Pipeline")}constructor(e,...t){yie(e)&&(t.unshift(e),e={}),super(e),this[lp]=[],t.length&&this.push(...t)}[HE](e){return e.reduce((t,i)=>(t.on("error",s=>i.emit("error",s)),t.pipe(i),i))}push(...e){this[lp].push(...e),this[Lt]&&e.unshift(this[Lt]);let t=this[HE](e);this[JE](t),this[Nn]||this[WE](e[0])}unshift(...e){this[lp].unshift(...e),this[Nn]&&e.push(this[Nn]);let t=this[HE](e);this[WE](e[0]),this[Lt]||this[JE](t)}destroy(e){return this[lp].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[JE](e){this[Lt]=e,e.on("error",t=>this[MM](e,t)),e.on("data",t=>this[FM](e,t)),e.on("end",()=>this[KE](e)),e.on("finish",()=>this[KE](e))}[MM](e,t){e===this[Lt]&&this.emit("error",t)}[FM](e,t){e===this[Lt]&&super.write(t)}[KE](e){e===this[Lt]&&super.end()}pause(){return super.pause(),this[Lt]&&this[Lt].pause&&this[Lt].pause()}emit(e,...t){return e==="resume"&&this[Lt]&&this[Lt].resume&&this[Lt].resume(),super.emit(e,...t)}[WE](e){this[Nn]=e,e.on("drain",()=>this[BM](e))}[BM](e){e===this[Nn]&&this.emit("drain")}write(e,t,i){return this[Nn].write(e,t,i)&&(this.flowing||this.buffer.length===0)}end(e,t,i){return this[Nn].end(e,t,i),this}};qM.exports=YE});var Ft=g((n$e,Kr)=>{"use strict";var nu=require("crypto"),{Minipass:Sie}=ee(),XE=["sha512","sha384","sha256"],e_=["sha512"],wie=/^[a-z0-9+/]+(?:=?=?)$/i,vie=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,Eie=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,_ie=/^[\x21-\x7E]+$/,ou=o(r=>r?.length?`?${r.join("?")}`:"","getOptString"),QE=class extends Sie{static{o(this,"IntegrityStream")}#e;#t;#r;constructor(e){super(),this.size=0,this.opts=e,this.#i(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...e_],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(nu.createHash)}#i(){this.sri=this.opts?.integrity?Mt(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=ou(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#r?t(this.#r):super.on(e,t)}emit(e,t){return e==="end"&&this.#s(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#s(){this.goodSri||this.#i();let e=Mt(this.hashes.map((i,s)=>`${this.algorithms[s]}-${i.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 i=new Error(`stream size mismatch when checking ${this.sri}.
18
+ Wanted: ${this.expectedSize}
19
+ Found: ${this.size}`);i.code="EBADSIZE",i.found=this.size,i.expected=this.expectedSize,i.sri=this.sri,this.emit("error",i)}else if(this.sri&&!t){let i=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);i.code="EINTEGRITY",i.found=e,i.expected=this.digests,i.algorithm=this.algorithm,i.sri=this.sri,this.emit("error",i)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#r=t,this.emit("verified",t))}},ji=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let i=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let s=this.source.match(i?Eie:vie);if(!s||i&&!XE.includes(s[1]))return;this.algorithm=s[1],this.digest=s[2];let n=s[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 i=Mt(e,t);if(!i)return!1;if(i.isIntegrity){let s=i.pickAlgorithm(t,[this.algorithm]);if(!s)return!1;let n=i[s].find(a=>a.digest===this.digest);return n||!1}return i.digest===this.digest?i:!1}toString(e){return e?.strict&&!(XE.includes(this.algorithm)&&this.digest.match(wie)&&this.options.every(t=>t.match(_ie)))?"":`${this.algorithm}-${this.digest}${ou(this.options)}`}};function jM(r,e,t,i){let s=r!=="",n=!1,a="",c=i.length-1;for(let u=0;u<c;u++){let h=ji.prototype.toString.call(i[u],t);h&&(n=!0,a+=h,a+=e)}let l=ji.prototype.toString.call(i[c],t);return l&&(n=!0,a+=l),s&&n?r+e+a:r+a}o(jM,"integrityHashToString");var xn=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||" ",i="";if(e?.strict){t=t.replace(/\S+/g," ");for(let s of XE)this[s]&&(i=jM(i,t,e,this[s]))}else for(let s of Object.keys(this))i=jM(i,t,e,this[s]);return i}concat(e,t){let i=typeof e=="string"?e:su(e,t);return Mt(`${this.toString(t)} ${i}`,t)}hexDigest(){return Mt(this,{single:!0}).hexDigest()}merge(e,t){let i=Mt(e,t);for(let s in i)if(this[s]){if(!this[s].find(n=>i[s].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[s]=i[s]}match(e,t){let i=Mt(e,t);if(!i)return!1;let s=i.pickAlgorithm(t,Object.keys(this));return!!s&&this[s]&&i[s]&&this[s].find(n=>i[s].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let i=e?.pickAlgorithm||kie,s=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return s.length?s.reduce((n,a)=>i(n,a)||n):null}};Kr.exports.parse=Mt;function Mt(r,e){if(!r)return null;if(typeof r=="string")return ZE(r,e);if(r.algorithm&&r.digest){let t=new xn;return t[r.algorithm]=[r],ZE(su(t,e),e)}else return ZE(su(r,e),e)}o(Mt,"parse");function ZE(r,e){if(e?.single)return new ji(r,e);let t=r.trim().split(/\s+/).reduce((i,s)=>{let n=new ji(s,e);if(n.algorithm&&n.digest){let a=n.algorithm;i[a]||(i[a]=[]),i[a].push(n)}return i},new xn);return t.isEmpty()?null:t}o(ZE,"_parse");Kr.exports.stringify=su;function su(r,e){return r.algorithm&&r.digest?ji.prototype.toString.call(r,e):typeof r=="string"?su(Mt(r,e),e):xn.prototype.toString.call(r,e)}o(su,"stringify");Kr.exports.fromHex=bie;function bie(r,e,t){let i=ou(t?.options);return Mt(`${e}-${Buffer.from(r,"hex").toString("base64")}${i}`,t)}o(bie,"fromHex");Kr.exports.fromData=Oie;function Oie(r,e){let t=e?.algorithms||[...e_],i=ou(e?.options);return t.reduce((s,n)=>{let a=nu.createHash(n).update(r).digest("base64"),c=new ji(`${n}-${a}${i}`,e);if(c.algorithm&&c.digest){let l=c.algorithm;s[l]||(s[l]=[]),s[l].push(c)}return s},new xn)}o(Oie,"fromData");Kr.exports.fromStream=Iie;function Iie(r,e){let t=t_(e);return new Promise((i,s)=>{r.pipe(t),r.on("error",s),t.on("error",s);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>i(n)),t.resume()})}o(Iie,"fromStream");Kr.exports.checkData=Tie;function Tie(r,e,t){if(e=Mt(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 i=e.pickAlgorithm(t),s=nu.createHash(i).update(r).digest("base64"),n=Mt({algorithm:i,digest:s}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&r.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
20
+ Wanted: ${t.size}
21
+ Found: ${r.length}`);throw c.code="EBADSIZE",c.found=r.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${n}. (${r.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=i,c.sri=e,c}}o(Tie,"checkData");Kr.exports.checkStream=Rie;function Rie(r,e,t){if(t=t||Object.create(null),t.integrity=e,e=Mt(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let i=t_(t);return new Promise((s,n)=>{r.pipe(i),r.on("error",n),i.on("error",n);let a;i.on("verified",c=>{a=c}),i.on("end",()=>s(a)),i.resume()})}o(Rie,"checkStream");Kr.exports.integrityStream=t_;function t_(r=Object.create(null)){return new QE(r)}o(t_,"integrityStream");Kr.exports.create=Aie;function Aie(r){let e=r?.algorithms||[...e_],t=ou(r?.options),i=e.map(nu.createHash);return{update:o(function(s,n){return i.forEach(a=>a.update(s,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=i.shift().digest("base64"),l=new ji(`${a}-${c}${t}`,r);if(l.algorithm&&l.digest){let u=l.algorithm;n[u]||(n[u]=[]),n[u].push(l)}return n},new xn)},"digest")}}o(Aie,"createIntegrity");var Cie=nu.getHashes(),$M=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(r=>Cie.includes(r));function kie(r,e){return $M.indexOf(r.toLowerCase())>=$M.indexOf(e.toLowerCase())?r:e}o(kie,"getPrioritizedHash")});var i_=g((a$e,r_)=>{(function(){var r;function e(t,i){var s=this instanceof e?this:r;if(s.reset(i),typeof t=="string"&&t.length>0&&s.hash(t),s!==this)return s}o(e,"MurmurHash3"),e.prototype.hash=function(t){var i,s,n,a,c;switch(c=t.length,this.len+=c,s=this.k1,n=0,this.rem){case 0:s^=c>n?t.charCodeAt(n++)&65535:0;case 1:s^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:s^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:s^=c>n?(t.charCodeAt(n)&255)<<24:0,s^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(i=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,i^=s,i=i<<13|i>>>19,i=i*5+3864292196&4294967295,!(n>=c);)s=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),s^=(a&255)<<24^(a&65280)>>8;switch(s=0,this.rem){case 3:s^=(t.charCodeAt(n+2)&65535)<<16;case 2:s^=(t.charCodeAt(n+1)&65535)<<8;case 1:s^=t.charCodeAt(n)&65535}this.h1=i}return this.k1=s,this},e.prototype.result=function(){var t,i;return t=this.k1,i=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,i^=t),i^=this.len,i^=i>>>16,i=i*51819+(i&65535)*2246770688&4294967295,i^=i>>>13,i=i*44597+(i&65535)*3266445312&4294967295,i^=i>>>16,i>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},r=new e,typeof r_<"u"?r_.exports=e:this.MurmurHash3=e})()});var VM=g((l$e,UM)=>{"use strict";var Pie=i_();UM.exports=function(r){if(r){var e=new Pie(r);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var s_=g((u$e,zM)=>{var Nie=require("path"),xie=VM();zM.exports=function(r,e,t){return Nie.join(r,(e?e+"-":"")+xie(t))}});var n_=g((h$e,Die)=>{Die.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 o_=g((f$e,GM)=>{"use strict";GM.exports=Lie;function Lie(r){return[r.slice(0,2),r.slice(2,4),r.slice(4)]}o(Lie,"hashToSegments")});var la=g((p$e,a_)=>{"use strict";var Mie=n_()["cache-version"].content,Fie=o_(),HM=require("path"),Bie=Ft();a_.exports=qie;function qie(r,e){let t=Bie.parse(e,{single:!0});return HM.join(WM(r),t.algorithm,...Fie(t.hexDigest()))}o(qie,"contentPath");a_.exports.contentDir=WM;function WM(r){return HM.join(r,`content-v${Mie}`)}o(WM,"contentDir")});var c_=g((m$e,JM)=>{var jie=o((r,{copy:e,wrap:t})=>{let i={};if(r&&typeof r=="object")for(let s of e)r[s]!==void 0&&(i[s]=r[s]);else i[t]=r;return i},"getOptions");JM.exports=jie});var YM=g((S$e,KM)=>{var $ie=$e(),Uie=o(r=>$ie.satisfies(process.version,r,{includePrerelease:!0}),"satisfies");KM.exports={satisfies:Uie}});var ZM=g((_$e,u_)=>{"use strict";var{inspect:Vie}=require("util"),l_=class{static{o(this,"SystemError")}constructor(e,t,i){let s=`${t}: ${i.syscall} returned ${i.code} (${i.message})`;i.path!==void 0&&(s+=` ${i.path}`),i.dest!==void 0&&(s+=` => ${i.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:s,enumerable:!1,writable:!0,configurable:!0},info:{value:i,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return i.errno},set(n){i.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return i.syscall},set(n){i.syscall=n},enumerable:!0,configurable:!0}}),i.path!==void 0&&Object.defineProperty(this,"path",{get(){return i.path},set(n){i.path=n},enumerable:!0,configurable:!0}),i.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return i.dest},set(n){i.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return Vie(this,{...t,getters:!0,customInspect:!1})}};function $i(r,e){u_.exports[r]=class extends l_{static{o(this,"NodeError")}constructor(i){super(r,e,i)}}}o($i,"E");$i("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");$i("ERR_FS_CP_EEXIST","Target already exists");$i("ERR_FS_CP_EINVAL","Invalid src or dest");$i("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");$i("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");$i("ERR_FS_CP_SOCKET","Cannot copy a socket file");$i("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");$i("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");$i("ERR_FS_EISDIR","Path is a directory");u_.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,i){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof i}`}}});var mF=g((O$e,gF)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:zie,ERR_FS_CP_EEXIST:Gie,ERR_FS_CP_EINVAL:up,ERR_FS_CP_FIFO_PIPE:Hie,ERR_FS_CP_NON_DIR_TO_DIR:Wie,ERR_FS_CP_SOCKET:Jie,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:Kie,ERR_FS_CP_UNKNOWN:Yie,ERR_FS_EISDIR:Zie,ERR_INVALID_ARG_TYPE:Xie}=ZM(),{constants:{errno:{EEXIST:Qie,EISDIR:ese,EINVAL:Ui,ENOTDIR:tse}}}=require("os"),{chmod:rse,copyFile:ise,lstat:oF,mkdir:aF,readdir:sse,readlink:XM,stat:ua,symlink:h_,unlink:cF,utimes:nse}=require("fs/promises"),{dirname:au,isAbsolute:QM,join:eF,parse:ose,resolve:cu,sep:ase,toNamespacedPath:tF}=require("path"),{fileURLToPath:cse}=require("url"),lse={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function use(r,e,t){if(t!=null&&typeof t!="object")throw new Xie("options",["Object"],t);return hse(tF(rF(r)),tF(rF(e)),{...lse,...t})}o(use,"cp");function rF(r){return r!=null&&r.href&&r.origin?cse(r):r}o(rF,"getValidatedPath");async function hse(r,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let i=await lF(r,e,t),{srcStat:s,destStat:n}=i;return await hF(r,s,e),t.filter?fF(iF,n,r,e,t):iF(n,r,e,t)}o(hse,"cpFn");async function lF(r,e,t){let{0:i,1:s}=await fse(r,e,t);if(s){if(uF(i,s))throw new up({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:Ui});if(i.isDirectory()&&!s.isDirectory())throw new zie({message:`cannot overwrite directory ${r} with non-directory ${e}`,path:e,syscall:"cp",errno:ese});if(!i.isDirectory()&&s.isDirectory())throw new Wie({message:`cannot overwrite non-directory ${r} with directory ${e}`,path:e,syscall:"cp",errno:tse})}if(i.isDirectory()&&f_(r,e))throw new up({message:`cannot copy ${r} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:Ui});return{srcStat:i,destStat:s}}o(lF,"checkPaths");function uF(r,e){return e.ino&&e.dev&&e.ino===r.ino&&e.dev===r.dev}o(uF,"areIdentical");function fse(r,e,t){let i=t.dereference?s=>ua(s,{bigint:!0}):s=>oF(s,{bigint:!0});return Promise.all([i(r),i(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})])}o(fse,"getStats");async function iF(r,e,t,i){let s=au(t);return await dse(s)||await aF(s,{recursive:!0}),hp(r,e,t,i)}o(iF,"checkParentDir");function dse(r){return ua(r).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(dse,"pathExists");async function hF(r,e,t){let i=cu(au(r)),s=cu(au(t));if(s===i||s===ose(s).root)return;let n;try{n=await ua(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(uF(e,n))throw new up({message:`cannot copy ${r} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:Ui});return hF(r,e,s)}o(hF,"checkParentPaths");var sF=o(r=>cu(r).split(ase).filter(Boolean),"normalizePathToArray");function f_(r,e){let t=sF(r),i=sF(e);return t.every((s,n)=>i[n]===s)}o(f_,"isSrcSubdir");async function fF(r,e,t,i,s,n){if(await s.filter(t,i))return r(e,t,i,s,n)}o(fF,"handleFilter");function pse(r,e,t,i){return i.filter?fF(hp,r,e,t,i):hp(r,e,t,i)}o(pse,"startCopy");async function hp(r,e,t,i){let n=await(i.dereference?ua:oF)(e);if(n.isDirectory()&&i.recursive)return Ese(n,r,e,t,i);if(n.isDirectory())throw new Zie({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:Ui});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return gse(n,r,e,t,i);if(n.isSymbolicLink())return bse(r,e,t);throw n.isSocket()?new Jie({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:Ui}):n.isFIFO()?new Hie({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:Ui}):new Yie({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:Ui})}o(hp,"getStatsForCopy");function gse(r,e,t,i,s){return e?mse(r,t,i,s):dF(r,t,i,s)}o(gse,"onFile");async function mse(r,e,t,i){if(i.force)return await cF(t),dF(r,e,t,i);if(i.errorOnExist)throw new Gie({message:`${t} already exists`,path:t,syscall:"cp",errno:Qie})}o(mse,"mayCopyFile");async function dF(r,e,t,i){return await ise(e,t),i.preserveTimestamps?yse(r.mode,e,t):fp(t,r.mode)}o(dF,"_copyFile");async function yse(r,e,t){return Sse(r)&&await wse(t,r),nF(r,e,t)}o(yse,"handleTimestampsAndMode");function Sse(r){return(r&128)===0}o(Sse,"fileIsNotWritable");function wse(r,e){return fp(r,e|128)}o(wse,"makeFileWritable");async function nF(r,e,t){return await vse(e,t),fp(t,r)}o(nF,"setDestTimestampsAndMode");function fp(r,e){return rse(r,e)}o(fp,"setDestMode");async function vse(r,e){let t=await ua(r);return nse(e,t.atime,t.mtime)}o(vse,"setDestTimestamps");function Ese(r,e,t,i,s){return e?pF(t,i,s):_se(r.mode,t,i,s)}o(Ese,"onDir");async function _se(r,e,t,i){return await aF(t),await pF(e,t,i),fp(t,r)}o(_se,"mkDirAndCopy");async function pF(r,e,t){let i=await sse(r);for(let s=0;s<i.length;s++){let n=i[s],a=eF(r,n),c=eF(e,n),{destStat:l}=await lF(a,c,t);await pse(l,a,c,t)}}o(pF,"copyDir");async function bse(r,e,t){let i=await XM(e);if(QM(i)||(i=cu(au(e),i)),!r)return h_(i,t);let s;try{s=await XM(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return h_(i,t);throw a}if(QM(s)||(s=cu(au(t),s)),f_(i,s))throw new up({message:`cannot copy ${i} to a subdirectory of self ${s}`,path:t,syscall:"cp",errno:Ui});if((await ua(e)).isDirectory()&&f_(s,i))throw new Kie({message:`cannot overwrite ${s} with ${i}`,path:t,syscall:"cp",errno:Ui});return Ose(i,t)}o(bse,"onLink");async function Ose(r,e){return await cF(e),h_(r,e)}o(Ose,"copyLink");gF.exports=use});var SF=g((T$e,yF)=>{var Ise=require("fs/promises"),Tse=c_(),Rse=YM(),Ase=mF(),Cse=Rse.satisfies(">=16.7.0"),kse=o(async(r,e,t)=>{let i=Tse(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return Cse?Ise.cp(r,e,i):Ase(r,e,i)},"cp");yF.exports=kse});var vF=g((A$e,wF)=>{var{join:Pse,sep:Nse}=require("path"),xse=c_(),{mkdir:Dse,mkdtemp:Lse,rm:Mse}=require("fs/promises"),Fse=o(async(r,e,t)=>{let i=xse(t,{copy:["tmpPrefix"]});await Dse(r,{recursive:!0});let s=await Lse(Pse(`${r}${Nse}`,i.tmpPrefix||"")),n,a;try{a=await e(s)}catch(c){n=c}try{await Mse(s,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");wF.exports=Fse});var OF=g((k$e,bF)=>{var{readdir:EF}=require("fs/promises"),{join:_F}=require("path"),Bse=o(async r=>{let e=[];for(let t of await EF(r))if(t.startsWith("@"))for(let i of await EF(_F(r,t)))e.push(_F(t,i));else e.push(t);return e},"readdirScoped");bF.exports=Bse});var kF=g((N$e,CF)=>{var{dirname:IF,join:TF,resolve:RF,relative:qse,isAbsolute:jse}=require("path"),Yr=require("fs/promises"),$se=o(async r=>{try{return await Yr.access(r),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),AF=o(async(r,e,t={},i=!0,s=[])=>{if(!r||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await $se(e))throw new Error(`The destination file exists: ${e}`);await Yr.mkdir(IF(e),{recursive:!0});try{await Yr.rename(r,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await Yr.lstat(r);if(a.isDirectory()){let c=await Yr.readdir(r);await Promise.all(c.map(l=>AF(TF(r,l),TF(e,l),t,!1,s)))}else a.isSymbolicLink()?s.push({source:r,destination:e}):await Yr.copyFile(r,e)}else throw n}i&&(await Promise.all(s.map(async({source:n,destination:a})=>{let c=await Yr.readlink(n);jse(c)&&(c=RF(a,qse(n,c)));let l="file";try{l=await Yr.stat(RF(IF(n),c)),l.isDirectory()&&(l="junction")}catch{}await Yr.symlink(c,a,l)})),await Yr.rm(r,{recursive:!0,force:!0}))},"moveFile");CF.exports=AF});var Dn=g((D$e,PF)=>{"use strict";var Use=SF(),Vse=vF(),zse=OF(),Gse=kF();PF.exports={cp:Use,withTempDir:Vse,readdirScoped:zse,moveFile:Gse}});var dp={};EZ(dp,{default:()=>NF,pMapIterable:()=>Hse,pMapSkip:()=>lu});async function NF(r,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:s}={}){return new Promise((n,a)=>{if(r[Symbol.iterator]===void 0&&r[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof r})`);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=[],l=[],u=new Map,h=!1,f=!1,d=!1,p=0,m=0,y=r[Symbol.iterator]===void 0?r[Symbol.asyncIterator]():r[Symbol.iterator](),w=o(()=>{_(s.reason)},"signalListener"),S=o(()=>{s?.removeEventListener("abort",w)},"cleanup"),v=o(b=>{n(b),S()},"resolve"),_=o(b=>{h=!0,f=!0,a(b),S()},"reject");s&&(s.aborted&&_(s.reason),s.addEventListener("abort",w,{once:!0}));let E=o(async()=>{if(f)return;let b=await y.next(),O=m;if(m++,b.done){if(d=!0,p===0&&!f){if(!i&&l.length>0){_(new AggregateError(l));return}if(f=!0,u.size===0){v(c);return}let T=[];for(let[I,L]of c.entries())u.get(I)!==lu&&T.push(L);v(T)}return}p++,(async()=>{try{let T=await b.value;if(f)return;let I=await e(T,O);I===lu&&u.set(O,I),c[O]=I,p--,await E()}catch(T){if(i)_(T);else{l.push(T),p--;try{await E()}catch(I){_(I)}}}})()},"next");(async()=>{for(let b=0;b<t;b++){try{await E()}catch(O){_(O);break}if(d||h)break}})()})}function Hse(r,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:i=t}={}){if(r[Symbol.iterator]===void 0&&r[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof r})`);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(i)&&i>=t||i===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${i}\` (${typeof i})`);return{async*[Symbol.asyncIterator](){let s=r[Symbol.asyncIterator]===void 0?r[Symbol.iterator]():r[Symbol.asyncIterator](),n=[],a=0,c=!1,l=0;function u(){if(c||!(a<t&&n.length<i))return;let h=(async()=>{let{done:f,value:d}=await s.next();if(f)return{done:!0};a++,u();try{let p=await e(await d,l++);if(a--,p===lu){let m=n.indexOf(h);m>0&&n.splice(m,1)}return u(),{done:!1,value:p}}catch(p){return c=!0,{error:p}}})();n.push(h)}for(o(u,"trySpawn"),u();n.length>0;){let{error:h,done:f,value:d}=await n[0];if(n.shift(),h)throw h;if(f)return;u(),d!==lu&&(yield d)}}}}var lu,pp=vZ(()=>{o(NF,"pMap");o(Hse,"pMapIterable");lu=Symbol("skip")});var ha=g((F$e,Bt)=>{"use strict";var Wse=require("crypto"),{appendFile:Jse,mkdir:g_,readFile:Kse,readdir:Yse,rm:xF,writeFile:Zse}=require("fs/promises"),{Minipass:Xse}=ee(),Zr=require("path"),Qse=Ft(),ene=s_(),tne=la(),rne=o_(),ine=n_()["cache-version"].index,{moveFile:sne}=Dn(),d_=5;Bt.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}};Bt.exports.compact=nne;async function nne(r,e,t,i={}){let s=uu(r,e),n=await gp(s),a=[];for(let d=n.length-1;d>=0;--d){let p=n[d];if(p.integrity===null&&!i.validateEntry)break;(!i.validateEntry||i.validateEntry(p)===!0)&&(a.length===0||!a.find(m=>t(m,p)))&&a.unshift(p)}let c=`
22
+ `+a.map(d=>{let p=JSON.stringify(d);return`${mp(p)} ${p}`}).join(`
23
+ `),l=o(async()=>{let d=ene(Zr.join(r,"tmp"),i.tmpPrefix);return await g_(Zr.dirname(d),{recursive:!0}),{target:d,moved:!1}},"setup"),u=o(async d=>{if(!d.moved)return xF(d.target,{recursive:!0,force:!0})},"teardown"),h=o(async d=>{await Zse(d.target,c,{flag:"wx"}),await g_(Zr.dirname(s),{recursive:!0}),await sne(d.target,s),d.moved=!0},"write"),f=await l();try{await h(f)}finally{await u(f)}return a.reverse().map(d=>yp(r,d,!0))}o(nne,"compact");Bt.exports.insert=DF;async function DF(r,e,t,i={}){let{metadata:s,size:n,time:a}=i,c=uu(r,e),l={key:e,integrity:t&&Qse.stringify(t),time:a||Date.now(),size:n,metadata:s};try{await g_(Zr.dirname(c),{recursive:!0});let u=JSON.stringify(l);await Jse(c,`
24
+ ${mp(u)} ${u}`)}catch(u){if(u.code==="ENOENT")return;throw u}return yp(r,l)}o(DF,"insert");Bt.exports.find=one;async function one(r,e){let t=uu(r,e);try{return(await gp(t)).reduce((s,n)=>n&&n.key===e?yp(r,n):s,null)}catch(i){if(i.code==="ENOENT")return null;throw i}}o(one,"find");Bt.exports.delete=ane;function ane(r,e,t={}){if(!t.removeFully)return DF(r,e,null,t);let i=uu(r,e);return xF(i,{recursive:!0,force:!0})}o(ane,"del");Bt.exports.lsStream=LF;function LF(r){let e=m_(r),t=new Xse({objectMode:!0});return Promise.resolve().then(async()=>{let{default:i}=await Promise.resolve().then(()=>(pp(),dp)),s=await p_(e);return await i(s,async n=>{let a=Zr.join(e,n),c=await p_(a);await i(c,async l=>{let u=Zr.join(a,l),h=await p_(u);await i(h,async f=>{let d=Zr.join(u,f);try{let m=(await gp(d)).reduce((y,w)=>(y.set(w.key,w),y),new Map);for(let y of m.values()){let w=yp(r,y);w&&t.write(w)}}catch(p){if(p.code==="ENOENT")return;throw p}},{concurrency:d_})},{concurrency:d_})},{concurrency:d_}),t.end(),t}).catch(i=>t.emit("error",i)),t}o(LF,"lsStream");Bt.exports.ls=cne;async function cne(r){return(await LF(r).collect()).reduce((t,i)=>(t[i.key]=i,t),{})}o(cne,"ls");Bt.exports.bucketEntries=gp;async function gp(r,e){let t=await Kse(r,"utf8");return lne(t,e)}o(gp,"bucketEntries");function lne(r){let e=[];return r.split(`
25
+ `).forEach(t=>{if(!t)return;let i=t.split(" ");if(!i[1]||mp(i[1])!==i[0])return;let s;try{s=JSON.parse(i[1])}catch{}s&&e.push(s)}),e}o(lne,"_bucketEntries");Bt.exports.bucketDir=m_;function m_(r){return Zr.join(r,`index-v${ine}`)}o(m_,"bucketDir");Bt.exports.bucketPath=uu;function uu(r,e){let t=MF(e);return Zr.join.apply(Zr,[m_(r)].concat(rne(t)))}o(uu,"bucketPath");Bt.exports.hashKey=MF;function MF(r){return FF(r,"sha256")}o(MF,"hashKey");Bt.exports.hashEntry=mp;function mp(r){return FF(r,"sha1")}o(mp,"hashEntry");function FF(r,e){return Wse.createHash(e).update(r).digest("hex")}o(FF,"hash");function yp(r,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?tne(r,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(yp,"formatEntry");function p_(r){return Yse(r).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(p_,"readdirOrEmpty")});var hu=g((q$e,fa)=>{"use strict";var{LRUCache:une}=Pi(),Sp=new une({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((r,e)=>e.startsWith("key:")?r.data.length:r.length,"sizeCalculation")});fa.exports.clearMemoized=hne;function hne(){let r={};return Sp.forEach((e,t)=>{r[t]=e}),Sp.clear(),r}o(hne,"clearMemoized");fa.exports.put=fne;function fne(r,e,t,i){wp(i).set(`key:${r}:${e.key}`,{entry:e,data:t}),BF(r,e.integrity,t,i)}o(fne,"put");fa.exports.put.byDigest=BF;function BF(r,e,t,i){wp(i).set(`digest:${r}:${e}`,t)}o(BF,"putDigest");fa.exports.get=dne;function dne(r,e,t){return wp(t).get(`key:${r}:${e}`)}o(dne,"get");fa.exports.get.byDigest=pne;function pne(r,e,t){return wp(t).get(`digest:${r}:${e}`)}o(pne,"getDigest");var y_=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function wp(r){return!r||!r.memoize?Sp:r.memoize.get&&r.memoize.set?r.memoize:typeof r.memoize=="object"?new y_(r.memoize):Sp}o(wp,"pickMem")});var As=g(du=>{"use strict";var{Minipass:gne}=ee(),mne=require("events").EventEmitter,Et=require("fs"),yne=Et.writev,ya=Symbol("_autoClose"),kr=Symbol("_close"),fu=Symbol("_ended"),ne=Symbol("_fd"),qF=Symbol("_finished"),Ts=Symbol("_flags"),S_=Symbol("_flush"),v_=Symbol("_handleChunk"),E_=Symbol("_makeBuf"),Op=Symbol("_mode"),vp=Symbol("_needDrain"),ga=Symbol("_onerror"),Sa=Symbol("_onopen"),w_=Symbol("_onread"),da=Symbol("_onwrite"),Rs=Symbol("_open"),Vi=Symbol("_path"),Mn=Symbol("_pos"),Xr=Symbol("_queue"),pa=Symbol("_read"),jF=Symbol("_readSize"),Is=Symbol("_reading"),Ep=Symbol("_remain"),$F=Symbol("_size"),_p=Symbol("_write"),Ln=Symbol("_writing"),bp=Symbol("_defaultFlag"),ma=Symbol("_errored"),Ip=class extends gne{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[ma]=!1,this[ne]=typeof t.fd=="number"?t.fd:null,this[Vi]=e,this[jF]=t.readSize||16*1024*1024,this[Is]=!1,this[$F]=typeof t.size=="number"?t.size:1/0,this[Ep]=this[$F],this[ya]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[ne]=="number"?this[pa]():this[Rs]()}get fd(){return this[ne]}get path(){return this[Vi]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Rs](){Et.open(this[Vi],"r",(e,t)=>this[Sa](e,t))}[Sa](e,t){e?this[ga](e):(this[ne]=t,this.emit("open",t),this[pa]())}[E_](){return Buffer.allocUnsafe(Math.min(this[jF],this[Ep]))}[pa](){if(!this[Is]){this[Is]=!0;let e=this[E_]();if(e.length===0)return process.nextTick(()=>this[w_](null,0,e));Et.read(this[ne],e,0,e.length,null,(t,i,s)=>this[w_](t,i,s))}}[w_](e,t,i){this[Is]=!1,e?this[ga](e):this[v_](t,i)&&this[pa]()}[kr](){if(this[ya]&&typeof this[ne]=="number"){let e=this[ne];this[ne]=null,Et.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[ga](e){this[Is]=!0,this[kr](),this.emit("error",e)}[v_](e,t){let i=!1;return this[Ep]-=e,e>0&&(i=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Ep]<=0)&&(i=!1,this[kr](),super.end()),i}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[ne]=="number"&&this[pa]();break;case"error":return this[ma]?void 0:(this[ma]=!0,super.emit(e,t));default:return super.emit(e,t)}}},__=class extends Ip{static{o(this,"ReadStreamSync")}[Rs](){let e=!0;try{this[Sa](null,Et.openSync(this[Vi],"r")),e=!1}finally{e&&this[kr]()}}[pa](){let e=!0;try{if(!this[Is]){this[Is]=!0;do{let t=this[E_](),i=t.length===0?0:Et.readSync(this[ne],t,0,t.length,null);if(!this[v_](i,t))break}while(!0);this[Is]=!1}e=!1}finally{e&&this[kr]()}}[kr](){if(this[ya]&&typeof this[ne]=="number"){let e=this[ne];this[ne]=null,Et.closeSync(e),this.emit("close")}}},Tp=class extends mne{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[ma]=!1,this[Ln]=!1,this[fu]=!1,this[vp]=!1,this[Xr]=[],this[Vi]=e,this[ne]=typeof t.fd=="number"?t.fd:null,this[Op]=t.mode===void 0?438:t.mode,this[Mn]=typeof t.start=="number"?t.start:null,this[ya]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[Mn]!==null?"r+":"w";this[bp]=t.flags===void 0,this[Ts]=this[bp]?i:t.flags,this[ne]===null&&this[Rs]()}emit(e,t){if(e==="error"){if(this[ma])return;this[ma]=!0}return super.emit(e,t)}get fd(){return this[ne]}get path(){return this[Vi]}[ga](e){this[kr](),this[Ln]=!0,this.emit("error",e)}[Rs](){Et.open(this[Vi],this[Ts],this[Op],(e,t)=>this[Sa](e,t))}[Sa](e,t){this[bp]&&this[Ts]==="r+"&&e&&e.code==="ENOENT"?(this[Ts]="w",this[Rs]()):e?this[ga](e):(this[ne]=t,this.emit("open",t),this[Ln]||this[S_]())}end(e,t){return e&&this.write(e,t),this[fu]=!0,!this[Ln]&&!this[Xr].length&&typeof this[ne]=="number"&&this[da](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[fu]?(this.emit("error",new Error("write() after end()")),!1):this[ne]===null||this[Ln]||this[Xr].length?(this[Xr].push(e),this[vp]=!0,!1):(this[Ln]=!0,this[_p](e),!0)}[_p](e){Et.write(this[ne],e,0,e.length,this[Mn],(t,i)=>this[da](t,i))}[da](e,t){e?this[ga](e):(this[Mn]!==null&&(this[Mn]+=t),this[Xr].length?this[S_]():(this[Ln]=!1,this[fu]&&!this[qF]?(this[qF]=!0,this[kr](),this.emit("finish")):this[vp]&&(this[vp]=!1,this.emit("drain"))))}[S_](){if(this[Xr].length===0)this[fu]&&this[da](null,0);else if(this[Xr].length===1)this[_p](this[Xr].pop());else{let e=this[Xr];this[Xr]=[],yne(this[ne],e,this[Mn],(t,i)=>this[da](t,i))}}[kr](){if(this[ya]&&typeof this[ne]=="number"){let e=this[ne];this[ne]=null,Et.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},b_=class extends Tp{static{o(this,"WriteStreamSync")}[Rs](){let e;if(this[bp]&&this[Ts]==="r+")try{e=Et.openSync(this[Vi],this[Ts],this[Op])}catch(t){if(t.code==="ENOENT")return this[Ts]="w",this[Rs]();throw t}else e=Et.openSync(this[Vi],this[Ts],this[Op]);this[Sa](null,e)}[kr](){if(this[ya]&&typeof this[ne]=="number"){let e=this[ne];this[ne]=null,Et.closeSync(e),this.emit("close")}}[_p](e){let t=!0;try{this[da](null,Et.writeSync(this[ne],e,0,e.length,this[Mn])),t=!1}finally{if(t)try{this[kr]()}catch{}}}};du.ReadStream=Ip;du.ReadStreamSync=__;du.WriteStream=Tp;du.WriteStreamSync=b_});var I_=g((V$e,wa)=>{"use strict";var pu=require("fs/promises"),Sne=As(),O_=Ft(),wne=la(),UF=ca();wa.exports=vne;var VF=64*1024*1024;async function vne(r,e,t={}){let{size:i}=t,{stat:s,cpath:n,sri:a}=await gu(r,e,async(l,u)=>({stat:i?{size:i}:await pu.stat(l),cpath:l,sri:u}));if(s.size>VF)return zF(n,s.size,a,new UF).concat();let c=await pu.readFile(n,{encoding:null});if(s.size!==c.length)throw bne(s.size,c.length);if(!O_.checkData(c,a))throw One(a,n);return c}o(vne,"read");var zF=o((r,e,t,i)=>(i.push(new Sne.ReadStream(r,{size:e,readSize:VF}),O_.integrityStream({integrity:t,size:e})),i),"readPipeline");wa.exports.stream=GF;wa.exports.readStream=GF;function GF(r,e,t={}){let{size:i}=t,s=new UF;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await gu(r,e,async(l,u)=>({stat:i?{size:i}:await pu.stat(l),cpath:l,sri:u}));return zF(a,n.size,c,s)}).catch(n=>s.emit("error",n)),s}o(GF,"readStream");wa.exports.copy=Ene;function Ene(r,e,t){return gu(r,e,i=>pu.copyFile(i,t))}o(Ene,"copy");wa.exports.hasContent=_ne;async function _ne(r,e){if(!e)return!1;try{return await gu(r,e,async(t,i)=>{let s=await pu.stat(t);return{size:s.size,sri:i,stat:s}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(_ne,"hasContent");async function gu(r,e,t){let i=O_.parse(e),s=i.pickAlgorithm(),n=i[s];if(n.length<=1){let a=wne(r,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async u=>{try{return await gu(r,u,t)}catch(h){return h.code==="ENOENT"?Object.assign(new Error("No matching content found for "+i.toString()),{code:"ENOENT"}):h}})),c=a.find(u=>!(u instanceof Error));if(c)return c;let l=a.find(u=>u.code==="ENOENT");throw l||a.find(u=>u instanceof Error)}}o(gu,"withContentSri");function bne(r,e){let t=new Error(`Bad data size: expected inserted data to be ${r} bytes, but got ${e} instead`);return t.expected=r,t.found=e,t.code="EBADSIZE",t}o(bne,"sizeError");function One(r,e){let t=new Error(`Integrity verification failed for ${r} (${e})`);return t.code="EINTEGRITY",t.sri=r,t.path=e,t}o(One,"integrityError")});var KF=g((G$e,Gi)=>{"use strict";var HF=jE(),{Minipass:WF}=ee(),JF=ca(),Fn=ha(),zi=hu(),Bn=I_();async function Ine(r,e,t={}){let{integrity:i,memoize:s,size:n}=t,a=zi.get(r,e,t);if(a&&s!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Fn.find(r,e,t);if(!c)throw new Fn.NotFoundError(r,e);let l=await Bn(r,c.integrity,{integrity:i,size:n});return s&&zi.put(r,c,l,t),{data:l,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(Ine,"getData");Gi.exports=Ine;async function Tne(r,e,t={}){let{integrity:i,memoize:s,size:n}=t,a=zi.get.byDigest(r,e,t);if(a&&s!==!1)return a;let c=await Bn(r,e,{integrity:i,size:n});return s&&zi.put.byDigest(r,e,c,t),c}o(Tne,"getDataByDigest");Gi.exports.byDigest=Tne;var Rne=o(r=>{let e=new WF;return e.on("newListener",function(t,i){t==="metadata"&&i(r.entry.metadata),t==="integrity"&&i(r.entry.integrity),t==="size"&&i(r.entry.size)}),e.end(r.data),e},"getMemoizedStream");function Ane(r,e,t={}){let{memoize:i,size:s}=t,n=zi.get(r,e,t);if(n&&i!==!1)return Rne(n);let a=new JF;return Promise.resolve().then(async()=>{let c=await Fn.find(r,e);if(!c)throw new Fn.NotFoundError(r,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(u,h){u==="metadata"&&h(c.metadata),u==="integrity"&&h(c.integrity),u==="size"&&h(c.size)});let l=Bn.readStream(r,c.integrity,{...t,size:typeof s!="number"?c.size:s});if(i){let u=new HF.PassThrough;u.on("collect",h=>zi.put(r,c,h,t)),a.unshift(u)}return a.unshift(l),a}).catch(c=>a.emit("error",c)),a}o(Ane,"getStream");Gi.exports.stream=Ane;function Cne(r,e,t={}){let{memoize:i}=t,s=zi.get.byDigest(r,e,t);if(s&&i!==!1){let n=new WF;return n.end(s),n}else{let n=Bn.readStream(r,e,t);if(!i)return n;let a=new HF.PassThrough;return a.on("collect",c=>zi.put.byDigest(r,e,c,t)),new JF(n,a)}}o(Cne,"getStreamDigest");Gi.exports.stream.byDigest=Cne;function kne(r,e,t={}){let{memoize:i}=t,s=zi.get(r,e,t);return s&&i!==!1?Promise.resolve(s.entry):Fn.find(r,e)}o(kne,"info");Gi.exports.info=kne;async function Pne(r,e,t,i={}){let s=await Fn.find(r,e,i);if(!s)throw new Fn.NotFoundError(r,e);return await Bn.copy(r,s.integrity,t,i),{metadata:s.metadata,size:s.size,integrity:s.integrity}}o(Pne,"copy");Gi.exports.copy=Pne;async function Nne(r,e,t,i={}){return await Bn.copy(r,e,t,i),e}o(Nne,"copyByDigest");Gi.exports.copy.byDigest=Nne;Gi.exports.hasContent=Bn.hasContent});var Rp=g((W$e,QF)=>{var xne=cp(),YF=Symbol("_flush"),ZF=Symbol("_flushed"),XF=Symbol("_flushing"),T_=class extends xne{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[YF]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[ZF])return super.emit(e,...t);if(this[XF])return;this[XF]=!0;let i=o(n=>{this[ZF]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),s=this[YF](i);s&&s.then&&s.then(()=>i(),n=>i(n))}};QF.exports=T_});var sB=g((K$e,k_)=>{"use strict";var eB=require("events"),Dne=la(),yu=require("fs/promises"),{moveFile:Lne}=Dn(),{Minipass:Mne}=ee(),tB=ca(),Fne=Rp(),R_=require("path"),A_=Ft(),Bne=s_(),qne=As();k_.exports=jne;var mu=new Map;async function jne(r,e,t={}){let{algorithms:i,size:s,integrity:n}=t;if(typeof s=="number"&&e.length!==s)throw zne(s,e.length);let a=A_.fromData(e,i?{algorithms:i}:{});if(n&&!A_.checkData(e,n,t))throw Gne(n,a);for(let c in a){let l=await rB(r,t),u=a[c].toString();try{await yu.writeFile(l.target,e,{flag:"wx"}),await iB(l,r,u,t)}finally{l.moved||await yu.rm(l.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(jne,"write");k_.exports.stream=$ne;var C_=class extends Fne{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new Mne,this.inputStream.on("error",i=>this.emit("error",i)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,i){return this.handleContentP||(this.handleContentP=Une(this.inputStream,this.cache,this.opts),this.handleContentP.catch(s=>this.emit("error",s))),this.inputStream.write(e,t,i)}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 $ne(r,e={}){return new C_(r,e)}o($ne,"writeStream");async function Une(r,e,t){let i=await rB(e,t);try{let s=await Vne(r,e,i.target,t);return await iB(i,e,s.integrity,t),s}finally{i.moved||await yu.rm(i.target,{recursive:!0,force:!0})}}o(Une,"handleContent");async function Vne(r,e,t,i){let s=new qne.WriteStream(t,{flags:"wx"});if(i.integrityEmitter){let[u,h]=await Promise.all([eB.once(i.integrityEmitter,"integrity").then(f=>f[0]),eB.once(i.integrityEmitter,"size").then(f=>f[0]),new tB(r,s).promise()]);return{integrity:u,size:h}}let n,a,c=A_.integrityStream({integrity:i.integrity,algorithms:i.algorithms,size:i.size});return c.on("integrity",u=>{n=u}),c.on("size",u=>{a=u}),await new tB(r,c,s).promise(),{integrity:n,size:a}}o(Vne,"pipeToTmp");async function rB(r,e){let t=Bne(R_.join(r,"tmp"),e.tmpPrefix);return await yu.mkdir(R_.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(rB,"makeTmp");async function iB(r,e,t){let i=Dne(e,t),s=R_.dirname(i);return mu.has(i)||mu.set(i,yu.mkdir(s,{recursive:!0}).then(async()=>(await Lne(r.target,i,{overwrite:!1}),r.moved=!0,r.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{mu.delete(i)})),mu.get(i)}o(iB,"moveToDestination");function zne(r,e){let t=new Error(`Bad data size: expected inserted data to be ${r} bytes, but got ${e} instead`);return t.expected=r,t.found=e,t.code="EBADSIZE",t}o(zne,"sizeError");function Gne(r,e){let t=new Error(`Integrity check failed:
26
+ Wanted: ${r}
27
+ Found: ${e}`);return t.code="EINTEGRITY",t.expected=r,t.found=e,t}o(Gne,"checksumError")});var lB=g((Z$e,P_)=>{"use strict";var nB=ha(),oB=hu(),aB=sB(),Hne=Rp(),{PassThrough:Wne}=jE(),Jne=ca(),cB=o(r=>({algorithms:["sha512"],...r}),"putOpts");P_.exports=Kne;async function Kne(r,e,t,i={}){let{memoize:s}=i;i=cB(i);let n=await aB(r,t,i),a=await nB.insert(r,e,n.integrity,{...i,size:n.size});return s&&oB.put(r,a,t,i),n.integrity}o(Kne,"putData");P_.exports.stream=Yne;function Yne(r,e,t={}){let{memoize:i}=t;t=cB(t);let s,n,a,c,l=new Jne;if(i){let h=new Wne().on("collect",f=>{c=f});l.push(h)}let u=aB.stream(r,t).on("integrity",h=>{s=h}).on("size",h=>{n=h}).on("error",h=>{a=h});return l.push(u),l.push(new Hne({async flush(){if(!a){let h=await nB.insert(r,e,s,{...t,size:n});i&&c&&oB.put(r,h,c,t),l.emit("integrity",s),l.emit("size",n)}}})),l}o(Yne,"putStream")});var N_=g((Q$e,hB)=>{"use strict";var{glob:Zne}=Md(),uB=require("path"),Xne=o(r=>r.split(uB.win32.sep).join(uB.posix.sep),"globify");hB.exports=(r,e)=>Zne(Xne(r),e)});var dB=g((tUe,fB)=>{"use strict";var Qne=require("fs/promises"),eoe=la(),{hasContent:toe}=I_();fB.exports=roe;async function roe(r,e){let t=await toe(r,e);return t&&t.sri?(await Qne.rm(eoe(r,t.sri),{recursive:!0,force:!0}),!0):!1}o(roe,"rm")});var gB=g((iUe,Su)=>{"use strict";var{rm:ioe}=require("fs/promises"),soe=N_(),noe=ha(),x_=hu(),ooe=require("path"),aoe=dB();Su.exports=pB;Su.exports.entry=pB;function pB(r,e,t){return x_.clearMemoized(),noe.delete(r,e,t)}o(pB,"entry");Su.exports.content=coe;function coe(r,e){return x_.clearMemoized(),aoe(r,e)}o(coe,"content");Su.exports.all=loe;async function loe(r){x_.clearMemoized();let e=await soe(ooe.join(r,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>ioe(t,{recursive:!0,force:!0})))}o(loe,"all")});var yB=g((nUe,F_)=>{"use strict";var{mkdir:uoe,readFile:hoe,rm:L_,stat:M_,truncate:foe,writeFile:doe}=require("fs/promises"),mB=la(),poe=As(),goe=N_(),va=ha(),Ap=require("path"),D_=Ft(),moe=o((r,e)=>Object.prototype.hasOwnProperty.call(r,e),"hasOwnProperty"),yoe=o(r=>({concurrency:20,log:{silly(){}},...r}),"verifyOpts");F_.exports=Soe;async function Soe(r,e){e=yoe(e),e.log.silly("verify","verifying cache at",r);let t=[woe,Eoe,_oe,Ooe,Toe,Roe,voe],i={};for(let s of t){let n=s.name,a=new Date,c=await s(r,e);c&&Object.keys(c).forEach(u=>{i[u]=c[u]});let l=new Date;i.runTime||(i.runTime={}),i.runTime[n]=l-a}return i.runTime.total=i.endTime-i.startTime,e.log.silly("verify","verification finished for",r,"in",`${i.runTime.total}ms`),i}o(Soe,"verify");async function woe(){return{startTime:new Date}}o(woe,"markStartTime");async function voe(){return{endTime:new Date}}o(voe,"markEndTime");async function Eoe(r,e){return e.log.silly("verify","fixing cache permissions"),await uoe(r,{recursive:!0}),null}o(Eoe,"fixPerms");async function _oe(r,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(pp(),dp)),i=va.lsStream(r),s=new Set;i.on("data",l=>{if(e.filter&&!e.filter(l))return;let u=D_.parse(l.integrity);for(let h in u)s.add(u[h].toString())}),await new Promise((l,u)=>{i.on("end",l).on("error",u)});let n=mB.contentDir(r),a=await goe(Ap.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async l=>{let u=l.split(/[/\\]/),h=u.slice(u.length-3).join(""),f=u[u.length-4],d=D_.fromHex(h,f);if(s.has(d.toString())){let p=await boe(l,d);p.valid?(c.verifiedContent++,c.keptSize+=p.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=p.size)}else{c.reclaimedCount++;let p=await M_(l);await L_(l,{recursive:!0,force:!0}),c.reclaimedSize+=p.size}return c},{concurrency:e.concurrency}),c}o(_oe,"garbageCollect");async function boe(r,e){let t={};try{let{size:i}=await M_(r);t.size=i,t.valid=!0,await D_.checkStream(new poe.ReadStream(r),e)}catch(i){if(i.code==="ENOENT")return{size:0,valid:!1};if(i.code!=="EINTEGRITY")throw i;await L_(r,{recursive:!0,force:!0}),t.valid=!1}return t}o(boe,"verifyContent");async function Ooe(r,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(pp(),dp)),i=await va.ls(r),s={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in i)if(moe(i,a)){let c=va.hashKey(a),l=i[a],u=e.filter&&!e.filter(l);u&&s.rejectedEntries++,n[c]&&!u?n[c].push(l):n[c]&&u||(u?(n[c]=[],n[c]._path=va.bucketPath(r,a)):(n[c]=[l],n[c]._path=va.bucketPath(r,a)))}return await t(Object.keys(n),a=>Ioe(r,n[a],s,e),{concurrency:e.concurrency}),s}o(Ooe,"rebuildIndex");async function Ioe(r,e,t){await foe(e._path);for(let i of e){let s=mB(r,i.integrity);try{await M_(s),await va.insert(r,i.key,i.integrity,{metadata:i.metadata,size:i.size,time:i.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(Ioe,"rebuildBucket");function Toe(r,e){return e.log.silly("verify","cleaning tmp directory"),L_(Ap.join(r,"tmp"),{recursive:!0,force:!0})}o(Toe,"cleanTmp");async function Roe(r,e){let t=Ap.join(r,"_lastverified");return e.log.silly("verify","writing verifile to "+t),doe(t,`${Date.now()}`)}o(Roe,"writeVerifile");F_.exports.lastRun=Aoe;async function Aoe(r){let e=await hoe(Ap.join(r,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(Aoe,"lastRun")});var wB=g((aUe,q_)=>{"use strict";var{withTempDir:Coe}=Dn(),SB=require("fs/promises"),B_=require("path");q_.exports.mkdir=koe;async function koe(r,e={}){let{tmpPrefix:t}=e,i=B_.join(r,"tmp");await SB.mkdir(i,{recursive:!0,owner:"inherit"});let s=`${i}${B_.sep}${t||""}`;return SB.mkdtemp(s,{owner:"inherit"})}o(koe,"mktmpdir");q_.exports.withTmp=Poe;function Poe(r,e,t){return t||(t=e,e={}),Coe(B_.join(r,"tmp"),t,e)}o(Poe,"withTmp")});var Qr=g((lUe,ae)=>{"use strict";var Cs=KF(),vB=lB(),j_=gB(),EB=yB(),{clearMemoized:Noe}=hu(),_B=wB(),Cp=ha();ae.exports.index={};ae.exports.index.compact=Cp.compact;ae.exports.index.insert=Cp.insert;ae.exports.ls=Cp.ls;ae.exports.ls.stream=Cp.lsStream;ae.exports.get=Cs;ae.exports.get.byDigest=Cs.byDigest;ae.exports.get.stream=Cs.stream;ae.exports.get.stream.byDigest=Cs.stream.byDigest;ae.exports.get.copy=Cs.copy;ae.exports.get.copy.byDigest=Cs.copy.byDigest;ae.exports.get.info=Cs.info;ae.exports.get.hasContent=Cs.hasContent;ae.exports.put=vB;ae.exports.put.stream=vB.stream;ae.exports.rm=j_.entry;ae.exports.rm.all=j_.all;ae.exports.rm.entry=ae.exports.rm;ae.exports.rm.content=j_.content;ae.exports.clearMemoized=Noe;ae.exports.tmp={};ae.exports.tmp.mkdir=_B.mkdir;ae.exports.tmp.withTmp=_B.withTmp;ae.exports.verify=EB;ae.exports.verify.lastRun=EB.lastRun});var OB=g((uUe,bB)=>{"use strict";var Ea=require("fs"),wu=require("path"),xoe=require("events").EventEmitter,Doe=Pn(),vu=class r extends xoe{static{o(this,"BundleWalker")}constructor(e){if(e=e||{},super(e),this.path=wu.resolve(e.path||process.cwd()),this.parent=e.parent||null,this.parent){if(this.result=this.parent.result,!this.parent.parent){let t=wu.basename(this.path),i=wu.basename(wu.dirname(this.path));this.result.add(/^@/.test(i)?i+"/"+t:t)}this.root=this.parent.root,this.packageJsonCache=this.parent.packageJsonCache}else this.result=new Set,this.root=this.path,this.packageJsonCache=e.packageJsonCache||new Map;this.seen=new Set,this.didDone=!1,this.children=0,this.node_modules=[],this.package=null,this.bundle=null}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);return e==="done"&&this.didDone&&this.emit("done",this.result),i}done(){if(!this.didDone)if(this.didDone=!0,this.parent)this.emit("done");else{let e=Array.from(this.result);this.result=e,this.emit("done",e)}}start(){let e=wu.resolve(this.path,"package.json");return this.packageJsonCache.has(e)?this.onPackage(this.packageJsonCache.get(e)):this.readPackageJson(e),this}readPackageJson(e){Ea.readFile(e,(t,i)=>t?this.done():this.onPackageJson(e,i))}onPackageJson(e,t){try{this.package=Doe(JSON.parse(t+""))}catch{return this.done()}this.packageJsonCache.set(e,this.package),this.onPackage(this.package)}allDepsBundled(e){return Object.keys(e.dependencies||{}).concat(Object.keys(e.optionalDependencies||{}))}onPackage(e){let t=this.parent?this.allDepsBundled(e):e.bundleDependencies||e.bundledDependencies||[],i=Array.from(new Set(Array.isArray(t)?t:t===!0?this.allDepsBundled(e):Object.keys(t)));if(!i.length)return this.done();this.bundle=i,this.readModules()}readModules(){Loe(this.path+"/node_modules",(e,t)=>e?this.onReaddir([]):this.onReaddir(t))}onReaddir(e){this.node_modules=e,this.bundle.forEach(t=>this.childDep(t)),this.children===0&&this.done()}childDep(e){this.node_modules.indexOf(e)!==-1?this.seen.has(e)||(this.seen.add(e),this.child(e)):this.parent&&this.parent.childDep(e)}child(e){let t=this.path+"/node_modules/"+e;this.children+=1;let i=new r({path:t,parent:this});i.on("done",()=>{--this.children===0&&this.done()}),i.start()}},kp=class r extends vu{static{o(this,"BundleWalkerSync")}start(){return super.start(),this.done(),this}readPackageJson(e){try{this.onPackageJson(e,Ea.readFileSync(e))}catch{}return this}readModules(){try{this.onReaddir(Moe(this.path+"/node_modules"))}catch{this.onReaddir([])}}child(e){new r({path:this.path+"/node_modules/"+e,parent:this}).start()}},Loe=o((r,e)=>{Ea.readdir(r,(t,i)=>{if(t)e(t);else{let s=i.filter(n=>/^@/.test(n));if(!s.length)e(null,i);else{let n=i.filter(c=>!/^@/.test(c)),a=s.length;s.forEach(c=>{Ea.readdir(r+"/"+c,(l,u)=>{l||!u.length?n.push(c):n.push.apply(n,u.map(h=>c+"/"+h)),--a===0&&e(null,n)})})}}})},"readdirNodeModules"),Moe=o(r=>{let e=Ea.readdirSync(r),t=e.filter(s=>!/^@/.test(s)),i=e.filter(s=>/^@/.test(s)).map(s=>{try{let n=Ea.readdirSync(r+"/"+s);return n.length?n.map(a=>s+"/"+a):[s]}catch{return[s]}}).reduce((s,n)=>s.concat(n),[]);return t.concat(i)},"readdirNodeModulesSync"),Pp=o((r,e)=>{let t=new Promise((i,s)=>{new vu(r).on("done",i).on("error",s).start()});return e?t.then(i=>e(null,i),e):t},"walk"),Foe=o(r=>new kp(r).start().result,"walkSync");bB.exports=Pp;Pp.sync=Foe;Pp.BundleWalker=vu;Pp.BundleWalkerSync=kp});var Dp=g((fUe,RB)=>{var Boe=OB(),{readFile:qoe,readdir:joe,stat:$oe}=require("fs/promises"),{resolve:Np,basename:Uoe,dirname:IB}=require("path"),Voe=Pn(),zoe=o(({path:r,packageJsonCache:e})=>e.has(r)?Promise.resolve(e.get(r)):qoe(r).then(t=>{let i=Voe(JSON.parse(t));return e.set(r,i),i}).catch(()=>null),"readPackage"),TB=Symbol("package data has been normalized"),Goe=o(({path:r,packageJsonCache:e})=>zoe({path:r,packageJsonCache:e}).then(t=>{if(!t||t[TB])return t;t.bundledDependencies&&!t.bundleDependencies&&(t.bundleDependencies=t.bundledDependencies,delete t.bundledDependencies);let i=t.bundleDependencies;return i===!0&&(t.bundleDependencies=[...Object.keys(t.dependencies||{}),...Object.keys(t.optionalDependencies||{})]),typeof i=="object"&&!Array.isArray(i)&&(t.bundleDependencies=Object.keys(i)),t[TB]=!0,t}),"rpj"),xp=o(async({path:r,depth:e=1,currentDepth:t=0,pkg:i=null,result:s=null,packageJsonCache:n=null})=>{if(s||(s=new Set),n||(n=new Map),i===!0)return Goe({path:r+"/package.json",packageJsonCache:n}).then(u=>xp({path:r,depth:e,currentDepth:t,pkg:u,result:s,packageJsonCache:n}));if(i&&i.bin){let u=IB(r),h=Uoe(u),f=/^@.+/.test(h)?IB(u):u,d=[];Object.keys(i.bin).forEach(m=>{let y=Np(f,".bin",m);d.push(y,y+".cmd",y+".ps1")}),(await Promise.all(d.map(m=>$oe(m).then(()=>m).catch(()=>null)))).filter(m=>m).forEach(m=>s.add(m))}if(t>=e)return s.add(r),s;let[a,c]=await Promise.all([joe(r,{withFileTypes:!0}),t===0&&i&&i.bundleDependencies?Boe({path:r,packageJsonCache:n}):null]).catch(()=>[]);if(!a)return s;if(!a.length&&!c&&t!==0)return s.add(r),s;let l=[];for(let u of a){let h=Np(r,u.name);if(u.isDirectory()===!1){s.add(h);continue}if(t!==0||u.name!=="node_modules"){t<e-1?l.push(xp({path:h,packageJsonCache:n,depth:e,currentDepth:t+1,result:s})):s.add(h);continue}}return c&&l.push(...c.map(u=>{let h=Np(r,"node_modules",u);return xp({path:h,packageJsonCache:n,pkg:!0,depth:e,currentDepth:t+1,result:s})})),l.length&&await Promise.all(l),s},"pkgContents");RB.exports=({path:r,...e})=>xp({path:Np(r),...e,pkg:!0}).then(t=>[...t])});var ye=g((pUe,Ou)=>{"use strict";var bu=process.platform==="win32",{URL:$_}=require("node:url"),_a=bu?require("node:path/win32"):require("node:path"),{homedir:Hoe}=require("node:os"),Woe=wl(),AB=$e(),NB=vE(),{log:Joe}=se(),xB=bu?/\\|[/]/:/[/]/,DB=/^(?:git[+])?[a-z]+:/i,Koe=/^[^@]+@[^:.]+\.[^:]+:.+$/i,V_=/[.](?:tgz|tar.gz|tar)$/i,Yoe=/:[0-9]+(\/|$)/i,Zoe=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,Xoe=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,CB="https://registry.npmjs.org";function Eu(r,e){let t,i;if(typeof r=="object")return r instanceof _u&&(!e||e===r.where)?r:r.name&&r.rawSpec?Eu.resolve(r.name,r.rawSpec,e||r.where):Eu(r.raw,e||r.where);let s=r.indexOf("@",1),n=s>0?r.slice(0,s):r;return DB.test(r)?i=r:Koe.test(r)?i=`git+ssh://${r}`:!n.startsWith("@")&&(xB.test(n)||V_.test(n))?i=r:s>0?(t=n,i=r.slice(s+1)||"*"):NB(r).validForOldPackages?(t=r,i="*"):i=r,LB(t,i,e,r)}o(Eu,"npa");function Qoe(r){return r?r.toLowerCase().startsWith("file:")?!0:bu?Zoe.test(r):Xoe.test(r):!1}o(Qoe,"isFileSpec");function eae(r){return r?r.toLowerCase().startsWith("npm:"):!1}o(eae,"isAliasSpec");function LB(r,e,t,i){let s=new _u({raw:i,name:r,rawSpec:e,fromArgument:i!=null});if(r&&(s.name=r),t||(t=process.cwd()),Qoe(e))return PB(s,t);if(eae(e))return lae(s,t);let n=Woe.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?oae(s,n):e&&DB.test(e)?cae(s):e&&(xB.test(e)||V_.test(e))?PB(s,t):uae(s)}o(LB,"resolve");function tae(r,e=CB){let t=Eu(r);if(t.type!=="version")throw sae(t.type,t.raw);let i="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==CB&&(i+="?repository_url="+e),i}o(tae,"toPurl");function rae(r,e,t){let i=new Error(`Invalid package name "${r}" of package "${t}": ${e.errors.join("; ")}.`);return i.code="EINVALIDPACKAGENAME",i}o(rae,"invalidPackageName");function iae(r,e){let t=new Error(`Invalid tag name "${r}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(iae,"invalidTagName");function sae(r,e){let t=new Error(`Invalid type "${r}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(sae,"invalidPurlType");var _u=class{static{o(this,"Result")}constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||"",this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=NB(e);if(!t.validForOldPackages)throw rae(e,t,this.raw);return this.name=e,this.scope=e[0]==="@"?e.slice(0,e.indexOf("/")):void 0,this.escapedName=e.replace("/","%2f"),this}toString(){let e=[];this.name!=null&&this.name!==""&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==""&&e.push(t),e.length?e.join("@"):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function U_(r,e){if(!e){r.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(r.gitRange)throw new Error("cannot override existing semver range with a committish");if(r.gitCommittish)throw new Error("cannot override existing committish with a second committish");r.gitCommittish=t;continue}let[i,s]=t.split(":");if(i==="semver"){if(r.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(r.gitRange)throw new Error("cannot override existing semver range with a second semver range");r.gitRange=decodeURIComponent(s);continue}if(i==="path"){if(r.gitSubdir)throw new Error("cannot override existing path with a second path");r.gitSubdir=`/${s}`;continue}Joe.warn("npm-package-arg",`ignoring unknown key "${i}"`)}}o(U_,"setGitAttrs");var nae=new Map([["\0","%00"],[" ","%09"],[`
28
+ `,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",bu?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function kB(r){let e="";for(let t=0;t<r.length;t++)e=`${e}${nae.get(r[t])??r[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(kB,"pathToFileURL");function PB(r,e){r.type=V_.test(r.rawSpec)?"file":"directory",r.where=e;let t=kB(r.rawSpec);t.startsWith("file:/")&&(/^file:\/\/[^/]/.test(t)&&(t=`file:/${t.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(t.slice(5))&&(t=t.replace(/^file:\/{1,3}/,"file:")));let i,s;try{i=new $_(t,`${kB(_a.resolve(e))}/`),s=new $_(t)}catch(c){let l=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(l,{raw:r.rawSpec,spec:r,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(i.pathname);return bu&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(r.saveSpec=`file:${n.substr(1)}`,a=_a.resolve(Hoe(),n.substr(3))):_a.isAbsolute(t.slice(5))?r.saveSpec=`file:${_a.resolve(a)}`:r.saveSpec=`file:${_a.relative(e,a)}`,r.fetchSpec=_a.resolve(e,a),r.saveSpec=r.saveSpec.split("\\").join("/"),r.saveSpec.startsWith("file://")&&(r.saveSpec=`file:/${r.saveSpec.slice(7)}`),r}o(PB,"fromFile");function oae(r,e){return r.type="git",r.hosted=e,r.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),r.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),U_(r,e.committish),r}o(oae,"fromHostedGit");function aae(r,e){let t=new Error(`Unsupported URL Type "${r}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(aae,"unsupportedURLType");function cae(r){let e=r.rawSpec;if(r.saveSpec=e,e.startsWith("git+ssh:")){let i=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(i&&!i[1].match(Yoe))return r.type="git",U_(r,i[2]),r.fetchSpec=i[1],r}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new $_(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":r.type="git",U_(r,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?r.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",r.fetchSpec=t.toString()),r.fetchSpec.startsWith("git+")&&(r.fetchSpec=r.fetchSpec.slice(4));break;case"http:":case"https:":r.type="remote",r.fetchSpec=r.saveSpec;break;default:throw aae(t.protocol,e)}return r}o(cae,"fromURL");function lae(r,e){let t=Eu(r.rawSpec.substr(4),e);if(t.type==="alias")throw new Error("nested aliases not supported");if(!t.registry)throw new Error("aliases only work for registry deps");if(!t.name)throw new Error("aliases must have a name");return r.subSpec=t,r.registry=!0,r.type="alias",r.saveSpec=null,r.fetchSpec=null,r}o(lae,"fromAlias");function uae(r){r.registry=!0;let e=r.rawSpec.trim();r.saveSpec=null,r.fetchSpec=e;let t=AB.valid(e,!0),i=AB.validRange(e,!0);if(t)r.type="version";else if(i)r.type="range";else{if(encodeURIComponent(e)!==e)throw iae(e,r.raw);r.type="tag"}return r}o(uae,"fromRegistry");Ou.exports=Eu;Ou.exports.resolve=LB;Ou.exports.toPurl=tae;Ou.exports.Result=_u});var Ra=g(er=>{"use strict";var MB=er&&er.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(er,"__esModule",{value:!0});er.WriteStreamSync=er.WriteStream=er.ReadStreamSync=er.ReadStream=void 0;var hae=MB(require("events")),_t=MB(require("fs")),fae=ee(),dae=_t.default.writev,Ps=Symbol("_autoClose"),Nr=Symbol("_close"),Iu=Symbol("_ended"),re=Symbol("_fd"),z_=Symbol("_finished"),Wi=Symbol("_flags"),G_=Symbol("_flush"),K_=Symbol("_handleChunk"),Y_=Symbol("_makeBuf"),Ru=Symbol("_mode"),Lp=Symbol("_needDrain"),Ia=Symbol("_onerror"),Ta=Symbol("_onopen"),H_=Symbol("_onread"),ba=Symbol("_onwrite"),Ns=Symbol("_open"),Pr=Symbol("_path"),ks=Symbol("_pos"),ei=Symbol("_queue"),Oa=Symbol("_read"),W_=Symbol("_readSize"),Hi=Symbol("_reading"),Tu=Symbol("_remain"),J_=Symbol("_size"),Mp=Symbol("_write"),qn=Symbol("_writing"),Fp=Symbol("_defaultFlag"),jn=Symbol("_errored"),Bp=class extends fae.Minipass{static{o(this,"ReadStream")}[jn]=!1;[re];[Pr];[W_];[Hi]=!1;[J_];[Tu];[Ps];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[jn]=!1,this[re]=typeof t.fd=="number"?t.fd:void 0,this[Pr]=e,this[W_]=t.readSize||16*1024*1024,this[Hi]=!1,this[J_]=typeof t.size=="number"?t.size:1/0,this[Tu]=this[J_],this[Ps]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[re]=="number"?this[Oa]():this[Ns]()}get fd(){return this[re]}get path(){return this[Pr]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ns](){_t.default.open(this[Pr],"r",(e,t)=>this[Ta](e,t))}[Ta](e,t){e?this[Ia](e):(this[re]=t,this.emit("open",t),this[Oa]())}[Y_](){return Buffer.allocUnsafe(Math.min(this[W_],this[Tu]))}[Oa](){if(!this[Hi]){this[Hi]=!0;let e=this[Y_]();if(e.length===0)return process.nextTick(()=>this[H_](null,0,e));_t.default.read(this[re],e,0,e.length,null,(t,i,s)=>this[H_](t,i,s))}}[H_](e,t,i){this[Hi]=!1,e?this[Ia](e):this[K_](t,i)&&this[Oa]()}[Nr](){if(this[Ps]&&typeof this[re]=="number"){let e=this[re];this[re]=void 0,_t.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ia](e){this[Hi]=!0,this[Nr](),this.emit("error",e)}[K_](e,t){let i=!1;return this[Tu]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[Tu]<=0)&&(i=!1,this[Nr](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[re]=="number"&&this[Oa](),!1;case"error":return this[jn]?!1:(this[jn]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};er.ReadStream=Bp;var Z_=class extends Bp{static{o(this,"ReadStreamSync")}[Ns](){let e=!0;try{this[Ta](null,_t.default.openSync(this[Pr],"r")),e=!1}finally{e&&this[Nr]()}}[Oa](){let e=!0;try{if(!this[Hi]){this[Hi]=!0;do{let t=this[Y_](),i=t.length===0?0:_t.default.readSync(this[re],t,0,t.length,null);if(!this[K_](i,t))break}while(!0);this[Hi]=!1}e=!1}finally{e&&this[Nr]()}}[Nr](){if(this[Ps]&&typeof this[re]=="number"){let e=this[re];this[re]=void 0,_t.default.closeSync(e),this.emit("close")}}};er.ReadStreamSync=Z_;var qp=class extends hae.default{static{o(this,"WriteStream")}readable=!1;writable=!0;[jn]=!1;[qn]=!1;[Iu]=!1;[ei]=[];[Lp]=!1;[Pr];[Ru];[Ps];[re];[Fp];[Wi];[z_]=!1;[ks];constructor(e,t){t=t||{},super(t),this[Pr]=e,this[re]=typeof t.fd=="number"?t.fd:void 0,this[Ru]=t.mode===void 0?438:t.mode,this[ks]=typeof t.start=="number"?t.start:void 0,this[Ps]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[ks]!==void 0?"r+":"w";this[Fp]=t.flags===void 0,this[Wi]=t.flags===void 0?i:t.flags,this[re]===void 0&&this[Ns]()}emit(e,...t){if(e==="error"){if(this[jn])return!1;this[jn]=!0}return super.emit(e,...t)}get fd(){return this[re]}get path(){return this[Pr]}[Ia](e){this[Nr](),this[qn]=!0,this.emit("error",e)}[Ns](){_t.default.open(this[Pr],this[Wi],this[Ru],(e,t)=>this[Ta](e,t))}[Ta](e,t){this[Fp]&&this[Wi]==="r+"&&e&&e.code==="ENOENT"?(this[Wi]="w",this[Ns]()):e?this[Ia](e):(this[re]=t,this.emit("open",t),this[qn]||this[G_]())}end(e,t){return e&&this.write(e,t),this[Iu]=!0,!this[qn]&&!this[ei].length&&typeof this[re]=="number"&&this[ba](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Iu]?(this.emit("error",new Error("write() after end()")),!1):this[re]===void 0||this[qn]||this[ei].length?(this[ei].push(e),this[Lp]=!0,!1):(this[qn]=!0,this[Mp](e),!0)}[Mp](e){_t.default.write(this[re],e,0,e.length,this[ks],(t,i)=>this[ba](t,i))}[ba](e,t){e?this[Ia](e):(this[ks]!==void 0&&typeof t=="number"&&(this[ks]+=t),this[ei].length?this[G_]():(this[qn]=!1,this[Iu]&&!this[z_]?(this[z_]=!0,this[Nr](),this.emit("finish")):this[Lp]&&(this[Lp]=!1,this.emit("drain"))))}[G_](){if(this[ei].length===0)this[Iu]&&this[ba](null,0);else if(this[ei].length===1)this[Mp](this[ei].pop());else{let e=this[ei];this[ei]=[],dae(this[re],e,this[ks],(t,i)=>this[ba](t,i))}}[Nr](){if(this[Ps]&&typeof this[re]=="number"){let e=this[re];this[re]=void 0,_t.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};er.WriteStream=qp;var X_=class extends qp{static{o(this,"WriteStreamSync")}[Ns](){let e;if(this[Fp]&&this[Wi]==="r+")try{e=_t.default.openSync(this[Pr],this[Wi],this[Ru])}catch(t){if(t?.code==="ENOENT")return this[Wi]="w",this[Ns]();throw t}else e=_t.default.openSync(this[Pr],this[Wi],this[Ru]);this[Ta](null,e)}[Nr](){if(this[Ps]&&typeof this[re]=="number"){let e=this[re];this[re]=void 0,_t.default.closeSync(e),this.emit("close")}}[Mp](e){let t=!0;try{this[ba](null,_t.default.writeSync(this[re],e,0,e.length,this[ks])),t=!1}finally{if(t)try{this[Nr]()}catch{}}}};er.WriteStreamSync=X_});var jp=g(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.dealias=De.isNoFile=De.isFile=De.isAsync=De.isSync=De.isAsyncNoFile=De.isSyncNoFile=De.isAsyncFile=De.isSyncFile=void 0;var pae=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),gae=o(r=>!!r.sync&&!!r.file,"isSyncFile");De.isSyncFile=gae;var mae=o(r=>!r.sync&&!!r.file,"isAsyncFile");De.isAsyncFile=mae;var yae=o(r=>!!r.sync&&!r.file,"isSyncNoFile");De.isSyncNoFile=yae;var Sae=o(r=>!r.sync&&!r.file,"isAsyncNoFile");De.isAsyncNoFile=Sae;var wae=o(r=>!!r.sync,"isSync");De.isSync=wae;var vae=o(r=>!r.sync,"isAsync");De.isAsync=vae;var Eae=o(r=>!!r.file,"isFile");De.isFile=Eae;var _ae=o(r=>!r.file,"isNoFile");De.isNoFile=_ae;var bae=o(r=>{let e=pae.get(r);return e||r},"dealiasKey"),Oae=o((r={})=>{if(!r)return{};let e={};for(let[t,i]of Object.entries(r)){let s=bae(t);e[s]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e},"dealias");De.dealias=Oae});var Aa=g($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.makeCommand=void 0;var Au=jp(),Iae=o((r,e,t,i,s)=>Object.assign((n=[],a,c)=>{Array.isArray(n)&&(a=n,n={}),typeof a=="function"&&(c=a,a=void 0),a?a=Array.from(a):a=[];let l=(0,Au.dealias)(n);if(s?.(l,a),(0,Au.isSyncFile)(l)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return r(l,a)}else if((0,Au.isAsyncFile)(l)){let u=e(l,a),h=c||void 0;return h?u.then(()=>h(),h):u}else if((0,Au.isSyncNoFile)(l)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return t(l,a)}else if((0,Au.isAsyncNoFile)(l)){if(typeof c=="function")throw new TypeError("callback only supported with file option");return i(l,a)}else throw new Error("impossible options??")},{syncFile:r,asyncFile:e,syncNoFile:t,asyncNoFile:i,validate:s}),"makeCommand");$p.makeCommand=Iae});var Q_=g(Ca=>{"use strict";var Tae=Ca&&Ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.constants=void 0;var Rae=Tae(require("zlib")),Aae=Rae.default.constants||{ZLIB_VERNUM:4736};Ca.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},Aae))});var ku=g(G=>{"use strict";var Cae=G&&G.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),kae=G&&G.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Pae=G&&G.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&Cae(t,e,i[s]);return kae(t,e),t}})(),Nae=G&&G.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(G,"__esModule",{value:!0});G.ZstdDecompress=G.ZstdCompress=G.BrotliDecompress=G.BrotliCompress=G.Unzip=G.InflateRaw=G.DeflateRaw=G.Gunzip=G.Gzip=G.Inflate=G.Deflate=G.Zlib=G.ZlibError=G.constants=void 0;var rb=Nae(require("assert")),$n=require("buffer"),xae=ee(),FB=Pae(require("zlib")),ti=Q_(),Dae=Q_();Object.defineProperty(G,"constants",{enumerable:!0,get:o(function(){return Dae.constants},"get")});var Lae=$n.Buffer.concat,BB=Object.getOwnPropertyDescriptor($n.Buffer,"concat"),Mae=o(r=>r,"noop"),eb=BB?.writable===!0||BB?.set!==void 0?r=>{$n.Buffer.concat=r?Mae:Lae}:r=>{},Un=Symbol("_superWrite"),Vn=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"}};G.ZlibError=Vn;var tb=Symbol("flushFlag"),Cu=class extends xae.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#r;#i;#s;#o;#n;get sawError(){return this.#e}get handle(){return this.#o}get flushFlag(){return this.#r}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#r=e.flush??0,this.#i=e.finishFlush??0,this.#s=e.fullFlushFlag??0,typeof FB[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#o=new FB[t](e)}catch(i){throw new Vn(i,this.constructor)}this.#n=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#o?.on("error",i=>this.#n(new Vn(i))),this.once("end",()=>this.close)}close(){this.#o&&(this.#o.close(),this.#o=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,rb.default)(this.#o,"zlib binding closed"),this.#o.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#s),this.write(Object.assign($n.Buffer.alloc(0),{[tb]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#i),this.#t=!0,super.end(i)}get ended(){return this.#t}[Un](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=$n.Buffer.from(e,t)),this.#e)return;(0,rb.default)(this.#o,"zlib binding closed");let s=this.#o._handle,n=s.close;s.close=()=>{};let a=this.#o.close;this.#o.close=()=>{},eb(!0);let c;try{let u=typeof e[tb]=="number"?e[tb]:this.#r;c=this.#o._processChunk(e,u),eb(!1)}catch(u){eb(!1),this.#n(new Vn(u,this.write))}finally{this.#o&&(this.#o._handle=s,s.close=n,this.#o.close=a,this.#o.removeAllListeners("error"))}this.#o&&this.#o.on("error",u=>this.#n(new Vn(u,this.write)));let l;if(c)if(Array.isArray(c)&&c.length>0){let u=c[0];l=this[Un]($n.Buffer.from(u));for(let h=1;h<c.length;h++)l=this[Un](c[h])}else l=this[Un]($n.Buffer.from(c));return i&&i(),l}},ri=class extends Cu{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||ti.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ti.constants.Z_FINISH,e.fullFlushFlag=ti.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(ti.constants.Z_SYNC_FLUSH),(0,rb.default)(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(s,n)=>{typeof s=="function"&&(n=s,s=this.flushFlag),this.flush(s),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#t=t)}}}};G.Zlib=ri;var ib=class extends ri{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};G.Deflate=ib;var sb=class extends ri{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};G.Inflate=sb;var nb=class extends ri{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Un](e){return this.#e?(this.#e=!1,e[9]=255,super[Un](e)):super[Un](e)}};G.Gzip=nb;var ob=class extends ri{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};G.Gunzip=ob;var ab=class extends ri{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};G.DeflateRaw=ab;var cb=class extends ri{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};G.InflateRaw=cb;var lb=class extends ri{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};G.Unzip=lb;var Up=class extends Cu{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||ti.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ti.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=ti.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},ub=class extends Up{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};G.BrotliCompress=ub;var hb=class extends Up{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};G.BrotliDecompress=hb;var Vp=class extends Cu{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||ti.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||ti.constants.ZSTD_e_end,e.fullFlushFlag=ti.constants.ZSTD_e_flush,super(e,t)}},fb=class extends Vp{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};G.ZstdCompress=fb;var db=class extends Vp{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};G.ZstdDecompress=db});var $B=g(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.parse=ka.encode=void 0;var Fae=o((r,e)=>{if(Number.isSafeInteger(r))r<0?qae(r,e):Bae(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},"encode");ka.encode=Fae;var Bae=o((r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},"encodePositive"),qae=o((r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var i=e.length;i>1;i--){var s=r&255;r=Math.floor(r/256),t?e[i-1]=qB(s):s===0?e[i-1]=0:(t=!0,e[i-1]=jB(s))}},"encodeNegative"),jae=o(r=>{let e=r[0],t=e===128?Uae(r.subarray(1,r.length)):e===255?$ae(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},"parse");ka.parse=jae;var $ae=o(r=>{for(var e=r.length,t=0,i=!1,s=e-1;s>-1;s--){var n=Number(r[s]),a;i?a=qB(n):n===0?a=n:(i=!0,a=jB(n)),a!==0&&(t-=a*Math.pow(256,e-s-1))}return t},"twos"),Uae=o(r=>{for(var e=r.length,t=0,i=e-1;i>-1;i--){var s=Number(r[i]);s!==0&&(t+=s*Math.pow(256,e-i-1))}return t},"pos"),qB=o(r=>(255^r)&255,"onesComp"),jB=o(r=>(255^r)+1&255,"twosComp")});var pb=g(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.code=qt.name=qt.isName=qt.isCode=void 0;var Vae=o(r=>qt.name.has(r),"isCode");qt.isCode=Vae;var zae=o(r=>qt.code.has(r),"isName");qt.isName=zae;qt.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);qt.code=new Map(Array.from(qt.name).map(r=>[r[1],r[0]]))});var Na=g(ii=>{"use strict";var Gae=ii&&ii.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Hae=ii&&ii.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),UB=ii&&ii.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Gae(e,r,t);return Hae(e,r),e};Object.defineProperty(ii,"__esModule",{value:!0});ii.Header=void 0;var Pa=require("node:path"),VB=UB($B()),Pu=UB(pb()),yb=class{static{o(this,"Header")}cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,s){Buffer.isBuffer(e)?this.decode(e,t||0,i,s):e&&this.#t(e)}decode(e,t,i,s){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=zn(e,t,100),this.mode=xs(e,t+100,8),this.uid=xs(e,t+108,8),this.gid=xs(e,t+116,8),this.size=xs(e,t+124,12),this.mtime=gb(e,t+136,12),this.cksum=xs(e,t+148,12),s&&this.#t(s,!0),i&&this.#t(i);let n=zn(e,t+156,1);if(Pu.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=zn(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=zn(e,t+265,32),this.gname=zn(e,t+297,32),this.devmaj=xs(e,t+329,8)??0,this.devmin=xs(e,t+337,8)??0,e[t+475]!==0){let c=zn(e,t+345,155);this.path=c+"/"+this.path}else{let c=zn(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=gb(e,t+476,12),this.ctime=gb(e,t+488,12)}let a=256;for(let c=t;c<t+148;c++)a+=e[c];for(let c=t+156;c<t+512;c++)a+=e[c];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#t(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,s])=>!(s==null||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,s=Wae(this.path||"",i),n=s[0],a=s[1];this.needPax=!!s[2],this.needPax=Gn(e,t,100,n)||this.needPax,this.needPax=Ds(e,t+100,8,this.mode)||this.needPax,this.needPax=Ds(e,t+108,8,this.uid)||this.needPax,this.needPax=Ds(e,t+116,8,this.gid)||this.needPax,this.needPax=Ds(e,t+124,12,this.size)||this.needPax,this.needPax=mb(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#e.charCodeAt(0),this.needPax=Gn(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Gn(e,t+265,32,this.uname)||this.needPax,this.needPax=Gn(e,t+297,32,this.gname)||this.needPax,this.needPax=Ds(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ds(e,t+337,8,this.devmin)||this.needPax,this.needPax=Gn(e,t+345,i,a)||this.needPax,e[t+475]!==0?this.needPax=Gn(e,t+345,155,a)||this.needPax:(this.needPax=Gn(e,t+345,130,a)||this.needPax,this.needPax=mb(e,t+476,12,this.atime)||this.needPax,this.needPax=mb(e,t+488,12,this.ctime)||this.needPax);let c=256;for(let l=t;l<t+148;l++)c+=e[l];for(let l=t+156;l<t+512;l++)c+=e[l];return this.cksum=c,Ds(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Pu.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Pu.code.get(e));if(Pu.isCode(t)||t==="Unsupported")this.#e=t;else if(Pu.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};ii.Header=yb;var Wae=o((r,e)=>{let i=r,s="",n,a=Pa.posix.parse(r).root||".";if(Buffer.byteLength(i)<100)n=[i,s,!1];else{s=Pa.posix.dirname(i),i=Pa.posix.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(s)<=e?n=[i,s,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(s)<=e?n=[i.slice(0,99),s,!0]:(i=Pa.posix.join(Pa.posix.basename(s),i),s=Pa.posix.dirname(s));while(s!==a&&n===void 0);n||(n=[r.slice(0,99),"",!0])}return n},"splitPrefix"),zn=o((r,e,t)=>r.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),"decString"),gb=o((r,e,t)=>Jae(xs(r,e,t)),"decDate"),Jae=o(r=>r===void 0?void 0:new Date(r*1e3),"numToDate"),xs=o((r,e,t)=>Number(r[e])&128?VB.parse(r.subarray(e,e+t)):Yae(r,e,t),"decNumber"),Kae=o(r=>isNaN(r)?void 0:r,"nanUndef"),Yae=o((r,e,t)=>Kae(parseInt(r.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),"decSmallNumber"),Zae={12:8589934591,8:2097151},Ds=o((r,e,t,i)=>i===void 0?!1:i>Zae[t]||i<0?(VB.encode(i,r.subarray(e,e+t)),!0):(Xae(r,e,t,i),!1),"encNumber"),Xae=o((r,e,t,i)=>r.write(Qae(i,t),e,t,"ascii"),"encSmallNumber"),Qae=o((r,e)=>ece(Math.floor(r).toString(8),e),"octalString"),ece=o((r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0","padOctal"),mb=o((r,e,t,i)=>i===void 0?!1:Ds(r,e,t,i.getTime()/1e3),"encDate"),tce=new Array(156).join("\0"),Gn=o((r,e,t,i)=>i===void 0?!1:(r.write(i+tce,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t),"encString")});var Gp=g(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.Pax=void 0;var rce=require("node:path"),ice=Na(),Sb=class r{static{o(this,"Pax")}atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),s=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)s[n]=0;new ice.Header({path:("PaxHeader/"+(0,rce.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(s),s.write(e,512,t,"utf8");for(let n=t+512;n<s.length;n++)s[n]=0;return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let t=this[e],i=t instanceof Date?t.getTime()/1e3:t,s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+i+`
29
+ `,n=Buffer.byteLength(s),a=Math.floor(Math.log(n)/Math.log(10))+1;return n+a>=Math.pow(10,a)&&(a+=1),a+n+s}static parse(e,t,i=!1){return new r(sce(nce(e),t),i)}};zp.Pax=Sb;var sce=o((r,e)=>e?Object.assign({},e,r):r,"merge"),nce=o(r=>r.replace(/\n$/,"").split(`
30
+ `).reduce(oce,Object.create(null)),"parseKV"),oce=o((r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let i=e.split("="),s=i.shift();if(!s)return r;let n=s.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),a=i.join("=");return r[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(a)*1e3):/^[0-9]+$/.test(a)?+a:a,r},"parseKVLine")});var xa=g(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.normalizeWindowsPath=void 0;var ace=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Hp.normalizeWindowsPath=ace!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var Kp=g(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.ReadEntry=void 0;var cce=ee(),Wp=xa(),wb=class extends cce.Minipass{static{o(this,"ReadEntry")}extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,Wp.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,Wp.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,s=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&(e.path=(0,Wp.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,Wp.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,s])=>!(s==null||i==="path"&&t))))}};Jp.ReadEntry=wb});var Zp=g(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.warnMethod=void 0;var lce=o((r,e,t,i={})=>{r.file&&(i.file=r.file),r.cwd&&(i.cwd=r.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!r.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),r.emit("warn",e,t,i)):t instanceof Error?r.emit("error",Object.assign(t,i)):r.emit("error",Object.assign(new Error(`${e}: ${t}`),i))},"warnMethod");Yp.warnMethod=lce});var ng=g(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.Parser=void 0;var uce=require("events"),vb=ku(),zB=Na(),GB=Gp(),hce=Kp(),fce=Zp(),dce=1024*1024,Ib=Buffer.from([31,139]),Tb=Buffer.from([40,181,47,253]),pce=Math.max(Ib.length,Tb.length),tr=Symbol("state"),Hn=Symbol("writeEntry"),Ji=Symbol("readEntry"),Eb=Symbol("nextEntry"),HB=Symbol("processEntry"),si=Symbol("extendedHeader"),Nu=Symbol("globalExtendedHeader"),Ls=Symbol("meta"),WB=Symbol("emitMeta"),ue=Symbol("buffer"),Ki=Symbol("queue"),Ms=Symbol("ended"),_b=Symbol("emittedEnd"),Wn=Symbol("emit"),Le=Symbol("unzip"),Xp=Symbol("consumeChunk"),Qp=Symbol("consumeChunkSub"),bb=Symbol("consumeBody"),JB=Symbol("consumeMeta"),KB=Symbol("consumeHeader"),xu=Symbol("consuming"),Ob=Symbol("bufferConcat"),eg=Symbol("maybeEnd"),Da=Symbol("writing"),Fs=Symbol("aborted"),tg=Symbol("onDone"),Jn=Symbol("sawValidEntry"),rg=Symbol("sawNullBlock"),ig=Symbol("sawEOF"),YB=Symbol("closeStream"),gce=o(()=>!0,"noop"),Rb=class extends uce.EventEmitter{static{o(this,"Parser")}file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Ki]=[];[ue];[Ji];[Hn];[tr]="begin";[Ls]="";[si];[Nu];[Ms]=!1;[Le];[Fs]=!1;[Jn];[rg]=!1;[ig]=!1;[Da]=!1;[xu]=!1;[_b]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(tg,()=>{(this[tr]==="begin"||this[Jn]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(tg,e.ondone):this.on(tg,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||dce,this.filter=typeof e.filter=="function"?e.filter:gce;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[YB]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){(0,fce.warnMethod)(this,e,t,i)}[KB](e,t){this[Jn]===void 0&&(this[Jn]=!1);let i;try{i=new zB.Header(e,t,this[si],this[Nu])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(i.nullBlock)this[rg]?(this[ig]=!0,this[tr]==="begin"&&(this[tr]="header"),this[Wn]("eof")):(this[rg]=!0,this[Wn]("nullBlock"));else if(this[rg]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let s=i.type;if(/^(Symbolic)?Link$/.test(s)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[Hn]=new hce.ReadEntry(i,this[si],this[Nu]);if(!this[Jn])if(n.remain){let a=o(()=>{n.invalid||(this[Jn]=!0)},"onend");n.on("end",a)}else this[Jn]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Wn]("ignoredEntry",n),this[tr]="ignore",n.resume()):n.size>0&&(this[Ls]="",n.on("data",a=>this[Ls]+=a),this[tr]="meta"):(this[si]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Wn]("ignoredEntry",n),this[tr]=n.remain?"ignore":"header",n.resume()):(n.remain?this[tr]="body":(this[tr]="header",n.end()),this[Ji]?this[Ki].push(n):(this[Ki].push(n),this[Eb]())))}}}[YB](){queueMicrotask(()=>this.emit("close"))}[HB](e){let t=!0;if(!e)this[Ji]=void 0,t=!1;else if(Array.isArray(e)){let[i,...s]=e;this.emit(i,...s)}else this[Ji]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[Eb]()),t=!1);return t}[Eb](){do;while(this[HB](this[Ki].shift()));if(!this[Ki].length){let e=this[Ji];!e||e.flowing||e.size===e.remain?this[Da]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[bb](e,t){let i=this[Hn];if(!i)throw new Error("attempt to consume body without entry??");let s=i.blockRemain??0,n=s>=e.length&&t===0?e:e.subarray(t,t+s);return i.write(n),i.blockRemain||(this[tr]="header",this[Hn]=void 0,i.end()),n.length}[JB](e,t){let i=this[Hn],s=this[bb](e,t);return!this[Hn]&&i&&this[WB](i),s}[Wn](e,t,i){!this[Ki].length&&!this[Ji]?this.emit(e,t,i):this[Ki].push([e,t,i])}[WB](e){switch(this[Wn]("meta",this[Ls]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[si]=GB.Pax.parse(this[Ls],this[si],!1);break;case"GlobalExtendedHeader":this[Nu]=GB.Pax.parse(this[Ls],this[Nu],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[si]??Object.create(null);this[si]=t,t.path=this[Ls].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[si]||Object.create(null);this[si]=t,t.linkpath=this[Ls].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Fs]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Fs])return i?.(),!1;if((this[Le]===void 0||this.brotli===void 0&&this[Le]===!1)&&e){if(this[ue]&&(e=Buffer.concat([this[ue],e]),this[ue]=void 0),e.length<pce)return this[ue]=e,i?.(),!0;for(let l=0;this[Le]===void 0&&l<Ib.length;l++)e[l]!==Ib[l]&&(this[Le]=!1);let a=!1;if(this[Le]===!1&&this.zstd!==!1){a=!0;for(let l=0;l<Tb.length;l++)if(e[l]!==Tb[l]){a=!1;break}}let c=this.brotli===void 0&&!a;if(this[Le]===!1&&c)if(e.length<512)if(this[Ms])this.brotli=!0;else return this[ue]=e,i?.(),!0;else try{new zB.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[Le]===void 0||this[Le]===!1&&(this.brotli||a)){let l=this[Ms];this[Ms]=!1,this[Le]=this[Le]===void 0?new vb.Unzip({}):a?new vb.ZstdDecompress({}):new vb.BrotliDecompress({}),this[Le].on("data",h=>this[Xp](h)),this[Le].on("error",h=>this.abort(h)),this[Le].on("end",()=>{this[Ms]=!0,this[Xp]()}),this[Da]=!0;let u=!!this[Le][l?"end":"write"](e);return this[Da]=!1,i?.(),u}}this[Da]=!0,this[Le]?this[Le].write(e):this[Xp](e),this[Da]=!1;let n=this[Ki].length?!1:this[Ji]?this[Ji].flowing:!0;return!n&&!this[Ki].length&&this[Ji]?.once("drain",()=>this.emit("drain")),i?.(),n}[Ob](e){e&&!this[Fs]&&(this[ue]=this[ue]?Buffer.concat([this[ue],e]):e)}[eg](){if(this[Ms]&&!this[_b]&&!this[Fs]&&!this[xu]){this[_b]=!0;let e=this[Hn];if(e&&e.blockRemain){let t=this[ue]?this[ue].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[ue]&&e.write(this[ue]),e.end()}this[Wn](tg)}}[Xp](e){if(this[xu]&&e)this[Ob](e);else if(!e&&!this[ue])this[eg]();else if(e){if(this[xu]=!0,this[ue]){this[Ob](e);let t=this[ue];this[ue]=void 0,this[Qp](t)}else this[Qp](e);for(;this[ue]&&this[ue]?.length>=512&&!this[Fs]&&!this[ig];){let t=this[ue];this[ue]=void 0,this[Qp](t)}this[xu]=!1}(!this[ue]||this[Ms])&&this[eg]()}[Qp](e){let t=0,i=e.length;for(;t+512<=i&&!this[Fs]&&!this[ig];)switch(this[tr]){case"begin":case"header":this[KB](e,t),t+=512;break;case"ignore":case"body":t+=this[bb](e,t);break;case"meta":t+=this[JB](e,t);break;default:throw new Error("invalid state: "+this[tr])}t<i&&(this[ue]?this[ue]=Buffer.concat([e.subarray(t),this[ue]]):this[ue]=e.subarray(t))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[Fs]||(this[Le]?(e&&this[Le].write(e),this[Le].end()):(this[Ms]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[eg]())),this}};sg.Parser=Rb});var ag=g(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.stripTrailingSlashes=void 0;var mce=o(r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)},"stripTrailingSlashes");og.stripTrailingSlashes=mce});var Ma=g(pt=>{"use strict";var yce=pt&&pt.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Sce=pt&&pt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),wce=pt&&pt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&yce(e,r,t);return Sce(e,r),e},vce=pt&&pt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pt,"__esModule",{value:!0});pt.list=pt.filesFilter=void 0;var Ece=wce(Ra()),La=vce(require("node:fs")),ZB=require("path"),_ce=Aa(),cg=ng(),Ab=ag(),bce=o(r=>{let e=r.onReadEntry;r.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},"onReadEntryFunction"),Oce=o((r,e)=>{let t=new Map(e.map(n=>[(0,Ab.stripTrailingSlashes)(n),!0])),i=r.filter,s=o((n,a="")=>{let c=a||(0,ZB.parse)(n).root||".",l;if(n===c)l=!1;else{let u=t.get(n);u!==void 0?l=u:l=s((0,ZB.dirname)(n),c)}return t.set(n,l),l},"mapHas");r.filter=i?(n,a)=>i(n,a)&&s((0,Ab.stripTrailingSlashes)(n)):n=>s((0,Ab.stripTrailingSlashes)(n))},"filesFilter");pt.filesFilter=Oce;var Ice=o(r=>{let e=new cg.Parser(r),t=r.file,i;try{i=La.default.openSync(t,"r");let s=La.default.fstatSync(i),n=r.maxReadSize||16*1024*1024;if(s.size<n){let a=Buffer.allocUnsafe(s.size);La.default.readSync(i,a,0,s.size,0),e.end(a)}else{let a=0,c=Buffer.allocUnsafe(n);for(;a<s.size;){let l=La.default.readSync(i,c,0,n,a);a+=l,e.write(c.subarray(0,l))}e.end()}}finally{if(typeof i=="number")try{La.default.closeSync(i)}catch{}}},"listFileSync"),Tce=o((r,e)=>{let t=new cg.Parser(r),i=r.maxReadSize||16*1024*1024,s=r.file;return new Promise((a,c)=>{t.on("error",c),t.on("end",a),La.default.stat(s,(l,u)=>{if(l)c(l);else{let h=new Ece.ReadStream(s,{readSize:i,size:u.size});h.on("error",c),h.pipe(t)}})})},"listFile");pt.list=(0,_ce.makeCommand)(Ice,Tce,r=>new cg.Parser(r),r=>new cg.Parser(r),(r,e)=>{e?.length&&(0,pt.filesFilter)(r,e),r.noResume||bce(r)})});var XB=g(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.modeFix=void 0;var Rce=o((r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r),"modeFix");lg.modeFix=Rce});var Cb=g(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.stripAbsolutePath=void 0;var Ace=require("node:path"),{isAbsolute:Cce,parse:QB}=Ace.win32,kce=o(r=>{let e="",t=QB(r);for(;Cce(r)||t.root;){let i=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(i.length),e+=i,t=QB(r)}return[e,r]},"stripAbsolutePath");ug.stripAbsolutePath=kce});var Pb=g(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.decode=Fa.encode=void 0;var hg=["|","<",">","?",":"],kb=hg.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Pce=new Map(hg.map((r,e)=>[r,kb[e]])),Nce=new Map(kb.map((r,e)=>[r,hg[e]])),xce=o(r=>hg.reduce((e,t)=>e.split(t).join(Pce.get(t)),r),"encode");Fa.encode=xce;var Dce=o(r=>kb.reduce((e,t)=>e.split(t).join(Nce.get(t)),r),"decode");Fa.decode=Dce});var Ub=g(it=>{"use strict";var Lce=it&&it.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Mce=it&&it.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Fce=it&&it.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Lce(e,r,t);return Mce(e,r),e},nq=it&&it.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(it,"__esModule",{value:!0});it.WriteEntryTar=it.WriteEntrySync=it.WriteEntry=void 0;var oi=nq(require("fs")),oq=ee(),eq=nq(require("path")),aq=Na(),cq=XB(),ni=xa(),lq=jp(),uq=Gp(),hq=Cb(),Bce=ag(),fq=Zp(),qce=Fce(Pb()),dq=o((r,e)=>e?(r=(0,ni.normalizeWindowsPath)(r).replace(/^\.(\/|$)/,""),(0,Bce.stripTrailingSlashes)(e)+"/"+r):(0,ni.normalizeWindowsPath)(r),"prefixPath"),jce=16*1024*1024,tq=Symbol("process"),rq=Symbol("file"),iq=Symbol("directory"),xb=Symbol("symlink"),sq=Symbol("hardlink"),Du=Symbol("header"),fg=Symbol("read"),Db=Symbol("lstat"),dg=Symbol("onlstat"),Lb=Symbol("onread"),Mb=Symbol("onreadlink"),Fb=Symbol("openfile"),Bb=Symbol("onopenfile"),Bs=Symbol("close"),pg=Symbol("mode"),qb=Symbol("awaitDrain"),Nb=Symbol("ondrain"),ai=Symbol("prefix"),gg=class extends oq.Minipass{static{o(this,"WriteEntry")}path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=(0,lq.dealias)(t);super(),this.path=(0,ni.normalizeWindowsPath)(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||jce,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=(0,ni.normalizeWindowsPath)(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?(0,ni.normalizeWindowsPath)(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let s=!1;if(!this.preservePaths){let[a,c]=(0,hq.stripAbsolutePath)(this.path);a&&typeof c=="string"&&(this.path=c,s=a)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=qce.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,ni.normalizeWindowsPath)(i.absolute||eq.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});let n=this.statCache.get(this.absolute);n?this[dg](n):this[Db]()}warn(e,t,i={}){return(0,fq.warnMethod)(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Db](){oi.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[dg](t)})}[dg](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=$ce(e),this.emit("stat",e),this[tq]()}[tq](){switch(this.type){case"File":return this[rq]();case"Directory":return this[iq]();case"SymbolicLink":return this[xb]();default:return this.end()}}[pg](e){return(0,cq.modeFix)(e,this.type==="Directory",this.portable)}[ai](e){return dq(e,this.prefix)}[Du](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new aq.Header({path:this[ai](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ai](this.linkpath):this.linkpath,mode:this[pg](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new uq.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[ai](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ai](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[iq](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Du](),this.end()}[xb](){oi.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Mb](t)})}[Mb](e){this.linkpath=(0,ni.normalizeWindowsPath)(e),this[Du](),this.end()}[sq](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,ni.normalizeWindowsPath)(eq.default.relative(this.cwd,e)),this.stat.size=0,this[Du](),this.end()}[rq](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[sq](t);this.linkCache.set(e,this.absolute)}if(this[Du](),this.stat.size===0)return this.end();this[Fb]()}[Fb](){oi.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[Bb](t)})}[Bb](e){if(this.fd=e,this.#e)return this[Bs]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[fg]()}[fg](){let{fd:e,buf:t,offset:i,length:s,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");oi.default.read(e,t,i,s,n,(a,c)=>{if(a)return this[Bs](()=>this.emit("error",a));this[Lb](c)})}[Bs](e=()=>{}){this.fd!==void 0&&oi.default.close(this.fd,e)}[Lb](e){if(e<=0&&this.remain>0){let s=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Bs](()=>this.emit("error",s))}if(e>this.remain){let s=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Bs](()=>this.emit("error",s))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let s=e;s<this.length&&e<this.blockRemain;s++)this.buf[s+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[Nb]():this[qb](()=>this[Nb]())}[qb](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let s=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",s)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[Nb](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Bs](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[fg]()}};it.WriteEntry=gg;var jb=class extends gg{static{o(this,"WriteEntrySync")}sync=!0;[Db](){this[dg](oi.default.lstatSync(this.absolute))}[xb](){this[Mb](oi.default.readlinkSync(this.absolute))}[Fb](){this[Bb](oi.default.openSync(this.absolute,"r"))}[fg](){let e=!0;try{let{fd:t,buf:i,offset:s,length:n,pos:a}=this;if(t===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let c=oi.default.readSync(t,i,s,n,a);this[Lb](c),e=!1}finally{if(e)try{this[Bs](()=>{})}catch{}}}[qb](e){e()}[Bs](e=()=>{}){this.fd!==void 0&&oi.default.closeSync(this.fd),e()}};it.WriteEntrySync=jb;var $b=class extends oq.Minipass{static{o(this,"WriteEntryTar")}blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return(0,fq.warnMethod)(this,e,t,i)}constructor(e,t={}){let i=(0,lq.dealias)(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:s}=e;if(s==="Unsupported")throw new Error("writing entry that should be ignored");this.type=s,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=(0,ni.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[pg](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,ni.normalizeWindowsPath)(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[c,l]=(0,hq.stripAbsolutePath)(this.path);c&&typeof l=="string"&&(this.path=l,n=c)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new aq.Header({path:this[ai](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ai](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new uq.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[ai](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ai](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let a=this.header?.block;if(!a)throw new Error("failed to encode header");super.write(a),e.pipe(this)}[ai](e){return dq(e,this.prefix)}[pg](e){return(0,cq.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let s=e.length;if(s>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}};it.WriteEntryTar=$b;var $ce=o(r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported","getType")});var pq=g(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.Node=qa.Yallist=void 0;var Vb=class r{static{o(this,"Yallist")}tail;head;length=0;static create(e=[]){return new r(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,i=e.length;t<i;t++)Vce(this,e[t]);return this.length}unshift(...e){for(var t=0,i=e.length;t<i;t++)zce(this,e[t]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,s=0;i;s++)e.call(t,i.value,s,this),i=i.next}forEachReverse(e,t){t=t||this;for(let i=this.tail,s=this.length-1;i;s--)e.call(t,i.value,s,this),i=i.prev}get(e){let t=0,i=this.head;for(;i&&t<e;t++)i=i.next;if(t===e&&i)return i.value}getReverse(e){let t=0,i=this.tail;for(;i&&t<e;t++)i=i.prev;if(t===e&&i)return i.value}map(e,t){t=t||this;let i=new r;for(let s=this.head;s;)i.push(e.call(t,s.value,this)),s=s.next;return i}mapReverse(e,t){t=t||this;var i=new r;for(let s=this.tail;s;)i.push(e.call(t,s.value,this)),s=s.prev;return i}reduce(e,t){let i,s=this.head;if(arguments.length>1)i=t;else if(this.head)s=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s;n++)i=e(i,s.value,n),s=s.next;return i}reduceReverse(e,t){let i,s=this.tail;if(arguments.length>1)i=t;else if(this.tail)s=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;s;n--)i=e(i,s.value,n),s=s.prev;return i}toArray(){let e=new Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new r;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let s=this.head,n=0;for(n=0;s&&n<e;n++)s=s.next;for(;s&&n<t;n++,s=s.next)i.push(s.value);return i}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new r;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let s=this.length,n=this.tail;for(;n&&s>t;s--)n=n.prev;for(;n&&s>e;s--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let s=this.head;for(let a=0;s&&a<e;a++)s=s.next;let n=[];for(let a=0;s&&a<t;a++)n.push(s.value),s=this.removeNode(s);s?s!==this.tail&&(s=s.prev):s=this.tail;for(let a of i)s=Uce(this,s,a);return n}reverse(){let e=this.head,t=this.tail;for(let i=e;i;i=i.prev){let s=i.prev;i.prev=i.next,i.next=s}return this.head=t,this.tail=e,this}};qa.Yallist=Vb;function Uce(r,e,t){let i=e,s=e?e.next:r.head,n=new Ba(t,i,s,r);return n.next===void 0&&(r.tail=n),n.prev===void 0&&(r.head=n),r.length++,n}o(Uce,"insertAfter");function Vce(r,e){r.tail=new Ba(e,r.tail,void 0,r),r.head||(r.head=r.tail),r.length++}o(Vce,"push");function zce(r,e){r.head=new Ba(e,void 0,r.head,r),r.tail||(r.tail=r.head),r.length++}o(zce,"unshift");var Ba=class{static{o(this,"Node")}list;next;prev;value;constructor(e,t,i,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};qa.Node=Ba});var bg=g(st=>{"use strict";var Gce=st&&st.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Hce=st&&st.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Wce=st&&st.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Gce(e,r,t);return Hce(e,r),e},vq=st&&st.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(st,"__esModule",{value:!0});st.PackSync=st.Pack=st.PackJob=void 0;var Eg=vq(require("fs")),Kb=Ub(),Fu=class{static{o(this,"PackJob")}path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}};st.PackJob=Fu;var Jce=ee(),zb=Wce(ku()),Kce=pq(),Yce=Kp(),Zce=Zp(),gq=Buffer.alloc(1024),mg=Symbol("onStat"),Lu=Symbol("ended"),xr=Symbol("queue"),ja=Symbol("current"),Kn=Symbol("process"),Mu=Symbol("processing"),mq=Symbol("processJob"),Dr=Symbol("jobs"),Gb=Symbol("jobDone"),yg=Symbol("addFSEntry"),yq=Symbol("addTarEntry"),Yb=Symbol("stat"),Zb=Symbol("readdir"),Sg=Symbol("onreaddir"),wg=Symbol("pipe"),Sq=Symbol("entry"),Hb=Symbol("entryOpt"),vg=Symbol("writeEntryClass"),Eq=Symbol("write"),Wb=Symbol("ondrain"),wq=vq(require("path")),Jb=xa(),_g=class extends Jce.Minipass{static{o(this,"Pack")}opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[vg];onWriteEntry;[xr];[Dr]=0;[Mu]=!1;[Lu]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,Jb.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[vg]=Kb.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new zb.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new zb.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new zb.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[Wb]()),this.on("resume",()=>t.resume())}else this.on("drain",this[Wb]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[xr]=new Kce.Yallist,this[Dr]=0,this.jobs=Number(e.jobs)||4,this[Mu]=!1,this[Lu]=!1}[Eq](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[Lu]=!0,this[Kn](),i&&i(),this}write(e){if(this[Lu])throw new Error("write after end");return e instanceof Yce.ReadEntry?this[yq](e):this[yg](e),this.flowing}[yq](e){let t=(0,Jb.normalizeWindowsPath)(wq.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Fu(e.path,t);i.entry=new Kb.WriteEntryTar(e,this[Hb](i)),i.entry.on("end",()=>this[Gb](i)),this[Dr]+=1,this[xr].push(i)}this[Kn]()}[yg](e){let t=(0,Jb.normalizeWindowsPath)(wq.default.resolve(this.cwd,e));this[xr].push(new Fu(e,t)),this[Kn]()}[Yb](e){e.pending=!0,this[Dr]+=1;let t=this.follow?"stat":"lstat";Eg.default[t](e.absolute,(i,s)=>{e.pending=!1,this[Dr]-=1,i?this.emit("error",i):this[mg](e,s)})}[mg](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Kn]()}[Zb](e){e.pending=!0,this[Dr]+=1,Eg.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[Dr]-=1,t)return this.emit("error",t);this[Sg](e,i)})}[Sg](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Kn]()}[Kn](){if(!this[Mu]){this[Mu]=!0;for(let e=this[xr].head;e&&this[Dr]<this.jobs;e=e.next)if(this[mq](e.value),e.value.ignore){let t=e.next;this[xr].removeNode(e),e.next=t}this[Mu]=!1,this[Lu]&&!this[xr].length&&this[Dr]===0&&(this.zip?this.zip.end(gq):(super.write(gq),super.end()))}}get[ja](){return this[xr]&&this[xr].head&&this[xr].head.value}[Gb](e){this[xr].shift(),this[Dr]-=1,this[Kn]()}[mq](e){if(!e.pending){if(e.entry){e===this[ja]&&!e.piped&&this[wg](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[mg](e,t):this[Yb](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[Sg](e,t):this[Zb](e),!e.readdir)return}if(e.entry=this[Sq](e),!e.entry){e.ignore=!0;return}e===this[ja]&&!e.piped&&this[wg](e)}}}[Hb](e){return{onwarn:o((t,i,s)=>this.warn(t,i,s),"onwarn"),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Sq](e){this[Dr]+=1;try{return new this[vg](e.path,this[Hb](e)).on("end",()=>this[Gb](e)).on("error",i=>this.emit("error",i))}catch(t){this.emit("error",t)}}[Wb](){this[ja]&&this[ja].entry&&this[ja].entry.resume()}[wg](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[yg](a+s)});let t=e.entry,i=this.zip;if(!t)throw new Error("cannot pipe without source");i?t.on("data",s=>{i.write(s)||t.pause()}):t.on("data",s=>{super.write(s)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){(0,Zce.warnMethod)(this,e,t,i)}};st.Pack=_g;var Xb=class extends _g{static{o(this,"PackSync")}sync=!0;constructor(e){super(e),this[vg]=Kb.WriteEntrySync}pause(){}resume(){}[Yb](e){let t=this.follow?"statSync":"lstatSync";this[mg](e,Eg.default[t](e.absolute))}[Zb](e){this[Sg](e,Eg.default.readdirSync(e.absolute))}[wg](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[yg](a+s)}),!t)throw new Error("Cannot pipe without source");i?t.on("data",s=>{i.write(s)}):t.on("data",s=>{super[Eq](s)})}};st.PackSync=Xb});var Qb=g($a=>{"use strict";var Xce=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});$a.create=void 0;var _q=Ra(),bq=Xce(require("node:path")),Oq=Ma(),Qce=Aa(),Og=bg(),ele=o((r,e)=>{let t=new Og.PackSync(r),i=new _q.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(i),Iq(t,e)},"createFileSync"),tle=o((r,e)=>{let t=new Og.Pack(r),i=new _q.WriteStream(r.file,{mode:r.mode||438});t.pipe(i);let s=new Promise((n,a)=>{i.on("error",a),i.on("close",n),t.on("error",a)});return Tq(t,e),s},"createFile"),Iq=o((r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,Oq.list)({file:bq.default.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(i=>r.add(i),"onReadEntry")}):r.add(t)}),r.end()},"addFilesSync"),Tq=o(async(r,e)=>{for(let t=0;t<e.length;t++){let i=String(e[t]);i.charAt(0)==="@"?await(0,Oq.list)({file:bq.default.resolve(String(r.cwd),i.slice(1)),noResume:!0,onReadEntry:o(s=>{r.add(s)},"onReadEntry")}):r.add(i)}r.end()},"addFilesAsync"),rle=o((r,e)=>{let t=new Og.PackSync(r);return Iq(t,e),t},"createSync"),ile=o((r,e)=>{let t=new Og.Pack(r);return Tq(t,e),t},"createAsync");$a.create=(0,Qce.makeCommand)(ele,tle,rle,ile,(r,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var Cq=g(Ua=>{"use strict";var sle=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.getWriteFlag=void 0;var Rq=sle(require("fs")),nle=process.env.__FAKE_PLATFORM__||process.platform,ole=nle==="win32",{O_CREAT:ale,O_TRUNC:cle,O_WRONLY:lle}=Rq.default.constants,Aq=Number(process.env.__FAKE_FS_O_FILENAME__)||Rq.default.constants.UV_FS_O_FILEMAP||0,ule=ole&&!!Aq,hle=512*1024,fle=Aq|cle|ale|lle;Ua.getWriteFlag=ule?r=>r<hle?fle:"w":()=>"w"});var Pq=g(ci=>{"use strict";var kq=ci&&ci.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ci,"__esModule",{value:!0});ci.chownrSync=ci.chownr=void 0;var Tg=kq(require("node:fs")),Bu=kq(require("node:path")),e0=o((r,e,t)=>{try{return Tg.default.lchownSync(r,e,t)}catch(i){if(i?.code!=="ENOENT")throw i}},"lchownSync"),Ig=o((r,e,t,i)=>{Tg.default.lchown(r,e,t,s=>{i(s&&s?.code!=="ENOENT"?s:null)})},"chown"),dle=o((r,e,t,i,s)=>{if(e.isDirectory())(0,ci.chownr)(Bu.default.resolve(r,e.name),t,i,n=>{if(n)return s(n);let a=Bu.default.resolve(r,e.name);Ig(a,t,i,s)});else{let n=Bu.default.resolve(r,e.name);Ig(n,t,i,s)}},"chownrKid"),ple=o((r,e,t,i)=>{Tg.default.readdir(r,{withFileTypes:!0},(s,n)=>{if(s){if(s.code==="ENOENT")return i();if(s.code!=="ENOTDIR"&&s.code!=="ENOTSUP")return i(s)}if(s||!n.length)return Ig(r,e,t,i);let a=n.length,c=null,l=o(u=>{if(!c){if(u)return i(c=u);if(--a===0)return Ig(r,e,t,i)}},"then");for(let u of n)dle(r,u,e,t,l)})},"chownr");ci.chownr=ple;var gle=o((r,e,t,i)=>{e.isDirectory()&&(0,ci.chownrSync)(Bu.default.resolve(r,e.name),t,i),e0(Bu.default.resolve(r,e.name),t,i)},"chownrKidSync"),mle=o((r,e,t)=>{let i;try{i=Tg.default.readdirSync(r,{withFileTypes:!0})}catch(s){let n=s;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return e0(r,e,t);throw n}for(let s of i)gle(r,s,e,t);return e0(r,e,t)},"chownrSync");ci.chownrSync=mle});var Nq=g(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.CwdError=void 0;var t0=class extends Error{static{o(this,"CwdError")}path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};Rg.CwdError=t0});var xq=g(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.SymlinkError=void 0;var r0=class extends Error{static{o(this,"SymlinkError")}path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};Ag.SymlinkError=r0});var Bq=g(qs=>{"use strict";var s0=qs&&qs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qs,"__esModule",{value:!0});qs.mkdirSync=qs.mkdir=void 0;var Dq=Pq(),jt=s0(require("node:fs")),yle=s0(require("node:fs/promises")),Cg=s0(require("node:path")),Lq=Nq(),Yi=xa(),Mq=xq(),Sle=o((r,e)=>{jt.default.stat(r,(t,i)=>{(t||!i.isDirectory())&&(t=new Lq.CwdError(r,t?.code||"ENOTDIR")),e(t)})},"checkCwd"),wle=o((r,e,t)=>{r=(0,Yi.normalizeWindowsPath)(r);let i=e.umask??18,s=e.mode|448,n=(s&i)!==0,a=e.uid,c=e.gid,l=typeof a=="number"&&typeof c=="number"&&(a!==e.processUid||c!==e.processGid),u=e.preserve,h=e.unlink,f=(0,Yi.normalizeWindowsPath)(e.cwd),d=o((y,w)=>{y?t(y):w&&l?(0,Dq.chownr)(w,a,c,S=>d(S)):n?jt.default.chmod(r,s,t):t()},"done");if(r===f)return Sle(r,d);if(u)return yle.default.mkdir(r,{mode:s,recursive:!0}).then(y=>d(null,y??void 0),d);let m=(0,Yi.normalizeWindowsPath)(Cg.default.relative(f,r)).split("/");i0(f,m,s,h,f,void 0,d)},"mkdir");qs.mkdir=wle;var i0=o((r,e,t,i,s,n,a)=>{if(!e.length)return a(null,n);let c=e.shift(),l=(0,Yi.normalizeWindowsPath)(Cg.default.resolve(r+"/"+c));jt.default.mkdir(l,t,Fq(l,e,t,i,s,n,a))},"mkdir_"),Fq=o((r,e,t,i,s,n,a)=>c=>{c?jt.default.lstat(r,(l,u)=>{if(l)l.path=l.path&&(0,Yi.normalizeWindowsPath)(l.path),a(l);else if(u.isDirectory())i0(r,e,t,i,s,n,a);else if(i)jt.default.unlink(r,h=>{if(h)return a(h);jt.default.mkdir(r,t,Fq(r,e,t,i,s,n,a))});else{if(u.isSymbolicLink())return a(new Mq.SymlinkError(r,r+"/"+e.join("/")));a(c)}}):(n=n||r,i0(r,e,t,i,s,n,a))},"onmkdir"),vle=o(r=>{let e=!1,t;try{e=jt.default.statSync(r).isDirectory()}catch(i){t=i?.code}finally{if(!e)throw new Lq.CwdError(r,t??"ENOTDIR")}},"checkCwdSync"),Ele=o((r,e)=>{r=(0,Yi.normalizeWindowsPath)(r);let t=e.umask??18,i=e.mode|448,s=(i&t)!==0,n=e.uid,a=e.gid,c=typeof n=="number"&&typeof a=="number"&&(n!==e.processUid||a!==e.processGid),l=e.preserve,u=e.unlink,h=(0,Yi.normalizeWindowsPath)(e.cwd),f=o(y=>{y&&c&&(0,Dq.chownrSync)(y,n,a),s&&jt.default.chmodSync(r,i)},"done");if(r===h)return vle(h),f();if(l)return f(jt.default.mkdirSync(r,{mode:i,recursive:!0})??void 0);let p=(0,Yi.normalizeWindowsPath)(Cg.default.relative(h,r)).split("/"),m;for(let y=p.shift(),w=h;y&&(w+="/"+y);y=p.shift()){w=(0,Yi.normalizeWindowsPath)(Cg.default.resolve(w));try{jt.default.mkdirSync(w,i),m=m||w}catch{let v=jt.default.lstatSync(w);if(v.isDirectory())continue;if(u){jt.default.unlinkSync(w),jt.default.mkdirSync(w,i),m=m||w;continue}else if(v.isSymbolicLink())return new Mq.SymlinkError(w,w+"/"+p.join("/"))}}return f(m)},"mkdirSync");qs.mkdirSync=Ele});var jq=g(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.normalizeUnicode=void 0;var n0=Object.create(null),qq=1e4,Va=new Set,_le=o(r=>{Va.has(r)?Va.delete(r):n0[r]=r.normalize("NFD"),Va.add(r);let e=n0[r],t=Va.size-qq;if(t>qq/10){for(let i of Va)if(Va.delete(i),delete n0[i],--t<=0)break}return e},"normalizeUnicode");kg.normalizeUnicode=_le});var Uq=g(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.PathReservations=void 0;var $q=require("node:path"),ble=jq(),Ole=ag(),Ile=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tle=Ile==="win32",Rle=o(r=>r.split("/").slice(0,-1).reduce((t,i)=>{let s=t[t.length-1];return s!==void 0&&(i=(0,$q.join)(s,i)),t.push(i||"/"),t},[]),"getDirs"),o0=class{static{o(this,"PathReservations")}#e=new Map;#t=new Map;#r=new Set;reserve(e,t){e=Tle?["win32 parallelization disabled"]:e.map(s=>(0,Ole.stripTrailingSlashes)((0,$q.join)((0,ble.normalizeUnicode)(s))).toLowerCase());let i=new Set(e.map(s=>Rle(s)).reduce((s,n)=>s.concat(n)));this.#t.set(t,{dirs:i,paths:e});for(let s of e){let n=this.#e.get(s);n?n.push(t):this.#e.set(s,[t])}for(let s of i){let n=this.#e.get(s);if(!n)this.#e.set(s,[new Set([t])]);else{let a=n[n.length-1];a instanceof Set?a.add(t):n.push(new Set([t]))}}return this.#s(t)}#i(e){let t=this.#t.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#i(e);return t.every(s=>s&&s[0]===e)&&i.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#s(e){return this.#r.has(e)||!this.check(e)?!1:(this.#r.add(e),e(()=>this.#o(e)),!0)}#o(e){if(!this.#r.has(e))return!1;let t=this.#t.get(e);if(!t)throw new Error("invalid reservation");let{paths:i,dirs:s}=t,n=new Set;for(let a of i){let c=this.#e.get(a);if(!c||c?.[0]!==e)continue;let l=c[1];if(!l){this.#e.delete(a);continue}if(c.shift(),typeof l=="function")n.add(l);else for(let u of l)n.add(u)}for(let a of s){let c=this.#e.get(a),l=c?.[0];if(!(!c||!(l instanceof Set)))if(l.size===1&&c.length===1){this.#e.delete(a);continue}else if(l.size===1){c.shift();let u=c[0];typeof u=="function"&&n.add(u)}else l.delete(e)}return this.#r.delete(e),n.forEach(a=>this.#s(a)),!0}};Pg.PathReservations=o0});var m0=g(bt=>{"use strict";var Ale=bt&&bt.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Cle=bt&&bt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Xq=bt&&bt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Ale(e,r,t);return Cle(e,r),e},g0=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bt,"__esModule",{value:!0});bt.UnpackSync=bt.Unpack=void 0;var kle=Xq(Ra()),Ple=g0(require("node:assert")),Qq=require("node:crypto"),Y=g0(require("node:fs")),Zi=g0(require("node:path")),ej=Cq(),tj=Bq(),Lr=xa(),Nle=ng(),xle=Cb(),Vq=Xq(Pb()),Dle=Uq(),zq=Symbol("onEntry"),l0=Symbol("checkFs"),Gq=Symbol("checkFs2"),u0=Symbol("isReusable"),rr=Symbol("makeFs"),h0=Symbol("file"),f0=Symbol("directory"),Dg=Symbol("link"),Hq=Symbol("symlink"),Wq=Symbol("hardlink"),Jq=Symbol("unsupported"),Kq=Symbol("checkPath"),js=Symbol("mkdir"),nt=Symbol("onError"),Ng=Symbol("pending"),Yq=Symbol("pend"),za=Symbol("unpend"),a0=Symbol("ended"),c0=Symbol("maybeClose"),d0=Symbol("skip"),qu=Symbol("doChown"),ju=Symbol("uid"),$u=Symbol("gid"),Uu=Symbol("checkedCwd"),Lle=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Vu=Lle==="win32",Mle=1024,Fle=o((r,e)=>{if(!Vu)return Y.default.unlink(r,e);let t=r+".DELETE."+(0,Qq.randomBytes)(16).toString("hex");Y.default.rename(r,t,i=>{if(i)return e(i);Y.default.unlink(t,e)})},"unlinkFile"),Ble=o(r=>{if(!Vu)return Y.default.unlinkSync(r);let e=r+".DELETE."+(0,Qq.randomBytes)(16).toString("hex");Y.default.renameSync(r,e),Y.default.unlinkSync(e)},"unlinkFileSync"),Zq=o((r,e,t)=>r!==void 0&&r===r>>>0?r:e!==void 0&&e===e>>>0?e:t,"uint32"),Lg=class extends Nle.Parser{static{o(this,"Unpack")}[a0]=!1;[Uu]=!1;[Ng]=0;reservations=new Dle.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[a0]=!0,this[c0]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:Mle,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Vu,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,Lr.normalizeWindowsPath)(Zi.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:process.umask():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[zq](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[c0](){this[a0]&&this[Ng]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Kq](e){let t=(0,Lr.normalizeWindowsPath)(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let s=(0,Lr.normalizeWindowsPath)(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(i.includes("..")||Vu&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[s,n]=(0,xle.stripAbsolutePath)(t);s&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:e,path:t}))}if(Zi.default.isAbsolute(e.path)?e.absolute=(0,Lr.normalizeWindowsPath)(Zi.default.resolve(e.path)):e.absolute=(0,Lr.normalizeWindowsPath)(Zi.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,Lr.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:s}=Zi.default.win32.parse(String(e.absolute));e.absolute=s+Vq.encode(String(e.absolute).slice(s.length));let{root:n}=Zi.default.win32.parse(e.path);e.path=n+Vq.encode(e.path.slice(n.length))}return!0}[zq](e){if(!this[Kq](e))return e.resume();switch(Ple.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[l0](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Jq](e)}}[nt](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[za](),t.resume())}[js](e,t,i){(0,tj.mkdir)((0,Lr.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},i)}[qu](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[ju](e){return Zq(this.uid,e.uid,this.processUid)}[$u](e){return Zq(this.gid,e.gid,this.processGid)}[h0](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new kle.WriteStream(String(e.absolute),{flags:(0,ej.getWriteFlag)(e.size),mode:i,autoClose:!1});s.on("error",l=>{s.fd&&Y.default.close(s.fd,()=>{}),s.write=()=>!0,this[nt](l,e),t()});let n=1,a=o(l=>{if(l){s.fd&&Y.default.close(s.fd,()=>{}),this[nt](l,e),t();return}--n===0&&s.fd!==void 0&&Y.default.close(s.fd,u=>{u?this[nt](u,e):this[za](),t()})},"done");s.on("finish",()=>{let l=String(e.absolute),u=s.fd;if(typeof u=="number"&&e.mtime&&!this.noMtime){n++;let h=e.atime||new Date,f=e.mtime;Y.default.futimes(u,h,f,d=>d?Y.default.utimes(l,h,f,p=>a(p&&d)):a())}if(typeof u=="number"&&this[qu](e)){n++;let h=this[ju](e),f=this[$u](e);typeof h=="number"&&typeof f=="number"&&Y.default.fchown(u,h,f,d=>d?Y.default.chown(l,h,f,p=>a(p&&d)):a())}a()});let c=this.transform&&this.transform(e)||e;c!==e&&(c.on("error",l=>{this[nt](l,e),t()}),e.pipe(c)),c.pipe(s)}[f0](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[js](String(e.absolute),i,s=>{if(s){this[nt](s,e),t();return}let n=1,a=o(()=>{--n===0&&(t(),this[za](),e.resume())},"done");e.mtime&&!this.noMtime&&(n++,Y.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,a)),this[qu](e)&&(n++,Y.default.chown(String(e.absolute),Number(this[ju](e)),Number(this[$u](e)),a)),a()})}[Jq](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Hq](e,t){this[Dg](e,String(e.linkpath),"symlink",t)}[Wq](e,t){let i=(0,Lr.normalizeWindowsPath)(Zi.default.resolve(this.cwd,String(e.linkpath)));this[Dg](e,i,"link",t)}[Yq](){this[Ng]++}[za](){this[Ng]--,this[c0]()}[d0](e){this[za](),e.resume()}[u0](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Vu}[l0](e){this[Yq]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[Gq](e,i))}[Gq](e,t){let i=o(c=>{t(c)},"done"),s=o(()=>{this[js](this.cwd,this.dmode,c=>{if(c){this[nt](c,e),i();return}this[Uu]=!0,n()})},"checkCwd"),n=o(()=>{if(e.absolute!==this.cwd){let c=(0,Lr.normalizeWindowsPath)(Zi.default.dirname(String(e.absolute)));if(c!==this.cwd)return this[js](c,this.dmode,l=>{if(l){this[nt](l,e),i();return}a()})}a()},"start"),a=o(()=>{Y.default.lstat(String(e.absolute),(c,l)=>{if(l&&(this.keep||this.newer&&l.mtime>(e.mtime??l.mtime))){this[d0](e),i();return}if(c||this[u0](e,l))return this[rr](null,e,i);if(l.isDirectory()){if(e.type==="Directory"){let u=this.chmod&&e.mode&&(l.mode&4095)!==e.mode,h=o(f=>this[rr](f??null,e,i),"afterChmod");return u?Y.default.chmod(String(e.absolute),Number(e.mode),h):h()}if(e.absolute!==this.cwd)return Y.default.rmdir(String(e.absolute),u=>this[rr](u??null,e,i))}if(e.absolute===this.cwd)return this[rr](null,e,i);Fle(String(e.absolute),u=>this[rr](u??null,e,i))})},"afterMakeParent");this[Uu]?n():s()}[rr](e,t,i){if(e){this[nt](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[h0](t,i);case"Link":return this[Wq](t,i);case"SymbolicLink":return this[Hq](t,i);case"Directory":case"GNUDumpDir":return this[f0](t,i)}}[Dg](e,t,i,s){Y.default[i](t,String(e.absolute),n=>{n?this[nt](n,e):(this[za](),e.resume()),s()})}};bt.Unpack=Lg;var xg=o(r=>{try{return[null,r()]}catch(e){return[e,null]}},"callSync"),p0=class extends Lg{static{o(this,"UnpackSync")}sync=!0;[rr](e,t){return super[rr](e,t,()=>{})}[l0](e){if(!this[Uu]){let n=this[js](this.cwd,this.dmode);if(n)return this[nt](n,e);this[Uu]=!0}if(e.absolute!==this.cwd){let n=(0,Lr.normalizeWindowsPath)(Zi.default.dirname(String(e.absolute)));if(n!==this.cwd){let a=this[js](n,this.dmode);if(a)return this[nt](a,e)}}let[t,i]=xg(()=>Y.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[d0](e);if(t||this[u0](e,i))return this[rr](null,e);if(i.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[c]=a?xg(()=>{Y.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[rr](c,e)}let[n]=xg(()=>Y.default.rmdirSync(String(e.absolute)));this[rr](n,e)}let[s]=e.absolute===this.cwd?[]:xg(()=>Ble(String(e.absolute)));this[rr](s,e)}[h0](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,s=o(c=>{let l;try{Y.default.closeSync(n)}catch(u){l=u}(c||l)&&this[nt](c||l,e),t()},"oner"),n;try{n=Y.default.openSync(String(e.absolute),(0,ej.getWriteFlag)(e.size),i)}catch(c){return s(c)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",c=>this[nt](c,e)),e.pipe(a)),a.on("data",c=>{try{Y.default.writeSync(n,c,0,c.length)}catch(l){s(l)}}),a.on("end",()=>{let c=null;if(e.mtime&&!this.noMtime){let l=e.atime||new Date,u=e.mtime;try{Y.default.futimesSync(n,l,u)}catch(h){try{Y.default.utimesSync(String(e.absolute),l,u)}catch{c=h}}}if(this[qu](e)){let l=this[ju](e),u=this[$u](e);try{Y.default.fchownSync(n,Number(l),Number(u))}catch(h){try{Y.default.chownSync(String(e.absolute),Number(l),Number(u))}catch{c=c||h}}}s(c)})}[f0](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[js](String(e.absolute),i);if(s){this[nt](s,e),t();return}if(e.mtime&&!this.noMtime)try{Y.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[qu](e))try{Y.default.chownSync(String(e.absolute),Number(this[ju](e)),Number(this[$u](e)))}catch{}t(),e.resume()}[js](e,t){try{return(0,tj.mkdirSync)((0,Lr.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(i){return i}}[Dg](e,t,i,s){let n=`${i}Sync`;try{Y.default[n](t,String(e.absolute)),s(),e.resume()}catch(a){return this[nt](a,e)}}};bt.UnpackSync=p0});var y0=g(ir=>{"use strict";var qle=ir&&ir.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),jle=ir&&ir.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),$le=ir&&ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&qle(e,r,t);return jle(e,r),e},Ule=ir&&ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ir,"__esModule",{value:!0});ir.extract=void 0;var rj=$le(Ra()),ij=Ule(require("node:fs")),Vle=Ma(),zle=Aa(),Mg=m0(),Gle=o(r=>{let e=new Mg.UnpackSync(r),t=r.file,i=ij.default.statSync(t),s=r.maxReadSize||16*1024*1024;new rj.ReadStreamSync(t,{readSize:s,size:i.size}).pipe(e)},"extractFileSync"),Hle=o((r,e)=>{let t=new Mg.Unpack(r),i=r.maxReadSize||16*1024*1024,s=r.file;return new Promise((a,c)=>{t.on("error",c),t.on("close",a),ij.default.stat(s,(l,u)=>{if(l)c(l);else{let h=new rj.ReadStream(s,{readSize:i,size:u.size});h.on("error",c),h.pipe(t)}})})},"extractFile");ir.extract=(0,zle.makeCommand)(Gle,Hle,r=>new Mg.UnpackSync(r),r=>new Mg.Unpack(r),(r,e)=>{e?.length&&(0,Vle.filesFilter)(r,e)})});var Fg=g(Ga=>{"use strict";var sj=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.replace=void 0;var nj=Ra(),$t=sj(require("node:fs")),oj=sj(require("node:path")),aj=Na(),cj=Ma(),Wle=Aa(),Jle=jp(),lj=bg(),Kle=o((r,e)=>{let t=new lj.PackSync(r),i=!0,s,n;try{try{s=$t.default.openSync(r.file,"r+")}catch(l){if(l?.code==="ENOENT")s=$t.default.openSync(r.file,"w+");else throw l}let a=$t.default.fstatSync(s),c=Buffer.alloc(512);e:for(n=0;n<a.size;n+=512){for(let h=0,f=0;h<512;h+=f){if(f=$t.default.readSync(s,c,h,c.length-h,n+h),n===0&&c[0]===31&&c[1]===139)throw new Error("cannot append to compressed archives");if(!f)break e}let l=new aj.Header(c);if(!l.cksumValid)break;let u=512*Math.ceil((l.size||0)/512);if(n+u+512>a.size)break;n+=u,r.mtimeCache&&l.mtime&&r.mtimeCache.set(String(l.path),l.mtime)}i=!1,Yle(r,t,n,s,e)}finally{if(i)try{$t.default.closeSync(s)}catch{}}},"replaceSync"),Yle=o((r,e,t,i,s)=>{let n=new nj.WriteStreamSync(r.file,{fd:i,start:t});e.pipe(n),Xle(e,s)},"streamSync"),Zle=o((r,e)=>{e=Array.from(e);let t=new lj.Pack(r),i=o((n,a,c)=>{let l=o((p,m)=>{p?$t.default.close(n,y=>c(p)):c(null,m)},"cb"),u=0;if(a===0)return l(null,0);let h=0,f=Buffer.alloc(512),d=o((p,m)=>{if(p||typeof m>"u")return l(p);if(h+=m,h<512&&m)return $t.default.read(n,f,h,f.length-h,u+h,d);if(u===0&&f[0]===31&&f[1]===139)return l(new Error("cannot append to compressed archives"));if(h<512)return l(null,u);let y=new aj.Header(f);if(!y.cksumValid)return l(null,u);let w=512*Math.ceil((y.size??0)/512);if(u+w+512>a||(u+=w+512,u>=a))return l(null,u);r.mtimeCache&&y.mtime&&r.mtimeCache.set(String(y.path),y.mtime),h=0,$t.default.read(n,f,0,512,u,d)},"onread");$t.default.read(n,f,0,512,u,d)},"getPos");return new Promise((n,a)=>{t.on("error",a);let c="r+",l=o((u,h)=>{if(u&&u.code==="ENOENT"&&c==="r+")return c="w+",$t.default.open(r.file,c,l);if(u||!h)return a(u);$t.default.fstat(h,(f,d)=>{if(f)return $t.default.close(h,()=>a(f));i(h,d.size,(p,m)=>{if(p)return a(p);let y=new nj.WriteStream(r.file,{fd:h,start:m});t.pipe(y),y.on("error",a),y.on("close",n),Qle(t,e)})})},"onopen");$t.default.open(r.file,c,l)})},"replaceAsync"),Xle=o((r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,cj.list)({file:oj.default.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(i=>r.add(i),"onReadEntry")}):r.add(t)}),r.end()},"addFilesSync"),Qle=o(async(r,e)=>{for(let t=0;t<e.length;t++){let i=String(e[t]);i.charAt(0)==="@"?await(0,cj.list)({file:oj.default.resolve(String(r.cwd),i.slice(1)),noResume:!0,onReadEntry:o(s=>r.add(s),"onReadEntry")}):r.add(i)}r.end()},"addFilesAsync");Ga.replace=(0,Wle.makeCommand)(Kle,Zle,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(r,e)=>{if(!(0,Jle.isFile)(r))throw new TypeError("file is required");if(r.gzip||r.brotli||r.zstd||r.file.endsWith(".br")||r.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var S0=g(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.update=void 0;var eue=Aa(),zu=Fg();Bg.update=(0,eue.makeCommand)(zu.replace.syncFile,zu.replace.asyncFile,zu.replace.syncNoFile,zu.replace.asyncNoFile,(r,e=[])=>{zu.replace.validate?.(r,e),tue(r)});var tue=o(r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,i)=>e(t,i)&&!((r.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0)):(t,i)=>!((r.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))},"mtimeFilter")});var Gu=g(J=>{"use strict";var uj=J&&J.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),rue=J&&J.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),sr=J&&J.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&uj(e,r,t)},iue=J&&J.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&uj(e,r,t);return rue(e,r),e};Object.defineProperty(J,"__esModule",{value:!0});J.u=J.types=J.r=J.t=J.x=J.c=void 0;sr(Qb(),J);var sue=Qb();Object.defineProperty(J,"c",{enumerable:!0,get:o(function(){return sue.create},"get")});sr(y0(),J);var nue=y0();Object.defineProperty(J,"x",{enumerable:!0,get:o(function(){return nue.extract},"get")});sr(Na(),J);sr(Ma(),J);var oue=Ma();Object.defineProperty(J,"t",{enumerable:!0,get:o(function(){return oue.list},"get")});sr(bg(),J);sr(ng(),J);sr(Gp(),J);sr(Kp(),J);sr(Fg(),J);var aue=Fg();Object.defineProperty(J,"r",{enumerable:!0,get:o(function(){return aue.replace},"get")});J.types=iue(pb());sr(m0(),J);sr(S0(),J);var cue=S0();Object.defineProperty(J,"u",{enumerable:!0,get:o(function(){return cue.update},"get")});sr(Ub(),J)});var Yn=g((R2e,hj)=>{hj.exports={cacheFetches:Symbol.for("pacote.Fetcher._cacheFetches"),readPackageJson:Symbol.for("package.Fetcher._readPackageJson"),tarballFromResolved:Symbol.for("pacote.Fetcher._tarballFromResolved")}});var dj=g((A2e,fj)=>{var{resolve:w0}=require("node:path"),{tmpdir:lue,homedir:uue}=require("node:os");fj.exports=(r=!1)=>{let e=lue(),t=process.getuid?process.getuid():process.pid,i=uue()||w0(e,"npm-"+t),s=r||process.platform,n=s==="win32"?"npm-cache":".npm",a=s==="win32"&&process.env.LOCALAPPDATA||i;return{cacache:w0(a,n,"_cacache"),tufcache:w0(a,n,"_tuf")}}});var v0=g((C2e,pj)=>{var hue=o((r,e)=>typeof e=="string"?{[r]:e}:e,"binObj"),fue=o((r,e)=>{let t=hue(r.name,r.bin),i=e.replace(/^[^\\/]*\//,"");for(let s of Object.entries(t))if(s[1]===i)return!0;return!1},"hasBin");pj.exports=(r,e)=>r&&r.bin?fue(r,e):!1});var E0=g((P2e,gj)=>{var due=o(r=>{let e=r;for(;e.endsWith("/");)e=e.slice(0,-1);return e},"removeTrailingSlashes");gj.exports=due});var I0=g((x2e,mj)=>{var Hu=class extends Error{static{o(this,"GitError")}shouldRetry(){return!1}},_0=class extends Hu{static{o(this,"GitConnectionError")}constructor(){super("A git connection error occurred")}shouldRetry(e){return e<3}},b0=class extends Hu{static{o(this,"GitPathspecError")}constructor(){super("The git reference could not be found")}},O0=class extends Hu{static{o(this,"GitUnknownError")}constructor(){super("An unknown git error occurred")}};mj.exports={GitConnectionError:_0,GitPathspecError:b0,GitUnknownError:O0}});var Sj=g((L2e,yj)=>{var{GitConnectionError:pue,GitPathspecError:gue,GitUnknownError:mue}=I0(),yue=new RegExp(["remote error: Internal Server Error","The remote end hung up unexpectedly","Connection timed out","Operation timed out","Failed to connect to .* Timed out","Connection reset by peer","SSL_ERROR_SYSCALL","The requested URL returned error: 503"].join("|")),Sue=/pathspec .* did not match any file\(s\) known to git/;function wue(r){let e=r.stderr,t;return yue.test(e)?t=new pue(e):Sue.test(e)?t=new gue(e):t=new mue(e),Object.assign(t,r)}o(wue,"makeError");yj.exports=wue});var _j=g((F2e,T0)=>{var wj=require("node:fs"),vue=require("node:os"),Eue=require("node:path"),_ue=Jv(),vj=Eue.join(vue.homedir(),".gitconfig"),Wu=null,Ej=o(()=>{if(Wu===null)try{if(Wu={},wj.existsSync(vj)){let r=wj.readFileSync(vj,"utf-8");Wu=_ue.parse(r)}}catch{Wu={}}return Wu},"loadGitConfig"),bue=o(()=>{let r=Ej();return{sshCommandSetInConfig:r?.core?.sshCommand!==void 0,askPassSetInConfig:r?.core?.askpass!==void 0}},"checkGitConfigs"),Oue=process.env.GIT_SSH_COMMAND!==void 0,Iue=process.env.GIT_ASKPASS!==void 0,{sshCommandSetInConfig:Tue,askPassSetInConfig:Rue}=bue(),Aue={...Iue||Rue?{}:{GIT_ASKPASS:"echo"},...Oue||Tue?{}:{GIT_SSH_COMMAND:"ssh -oStrictHostKeyChecking=accept-new"}};T0.exports=(r={})=>({stdioString:!0,...r,shell:!1,env:r.env||{...Aue,...process.env}});T0.exports.loadGitConfig=Ej});var Oj=g((q2e,bj)=>{var Cue=Bd(),R0;try{R0=Cue.sync("git")}catch{}bj.exports=(r={})=>r.git?r.git:!R0||r.git===!1?Object.assign(new Error("No git binary found in $PATH"),{code:"ENOGIT"}):R0});var Ju=g((j2e,Ij)=>{var kue=Qo(),Pue=Cn(),{log:Nue}=se(),xue=Sj(),Due=_j();Ij.exports=(r,e={})=>{let i=Oj()(e);if(i instanceof Error)return Promise.reject(i);let s=e.allowReplace||r[0]==="--no-replace-objects"?r:["--no-replace-objects",...r],n=e.retry;return n==null&&(n={retries:e.fetchRetries||2,factor:e.fetchRetryFactor||10,maxTimeout:e.fetchRetryMaxtimeout||6e4,minTimeout:e.fetchRetryMintimeout||1e3}),Pue((a,c)=>(c!==1&&Nue.silly("git",`Retrying git command: ${s.join(" ")} attempt # ${c}`),kue(i,s,Due(e)).catch(l=>{let u=xue(l);if(!u.shouldRetry(c))throw u;a(u)})),n)}});var Aj=g(($2e,Rj)=>{var Tj=$e();Rj.exports=r=>Lue(r.reduce($ue,{versions:{},"dist-tags":{},refs:{},shas:{}}));var Lue=o(r=>Bue(Mue(Fue(r))),"finish"),Mue=o(r=>(Object.keys(r.refs).forEach(e=>{let t=r.refs[e];r.shas[t.sha]?r.shas[t.sha].push(e):r.shas[t.sha]=[e]}),r),"shaList"),Fue=o(r=>(Object.keys(r.refs).filter(e=>e.endsWith("^{}")).forEach(e=>{let t=r.refs[e],i=r.refs[e.replace(/\^\{\}$/,"")];i&&(i.sha=t.sha,delete r.refs[e])}),r),"peelTags"),Bue=o(r=>{let e=r.refs.HEAD||{};return Object.keys(r.versions).forEach(i=>{let s=r.versions[i];r.refs.latest&&s.sha===r.refs.latest.sha?r["dist-tags"].latest=i:s.sha===e.sha&&(r["dist-tags"].HEAD=i,r.refs.latest||(r["dist-tags"].latest=i))}),r},"distTags"),que=o(r=>r.startsWith("refs/tags/")?"tag":r.startsWith("refs/heads/")?"branch":r.startsWith("refs/pull/")?"pull":r==="HEAD"?"head":"other","refType"),jue=o(r=>{let e=r.trim().split(/\s+/,2);if(e.length<2)return null;let t=e[0].trim(),i=e[1].trim(),s=que(i);if(s==="tag"){let n=i.slice(10);return{sha:t,ref:n,rawRef:i,type:s}}if(s==="branch"){let n=i.slice(11);return{sha:t,ref:n,rawRef:i,type:s}}if(s==="pull"){let n=i.slice(5).replace(/\/head$/,"");return{sha:t,ref:n,rawRef:i,type:s}}return s==="head"?{sha:t,ref:"HEAD",rawRef:i,type:s}:{sha:t,ref:i,rawRef:i,type:s}},"lineToRevDoc"),$ue=o((r,e)=>{let t=jue(e);if(!t)return r;if(r.refs[t.ref]=t,r.refs[t.rawRef]=t,t.type==="tag"){let i=!t.ref.endsWith("^{}")&&t.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);i&&Tj.valid(i[1],!0)&&(r.versions[Tj.clean(i[1],!0)]=t)}return r},"linesToRevsReducer")});var A0=g((V2e,kj)=>{var Uue=Ju(),{LRUCache:Vue}=Pi(),zue=Aj(),Cj=new Vue({max:100,ttl:300*1e3});kj.exports=async(r,e={})=>{if(!e.noGitRevCache){let s=Cj.get(r);if(s)return s}let{stdout:t}=await Uue(["ls-remote",r],e),i=zue(t.trim().split(`
31
+ `));return Cj.set(r,i),i}});var Nj=g(Pj=>{var Gue=o(r=>(r.fakePlatform||process.platform)==="win32","isWindows");Pj.isWindows=Gue});var Zu=g((H2e,Dj)=>{"use strict";var xj=ye(),Ku=$e(),{checkEngine:Hue}=Zd(),Wue=Pn(),C0=o((r,e,t)=>{try{return Hue(r,e,t),!0}catch{return!1}},"engineOk"),qg=o((r,e,t)=>!r||!r[e]||Date.parse(r[e])<=t,"isBefore"),Jue={includePrerelease:!0,loose:!0},jg=o((r,e)=>e&&Ku.satisfies(r,e,Jue),"shouldAvoid"),k0=o((r,e)=>r&&jg(r.version,e)?{...r,_shouldAvoid:!0}:r,"decorateAvoid"),Yu=o((r,e,t)=>{let{defaultTag:i="latest",before:s=null,nodeVersion:n=process.version,npmVersion:a=null,includeStaged:c=!1,avoid:l=null,avoidStrict:u=!1}=t,{name:h,time:f}=r,d=r.versions||{};if(u){let I={...t,avoidStrict:!1},L=Yu(r,e,I);if(!L||!L._shouldAvoid)return L;let F=Yu(r,`^${L.version}`,I);if(!F||!F._shouldAvoid)return{...F,_outsideDependencyRange:!0,_isSemVerMajor:!1};let X=Yu(r,"*",I);if(!X||!X._shouldAvoid)return{...X,_outsideDependencyRange:!0,_isSemVerMajor:!0};throw Object.assign(new Error(`No avoidable versions for ${h}`),{code:"ETARGET",name:h,wanted:e,avoid:l,before:s,versions:Object.keys(d)})}let p=c&&r.stagedVersions&&r.stagedVersions.versions||{},m=r.policyRestrictions&&r.policyRestrictions.versions||{},y=s&&f?+new Date(s):1/0,S=xj.resolve(h,e||i).type,v=r["dist-tags"]||{};if(S!=="tag"&&S!=="version"&&S!=="range")throw new Error("Only tag, version, and range are supported");if(e&&S==="tag"){let I=v[e];return qg(f,I,y)?k0(d[I]||p[I]||m[I],l):Yu(r,`<=${I}`,t)}if(e&&S==="version"){let I=Ku.clean(e,{loose:!0}),L=d[I]||p[I]||m[I];return qg(f,I,y)?k0(L,l):null}let _=S==="range"?e:"*",E=v[i];if(E&&(_==="*"||Ku.satisfies(E,_,{loose:!0}))&&!m[E]&&!jg(E,l)){let I=d[E];if(I&&qg(f,E,y)&&C0(I,a,n)&&!I.deprecated&&!p[E])return I}let b=Object.entries(d).concat(Object.entries(p)).concat(Object.entries(m)).filter(([I])=>qg(f,I,y));if(!b.length)throw Object.assign(new Error(`No versions available for ${h}`),{code:"ENOVERSIONS",name:h,type:S,wanted:e,before:s,versions:Object.keys(d)});let O={loose:!0},T=b.filter(([I])=>Ku.satisfies(I,_,{loose:!0})).sort((I,L)=>{let[F,X]=I,[Ce,Wt]=L,Ie=!jg(F,l),ki=!jg(Ce,l),Uo=!m[F],Vo=!m[Ce],zo=!p[F],Go=!p[Ce],ds=!X.deprecated,ps=!Wt.deprecated,gs=C0(X,a,n),ms=C0(Wt,a,n);return ki-Ie||Vo-Uo||Go-zo||(ps&&ms)-(ds&&gs)||ms-gs||ps-ds||Ku.rcompare(F,Ce,O)});return k0(T[0]&&T[0][1],l)},"pickManifest");Dj.exports=(r,e,t={})=>{let i=Yu(r,e,t),s=i&&Wue(i),n=r.policyRestrictions,a=n&&n.versions||{};if(s&&!a[s.version])return s;let{before:c=null,defaultTag:l="latest"}=t,u=c?new Date(c).toLocaleString():"",{name:h}=r,f=`${h}@${e}`+(c?` with a date before ${u}`:""),d=s&&!!a[s.version],p=d?n.message:"",m=d?`Could not download ${f} due to policy violations:
32
+ ${p}`:`No matching version found for ${f}.`,y=d?"E403":"ETARGET";throw Object.assign(new Error(m),{code:y,type:xj.resolve(r.name,e).type,wanted:e,versions:Object.keys(r.versions??{}),name:h,distTags:r["dist-tags"],defaultTag:l})}});var Bj=g((J2e,Fj)=>{var Kue=new Set(["github.com","gist.github.com","gitlab.com","bitbucket.com","bitbucket.org"]),{parse:Yue}=require("url"),Lj=require("path"),Zue=A0(),Xu=Ju(),{isWindows:$g}=Nj(),Xue=Zu(),P0=require("fs/promises");Fj.exports=(r,e="HEAD",t=null,i={})=>Zue(r,i).then(s=>ehe(r,s,e,the(s,e,i),t||Que(r,i.cwd),i));var N0=o((r,e)=>e.gitShallow===!1||e.gitShallow?e.gitShallow:Kue.has(Yue(r).host),"maybeShallow"),Que=o((r,e=process.cwd())=>Lj.resolve(e,Lj.basename(r.replace(/[/\\]?\.git$/,""))),"defaultTarget"),ehe=o((r,e,t,i,s,n)=>i?i.sha===e.refs.HEAD.sha?she(r,i,s,n):i.type==="tag"||i.type==="branch"?ihe(r,i,s,n):rhe(r,i,s,n):nhe(r,t,s,n),"clone"),the=o((r,e,t)=>{let{spec:i={}}=t;return e=i.gitCommittish||e,r?i.gitRange?Xue(r,i.gitRange,t):e?r.refs[e]?r.refs[e]:r.shas[e]?r.refs[r.shas[e][0]]:null:r.refs.HEAD:null},"resolveRef"),rhe=o((r,e,t,i)=>{let s=N0(r,i),n=["fetch","origin",e.rawRef].concat(s?["--depth=1"]:[]),a=o(c=>Xu(c,{...i,cwd:t}),"git");return P0.mkdir(t,{recursive:!0}).then(()=>a(["init"])).then(()=>$g(i)?a(["config","--local","--add","core.longpaths","true"]):null).then(()=>a(["remote","add","origin",r])).then(()=>a(n)).then(()=>a(["checkout",e.sha])).then(()=>Mj(t,i)).then(()=>e.sha)},"other"),ihe=o((r,e,t,i)=>{let s=["clone","-b",e.ref,r,t,"--recurse-submodules"];return N0(r,i)&&s.push("--depth=1"),$g(i)&&s.push("--config","core.longpaths=true"),Xu(s,i).then(()=>e.sha)},"branch"),she=o((r,e,t,i)=>{let s=["clone",r,t,"--recurse-submodules"];return N0(r,i)&&s.push("--depth=1"),$g(i)&&s.push("--config","core.longpaths=true"),Xu(s,i).then(()=>e.sha)},"plain"),Mj=o(async(r,e)=>await P0.stat(`${r}/.gitmodules`).then(()=>!0).catch(()=>!1)?Xu(["submodule","update","-q","--init","--recursive"],{...e,cwd:r}):null,"updateSubmodules"),nhe=o((r,e,t,i)=>{let s=$g(i)?["--config","core.longpaths=true"]:[],n=["clone","--mirror","-q",r,t+"/.git"],a=o(c=>Xu(c,{...i,cwd:t}),"git");return P0.mkdir(t,{recursive:!0}).then(()=>a(n.concat(s))).then(()=>a(["init"])).then(()=>a(["checkout",e])).then(()=>Mj(t,i)).then(()=>a(["rev-parse","--revs-only","HEAD"])).then(({stdout:c})=>c.trim())},"unresolved")});var x0=g((Y2e,qj)=>{var{stat:ohe}=require("fs/promises");qj.exports=({cwd:r=process.cwd()}={})=>ohe(r+"/.git").then(()=>!0,()=>!1)});var $j=g((Z2e,jj)=>{var ahe=x0(),{dirname:che}=require("path");jj.exports=async({cwd:r=process.cwd(),root:e}={})=>{for(;;){if(await ahe({cwd:r}))return r;let t=che(r);if(r===e||r===t)return null;r=t}}});var Vj=g((X2e,Uj)=>{var lhe=Ju();Uj.exports=(r={})=>lhe(["status","--porcelain=v1","-uno"],r).then(e=>!e.stdout.trim().split(/\r?\n+/).map(t=>t.trim()).filter(t=>t).length)});var Gj=g((Q2e,zj)=>{zj.exports={clone:Bj(),revs:A0(),spawn:Ju(),is:x0(),find:$j(),isClean:Vj(),errors:I0()}});var Wj=g((eVe,Hj)=>{"use strict";var $s=require("fs"),D0=require("path"),uhe=require("events").EventEmitter,hhe=Rr().Minimatch,Qu=class r extends uhe{static{o(this,"Walker")}constructor(e){e=e||{},super(e),this.isSymbolicLink=e.isSymbolicLink,this.path=e.path||process.cwd(),this.basename=D0.basename(this.path),this.ignoreFiles=e.ignoreFiles||[".ignore"],this.ignoreRules={},this.parent=e.parent||null,this.includeEmpty=!!e.includeEmpty,this.root=this.parent?this.parent.root:this.path,this.follow=!!e.follow,this.result=this.parent?this.parent.result:new Set,this.entries=null,this.sawError=!1,this.exact=e.exact}sort(e,t){return e.localeCompare(t,"en")}emit(e,t){let i=!1;return this.sawError&&e==="error"||(e==="error"?this.sawError=!0:e==="done"&&!this.parent&&(t=Array.from(t).map(s=>/^@/.test(s)?`./${s}`:s).sort(this.sort),this.result=t),e==="error"&&this.parent?i=this.parent.emit("error",t):i=super.emit(e,t)),i}start(){return $s.readdir(this.path,(e,t)=>e?this.emit("error",e):this.onReaddir(t)),this}isIgnoreFile(e){return e!=="."&&e!==".."&&this.ignoreFiles.indexOf(e)!==-1}onReaddir(e){this.entries=e,e.length===0?(this.includeEmpty&&this.result.add(this.path.slice(this.root.length+1)),this.emit("done",this.result)):this.entries.some(i=>this.isIgnoreFile(i))?this.addIgnoreFiles():this.filterEntries()}addIgnoreFiles(){let e=this.entries.filter(s=>this.isIgnoreFile(s)),t=e.length,i=o(()=>{--t===0&&this.filterEntries()},"then");e.forEach(s=>this.addIgnoreFile(s,i))}addIgnoreFile(e,t){let i=D0.resolve(this.path,e);$s.readFile(i,"utf8",(s,n)=>s?this.emit("error",s):this.onReadIgnoreFile(e,n,t))}onReadIgnoreFile(e,t,i){let s={matchBase:!0,dot:!0,flipNegate:!0,nocase:!0},n=t.split(/\r?\n/).filter(a=>!/^#|^$/.test(a.trim())).map(a=>new hhe(a.trim(),s));this.ignoreRules[e]=n,i()}filterEntries(){let e=this.entries.map(i=>{let s=this.filterEntry(i),n=this.filterEntry(i,!0);return s||n?[i,s,n]:!1}).filter(i=>i),t=e.length;if(t===0)this.emit("done",this.result);else{let i=o(()=>{--t===0&&this.emit("done",this.result)},"then");e.forEach(s=>{let n=s[0],a=s[1],c=s[2];this.stat({entry:n,file:a,dir:c},i)})}}onstat({st:e,entry:t,file:i,dir:s,isSymbolicLink:n},a){let c=this.path+"/"+t;e.isDirectory()?s?this.walker(t,{isSymbolicLink:n,exact:i||this.filterEntry(t+"/")},a):a():(i&&this.result.add(c.slice(this.root.length+1)),a())}stat({entry:e,file:t,dir:i},s){let n=this.path+"/"+e;$s.lstat(n,(a,c)=>{if(a)this.emit("error",a);else{let l=c.isSymbolicLink();this.follow&&l?$s.stat(n,(u,h)=>{u?this.emit("error",u):this.onstat({st:h,entry:e,file:t,dir:i,isSymbolicLink:l},s)}):this.onstat({st:c,entry:e,file:t,dir:i,isSymbolicLink:l},s)}})}walkerOpt(e,t){return{path:this.path+"/"+e,parent:this,ignoreFiles:this.ignoreFiles,follow:this.follow,includeEmpty:this.includeEmpty,...t}}walker(e,t,i){new r(this.walkerOpt(e,t)).on("done",i).start()}filterEntry(e,t,i){let s=!0;if(this.parent&&this.parent.filterEntry){let n=this.basename+"/"+e,a=i||e;if(s=this.parent.filterEntry(n,t,a),!s&&!this.exact)return!1}return this.ignoreFiles.forEach(n=>{this.ignoreRules[n]&&this.ignoreRules[n].forEach(a=>{if(a.negate!==s){let c=i&&a.globParts.some(u=>u.length<=(u.slice(-1)[0]?1:2));(a.match("/"+e)||a.match(e)||!!t&&(a.match("/"+e+"/")||a.match(e+"/")||a.negate&&(a.match("/"+e,!0)||a.match(e,!0))||c&&(a.match("/"+i+"/")||a.match(i+"/")||a.negate&&(a.match("/"+i,!0)||a.match(i,!0)))))&&(s=a.negate)}})}),s}},Ug=class r extends Qu{static{o(this,"WalkerSync")}start(){return this.onReaddir($s.readdirSync(this.path)),this}addIgnoreFile(e,t){let i=D0.resolve(this.path,e);this.onReadIgnoreFile(e,$s.readFileSync(i,"utf8"),t)}stat({entry:e,file:t,dir:i},s){let n=this.path+"/"+e,a=$s.lstatSync(n),c=a.isSymbolicLink();this.follow&&c&&(a=$s.statSync(n)),this.onstat({st:a,entry:e,file:t,dir:i,isSymbolicLink:c},s)}walker(e,t,i){new r(this.walkerOpt(e,t)).start(),i()}},Vg=o((r,e)=>{let t=new Promise((i,s)=>{new Qu(r).on("done",i).on("error",s).start()});return e?t.then(i=>e(null,i),e):t},"walk"),fhe=o(r=>new Ug(r).start().result,"walkSync");Hj.exports=Vg;Vg.sync=fhe;Vg.Walker=Qu;Vg.WalkerSync=Ug});var L0=g((rVe,Qj)=>{"use strict";var{Walker:dhe}=Wj(),{lstatSync:phe,readFileSync:ghe}=require("fs"),{basename:Jj,dirname:mhe,extname:Kj,join:Ja,relative:Wa,resolve:yhe,sep:She}=require("path"),{log:whe}=se(),eh=Symbol("npm-packlist.rules.default"),Ha=Symbol("npm-packlist.rules.strict"),vhe=o(r=>/\*/.test(r),"nameIsBadForWindows"),Ehe=[".npmignore",".gitignore","**/.git","**/.svn","**/.hg","**/CVS","**/.git/**","**/.svn/**","**/.hg/**","**/CVS/**","/.lock-wscript","/.wafpickle-*","/build/config.gypi","npm-debug.log","**/.npmrc",".*.swp",".DS_Store","**/.DS_Store/**","._*","**/._*/**","*.orig","/archived-packages/**"],Yj=["/.git"],zg=o(r=>r.split("\\").join("/"),"normalizePath"),Zj=o((r,e,t=[])=>{for(let a of[".npmignore",".gitignore"])try{let c=ghe(Ja(r,a),{encoding:"utf8"});t.push(c);break}catch(c){if(c.code!=="ENOENT")throw c}if(!e)return t;let i=e.split(She,1)[0],s=Ja(r,i),n=Wa(s,Ja(r,e));return Zj(s,n,t)},"readOutOfTreeIgnoreFiles"),Gg=class r extends dhe{static{o(this,"PackWalker")}constructor(e,t){let i={...t,includeEmpty:!1,follow:!1,path:yhe(t?.path||e.path).replace(/\\/g,"/"),ignoreFiles:t?.ignoreFiles||[eh,"package.json",".npmignore",".gitignore",Ha]};super(i),this.isPackage=i.isPackage,this.seen=i.seen||new Set,this.tree=e,this.requiredFiles=i.requiredFiles||[];let s=[];if(i.prefix&&i.workspaces){let n=zg(i.path),a=zg(i.prefix),c=i.workspaces.map(l=>zg(l));if(n!==a&&c.includes(n)){let l=Wa(i.prefix,mhe(i.path));s.push(...Zj(i.prefix,l))}else n===a&&s.push(...c.map(l=>zg(Wa(i.path,l))))}this.injectRules(eh,[...Ehe,...s]),this.isPackage||this.injectRules(Ha,[...Yj,...this.requiredFiles.map(n=>`!${n}`)])}addIgnoreFile(e,t){return e!=="package.json"||!this.isPackage?super.addIgnoreFile(e,t):this.processPackage(t)}emit(e,t){return e!=="done"||!this.isPackage?super.emit(e,t):(this.gatherBundles().then(()=>{super.emit("done",this.result)}),!0)}filterEntries(){return this.ignoreRules["package.json"]?(this.ignoreRules[".npmignore"]=null,this.ignoreRules[".gitignore"]=null):this.ignoreRules[".npmignore"]?this.ignoreRules[".gitignore"]=null:this.ignoreRules[".gitignore"]&&!this.ignoreRules[".npmignore"]&&whe.warn("gitignore-fallback","No .npmignore file found, using .gitignore for file exclusion. Consider creating a .npmignore file to explicitly control published files."),super.filterEntries()}onstat(e,t){return!e.st.isFile()&&!e.st.isDirectory()?t():super.onstat(e,t)}stat(e,t){return vhe(e.entry)?t():super.stat(e,t)}walkerOpt(e,t){let i=null;if(this.tree.workspaces){let s=[...this.tree.workspaces.values()].map(a=>a.replace(/\\/g,"/")),n=Ja(this.path,e).replace(/\\/g,"/");s.includes(n)&&(i=[eh,"package.json",".npmignore",".gitignore",Ha])}else i=[eh,".npmignore",".gitignore",Ha];return{...super.walkerOpt(e,t),ignoreFiles:i,requiredFiles:this.requiredFiles.map(s=>Wa(s,e)===".."?Wa(e,s).replace(/\\/g,"/"):!1).filter(Boolean)}}walker(e,t,i){new r(this.tree,this.walkerOpt(e,t)).on("done",i).start()}sort(e,t){let i=Kj(e).toLowerCase(),s=Kj(t).toLowerCase(),n=Jj(e).toLowerCase(),a=Jj(t).toLowerCase();return i.localeCompare(s,"en")||n.localeCompare(a,"en")||e.localeCompare(t,"en")}injectRules(e,t,i=()=>{}){this.onReadIgnoreFile(e,`${t.join(`
33
+ `)}
34
+ `,i)}processPackage(e){let{bin:t,browser:i,files:s,main:n}=this.tree.package,a=[],c=[...Yj,"!/package.json","!/readme{,.*[^~$]}","!/copying{,.*[^~$]}","!/license{,.*[^~$]}","!/licence{,.*[^~$]}","/.git","/node_modules",".npmrc","/package-lock.json","/yarn.lock","/pnpm-lock.yaml","/bun.lockb"];if(s){for(let l of s){l.startsWith("./")&&(l=l.slice(1)),l.endsWith("/*")&&(l+="*");let u=`!${l}`;try{let h=phe(Ja(this.path,l.replace(/^!+/,"")).replace(/\\/g,"/"));h.isFile()?(c.unshift(u),this.requiredFiles.push(l.startsWith("/")?l.slice(1):l)):h.isDirectory()&&(a.push(u),a.push(`${u}/**`))}catch{a.push(u)}}this.injectRules("package.json",["*",...a])}if(i&&c.push(`!/${i}`),n&&c.push(`!/${n}`),t)for(let l in t)c.push(`!/${t[l]}`);this.injectRules(Ha,c,e)}async gatherBundles(){if(this.seen.has(this.tree))return;this.seen.add(this.tree);let e;if(this.tree.isProjectRoot){let{bundleDependencies:t}=this.tree.package;e=t||[]}else{let{dependencies:t,optionalDependencies:i}=this.tree.package;e=Object.keys(t||{}).concat(Object.keys(i||{}))}for(let t of e){let i=this.tree.edgesOut.get(t);if(!i||i.peer||i.dev)continue;let s=this.tree.edgesOut.get(t).to;if(!s)continue;let n=s.path,a=s.target,c={path:n,isPackage:!0,ignoreFiles:[],seen:this.seen};s.isLink&&c.ignoreFiles.push(eh),c.ignoreFiles.push("package.json"),s.isLink&&(c.ignoreFiles.push(".npmignore"),c.ignoreFiles.push(".gitignore")),c.ignoreFiles.push(Ha);let l=new r(a,c),u=await new Promise((f,d)=>{l.on("error",d),l.on("done",f),l.start()}),h=Wa(this.root,l.path);for(let f of u)this.result.add(Ja(h,f).replace(/\\/g,"/"))}}},Xj=o((r,e,t)=>{typeof e=="function"&&(t=e,e={});let i=new Promise((s,n)=>{new Gg(r,{...e,isPackage:!0}).on("done",s).on("error",n).start()});return t?i.then(s=>t(null,s),t):i},"walk");Qj.exports=Xj;Xj.Walker=Gg});var r$=g((sVe,t$)=>{var{resolve:e$,dirname:_he,delimiter:M0}=require("path"),bhe=e$(__dirname,"../lib/node-gyp-bin"),Ohe=o((r,e,t)=>{let i=Object.keys(t).filter(l=>/^path$/i.test(l)&&t[l]).map(l=>t[l].split(M0)).reduce((l,u)=>l.concat(u.filter(h=>!l.includes(h))),[]).join(M0),s=[];e&&s.push(...e);let n=r,a;do s.push(e$(n,"node_modules",".bin")),a=n,n=_he(n);while(n!==a);s.push(bhe,i);let c=s.join(M0);for(let l of Object.keys(t))/^path$/i.test(l)&&(t[l]=c);return t},"setPATH");t$.exports=Ohe});var s$=g((oVe,i$)=>{var Ihe=r$(),{resolve:The}=require("path"),Hg,Rhe=o(r=>{let{args:e,binPaths:t,cmd:i,env:s,event:n,nodeGyp:a,path:c,scriptShell:l=!0,stdio:u,stdioString:h}=r;a?Hg=a:s.npm_config_node_gyp?Hg=s.npm_config_node_gyp:Hg=require.resolve("node-gyp/bin/node-gyp.js");let d={env:Ihe(c,t,{...process.env,...s,npm_package_json:The(c,"package.json"),npm_lifecycle_event:n,npm_lifecycle_script:i,npm_config_node_gyp:Hg}),stdioString:h,stdio:u,cwd:c,shell:l};return[i,e,d]},"makeSpawnArgs");i$.exports=Rhe});var o$=g((cVe,n$)=>{var F0=o((r,e,t={})=>{for(let[i,s]of Object.entries(r))s!==void 0&&(s===null||s===!1?t[`${e}${i}`]="":Array.isArray(s)?s.forEach((n,a)=>{F0({[`${i}_${a}`]:n},`${e}`,t)}):typeof s=="object"?F0(s,`${e}${i}_`,t):t[`${e}${i}`]=String(s));return t},"packageEnvs");n$.exports=r=>F0({name:r.name,version:r.version,config:r.config,engines:r.engines,bin:r.bin},"npm_package_")});var B0=g((uVe,c$)=>{var Ahe=require("util"),a$=require("fs"),{stat:Che}=a$.promises||{stat:Ahe.promisify(a$.stat)};async function khe(r){return await Che(`${r}/binding.gyp`).then(e=>e.isFile()).catch(()=>!1)}o(khe,"isNodeGypPackage");c$.exports={isNodeGypPackage:khe,defaultGypInstallScript:"node-gyp rebuild"}});var u$=g((fVe,l$)=>{var Wg=new Set,q0=!1,j0=["SIGINT","SIGTERM"],$0=o(r=>{for(let e of Wg)e.kill(r)},"handleSignal"),Phe=o(()=>{for(let r of j0)process.on(r,$0);q0=!0},"setupListeners"),Nhe=o(()=>{if(Wg.size===0){for(let r of j0)process.removeListener(r,$0);q0=!1}},"cleanupListeners"),xhe=o(r=>{Wg.add(r),q0||Phe(),r.once("exit",()=>{Wg.delete(r),Nhe()})},"add");l$.exports={add:xhe,handleSignal:$0,forwardedSignals:j0}});var U0=g((pVe,h$)=>{var{stat:Dhe}=require("node:fs/promises"),{resolve:Lhe}=require("node:path");h$.exports=async r=>{try{return(await Dhe(Lhe(r,"server.js"))).isFile()}catch{return!1}}});var d$=g((gVe,f$)=>{var Mhe=s$(),Fhe=Qo(),Bhe=o$(),{isNodeGypPackage:qhe,defaultGypInstallScript:jhe}=B0(),$he=u$(),Uhe=U0(),Vhe=o(async r=>{let{args:e=[],binPaths:t=!1,env:i={},event:s,nodeGyp:n,path:a,pkg:c,scriptShell:l,signalTimeout:u=500,stdio:h="pipe",stdioString:f}=r,{scripts:d={},gypfile:p}=c,m=null;if(r.cmd?m=r.cmd:c.scripts&&c.scripts[s]?m=c.scripts[s]:s==="install"&&!d.install&&!d.preinstall&&p!==!1&&await qhe(a)?m=jhe:s==="start"&&await Uhe(a)&&(m="node server.js"),!m)return{code:0,signal:null};let y=o(()=>{},"inputEnd");if(h==="inherit"){let E;c._id?E=`
35
+ > ${c._id} ${s}
36
+ `:E=`
37
+ > ${s}
38
+ `,E+=`> ${m.trim().replace(/\n/g,`
39
+ > `)}`,e.length&&(E+=` ${e.join(" ")}`),E+=`
40
+ `;let{output:b,input:O}=se();b.standard(E),y=O.start()}let[w,S,v]=Mhe({args:e,binPaths:t,cmd:m,env:{...i,...Bhe(c)},event:s,nodeGyp:n,path:a,scriptShell:l,stdio:h,stdioString:f}),_=Fhe(w,S,v,{event:s,script:m,pkgid:c._id,path:a});return h==="inherit"&&$he.add(_.process),_.stdin&&_.stdin.end(),_.catch(E=>{let{signal:b}=E;if(h==="inherit"&&b)return process.kill(process.pid,b),new Promise((O,T)=>setTimeout(()=>T(E),u));throw E}).finally(y)},"runScriptPkg");f$.exports=Vhe});var g$=g((yVe,p$)=>{var zhe=o(r=>{if(typeof r!="object"||!r)throw new TypeError("invalid options object provided to runScript");let{event:e,path:t,scriptShell:i,env:s={},stdio:n="pipe",args:a=[],cmd:c}=r;if(!e||typeof e!="string")throw new TypeError("valid event not provided to runScript");if(!t||typeof t!="string")throw new TypeError("valid path not provided to runScript");if(i!==void 0&&typeof i!="string")throw new TypeError("invalid scriptShell option provided to runScript");if(typeof s!="object"||!s)throw new TypeError("invalid env option provided to runScript");if(typeof n!="string"&&!Array.isArray(n))throw new TypeError("invalid stdio option provided to runScript");if(!Array.isArray(a)||a.some(l=>typeof l!="string"))throw new TypeError("invalid args option provided to runScript");if(c!==void 0&&typeof c!="string")throw new TypeError("invalid cmd option provided to runScript")},"validateOptions");p$.exports=zhe});var Ka=g((wVe,y$)=>{var Ghe=wt(),m$=d$(),Hhe=g$(),Whe=U0(),Jhe=o(async r=>{if(Hhe(r),r.pkg)return m$(r);let{content:e}=await Ghe.normalize(r.path);return m$({...r,pkg:e})},"runScript");y$.exports=Object.assign(Jhe,{isServerPackage:Whe})});var Ya=g((EVe,S$)=>{var{resolve:Khe}=require("node:path"),{stat:Yhe,chmod:Zhe}=require("node:fs/promises"),Xhe=Qr(),Qhe=As(),efe=Zn(),V0=Yn(),z0=class extends efe{static{o(this,"FileFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec}get types(){return["file"]}manifest(){return this.package?Promise.resolve(this.package):Xhe.tmp.withTmp(this.cache,this.opts,e=>this.extract(e).then(()=>this[V0.readPackageJson](e)).then(t=>this.package={...t,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from}))}#e(e,t){return e.bin?Promise.all(Object.keys(e.bin).map(async i=>{let s=Khe(t,e.bin[i]);try{let n=await Yhe(s),a=n.mode|73;if(a===n.mode)return;await Zhe(s,a)}catch{}})):Promise.resolve()}extract(e){return super.extract(e).then(t=>this.package?t:this[V0.readPackageJson](e).then(i=>this.#e(i,e)).then(()=>t))}[V0.tarballFromResolved](){return new Qhe.ReadStream(this.resolved)}packument(){return this.manifest().then(e=>({name:e.name,"dist-tags":{[this.defaultTag]:e.version},versions:{[e.version]:{...e,dist:{tarball:`file:${this.resolved}`,integrity:this.integrity&&String(this.integrity)}}}}))}};S$.exports=z0});var v$=g((bVe,w$)=>{var tfe=v0(),rfe=o(r=>({cwd:r._resolved,prefix:"package/",portable:!0,gzip:{level:9},filter:o((e,t)=>(tfe(r,e)&&(t.mode|=73),!0),"filter"),mtime:new Date("1985-10-26T08:15:00.000Z")}),"tarCreateOptions");w$.exports=rfe});var Jg=g((IVe,b$)=>{var{resolve:ife}=require("node:path"),sfe=L0(),nfe=Ka(),ofe=Gu(),{Minipass:afe}=ee(),cfe=Zn(),lfe=Ya(),E$=Yn(),_$=v$(),G0=class extends cfe{static{o(this,"DirFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec,this.tree=t.tree||null,this.Arborist=t.Arborist||null}static tarCreateOptions(e){return _$(e)}get types(){return["directory"]}#e(){return this.manifest().then(e=>{if(!e.scripts||!e.scripts.prepare||this.opts.ignoreScripts)return;let t=this.opts.foregroundScripts?"inherit":"pipe";return nfe({scriptShell:this.opts.scriptShell||void 0,pkg:e,event:"prepare",path:this.resolved,stdio:t,env:{npm_package_resolved:this.resolved,npm_package_integrity:this.integrity,npm_package_json:ife(this.resolved,"package.json")}})})}[E$.tarballFromResolved](){if(!this.tree&&!this.Arborist)throw new Error("DirFetcher requires either a tree or an Arborist constructor to pack");let e=new afe;e.resolved=this.resolved,e.integrity=this.integrity;let{prefix:t,workspaces:i}=this.opts;return this.#e().then(async()=>{if(!this.tree){let s=new this.Arborist({path:this.resolved});this.tree=await s.loadActual()}return sfe(this.tree,{path:this.resolved,prefix:t,workspaces:i})}).then(s=>ofe.c(_$(this.package),s).on("error",n=>e.emit("error",n)).pipe(e)).catch(s=>e.emit("error",s)),e}manifest(){return this.package?Promise.resolve(this.package):this[E$.readPackageJson](this.resolved).then(e=>this.package={...e,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from})}packument(){return lfe.prototype.packument.apply(this)}};b$.exports=G0});var Y0=g((RVe,O$)=>{"use strict";var{URL:ufe}=require("node:url");function hfe(r){try{let t=new ufe(r).pathname.slice(1);if(!t.match(/^-/)){t=t.split("/");var e=t.indexOf("_rewrite");return e===-1?e=t.length-1:e++,decodeURIComponent(t[e])}}catch{}}o(hfe,"packageName");var Xn=class extends Error{static{o(this,"HttpErrorBase")}constructor(e,t,i,s){super(),this.name=this.constructor.name,this.headers=typeof t.headers?.raw=="function"?t.headers.raw():t.headers,this.statusCode=t.status,this.code=`E${t.status}`,this.method=e,this.uri=t.url,this.body=i,this.pkgid=s?s.toString():hfe(t.url),Error.captureStackTrace(this,this.constructor)}},H0=class extends Xn{static{o(this,"HttpErrorGeneral")}constructor(e,t,i,s){super(e,t,i,s),this.message=`${t.status} ${t.statusText} - ${this.method.toUpperCase()} ${this.spec||this.uri}${i&&i.error?" - "+i.error:""}`}},W0=class extends Xn{static{o(this,"HttpErrorAuthOTP")}constructor(e,t,i,s){super(e,t,i,s),this.message="OTP required for authentication",this.code="EOTP"}},J0=class extends Xn{static{o(this,"HttpErrorAuthIPAddress")}constructor(e,t,i,s){super(e,t,i,s),this.message="Login is not allowed from your IP address",this.code="EAUTHIP"}},K0=class extends Xn{static{o(this,"HttpErrorAuthUnknown")}constructor(e,t,i,s){super(e,t,i,s),this.message="Unable to authenticate, need: "+t.headers.get("www-authenticate")}};O$.exports={HttpErrorBase:Xn,HttpErrorGeneral:H0,HttpErrorAuthOTP:W0,HttpErrorAuthIPAddress:J0,HttpErrorAuthUnknown:K0}});var T$=g((CVe,I$)=>{var ffe=cp(),th=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"}},Kg=class extends ffe{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,i){let s=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(s)?(this.found+=s.length,this.found>this.expect&&this.emit("error",new th(this.found,this.expect)),super.write(e,t,i)):(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 th(this.found,this.expect)),super.emit(e,...t)}};Kg.SizeError=th;I$.exports=Kg});var A$=g((PVe,R$)=>{"use strict";var{Minipass:dfe}=ee(),Z0=Symbol("type"),Xi=Symbol("buffer"),Yg=class r{static{o(this,"Blob")}constructor(e,t){this[Z0]="";let i=[],s=0;if(e){let a=e,c=Number(a.length);for(let l=0;l<c;l++){let u=a[l],h=u instanceof Buffer?u:ArrayBuffer.isView(u)?Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?Buffer.from(u):u instanceof r?u[Xi]:typeof u=="string"?Buffer.from(u):Buffer.from(String(u));s+=h.length,i.push(h)}}this[Xi]=Buffer.concat(i,s);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[Z0]=n)}get size(){return this[Xi].length}get type(){return this[Z0]}text(){return Promise.resolve(this[Xi].toString())}arrayBuffer(){let e=this[Xi],t=e.byteOffset,i=e.byteLength,s=e.buffer.slice(t,t+i);return Promise.resolve(s)}stream(){return new dfe().end(this[Xi])}slice(e,t,i){let s=this.size,n=e===void 0?0:e<0?Math.max(s+e,0):Math.min(e,s),a=t===void 0?s:t<0?Math.max(s+t,0):Math.min(t,s),c=Math.max(a-n,0),u=this[Xi].slice(n,n+c),h=new r([],{type:i});return h[Xi]=u,h}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return Xi}};Object.defineProperties(Yg.prototype,{size:{enumerable:!0},type:{enumerable:!0}});R$.exports=Yg});var Q0=g((xVe,C$)=>{"use strict";var X0=class extends Error{static{o(this,"FetchError")}constructor(e,t,i){super(e),this.code="FETCH_ERROR",i&&Object.assign(this,i),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"}};C$.exports=X0});var P$=g((LVe,k$)=>{k$.exports={}});var Xg=g((MVe,D$)=>{"use strict";var{Minipass:li}=ee(),eO=T$(),x$=A$(),{BUFFER:pfe}=x$,rh=Q0(),tO;try{tO=P$().convert}catch{}var Qi=Symbol("Body internals"),Qn=Symbol("consumeBody"),Zg=class{static{o(this,"Body")}constructor(e,t={}){let{size:i=0,timeout:s=0}=t,n=e==null?null:N$(e)?Buffer.from(e.toString()):ih(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):li.isStream(e)?e:Buffer.from(String(e));this[Qi]={body:n,disturbed:!1,error:null},this.size=i,this.timeout=s,li.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new rh(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[Qi].error=c})}get body(){return this[Qi].body}get bodyUsed(){return this[Qi].disturbed}arrayBuffer(){return this[Qn]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Qn]().then(t=>Object.assign(new x$([],{type:e.toLowerCase()}),{[pfe]:t}))}async json(){let e=await this[Qn]();try{return JSON.parse(e.toString())}catch(t){throw new rh(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Qn]().then(e=>e.toString())}buffer(){return this[Qn]()}textConverted(){return this[Qn]().then(e=>gfe(e,this.headers))}[Qn](){if(this[Qi].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[Qi].disturbed=!0,this[Qi].error)return Promise.reject(this[Qi].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=ih(this.body)?this.body.stream():this.body;if(!li.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof eO||!this.size&&e instanceof li&&!(e instanceof eO)?e:this.size?new eO({size:this.size}):new li,i=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new rh(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return i&&i.unref&&i.unref(),new Promise(s=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),s()}).then(()=>t.concat()).then(s=>(clearTimeout(i),s)).catch(s=>{throw clearTimeout(i),s.name==="AbortError"||s.name==="FetchError"?s:s.name==="RangeError"?new rh(`Could not create Buffer from response body for ${this.url}: ${s.message}`,"system",s):new rh(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(li.isStream(t)&&typeof t.getBoundary!="function"){let i=new li,s=new li,n=new li;return i.on("error",a=>{s.emit("error",a),n.emit("error",a)}),t.on("error",a=>i.emit("error",a)),i.pipe(s),i.pipe(n),t.pipe(i),e[Qi].body=s,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":N$(e)?"application/x-www-form-urlencoded;charset=UTF-8":ih(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()}`:li.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:ih(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:i}=t;return i==null?e.end():Buffer.isBuffer(i)||typeof i=="string"?e.end(i):(ih(i)?i.stream():i).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(Zg.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var N$=o(r=>typeof r!="object"||typeof r.append!="function"||typeof r.delete!="function"||typeof r.get!="function"||typeof r.getAll!="function"||typeof r.has!="function"||typeof r.set!="function"?!1:r.constructor.name==="URLSearchParams"||Object.prototype.toString.call(r)==="[object URLSearchParams]"||typeof r.sort=="function","isURLSearchParams"),ih=o(r=>typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&typeof r.constructor=="function"&&typeof r.constructor.name=="string"&&/^(Blob|File)$/.test(r.constructor.name)&&/^(Blob|File)$/.test(r[Symbol.toStringTag]),"isBlob"),gfe=o((r,e)=>{if(typeof tO!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),i="utf-8",s;t&&(s=/charset=([^;]*)/i.exec(t));let n=r.slice(0,1024).toString();return!s&&n&&(s=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!s&&n&&(s=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),s||(s=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),s&&s.pop()),s&&(s=/charset=(.*)/i.exec(s.pop()))),!s&&n&&(s=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),s&&(i=s.pop(),(i==="gb2312"||i==="gbk")&&(i="gb18030")),tO(r,"UTF-8",i).toString()},"convertBody");D$.exports=Zg});var em=g((BVe,F$)=>{"use strict";var M$=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,iO=/[^\t\x20-\x7e\x80-\xff]/,sh=o(r=>{if(r=`${r}`,M$.test(r)||r==="")throw new TypeError(`${r} is not a legal HTTP header name`)},"validateName"),L$=o(r=>{if(r=`${r}`,iO.test(r))throw new TypeError(`${r} is not a legal HTTP header value`)},"validateValue"),Za=o((r,e)=>{e=e.toLowerCase();for(let t in r)if(t.toLowerCase()===e)return t},"find"),Pe=Symbol("map"),Qg=class r{static{o(this,"Headers")}constructor(e=void 0){if(this[Pe]=Object.create(null),e instanceof r){let t=e.raw(),i=Object.keys(t);for(let s of i)for(let n of t[s])this.append(s,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 i=[];for(let s of e){if(typeof s!="object"||typeof s[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(s);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");i.push(n)}for(let s of i)this.append(s[0],s[1])}else for(let i of Object.keys(e))this.append(i,e[i])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,sh(e);let t=Za(this[Pe],e);return t===void 0?null:this[Pe][t].join(", ")}forEach(e,t=void 0){let i=sO(this);for(let s=0;s<i.length;s++){let[n,a]=i[s];e.call(t,a,n,this),i=sO(this)}}set(e,t){e=`${e}`,t=`${t}`,sh(e),L$(t);let i=Za(this[Pe],e);this[Pe][i!==void 0?i:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,sh(e),L$(t);let i=Za(this[Pe],e);i!==void 0?this[Pe][i].push(t):this[Pe][e]=[t]}has(e){return e=`${e}`,sh(e),Za(this[Pe],e)!==void 0}delete(e){e=`${e}`,sh(e);let t=Za(this[Pe],e);t!==void 0&&delete this[Pe][t]}raw(){return this[Pe]}keys(){return new eo(this,"key")}values(){return new eo(this,"value")}[Symbol.iterator](){return new eo(this,"key+value")}entries(){return new eo(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[Pe]),i=Za(e[Pe],"Host");return i!==void 0&&(t[i]=t[i][0]),t}static createHeadersLenient(e){let t=new r;for(let i of Object.keys(e))if(!M$.test(i))if(Array.isArray(e[i]))for(let s of e[i])iO.test(s)||(t[Pe][i]===void 0?t[Pe][i]=[s]:t[Pe][i].push(s));else iO.test(e[i])||(t[Pe][i]=[e[i]]);return t}};Object.defineProperties(Qg.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 sO=o((r,e="key+value")=>Object.keys(r[Pe]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>r[Pe][t].join(", "):t=>[t.toLowerCase(),r[Pe][t].join(", ")]),"getHeaders"),rO=Symbol("internal"),eo=class r{static{o(this,"HeadersIterator")}constructor(e,t){this[rO]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==r.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:i}=this[rO],s=sO(e,t),n=s.length;return i>=n?{value:void 0,done:!0}:(this[rO].index++,{value:s[i],done:!1})}};Object.setPrototypeOf(eo.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));F$.exports=Qg});var $$=g((jVe,j$)=>{"use strict";var mfe=require("http"),{STATUS_CODES:yfe}=mfe,B$=em(),q$=Xg(),{clone:Sfe,extractContentType:wfe}=q$,es=Symbol("Response internals"),tm=class r extends q${static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let i=t.status||200,s=new B$(t.headers);if(e!=null&&!s.has("Content-Type")){let n=wfe(e);n&&s.append("Content-Type",n)}this[es]={url:t.url,status:i,statusText:t.statusText||yfe[i],headers:s,counter:t.counter,trailer:Promise.resolve(t.trailer||new B$)}}get trailer(){return this[es].trailer}get url(){return this[es].url||""}get status(){return this[es].status}get ok(){return this[es].status>=200&&this[es].status<300}get redirected(){return this[es].counter>0}get statusText(){return this[es].statusText}get headers(){return this[es].headers}clone(){return new r(Sfe(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"}};j$.exports=tm;Object.defineProperties(tm.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var U$=g((UVe,vfe)=>{vfe.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 G$=g((VVe,z$)=>{"use strict";var{URL:nO}=require("url"),{Minipass:Efe}=ee(),oO=em(),{exportNodeCompatibleHeaders:_fe}=oO,V$=Xg(),{clone:bfe,extractContentType:Ofe,getTotalBytes:Ife}=V$,Tfe=U$().version,Rfe=`minipass-fetch/${Tfe} (+https://github.com/isaacs/minipass-fetch)`,Mr=Symbol("Request internals"),rm=o(r=>typeof r=="object"&&typeof r[Mr]=="object","isRequest"),Afe=o(r=>{let e=r&&typeof r=="object"&&Object.getPrototypeOf(r);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),im=class r extends V${static{o(this,"Request")}constructor(e,t={}){let i=rm(e)?new nO(e.url):e&&e.href?new nO(e.href):new nO(`${e}`);rm(e)?t={...e[Mr],...t}:(!e||typeof e=="string")&&(e={});let s=(t.method||e.method||"GET").toUpperCase(),n=s==="GET"||s==="HEAD";if((t.body!==null&&t.body!==void 0||rm(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:rm(e)&&e.body!==null?bfe(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new oO(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let F=Ofe(a);F&&c.append("Content-Type",F)}let l="signal"in t?t.signal:null;if(l!=null&&!Afe(l))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:u,cert:h,ciphers:f,clientCertEngine:d,crl:p,dhparam:m,ecdhCurve:y,family:w,honorCipherOrder:S,key:v,passphrase:_,pfx:E,rejectUnauthorized:b=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:O,secureProtocol:T,servername:I,sessionIdContext:L}=t;this[Mr]={method:s,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:i,signal:l,ca:u,cert:h,ciphers:f,clientCertEngine:d,crl:p,dhparam:m,ecdhCurve:y,family:w,honorCipherOrder:S,key:v,passphrase:_,pfx:E,rejectUnauthorized:b,secureOptions:O,secureProtocol:T,servername:I,sessionIdContext:L},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[Mr].method}get url(){return this[Mr].parsedURL.toString()}get headers(){return this[Mr].headers}get redirect(){return this[Mr].redirect}get signal(){return this[Mr].signal}clone(){return new r(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[Mr].parsedURL,i=new oO(e[Mr].headers);if(i.has("Accept")||i.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&Efe.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let s=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?Ife(e):null;s&&i.set("Content-Length",s+""),i.has("User-Agent")||i.set("User-Agent",Rfe),e.compress&&!i.has("Accept-Encoding")&&i.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!i.has("Connection")&&!n&&i.set("Connection","close");let{ca:a,cert:c,ciphers:l,clientCertEngine:u,crl:h,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:m,key:y,passphrase:w,pfx:S,rejectUnauthorized:v,secureOptions:_,secureProtocol:E,servername:b,sessionIdContext:O}=e[Mr];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:_fe(i),agent:n,ca:a,cert:c,ciphers:l,clientCertEngine:u,crl:h,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:m,key:y,passphrase:w,pfx:S,rejectUnauthorized:v,secureOptions:_,secureProtocol:E,servername:b,sessionIdContext:O,timeout:e.timeout}}};z$.exports=im;Object.defineProperties(im.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var W$=g((GVe,H$)=>{"use strict";var aO=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){}};H$.exports=aO});var Qa=g((WVe,Y$)=>{"use strict";var{URL:nh}=require("url"),Cfe=require("http"),kfe=require("https"),Xa=ku(),{Minipass:J$}=ee(),Pfe=Xg(),{writeToStream:Nfe,getTotalBytes:xfe}=Pfe,to=$$(),lO=em(),{createHeadersLenient:K$}=lO,oh=G$(),{getNodeRequestOptions:Dfe}=oh,Us=Q0(),cO=W$(),ts=o(async(r,e)=>{if(/^data:/.test(r)){let t=new oh(r,e);return Promise.resolve().then(()=>new Promise((i,s)=>{let n,a;try{let{pathname:u,search:h}=new nh(r),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 m=decodeURIComponent(f.join(",")+h);a=p?Buffer.from(m,"base64"):Buffer.from(m)}catch(u){return s(new Us(`[${t.method}] ${t.url} invalid URL, ${u.message}`,"system",u))}let{signal:c}=t;if(c&&c.aborted)return s(new cO("The user aborted a request."));let l={"Content-Length":a.length};return n&&(l["Content-Type"]=n),i(new to(a,{headers:l}))}))}return new Promise((t,i)=>{let s=new oh(r,e),n;try{n=Dfe(s)}catch(m){return i(m)}let a=(n.protocol==="https:"?kfe:Cfe).request,{signal:c}=s,l=null,u=o(()=>{let m=new cO("The user aborted a request.");i(m),J$.isStream(s.body)&&typeof s.body.destroy=="function"&&s.body.destroy(m),l&&l.body&&l.body.emit("error",m)},"abort");if(c&&c.aborted)return u();let h=o(()=>{u(),f()},"abortAndFinalize"),f=o(()=>{d.abort(),c&&c.removeEventListener("abort",h),clearTimeout(p)},"finalize"),d=a(n);c&&c.addEventListener("abort",h);let p=null;s.timeout&&d.once("socket",()=>{p=setTimeout(()=>{i(new Us(`network timeout at: ${s.url}`,"request-timeout")),f()},s.timeout)}),d.on("error",m=>{d.res&&d.res.emit("error",m),i(new Us(`request to ${s.url} failed, reason: ${m.message}`,"system",m)),f()}),d.on("response",m=>{clearTimeout(p);let y=K$(m.headers);if(ts.isRedirect(m.statusCode)){let b=y.get("Location"),O=null;try{O=b===null?null:new nh(b,s.url).toString()}catch{if(s.redirect!=="manual"){i(new Us(`uri requested responds with an invalid redirect URL: ${b}`,"invalid-redirect")),f();return}}if(s.redirect==="error"){i(new Us(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),f();return}else if(s.redirect==="manual"){if(O!==null)try{y.set("Location",O)}catch(T){i(T)}}else if(s.redirect==="follow"&&O!==null){if(s.counter>=s.follow){i(new Us(`maximum redirect reached at: ${s.url}`,"max-redirect")),f();return}if(m.statusCode!==303&&s.body&&xfe(s)===null){i(new Us("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}s.headers.set("host",new nh(O).host);let T={headers:new lO(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout},I=new nh(s.url),L=new nh(O);I.hostname!==L.hostname&&(T.headers.delete("authorization"),T.headers.delete("cookie")),(m.statusCode===303||(m.statusCode===301||m.statusCode===302)&&s.method==="POST")&&(T.method="GET",T.body=void 0,T.headers.delete("content-length")),t(ts(new oh(O,T))),f();return}}m.once("end",()=>c&&c.removeEventListener("abort",h));let w=new J$;w.on("error",f),m.on("error",b=>w.emit("error",b)),m.on("data",b=>w.write(b)),m.on("end",()=>w.end());let S={url:s.url,status:m.statusCode,statusText:m.statusMessage,headers:y,size:s.size,timeout:s.timeout,counter:s.counter,trailer:new Promise(b=>m.on("end",()=>b(K$(m.trailers))))},v=y.get("Content-Encoding");if(!s.compress||s.method==="HEAD"||v===null||m.statusCode===204||m.statusCode===304){l=new to(w,S),t(l);return}let _={flush:Xa.constants.Z_SYNC_FLUSH,finishFlush:Xa.constants.Z_SYNC_FLUSH};if(v==="gzip"||v==="x-gzip"){let b=new Xa.Gunzip(_);l=new to(w.on("error",O=>b.emit("error",O)).pipe(b),S),t(l);return}if(v==="deflate"||v==="x-deflate"){m.once("data",b=>{let O=(b[0]&15)===8?new Xa.Inflate:new Xa.InflateRaw;w.on("error",T=>O.emit("error",T)).pipe(O),l=new to(O,S),t(l)});return}if(v==="br"){try{var E=new Xa.BrotliDecompress}catch(b){i(b),f();return}w.on("error",b=>E.emit("error",b)).pipe(E),l=new to(E,S),t(l);return}l=new to(w,S),t(l)}),Nfe(d,s)})},"fetch");Y$.exports=ts;ts.isRedirect=r=>r===301||r===302||r===303||r===307||r===308;ts.Headers=lO;ts.Request=oh;ts.Response=to;ts.FetchError=Us;ts.AbortError=cO});var Z$=g((KVe,Lfe)=>{Lfe.exports={name:"npm-registry-fetch",version:"19.0.0",description:"Fetch-based http client for use with npm registry APIs",main:"lib",files:["bin/","lib/"],scripts:{eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",test:"tap",posttest:"npm run lint",npmclilint:"npmcli-lint",postsnap:"npm run lintfix --",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/npm-registry-fetch.git"},keywords:["npm","registry","fetch"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/redact":"^3.0.0",jsonparse:"^1.3.1","make-fetch-happen":"^15.0.0",minipass:"^7.0.2","minipass-fetch":"^4.0.0",minizlib:"^3.0.1","npm-package-arg":"^13.0.0","proc-log":"^5.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",cacache:"^20.0.0",nock:"^13.2.4","require-inject":"^1.4.4",ssri:"^12.0.0",tap:"^16.0.1"},tap:{"check-coverage":!0,"test-ignore":"test[\\\\/](util|cache)[\\\\/]","nyc-arg":["--exclude","tap-snapshots/**"]},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.",version:"4.25.0",publish:"true"}}});var uO=g((YVe,Q$)=>{var X$=Z$();Q$.exports={maxSockets:12,method:"GET",registry:"https://registry.npmjs.org/",timeout:300*1e3,strictSSL:!0,noProxy:process.env.NOPROXY,userAgent:`${X$.name}@${X$.version}/node@${process.version}+${process.arch} (${process.platform})`}});var hO=g((ZVe,eU)=>{var ec="regex",tc="path",Mfe={type:ec,pattern:/\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi,replacement:"[REDACTED_NPM_SECRET]"},Ffe={type:ec,pattern:/\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi,replacement:"[REDACTED_AUTH_HEADER]"},Bfe={type:ec,pattern:/\b[A-Za-z0-9-_]{10,}(?!\.\d+\.)\.[A-Za-z0-9-_]{3,}\.[A-Za-z0-9-_]{20,}\b/gi,replacement:"[REDACTED_JSON_WEB_TOKEN]"},qfe={type:ec,pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,replacement:"[REDACTED_UUID]"},jfe={type:ec,pattern:/(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi,replacement:"[REDACTED_URL]"},$fe={type:tc,predicate:o(({path:r})=>r.endsWith(".headers.authorization"),"predicate"),replacement:"[REDACTED_HEADER_AUTHORIZATION]"},Ufe={type:tc,predicate:o(({path:r})=>r.endsWith(".headers.set-cookie"),"predicate"),replacement:"[REDACTED_HEADER_SET_COOKIE]"},Vfe={type:tc,predicate:o(({path:r})=>r.endsWith(".headers.cookie"),"predicate"),replacement:"[REDACTED_HEADER_COOKIE]"},zfe={type:tc,predicate:o(({path:r})=>r.endsWith(".request"),"predicate"),replacement:o(r=>({method:r?.method,path:r?.path,headers:r?.headers,url:r?.url}),"replacement")},Gfe={type:tc,predicate:o(({path:r})=>r.endsWith(".response"),"predicate"),replacement:o(r=>({data:r?.data,status:r?.status,headers:r?.headers}),"replacement")};eU.exports={TYPE_REGEX:ec,TYPE_URL:"url",TYPE_PATH:tc,NPM_SECRET:Mfe,AUTH_HEADER:Ffe,JSON_WEB_TOKEN:Bfe,UUID:qfe,URL_MATCHER:jfe,DEEP_HEADER_AUTHORIZATION:$fe,DEEP_HEADER_SET_COOKIE:Ufe,DEEP_HEADER_COOKIE:Vfe,REWRITE_REQUEST:zfe,REWRITE_RESPONSE:Gfe}});var oU=g((QVe,nU)=>{var{URL_MATCHER:Hfe,TYPE_URL:sm,TYPE_REGEX:Wfe,TYPE_PATH:Jfe}=hO(),Vs=o((r=0)=>(r=typeof r=="string"?r.length:r,r<8?"*".repeat(8):"*".repeat(r)),"asterisk"),tU=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"escapeRegExp"),rU=o(r=>{let e=decodeURIComponent(r),t=encodeURIComponent(r);return[...new Set([t,e,r])].map(tU).join("|")},"urlEncodeRegexGroup"),nm=o((r,...e)=>{let t="";for(let i=0;i<e.length;i++)t+=r[i]+`(${rU(e[i])})`;return t+=r[r.length-1],new RegExp(t)},"urlEncodeRegexTag"),Kfe=o(({hostname:r,replacement:e}={})=>({type:sm,predicate:o(({url:t})=>t.hostname===r,"predicate"),pattern:o(({url:t})=>nm`(^${t.protocol}//${t.username}:.+@)?${t.hostname}`,"pattern"),replacement:`$1${e||Vs()}`}),"redactUrlHostnameMatcher"),Yfe=o(({param:r,replacement:e}={})=>({type:sm,predicate:o(({url:t})=>t.searchParams.has(r),"predicate"),pattern:o(({url:t})=>nm`(${r}=)${t.searchParams.get(r)}`,"pattern"),replacement:`$1${e||Vs()}`}),"redactUrlSearchParamsMatcher"),iU=o(({replacement:r}={})=>({type:sm,predicate:o(({url:e})=>e.password,"predicate"),pattern:o(({url:e})=>nm`(^${e.protocol}//${e.username}:)${e.password}`,"pattern"),replacement:`$1${r||Vs()}`}),"redactUrlPasswordMatcher"),sU=o((...r)=>e=>{try{let t=new URL(e);return fO(...r)(e,{url:t})}catch{return e}},"redactUrlReplacement"),Zfe=o((...r)=>({...Hfe,replacement:sU(...r)}),"redactUrlMatcher"),Xfe={[Wfe]:r=>e=>(typeof e=="string"&&(e=e.replace(r.pattern,r.replacement)),e),[sm]:r=>(e,t)=>{if(typeof e=="string")try{let i=t?.url||new URL(e),{predicate:s,pattern:n}=r;s({url:i})&&(e=e.replace(n({url:i}),r.replacement))}catch{return e}return e},[Jfe]:r=>(e,t)=>{let i=t?.path,s=i.join(".").toLowerCase(),{predicate:n,replacement:a}=r,c=typeof a=="function"?a:()=>a;return n({rawPath:i,path:s})&&(e=c(e,{rawPath:i,path:s})),e}},Qfe=o(r=>Xfe[r.type](r),"redactMatcher"),fO=o((...r)=>(e,t)=>r.flat().reduce((s,n)=>(typeof n=="function"?n:Qfe(n))(s,t),e),"redactMatchers"),ede=o(()=>(r,e)=>typeof e=="number"?Vs(r):e+Vs(r.substring(e.length).length),"redactDynamicReplacement"),tde=o(r=>(e,t)=>typeof t=="number"?Vs(r):t+Vs(r),"redactFixedReplacement"),rde=o((r,e)=>fO(iU({replacement:e}))(r),"redactUrlPassword");nU.exports={asterisk:Vs,escapeRegExp:tU,urlEncodeRegexGroup:rU,urlEncodeRegexTag:nm,redactUrlHostnameMatcher:Kfe,redactUrlSearchParamsMatcher:Yfe,redactUrlPasswordMatcher:iU,redactUrlMatcher:Zfe,redactUrlReplacement:sU,redactDynamicReplacement:ede,redactFixedReplacement:tde,redactMatchers:fO,redactUrlPassword:rde}});var om=g((tze,lU)=>{var aU=hO(),{redactUrlPassword:ide}=oU(),dO="***",pO=o(r=>typeof r!="string"||!r?r:ide(r,dO).replace(aU.NPM_SECRET.pattern,`npm_${dO}`).replace(aU.UUID.pattern,dO),"redact"),cU=o(r=>{let e=/[\s=]/g,t=null,i="",s=0;for(;t=e.exec(r);)i+=pO(r.slice(s,t.index))+t[0],s=e.lastIndex;return i+pO(r.slice(s))},"splitAndRedact"),sde=o(r=>typeof r=="string"?cU(r):Array.isArray(r)?r.map(e=>typeof e=="string"?cU(e):e):r,"redactLog");lU.exports={redact:pO,redactLog:sde}});var fU=g((ize,hU)=>{"use strict";var ah=Y0(),{Response:nde}=Qa(),ode=uO(),{log:am}=se(),{redact:ade}=om(),cde="https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry",lde=o(async({method:r,uri:e,res:t,startTime:i,auth:s,opts:n})=>(n={...ode,...n},t.headers.has("npm-notice")&&!t.headers.has("x-local-cache")&&am.notice("",t.headers.get("npm-notice")),t.status>=400?(uU(r,t,i),s&&s.scopeAuthKey&&!s.token&&!s.auth&&am.warn("registry",`No auth for URI, but auth present for scoped registry.
41
+
42
+ URI: ${e}
43
+ Scoped Registry Key: ${s.scopeAuthKey}
44
+
45
+ More info here: ${cde}`),ude(r,t,i,n)):(t.body.on("end",()=>uU(r,t,i,n)),n.ignoreBody?(t.body.resume(),new nde(null,t)):t)),"checkResponse");hU.exports=lde;function uU(r,e,t){let i=Date.now()-t,s=e.headers.get("x-fetch-attempts"),n=s&&s>1?` attempt #${s}`:"",a=e.headers.get("x-local-cache-status"),c=a?` (cache ${a})`:"",l=ade(e.url);a==="hit"?am.http("cache",`${l} ${i}ms${n}${c}`):am.http("fetch",`${r.toUpperCase()} ${e.status} ${l} ${i}ms${n}${c}`)}o(uU,"logRequest");function ude(r,e,t,i){return e.buffer().catch(()=>null).then(s=>{let n=s;try{n=JSON.parse(s.toString("utf8"))}catch{}if(e.status===401&&e.headers.get("www-authenticate")){let a=e.headers.get("www-authenticate").split(/,\s*/).map(c=>c.toLowerCase());throw a.indexOf("ipaddress")!==-1?new ah.HttpErrorAuthIPAddress(r,e,n,i.spec):a.indexOf("otp")!==-1?new ah.HttpErrorAuthOTP(r,e,n,i.spec):new ah.HttpErrorAuthUnknown(r,e,n,i.spec)}else throw e.status===401&&s!=null&&/one-time pass/.test(s.toString("utf8"))?new ah.HttpErrorAuthOTP(r,e,n,i.spec):new ah.HttpErrorGeneral(r,e,n,i.spec)})}o(ude,"checkErrors")});var yU=g((nze,mU)=>{"use strict";var hde=require("fs"),fde=ye(),{URL:gO}=require("url"),dU=o((r,e)=>{let t=new gO(r),i=`//${t.host}${t.pathname}`;for(;i.length>2;){let s=dde(i,e);if(s)return{regKey:i,authKey:s};i=i.replace(/([^/]+|\/)$/,"")}return{regKey:!1,authKey:null}},"regFromURI"),dde=o((r,e)=>e[`${r}:_authToken`]?"_authToken":e[`${r}:_auth`]?"_auth":e[`${r}:username`]&&e[`${r}:_password`]?"username":e[`${r}:certfile`]&&e[`${r}:keyfile`]?"certfile":!1,"hasAuth"),pde=o((r,e)=>{let t=new gO(r),i=new gO(e);return t.host===i.host},"sameHost"),gde=o(r=>{let{spec:e}=r,{scope:t,subSpec:i}=e?fde(e):{},s=i&&i.scope,n=i?s:t;return n&&r[`${n}:registry`]||r.registry},"getRegistry"),pU=o(r=>{try{return hde.readFileSync(r,"utf8")}catch(e){if(e.code!=="ENOENT")throw e;return null}},"maybeReadFile"),gU=o((r,e={})=>{let{forceAuth:t}=e;if(!r)throw new Error("URI is required");let{regKey:i,authKey:s}=dU(r,t||e);if(t&&!i)return new ch({regKey:!1,authKey:null,scopeAuthKey:null,token:t._authToken||t.token,username:t.username,password:t._password||t.password,auth:t._auth||t.auth,certfile:t.certfile,keyfile:t.keyfile});if(!i){let f=gde(e);if(f&&r!==f&&pde(r,f))return gU(f,e);if(f!==e.registry){let{regKey:d,authKey:p}=dU(f,e);return new ch({scopeAuthKey:d,regKey:d,authKey:p})}}let{[`${i}:_authToken`]:n,[`${i}:username`]:a,[`${i}:_password`]:c,[`${i}:_auth`]:l,[`${i}:certfile`]:u,[`${i}:keyfile`]:h}=e;return new ch({scopeAuthKey:null,regKey:i,authKey:s,token:n,auth:l,username:a,password:c,certfile:u,keyfile:h})},"getAuth"),ch=class{static{o(this,"Auth")}constructor({token:e,auth:t,username:i,password:s,scopeAuthKey:n,certfile:a,keyfile:c,regKey:l,authKey:u}){if(this.scopeAuthKey=n,this.regKey=l,this.authKey=u,this.token=null,this.auth=null,this.isBasicAuth=!1,this.cert=null,this.key=null,e)this.token=e;else if(t)this.auth=t;else if(i&&s){let h=Buffer.from(s,"base64").toString("utf8");this.auth=Buffer.from(`${i}:${h}`,"utf8").toString("base64"),this.isBasicAuth=!0}if(a&&c){let h=pU(a,"utf-8"),f=pU(c,"utf-8");h&&f&&(this.cert=h,this.key=f)}}};mU.exports=gU});var wU=g((aze,SU)=>{var mde=require("dns"),yde=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],Sde=o(r=>{let{strictSSL:e,...t}={...r};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 i=parseInt(t.retry,10);isFinite(i)?t.retry={retries:i}: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:mde.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(s=>yde.includes(s.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");SU.exports=Sde});var EU=g((uze,vU)=>{"use strict";var wde=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),vde=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),Ede=new Set([500,502,503,504]),_de={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},bde={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function rs(r){let e=parseInt(r,10);return isFinite(e)?e:0}o(rs,"toNumberOrZero");function Ode(r){return r?Ede.has(r.status):!0}o(Ode,"isErrorResponse");function mO(r){let e={};if(!r)return e;let t=r.trim().split(/,/);for(let i of t){let[s,n]=i.split(/=/,2);e[s.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(mO,"parseCacheControl");function Ide(r){let e=[];for(let t in r){let i=r[t];e.push(i===!0?t:t+"="+i)}if(e.length)return e.join(", ")}o(Ide,"formatCacheControl");vU.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:i,cacheHeuristic:s,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=i!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=s!==void 0?s:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=mO(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=mO(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":Ide(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())&&vde.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||wde.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=mO(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>rs(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<rs(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 i of t)if(e.headers[i]!==this._reqHeaders[i])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let i in e)_de[i]||(t[i]=e[i]);if(e.connection){let i=e.connection.trim().split(/\s*,\s*/);for(let s of i)delete t[s]}if(t.warning){let i=t.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));i.length?t.warning=i.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 rs(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 rs(this._rescc["s-maxage"])}if(this._rescc["max-age"])return rs(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let i=Date.parse(this._resHeaders.expires);return Number.isNaN(i)||i<t?0:Math.max(e,(i-t)/1e3)}if(this._resHeaders["last-modified"]){let i=Date.parse(this._resHeaders["last-modified"]);if(isFinite(i)&&t>i)return Math.max(e,(t-i)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+rs(this._rescc["stale-if-error"]),i=e+rs(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,i)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+rs(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=rs(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 s=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));s.length?t["if-none-match"]=s.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()&&Ode(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let i=!1;t.status!==void 0&&t.status!=304?i=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?i=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?i=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(i=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!i)return{policy:new this.constructor(e,t,s),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!bde[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,s),modified:!1,matches:!0}}}});var IU=g((fze,yO)=>{"use strict";yO.exports=OU;yO.exports.preferredCharsets=OU;var Tde=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Rde(r){for(var e=r.split(","),t=0,i=0;t<e.length;t++){var s=Ade(e[t].trim(),t);s&&(e[i++]=s)}return e.length=i,e}o(Rde,"parseAcceptCharset");function Ade(r,e){var t=Tde.exec(r);if(!t)return null;var i=t[1],s=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"){s=parseFloat(c[1]);break}}return{charset:i,q:s,i:e}}o(Ade,"parseCharset");function Cde(r,e,t){for(var i={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=kde(r,e[s],t);n&&(i.s-n.s||i.q-n.q||i.o-n.o)<0&&(i=n)}return i}o(Cde,"getCharsetPriority");function kde(r,e,t){var i=0;if(e.charset.toLowerCase()===r.toLowerCase())i|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}o(kde,"specify");function OU(r,e){var t=Rde(r===void 0?"*":r||"");if(!e)return t.filter(bU).sort(_U).map(Pde);var i=e.map(o(function(n,a){return Cde(n,t,a)},"getPriority"));return i.filter(bU).sort(_U).map(o(function(n){return e[i.indexOf(n)]},"getCharset"))}o(OU,"preferredCharsets");function _U(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}o(_U,"compareSpecs");function Pde(r){return r.charset}o(Pde,"getFullCharset");function bU(r){return r.q>0}o(bU,"isQuality")});var CU=g((pze,SO)=>{"use strict";SO.exports=AU;SO.exports.preferredEncodings=AU;var Nde=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function xde(r){for(var e=r.split(","),t=!1,i=1,s=0,n=0;s<e.length;s++){var a=Dde(e[s].trim(),s);a&&(e[n++]=a,t=t||RU("identity",a),i=Math.min(i,a.q||1))}return t||(e[n++]={encoding:"identity",q:i,i:s}),e.length=n,e}o(xde,"parseAcceptEncoding");function Dde(r,e){var t=Nde.exec(r);if(!t)return null;var i=t[1],s=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"){s=parseFloat(c[1]);break}}return{encoding:i,q:s,i:e}}o(Dde,"parseEncoding");function Lde(r,e,t){for(var i={encoding:r,o:-1,q:0,s:0},s=0;s<e.length;s++){var n=RU(r,e[s],t);n&&(i.s-n.s||i.q-n.q||i.o-n.o)<0&&(i=n)}return i}o(Lde,"getEncodingPriority");function RU(r,e,t){var i=0;if(e.encoding.toLowerCase()===r.toLowerCase())i|=1;else if(e.encoding!=="*")return null;return{encoding:r,i:t,o:e.i,q:e.q,s:i}}o(RU,"specify");function AU(r,e,t){var i=xde(r||""),s=t?o(function(c,l){if(c.q!==l.q)return l.q-c.q;var u=t.indexOf(c.encoding),h=t.indexOf(l.encoding);return u===-1&&h===-1?l.s-c.s||c.o-l.o||c.i-l.i:u!==-1&&h!==-1?u-h:u===-1?1:-1},"comparator"):Mde;if(!e)return i.filter(TU).sort(s).map(Fde);var n=e.map(o(function(c,l){return Lde(c,i,l)},"getPriority"));return n.filter(TU).sort(s).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(AU,"preferredEncodings");function Mde(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i}o(Mde,"compareSpecs");function Fde(r){return r.encoding}o(Fde,"getFullEncoding");function TU(r){return r.q>0}o(TU,"isQuality")});var DU=g((mze,wO)=>{"use strict";wO.exports=xU;wO.exports.preferredLanguages=xU;var Bde=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function qde(r){for(var e=r.split(","),t=0,i=0;t<e.length;t++){var s=NU(e[t].trim(),t);s&&(e[i++]=s)}return e.length=i,e}o(qde,"parseAcceptLanguage");function NU(r,e){var t=Bde.exec(r);if(!t)return null;var i=t[1],s=t[2],n=i;s&&(n+="-"+s);var a=1;if(t[3])for(var c=t[3].split(";"),l=0;l<c.length;l++){var u=c[l].split("=");u[0]==="q"&&(a=parseFloat(u[1]))}return{prefix:i,suffix:s,q:a,i:e,full:n}}o(NU,"parseLanguage");function jde(r,e,t){for(var i={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=$de(r,e[s],t);n&&(i.s-n.s||i.q-n.q||i.o-n.o)<0&&(i=n)}return i}o(jde,"getLanguagePriority");function $de(r,e,t){var i=NU(r);if(!i)return null;var s=0;if(e.full.toLowerCase()===i.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===i.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===i.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}o($de,"specify");function xU(r,e){var t=qde(r===void 0?"*":r||"");if(!e)return t.filter(PU).sort(kU).map(Ude);var i=e.map(o(function(n,a){return jde(n,t,a)},"getPriority"));return i.filter(PU).sort(kU).map(o(function(n){return e[i.indexOf(n)]},"getLanguage"))}o(xU,"preferredLanguages");function kU(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}o(kU,"compareSpecs");function Ude(r){return r.full}o(Ude,"getFullLanguage");function PU(r){return r.q>0}o(PU,"isQuality")});var jU=g((Sze,vO)=>{"use strict";vO.exports=BU;vO.exports.preferredMediaTypes=BU;var Vde=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function zde(r){for(var e=Kde(r),t=0,i=0;t<e.length;t++){var s=FU(e[t].trim(),t);s&&(e[i++]=s)}return e.length=i,e}o(zde,"parseAccept");function FU(r,e){var t=Vde.exec(r);if(!t)return null;var i=Object.create(null),s=1,n=t[2],a=t[1];if(t[3])for(var c=Yde(t[3]).map(Jde),l=0;l<c.length;l++){var u=c[l],h=u[0].toLowerCase(),f=u[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(h==="q"){s=parseFloat(d);break}i[h]=d}return{type:a,subtype:n,params:i,q:s,i:e}}o(FU,"parseMediaType");function Gde(r,e,t){for(var i={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=Hde(r,e[s],t);n&&(i.s-n.s||i.q-n.q||i.o-n.o)<0&&(i=n)}return i}o(Gde,"getMediaTypePriority");function Hde(r,e,t){var i=FU(r),s=0;if(!i)return null;if(e.type.toLowerCase()==i.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==i.subtype.toLowerCase())s|=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()==(i.params[a]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}o(Hde,"specify");function BU(r,e){var t=zde(r===void 0?"*/*":r||"");if(!e)return t.filter(MU).sort(LU).map(Wde);var i=e.map(o(function(n,a){return Gde(n,t,a)},"getPriority"));return i.filter(MU).sort(LU).map(o(function(n){return e[i.indexOf(n)]},"getType"))}o(BU,"preferredMediaTypes");function LU(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}o(LU,"compareSpecs");function Wde(r){return r.type+"/"+r.subtype}o(Wde,"getFullType");function MU(r){return r.q>0}o(MU,"isQuality");function qU(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}o(qU,"quoteCount");function Jde(r){var e=r.indexOf("="),t,i;return e===-1?t=r:(t=r.slice(0,e),i=r.slice(e+1)),[t,i]}o(Jde,"splitKeyValuePair");function Kde(r){for(var e=r.split(","),t=1,i=0;t<e.length;t++)qU(e[i])%2==0?e[++i]=e[t]:e[i]+=","+e[t];return e.length=i+1,e}o(Kde,"splitMediaTypes");function Yde(r){for(var e=r.split(";"),t=1,i=0;t<e.length;t++)qU(e[i])%2==0?e[++i]=e[t]:e[i]+=";"+e[t];e.length=i+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(Yde,"splitParameters")});var $U=g((vze,EO)=>{"use strict";var Zde=IU(),Xde=CU(),Qde=DU(),epe=jU();EO.exports=oe;EO.exports.Negotiator=oe;function oe(r){if(!(this instanceof oe))return new oe(r);this.request=r}o(oe,"Negotiator");oe.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");oe.prototype.charsets=o(function(e){return Zde(this.request.headers["accept-charset"],e)},"charsets");oe.prototype.encoding=o(function(e,t){var i=this.encodings(e,t);return i&&i[0]},"encoding");oe.prototype.encodings=o(function(e,t){var i=t||{};return Xde(this.request.headers["accept-encoding"],e,i.preferred)},"encodings");oe.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");oe.prototype.languages=o(function(e){return Qde(this.request.headers["accept-language"],e)},"languages");oe.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");oe.prototype.mediaTypes=o(function(e){return epe(this.request.headers.accept,e)},"mediaTypes");oe.prototype.preferredCharset=oe.prototype.charset;oe.prototype.preferredCharsets=oe.prototype.charsets;oe.prototype.preferredEncoding=oe.prototype.encoding;oe.prototype.preferredEncodings=oe.prototype.encodings;oe.prototype.preferredLanguage=oe.prototype.language;oe.prototype.preferredLanguages=oe.prototype.languages;oe.prototype.preferredMediaType=oe.prototype.mediaType;oe.prototype.preferredMediaTypes=oe.prototype.mediaTypes});var bO=g((_ze,HU)=>{var UU=EU(),VU=$U(),tpe=Ft(),zU={shared:!1,ignoreCargoCult:!0},rpe={status:200,headers:{}},rc=o(r=>{let e={method:r.method,url:r.url,headers:{},compress:r.compress};return r.headers.forEach((t,i)=>{e.headers[i]=t}),e},"requestObject"),GU=o(r=>{let e={status:r.status,headers:{}};return r.headers.forEach((t,i)=>{e.headers[i]=t}),e},"responseObject"),_O=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:i,options:s}){this.entry=e,this.request=rc(t),this.response=GU(i),this.options=s,this.policy=new UU(this.request,this.response,zU),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 UU(rc(e),rpe,zU).storable()}satisfies(e){let t=rc(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let i=new VU(this.request),s=new VU(t);return JSON.stringify(i.mediaTypes())!==JSON.stringify(s.mediaTypes())||JSON.stringify(i.languages())!==JSON.stringify(s.languages())||JSON.stringify(i.encodings())!==JSON.stringify(s.encodings())?!1:this.options.integrity?tpe.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=rc(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=rc(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let i=rc(e),s=GU(t);return!this.policy.revalidatedPolicy(i,s).modified}};HU.exports=_O});var JU=g((Oze,WU)=>{var OO=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"}};WU.exports={NotCachedError:OO}});var TO=g((Tze,KU)=>{"use strict";var ipe=ca(),IO=class extends ipe{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)}};KU.exports=IO});var ZU=g((Aze,YU)=>{var{URL:spe,format:npe}=require("url"),ope={auth:!1,fragment:!1,search:!0,unicode:!1},ape=o(r=>{let e=new spe(r.url);return`make-fetch-happen:request-cache:${npe(e,ope)}`},"cacheKey");YU.exports=ape});var RO=g((kze,QU)=>{"use strict";var{LRUCache:cpe}=Pi(),XU=require("dns"),cm=new cpe({max:50}),lpe=o(({family:r=0,hints:e=XU.ADDRCONFIG,all:t=!1,verbatim:i=void 0,ttl:s=300*1e3,lookup:n=XU.lookup})=>({hints:e,lookup:o((a,...c)=>{let l=c.pop(),u=c[0]??{},h={family:r,hints:e,all:t,verbatim:i,...typeof u=="number"?{family:u}:u},f=JSON.stringify({hostname:a,...h});if(cm.has(f)){let d=cm.get(f);return process.nextTick(l,null,...d)}n(a,h,(d,...p)=>d?l(d):(cm.set(f,p,{ttl:s}),l(null,...p)))},"lookup")}),"getOptions");QU.exports={cache:cm,getOptions:lpe}});var AO=g((Nze,t2)=>{"use strict";var upe=RO(),hpe=o(r=>{let e=parseInt(r.family??"0",10),t=r.keepAlive??!0,i={keepAliveMsecs:t?1e3:void 0,maxSockets:r.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...r,family:e,keepAlive:t,timeouts:{idle:r.timeout??0,connection:0,response:0,transfer:0,...r.timeouts},...upe.getOptions({family:e,...r.dns})};return delete i.timeout,i},"normalizeOptions"),e2=o(r=>{let e="",t=Object.entries(r).sort((i,s)=>i[0]-s[0]);for(let[i,s]of t)s==null?s="null":s instanceof URL?s=s.toString():typeof s=="object"&&(s=e2(s)),e+=`${i}:${s}:`;return e},"createKey"),fpe=o(({secureEndpoint:r,...e})=>e2({secureEndpoint:!!r,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:r?!!e.rejectUnauthorized:!1,ca:r?e.ca:null,cert:r?e.cert:null,key:r?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");t2.exports={normalizeOptions:hpe,cacheOptions:fpe}});var i2=g((Dze,r2)=>{var ic=1e3,sc=ic*60,nc=sc*60,ro=nc*24,dpe=ro*7,ppe=ro*365.25;r2.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return gpe(r);if(t==="number"&&isFinite(r))return e.long?ype(r):mpe(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function gpe(r){if(r=String(r),!(r.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(r);if(e){var t=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return t*ppe;case"weeks":case"week":case"w":return t*dpe;case"days":case"day":case"d":return t*ro;case"hours":case"hour":case"hrs":case"hr":case"h":return t*nc;case"minutes":case"minute":case"mins":case"min":case"m":return t*sc;case"seconds":case"second":case"secs":case"sec":case"s":return t*ic;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}o(gpe,"parse");function mpe(r){var e=Math.abs(r);return e>=ro?Math.round(r/ro)+"d":e>=nc?Math.round(r/nc)+"h":e>=sc?Math.round(r/sc)+"m":e>=ic?Math.round(r/ic)+"s":r+"ms"}o(mpe,"fmtShort");function ype(r){var e=Math.abs(r);return e>=ro?lm(r,e,ro,"day"):e>=nc?lm(r,e,nc,"hour"):e>=sc?lm(r,e,sc,"minute"):e>=ic?lm(r,e,ic,"second"):r+" ms"}o(ype,"fmtLong");function lm(r,e,t,i){var s=e>=t*1.5;return Math.round(r/t)+" "+i+(s?"s":"")}o(lm,"plural")});var CO=g((Mze,s2)=>{function Spe(r){t.debug=t,t.default=t,t.coerce=l,t.disable=a,t.enable=s,t.enabled=c,t.humanize=i2(),t.destroy=u,Object.keys(r).forEach(h=>{t[h]=r[h]}),t.names=[],t.skips=[],t.formatters={};function e(h){let f=0;for(let d=0;d<h.length;d++)f=(f<<5)-f+h.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}o(e,"selectColor"),t.selectColor=e;function t(h){let f,d=null,p,m;function y(...w){if(!y.enabled)return;let S=y,v=Number(new Date),_=v-(f||v);S.diff=_,S.prev=f,S.curr=v,f=v,w[0]=t.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let E=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(O,T)=>{if(O==="%%")return"%";E++;let I=t.formatters[T];if(typeof I=="function"){let L=w[E];O=I.call(S,L),w.splice(E,1),E--}return O}),t.formatArgs.call(S,w),(S.log||t.log).apply(S,w)}return o(y,"debug"),y.namespace=h,y.useColors=t.useColors(),y.color=t.selectColor(h),y.extend=i,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:o(()=>d!==null?d:(p!==t.namespaces&&(p=t.namespaces,m=t.enabled(h)),m),"get"),set:o(w=>{d=w},"set")}),typeof t.init=="function"&&t.init(y),y}o(t,"createDebug");function i(h,f){let d=t(this.namespace+(typeof f>"u"?":":f)+h);return d.log=this.log,d}o(i,"extend");function s(h){t.save(h),t.namespaces=h,t.names=[],t.skips=[];let f=(typeof h=="string"?h:"").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(s,"enable");function n(h,f){let d=0,p=0,m=-1,y=0;for(;d<h.length;)if(p<f.length&&(f[p]===h[d]||f[p]==="*"))f[p]==="*"?(m=p,y=d,p++):(d++,p++);else if(m!==-1)p=m+1,y++,d=y;else return!1;for(;p<f.length&&f[p]==="*";)p++;return p===f.length}o(n,"matchesTemplate");function a(){let h=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),h}o(a,"disable");function c(h){for(let f of t.skips)if(n(h,f))return!1;for(let f of t.names)if(n(h,f))return!0;return!1}o(c,"enabled");function l(h){return h instanceof Error?h.stack||h.message:h}o(l,"coerce");function u(){}return o(u,"destroy"),t.enable(t.load()),t}o(Spe,"setup");s2.exports=Spe});var n2=g((Ot,um)=>{Ot.formatArgs=vpe;Ot.save=Epe;Ot.load=_pe;Ot.useColors=wpe;Ot.storage=bpe();Ot.destroy=(()=>{let r=!1;return()=>{r||(r=!0)}})();Ot.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 wpe(){let r;return!1}o(wpe,"useColors");function vpe(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+um.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,i=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(i=t))}),r.splice(i,0,e)}o(vpe,"formatArgs");Ot.log=console.debug||console.log||(()=>{});function Epe(r){try{r?Ot.storage.setItem("debug",r):Ot.storage.removeItem("debug")}catch{}}o(Epe,"save");function _pe(){let r;try{r=Ot.storage.getItem("debug")||Ot.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=void 0),r}o(_pe,"load");function bpe(){try{return}catch{}}o(bpe,"localstorage");um.exports=CO()(Ot);var{formatters:Ope}=um.exports;Ope.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var a2=g((qze,o2)=>{"use strict";o2.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",i=e.indexOf(t+r),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}});var u2=g((jze,l2)=>{"use strict";var Ipe=require("os"),c2=require("tty"),nr=a2(),{env:He}=process,zs;nr("no-color")||nr("no-colors")||nr("color=false")||nr("color=never")?zs=0:(nr("color")||nr("colors")||nr("color=true")||nr("color=always"))&&(zs=1);"FORCE_COLOR"in He&&(He.FORCE_COLOR==="true"?zs=1:He.FORCE_COLOR==="false"?zs=0:zs=He.FORCE_COLOR.length===0?1:Math.min(parseInt(He.FORCE_COLOR,10),3));function kO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}o(kO,"translateLevel");function PO(r,e){if(zs===0)return 0;if(nr("color=16m")||nr("color=full")||nr("color=truecolor"))return 3;if(nr("color=256"))return 2;if(r&&!e&&zs===void 0)return 0;let t=zs||0;if(He.TERM==="dumb")return t;if(process.platform==="win32"){let i=Ipe.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in He)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in He)||He.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in He)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(He.TEAMCITY_VERSION)?1:0;if(He.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in He){let i=parseInt((He.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(He.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(He.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(He.TERM)||"COLORTERM"in He?1:t}o(PO,"supportsColor");function Tpe(r){let e=PO(r,r&&r.isTTY);return kO(e)}o(Tpe,"getSupportLevel");l2.exports={supportsColor:Tpe,stdout:kO(PO(!0,c2.isatty(1))),stderr:kO(PO(!0,c2.isatty(2)))}});var f2=g((We,fm)=>{var Rpe=require("tty"),hm=require("util");We.init=Dpe;We.log=Ppe;We.formatArgs=Cpe;We.save=Npe;We.load=xpe;We.useColors=Ape;We.destroy=hm.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");We.colors=[6,2,3,4,5,1];try{let r=u2();r&&(r.stderr||r).level>=2&&(We.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{}We.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,n)=>n.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),r[t]=i,r},{});function Ape(){return"colors"in We.inspectOpts?!!We.inspectOpts.colors:Rpe.isatty(process.stderr.fd)}o(Ape,"useColors");function Cpe(r){let{namespace:e,useColors:t}=this;if(t){let i=this.color,s="\x1B[3"+(i<8?i:"8;5;"+i),n=` ${s};1m${e} \x1B[0m`;r[0]=n+r[0].split(`
46
+ `).join(`
47
+ `+n),r.push(s+"m+"+fm.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=kpe()+e+" "+r[0]}o(Cpe,"formatArgs");function kpe(){return We.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(kpe,"getDate");function Ppe(...r){return process.stderr.write(hm.formatWithOptions(We.inspectOpts,...r)+`
48
+ `)}o(Ppe,"log");function Npe(r){r?process.env.DEBUG=r:delete void 0}o(Npe,"save");function xpe(){}o(xpe,"load");function Dpe(r){r.inspectOpts={};let e=Object.keys(We.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=We.inspectOpts[e[t]]}o(Dpe,"init");fm.exports=CO()(We);var{formatters:h2}=fm.exports;h2.o=function(r){return this.inspectOpts.colors=this.useColors,hm.inspect(r,this.inspectOpts).split(`
49
+ `).map(e=>e.trim()).join(" ")};h2.O=function(r){return this.inspectOpts.colors=this.useColors,hm.inspect(r,this.inspectOpts)}});var io=g((Vze,NO)=>{typeof process>"u"||process.type==="renderer"||process.__nwjs?NO.exports=n2():NO.exports=f2()});var g2=g(It=>{"use strict";var Lpe=It&&It.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Mpe=It&&It.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),d2=It&&It.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Lpe(e,r,t);return Mpe(e,r),e};Object.defineProperty(It,"__esModule",{value:!0});It.req=It.json=It.toBuffer=void 0;var Fpe=d2(require("http")),Bpe=d2(require("https"));async function p2(r){let e=0,t=[];for await(let i of r)e+=i.length,t.push(i);return Buffer.concat(t,e)}o(p2,"toBuffer");It.toBuffer=p2;async function qpe(r){let t=(await p2(r)).toString("utf8");try{return JSON.parse(t)}catch(i){let s=i;throw s.message+=` (input: ${t})`,s}}o(qpe,"json");It.json=qpe;function jpe(r,e={}){let i=((typeof r=="string"?r:r.href).startsWith("https:")?Bpe:Fpe).request(r,e),s=new Promise((n,a)=>{i.once("response",n).once("error",a).end()});return i.then=s.then.bind(s),i}o(jpe,"req");It.req=jpe});var lh=g(Ut=>{"use strict";var y2=Ut&&Ut.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),$pe=Ut&&Ut.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),S2=Ut&&Ut.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&y2(e,r,t);return $pe(e,r),e},Upe=Ut&&Ut.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&y2(e,r,t)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.Agent=void 0;var Vpe=S2(require("net")),m2=S2(require("http")),zpe=require("https");Upe(g2(),Ut);var ui=Symbol("AgentBaseInternalState"),xO=class extends m2.Agent{static{o(this,"Agent")}constructor(e){super(e),this[ui]={}}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(`
50
+ `).some(i=>i.indexOf("(https.js:")!==-1||i.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 Vpe.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let i=this.sockets[e],s=i.indexOf(t);s!==-1&&(i.splice(s,1),this.totalSocketCount--,i.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?zpe.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,i){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(s),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,s)).then(c=>{if(this.decrementSockets(n,a),c instanceof m2.Agent)try{return c.addRequest(e,s)}catch(l){return i(l)}this[ui].currentSocket=c,super.createSocket(e,t,i)},c=>{this.decrementSockets(n,a),i(c)})}createConnection(){let e=this[ui].currentSocket;if(this[ui].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[ui].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[ui]&&(this[ui].defaultPort=e)}get protocol(){return this[ui].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[ui]&&(this[ui].protocol=e)}};Ut.Agent=xO});var E2=g(or=>{"use strict";var Gpe=or&&or.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Hpe=or&&or.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),v2=or&&or.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Gpe(e,r,t);return Hpe(e,r),e},Wpe=or&&or.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(or,"__esModule",{value:!0});or.HttpProxyAgent=void 0;var Jpe=v2(require("net")),Kpe=v2(require("tls")),Ype=Wpe(io()),Zpe=require("events"),Xpe=lh(),w2=require("url"),oc=(0,Ype.default)("http-proxy-agent"),dm=class extends Xpe.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new w2.URL(e):e,this.proxyHeaders=t?.headers??{},oc("Creating new HttpProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?Qpe(t,"headers"):null,host:i,port:s}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:i}=this,s=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${s}//${n}`,c=new w2.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let l=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(i.username||i.password){let u=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.password)}`;l["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}l["Proxy-Connection"]||(l["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(l)){let h=l[u];h&&e.setHeader(u,h)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let i,s;oc("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(oc("Patching connection write() output buffer with updated header"),i=e.outputData[0].data,s=i.indexOf(`\r
51
+ \r
52
+ `)+4,e.outputData[0].data=e._header+i.substring(s),oc("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(oc("Creating `tls.Socket`: %o",this.connectOpts),n=Kpe.connect(this.connectOpts)):(oc("Creating `net.Socket`: %o",this.connectOpts),n=Jpe.connect(this.connectOpts)),await(0,Zpe.once)(n,"connect"),n}};dm.protocols=["http","https"];or.HttpProxyAgent=dm;function Qpe(r,...e){let t={},i;for(i in r)e.includes(i)||(t[i]=r[i]);return t}o(Qpe,"omit")});var _2=g(ac=>{"use strict";var ege=ac&&ac.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ac,"__esModule",{value:!0});ac.parseProxyResponse=void 0;var tge=ege(io()),pm=(0,tge.default)("https-proxy-agent:parse-proxy-response");function rge(r){return new Promise((e,t)=>{let i=0,s=[];function n(){let h=r.read();h?u(h):r.once("readable",n)}o(n,"read");function a(){r.removeListener("end",c),r.removeListener("error",l),r.removeListener("readable",n)}o(a,"cleanup");function c(){a(),pm("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function l(h){a(),pm("onerror %o",h),t(h)}o(l,"onerror");function u(h){s.push(h),i+=h.length;let f=Buffer.concat(s,i),d=f.indexOf(`\r
53
+ \r
54
+ `);if(d===-1){pm("have not received end of HTTP headers yet..."),n();return}let p=f.slice(0,d).toString("ascii").split(`\r
55
+ `),m=p.shift();if(!m)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let y=m.split(" "),w=+y[1],S=y.slice(2).join(" "),v={};for(let _ of p){if(!_)continue;let E=_.indexOf(":");if(E===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${_}"`));let b=_.slice(0,E).toLowerCase(),O=_.slice(E+1).trimStart(),T=v[b];typeof T=="string"?v[b]=[T,O]:Array.isArray(T)?T.push(O):v[b]=O}pm("got proxy server response: %o %o",m,v),a(),e({connect:{statusCode:w,statusText:S,headers:v},buffered:f})}o(u,"ondata"),r.on("error",l),r.on("end",c),n()})}o(rge,"parseProxyResponse");ac.parseProxyResponse=rge});var A2=g(ar=>{"use strict";var ige=ar&&ar.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),sge=ar&&ar.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),T2=ar&&ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ige(e,r,t);return sge(e,r),e},R2=ar&&ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ar,"__esModule",{value:!0});ar.HttpsProxyAgent=void 0;var gm=T2(require("net")),b2=T2(require("tls")),nge=R2(require("assert")),oge=R2(io()),age=lh(),cge=require("url"),lge=_2(),uh=(0,oge.default)("https-proxy-agent"),O2=o(r=>r.servername===void 0&&r.host&&!gm.isIP(r.host)?{...r,servername:r.host}:r,"setServernameFromNonIpHost"),mm=class extends age.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new cge.URL(e):e,this.proxyHeaders=t?.headers??{},uh("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?I2(t,"headers"):null,host:i,port:s}}async connect(e,t){let{proxy:i}=this;if(!t.host)throw new TypeError('No "host" provided');let s;i.protocol==="https:"?(uh("Creating `tls.Socket`: %o",this.connectOpts),s=b2.connect(O2(this.connectOpts))):(uh("Creating `net.Socket`: %o",this.connectOpts),s=gm.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=gm.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
56
+ `;if(i.username||i.password){let d=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.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
57
+ `;let l=(0,lge.parseProxyResponse)(s);s.write(`${c}\r
58
+ `);let{connect:u,buffered:h}=await l;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",uge),t.secureEndpoint?(uh("Upgrading socket connection to TLS"),b2.connect({...I2(O2(t),"host","path","port"),socket:s})):s;s.destroy();let f=new gm.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{uh("Replaying proxy buffer for failed request"),(0,nge.default)(d.listenerCount("data")>0),d.push(h),d.push(null)}),f}};mm.protocols=["http","https"];ar.HttpsProxyAgent=mm;function uge(r){r.resume()}o(uge,"resume");function I2(r,...e){let t={},i;for(i in r)e.includes(i)||(t[i]=r[i]);return t}o(I2,"omit")});var N2=g(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var C2=require("buffer"),so={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."};is.ERRORS=so;function hge(r){if(!C2.Buffer.isEncoding(r))throw new Error(so.INVALID_ENCODING)}o(hge,"checkEncoding");is.checkEncoding=hge;function k2(r){return typeof r=="number"&&isFinite(r)&&gge(r)}o(k2,"isFiniteInteger");is.isFiniteInteger=k2;function P2(r,e){if(typeof r=="number"){if(!k2(r)||r<0)throw new Error(e?so.INVALID_OFFSET:so.INVALID_LENGTH)}else throw new Error(e?so.INVALID_OFFSET_NON_NUMBER:so.INVALID_LENGTH_NON_NUMBER)}o(P2,"checkOffsetOrLengthValue");function fge(r){P2(r,!1)}o(fge,"checkLengthValue");is.checkLengthValue=fge;function dge(r){P2(r,!0)}o(dge,"checkOffsetValue");is.checkOffsetValue=dge;function pge(r,e){if(r<0||r>e.length)throw new Error(so.INVALID_TARGET_OFFSET)}o(pge,"checkTargetOffset");is.checkTargetOffset=pge;function gge(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(gge,"isInteger");function mge(r){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof C2.Buffer.prototype[r]>"u")throw new Error(`Platform does not support Buffer.prototype.${r}.`)}o(mge,"bigIntAndBufferInt64Check");is.bigIntAndBufferInt64Check=mge});var D2=g(LO=>{"use strict";Object.defineProperty(LO,"__esModule",{value:!0});var z=N2(),x2=4096,yge="utf8",DO=class r{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=yge,this._writeOffset=0,this._readOffset=0,r.isSmartBufferOptions(e))if(e.encoding&&(z.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(z.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(z.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(z.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(x2);else{if(typeof e<"u")throw new Error(z.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(x2)}}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 z.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return z.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 z.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return z.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return z.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return z.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 z.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return z.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 z.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return z.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return z.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return z.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 i;typeof e=="number"?(z.checkLengthValue(e),i=Math.min(e,this.length-this._readOffset)):(t=e,i=this.length-this._readOffset),typeof t<"u"&&z.checkEncoding(t);let s=this._buff.slice(this._readOffset,this._readOffset+i).toString(t||this._encoding);return this._readOffset+=i,s}insertString(e,t,i){return z.checkOffsetValue(t),this._handleString(e,!0,t,i)}writeString(e,t,i){return this._handleString(e,!1,t,i)}readStringNT(e){typeof e<"u"&&z.checkEncoding(e);let t=this.length;for(let s=this._readOffset;s<this.length;s++)if(this._buff[s]===0){t=s;break}let i=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,i.toString(e||this._encoding)}insertStringNT(e,t,i){return z.checkOffsetValue(t),this.insertString(e,t,i),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,i){return this.writeString(e,t,i),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&z.checkLengthValue(e);let t=typeof e=="number"?e:this.length,i=Math.min(this.length,this._readOffset+t),s=this._buff.slice(this._readOffset,i);return this._readOffset=i,s}insertBuffer(e,t){return z.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let i=this._readOffset;i<this.length;i++)if(this._buff[i]===0){e=i;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return z.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&z.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){z.checkOffsetValue(e),z.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){z.checkOffsetValue(e),z.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){z.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 z.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,i,s){let n=this._writeOffset,a=this._encoding;typeof i=="number"?n=i:typeof i=="string"&&(z.checkEncoding(i),a=i),typeof s=="string"&&(z.checkEncoding(s),a=s);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 i=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,i){let s=typeof i=="number"?i:this._writeOffset;return t?this.ensureInsertable(e.length,s):this._ensureWriteable(e.length,s),e.copy(this._buff,s),t?this._writeOffset+=e.length:typeof i=="number"?this._writeOffset=Math.max(this._writeOffset,s+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let i=this._readOffset;if(typeof t<"u"&&(z.checkOffsetValue(t),i=t),i<0||i+e>this.length)throw new Error(z.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){z.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 i=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(i+e),i+e>this.length&&(this.length=i+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let i=this._buff,s=t*3/2+1;s<e&&(s=e),this._buff=Buffer.allocUnsafe(s),i.copy(this._buff,0,0,t)}}_readNumberValue(e,t,i){this.ensureReadable(t,i);let s=e.call(this._buff,typeof i=="number"?i:this._readOffset);return typeof i>"u"&&(this._readOffset+=t),s}_insertNumberValue(e,t,i,s){return z.checkOffsetValue(s),this.ensureInsertable(t,s),e.call(this._buff,i,s),this._writeOffset+=t,this}_writeNumberValue(e,t,i,s){if(typeof s=="number"){if(s<0)throw new Error(z.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);z.checkOffsetValue(s)}let n=typeof s=="number"?s:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,i,n),typeof s=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};LO.SmartBuffer=DO});var MO=g(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.SOCKS5_NO_ACCEPTABLE_AUTH=he.SOCKS5_CUSTOM_AUTH_END=he.SOCKS5_CUSTOM_AUTH_START=he.SOCKS_INCOMING_PACKET_SIZES=he.SocksClientState=he.Socks5Response=he.Socks5HostType=he.Socks5Auth=he.Socks4Response=he.SocksCommand=he.ERRORS=he.DEFAULT_TIMEOUT=void 0;var Sge=3e4;he.DEFAULT_TIMEOUT=Sge;var wge={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"};he.ERRORS=wge;var vge={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(r=>r+7,"Socks5ResponseHostname"),Socks4Response:8};he.SOCKS_INCOMING_PACKET_SIZES=vge;var L2;(function(r){r[r.connect=1]="connect",r[r.bind=2]="bind",r[r.associate=3]="associate"})(L2||(he.SocksCommand=L2={}));var M2;(function(r){r[r.Granted=90]="Granted",r[r.Failed=91]="Failed",r[r.Rejected=92]="Rejected",r[r.RejectedIdent=93]="RejectedIdent"})(M2||(he.Socks4Response=M2={}));var F2;(function(r){r[r.NoAuth=0]="NoAuth",r[r.GSSApi=1]="GSSApi",r[r.UserPass=2]="UserPass"})(F2||(he.Socks5Auth=F2={}));var Ege=128;he.SOCKS5_CUSTOM_AUTH_START=Ege;var _ge=254;he.SOCKS5_CUSTOM_AUTH_END=_ge;var bge=255;he.SOCKS5_NO_ACCEPTABLE_AUTH=bge;var B2;(function(r){r[r.Granted=0]="Granted",r[r.Failure=1]="Failure",r[r.NotAllowed=2]="NotAllowed",r[r.NetworkUnreachable=3]="NetworkUnreachable",r[r.HostUnreachable=4]="HostUnreachable",r[r.ConnectionRefused=5]="ConnectionRefused",r[r.TTLExpired=6]="TTLExpired",r[r.CommandNotSupported=7]="CommandNotSupported",r[r.AddressNotSupported=8]="AddressNotSupported"})(B2||(he.Socks5Response=B2={}));var q2;(function(r){r[r.IPv4=1]="IPv4",r[r.Hostname=3]="Hostname",r[r.IPv6=4]="IPv6"})(q2||(he.Socks5HostType=q2={}));var j2;(function(r){r[r.Created=0]="Created",r[r.Connecting=1]="Connecting",r[r.Connected=2]="Connected",r[r.SentInitialHandshake=3]="SentInitialHandshake",r[r.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",r[r.SentAuthentication=5]="SentAuthentication",r[r.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",r[r.SentFinalHandshake=7]="SentFinalHandshake",r[r.ReceivedFinalResponse=8]="ReceivedFinalResponse",r[r.BoundWaitingForConnection=9]="BoundWaitingForConnection",r[r.Established=10]="Established",r[r.Disconnected=11]="Disconnected",r[r.Error=99]="Error"})(j2||(he.SocksClientState=j2={}))});var BO=g(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.shuffleArray=cc.SocksClientError=void 0;var FO=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};cc.SocksClientError=FO;function Oge(r){for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[r[e],r[t]]=[r[t],r[e]]}}o(Oge,"shuffleArray");cc.shuffleArray=Oge});var ym=g(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.isInSubnet=Ige;no.isCorrect=Tge;no.numberToPaddedHex=$2;no.stringToPaddedHex=Rge;no.testBit=Age;function Ige(r){return this.subnetMask<r.subnetMask?!1:this.mask(r.subnetMask)===r.mask()}o(Ige,"isInSubnet");function Tge(r){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===r&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(Tge,"isCorrect");function $2(r){return r.toString(16).padStart(2,"0")}o($2,"numberToPaddedHex");function Rge(r){return $2(parseInt(r,10))}o(Rge,"stringToPaddedHex");function Age(r,e){let{length:t}=r;if(e>t)return!1;let i=t-e;return r.substring(i,i+1)==="1"}o(Age,"testBit")});var qO=g(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.RE_SUBNET_STRING=hi.RE_ADDRESS=hi.GROUPS=hi.BITS=void 0;hi.BITS=32;hi.GROUPS=4;hi.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;hi.RE_SUBNET_STRING=/\/\d{1,2}$/});var wm=g(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.AddressError=void 0;var jO=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};Sm.AddressError=jO});var UO=g(fi=>{"use strict";var Cge=fi&&fi.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),kge=fi&&fi.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),V2=fi&&fi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Cge(e,r,t);return kge(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.Address4=void 0;var lc=V2(ym()),Fr=V2(qO()),U2=wm(),$O=class r{static{o(this,"Address4")}constructor(e){this.groups=Fr.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=lc.isCorrect(Fr.BITS),this.isInSubnet=lc.isInSubnet,this.address=e;let t=Fr.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>Fr.BITS)throw new U2.AddressError("Invalid subnet mask.");e=e.replace(Fr.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new r(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(Fr.RE_ADDRESS))throw new U2.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"),i=[],s;for(s=0;s<8;s+=2){let n=t.slice(s,s+2);i.push(parseInt(n,16))}return new r(i.join("."))}static fromInteger(e){return r.fromHex(e.toString(16))}static fromArpa(e){let i=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new r(i)}toHex(){return this.parsedAddress.map(e=>lc.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<Fr.GROUPS;t+=2)e.push(`${lc.stringToPaddedHex(this.parsedAddress[t])}${lc.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>lc.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(Fr.BITS-this.subnetMask)}`)}startAddress(){return r.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return r.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(Fr.BITS-this.subnetMask)}`)}endAddress(){return r.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return r.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return r.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 r("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(Fr.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(Fr.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>`)}};fi.Address4=$O});var VO=g(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.RE_URL_WITH_PORT=Te.RE_URL=Te.RE_ZONE_STRING=Te.RE_SUBNET_STRING=Te.RE_BAD_ADDRESS=Te.RE_BAD_CHARACTERS=Te.TYPES=Te.SCOPES=Te.GROUPS=Te.BITS=void 0;Te.BITS=128;Te.GROUPS=8;Te.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};Te.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"};Te.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;Te.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;Te.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;Te.RE_ZONE_STRING=/%.*$/;Te.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;Te.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var zO=g(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.spanAllZeroes=z2;uc.spanAll=Pge;uc.spanLeadingZeroes=Nge;uc.simpleGroup=xge;function z2(r){return r.replace(/(0+)/g,'<span class="zero">$1</span>')}o(z2,"spanAllZeroes");function Pge(r,e=0){return r.split("").map((i,s)=>`<span class="digit value-${i} position-${s+e}">${z2(i)}</span>`).join("")}o(Pge,"spanAll");function G2(r){return r.replace(/^(0+)/,'<span class="zero">$1</span>')}o(G2,"spanLeadingZeroesSimple");function Nge(r){return r.split(":").map(t=>G2(t)).join(":")}o(Nge,"spanLeadingZeroes");function xge(r,e=0){return r.split(":").map((i,s)=>/group-v4/.test(i)?i:`<span class="hover-group group-${s+e}">${G2(i)}</span>`)}o(xge,"simpleGroup")});var H2=g(Tt=>{"use strict";var Dge=Tt&&Tt.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Lge=Tt&&Tt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Mge=Tt&&Tt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Dge(e,r,t);return Lge(e,r),e};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.ADDRESS_BOUNDARY=void 0;Tt.groupPossibilities=Em;Tt.padGroup=vm;Tt.simpleRegularExpression=Bge;Tt.possibleElisions=qge;var Fge=Mge(VO());function Em(r){return`(${r.join("|")})`}o(Em,"groupPossibilities");function vm(r){return r.length<4?`0{0,${4-r.length}}${r}`:r}o(vm,"padGroup");Tt.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function Bge(r){let e=[];r.forEach((i,s)=>{parseInt(i,16)===0&&e.push(s)});let t=e.map(i=>r.map((s,n)=>{if(n===i){let a=n===0||n===Fge.GROUPS-1?":":"";return Em([vm(s),a])}return vm(s)}).join(":"));return t.push(r.map(vm).join(":")),Em(t)}o(Bge,"simpleRegularExpression");function qge(r,e,t){let i=e?"":":",s=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${i}(:0{1,4}){1,${r-1}}`),n.push(`(0{1,4}:){1,${r-1}}${s}`),n.push(`(0{1,4}:){${r-1}}0{1,4}`);for(let a=1;a<r-1;a++)for(let c=1;c<r-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${r-c-a-1}}0{1,4}`);return Em(n)}o(qge,"possibleElisions")});var Y2=g(di=>{"use strict";var jge=di&&di.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),$ge=di&&di.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Om=di&&di.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&jge(e,r,t);return $ge(e,r),e};Object.defineProperty(di,"__esModule",{value:!0});di.Address6=void 0;var W2=Om(ym()),GO=Om(qO()),fe=Om(VO()),HO=Om(zO()),oo=UO(),ao=H2(),ss=wm(),_m=ym();function bm(r){if(!r)throw new Error("Assertion failed.")}o(bm,"assert");function Uge(r){let e=/(\d+)(\d{3})/;for(;e.test(r);)r=r.replace(e,"$1,$2");return r}o(Uge,"addCommas");function Vge(r){return r=r.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),r=r.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),r}o(Vge,"spanLeadingZeroes4");function zge(r,e){let t=[],i=[],s;for(s=0;s<r.length;s++)s<e[0]?t.push(r[s]):s>e[1]&&i.push(r[s]);return t.concat(["compact"]).concat(i)}o(zge,"compact");function J2(r){return parseInt(r,16).toString(16).padStart(4,"0")}o(J2,"paddedHex");function K2(r){return r&255}o(K2,"unsignByte");var WO=class r{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=W2.isInSubnet,this.isCorrect=W2.isCorrect(fe.BITS),t===void 0?this.groups=fe.GROUPS:this.groups=t,this.address=e;let i=fe.RE_SUBNET_STRING.exec(e);if(i){if(this.parsedSubnet=i[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>fe.BITS)throw new ss.AddressError("Invalid subnet mask.");e=e.replace(fe.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new ss.AddressError("Invalid subnet mask.");let s=fe.RE_ZONE_STRING.exec(e);s&&(this.zone=s[0],e=e.replace(fe.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new r(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),i=[],s;for(s=0;s<fe.GROUPS;s++)i.push(t.slice(s*4,(s+1)*4));return new r(i.join(":"))}static fromURL(e){let t,i=null,s;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(s=fe.RE_URL_WITH_PORT.exec(e),s===null)return{error:"failed to parse address with port",address:null,port:null};t=s[1],i=s[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),s=fe.RE_URL.exec(e),s===null)return{error:"failed to parse address from URL",address:null,port:null};t=s[1]}else t=e;return i?(i=parseInt(i,10),(i<0||i>65536)&&(i=null)):i=null,{address:new r(t),port:i}}static fromAddress4(e){let t=new oo.Address4(e),i=fe.BITS-(GO.BITS-t.subnetMask);return new r(`::ffff:${t.correctForm()}/${i}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),i=7;if(t.length!==63)throw new ss.AddressError("Invalid 'ip6.arpa' form.");let s=t.split(".").reverse();for(let n=i;n>0;n--){let a=n*4;s.splice(a,0,":")}return t=s.join(""),new r(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=fe.BITS-this.subnetMask,i=Math.abs(e-fe.BITS),s=t-i;return s<0?"0":Uge((BigInt("2")**BigInt(s)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(fe.BITS-this.subnetMask)}`)}startAddress(){return r.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return r.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(fe.BITS-this.subnetMask)}`)}endAddress(){return r.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return r.fromBigInt(this._endAddress()-e)}getScope(){let e=fe.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(fe.TYPES))if(this.isInSubnet(new r(e)))return fe.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 i=t-e;if(i%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(i/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,fe.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),i=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?i:`${i}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],i=0,s=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&i++,c!==0&&i>0&&(i>1&&s.push([e-i,e-1]),i=0)}i>1&&s.push([this.parsedAddress.length-i,this.parsedAddress.length-1]);let n=s.map(c=>c[1]-c[0]+1);if(s.length>0){let c=n.indexOf(Math.max(...n));t=zge(this.parsedAddress,s[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(fe.BITS,"0")}parse4in6(e){let t=e.split(":"),s=t.slice(-1)[0].match(GO.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new oo.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new ss.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(GO.RE_ADDRESS,this.address4.parsedAddress.map(Vge).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(fe.RE_BAD_CHARACTERS);if(t)throw new ss.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(fe.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let i=e.match(fe.RE_BAD_ADDRESS);if(i)throw new ss.AddressError(`Address failed regex: ${i.join("")}`,e.replace(fe.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let s=[],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 l=this.groups-(a.length+c.length);if(!l)throw new ss.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,s=s.concat(a);for(let u=0;u<l;u++)s.push("0");s=s.concat(c)}else if(n.length===1)s=e.split(":"),this.elidedGroups=0;else throw new ss.AddressError("Too many :: groups found");if(s=s.map(a=>parseInt(a,16).toString(16)),s.length!==this.groups)throw new ss.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(J2).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(J2).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return oo.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),i=new r(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(i)||(s=":"),i+s+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),i=(this.getBits(80,96)^BigInt("0xffff")).toString(),s=oo.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=oo.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),l=(0,_m.testBit)(c,15),u=(0,_m.testBit)(c,14),h=(0,_m.testBit)(c,8),f=(0,_m.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:s.address,client4:a.address,flags:c,coneNat:l,microsoft:{reserved:u,universalLocal:f,groupIndividual:h,nonce:d},udpPort:i}}inspect6to4(){let e=this.getBitsBase16(0,16),t=oo.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 r(e)}toByteArray(){let e=this.bigInt().toString(16),i=`${"0".repeat(e.length%2)}${e}`,s=[];for(let n=0,a=i.length;n<a;n+=2)s.push(parseInt(i.substring(n,n+2),16));return s}toUnsignedByteArray(){return this.toByteArray().map(K2)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(K2))}static fromUnsignedByteArray(e){let t=BigInt("256"),i=BigInt("0"),s=BigInt("1");for(let n=e.length-1;n>=0;n--)i+=s*BigInt(e[n].toString(10)),s*=t;return r.fromBigInt(i)}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 r("2001::/32"))}is6to4(){return this.isInSubnet(new r("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 i=t.call(this);return e.className?`<a href="${e.prefix}${i}" class="${e.className}">${i}</a>`:`<a href="${e.prefix}${i}">${i}</a>`}group(){if(this.elidedGroups===0)return HO.simpleGroup(this.address).join(":");bm(typeof this.elidedGroups=="number"),bm(typeof this.elisionBegin=="number");let e=[],[t,i]=this.address.split("::");t.length?e.push(...HO.simpleGroup(t)):e.push("");let s=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)s.push(`group-${n}`);return e.push(`<span class="${s.join(" ")}"></span>`),i.length?e.push(...HO.simpleGroup(i,this.elisionEnd)):e.push(""),this.is4()&&(bm(this.address4 instanceof oo.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],i=new r(this.correctForm());if(i.elidedGroups===0)t.push((0,ao.simpleRegularExpression)(i.parsedAddress));else if(i.elidedGroups===fe.GROUPS)t.push((0,ao.possibleElisions)(fe.GROUPS));else{let s=i.address.split("::");s[0].length&&t.push((0,ao.simpleRegularExpression)(s[0].split(":"))),bm(typeof i.elidedGroups=="number"),t.push((0,ao.possibleElisions)(i.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&t.push((0,ao.simpleRegularExpression)(s[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",ao.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",ao.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};di.Address6=WO});var JO=g(ot=>{"use strict";var Gge=ot&&ot.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Hge=ot&&ot.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Wge=ot&&ot.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Gge(e,r,t);return Hge(e,r),e};Object.defineProperty(ot,"__esModule",{value:!0});ot.v6=ot.AddressError=ot.Address6=ot.Address4=void 0;var Jge=UO();Object.defineProperty(ot,"Address4",{enumerable:!0,get:o(function(){return Jge.Address4},"get")});var Kge=Y2();Object.defineProperty(ot,"Address6",{enumerable:!0,get:o(function(){return Kge.Address6},"get")});var Yge=wm();Object.defineProperty(ot,"AddressError",{enumerable:!0,get:o(function(){return Yge.AddressError},"get")});var Zge=Wge(zO());ot.v6={helpers:Zge}});var rV=g(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.ipToBuffer=cr.int32ToIpv4=cr.ipv4ToInt32=cr.validateSocksClientChainOptions=cr.validateSocksClientOptions=void 0;var gt=BO(),Je=MO(),Xge=require("stream"),KO=JO(),Z2=require("net");function Qge(r,e=["connect","bind","associate"]){if(!Je.SocksCommand[r.command])throw new gt.SocksClientError(Je.ERRORS.InvalidSocksCommand,r);if(e.indexOf(r.command)===-1)throw new gt.SocksClientError(Je.ERRORS.InvalidSocksCommandForOperation,r);if(!Q2(r.destination))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsDestination,r);if(!eV(r.proxy))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsProxy,r);if(X2(r.proxy,r),r.timeout&&!tV(r.timeout))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsTimeout,r);if(r.existing_socket&&!(r.existing_socket instanceof Xge.Duplex))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsExistingSocket,r)}o(Qge,"validateSocksClientOptions");cr.validateSocksClientOptions=Qge;function eme(r){if(r.command!=="connect")throw new gt.SocksClientError(Je.ERRORS.InvalidSocksCommandChain,r);if(!Q2(r.destination))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsDestination,r);if(!(r.proxies&&Array.isArray(r.proxies)&&r.proxies.length>=2))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsProxiesLength,r);if(r.proxies.forEach(e=>{if(!eV(e))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsProxy,r);X2(e,r)}),r.timeout&&!tV(r.timeout))throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsTimeout,r)}o(eme,"validateSocksClientChainOptions");cr.validateSocksClientChainOptions=eme;function X2(r,e){if(r.custom_auth_method!==void 0){if(r.custom_auth_method<Je.SOCKS5_CUSTOM_AUTH_START||r.custom_auth_method>Je.SOCKS5_CUSTOM_AUTH_END)throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(r.custom_auth_request_handler===void 0||typeof r.custom_auth_request_handler!="function")throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(r.custom_auth_response_size===void 0)throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(r.custom_auth_response_handler===void 0||typeof r.custom_auth_response_handler!="function")throw new gt.SocksClientError(Je.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(X2,"validateCustomProxyAuth");function Q2(r){return r&&typeof r.host=="string"&&Buffer.byteLength(r.host)<256&&typeof r.port=="number"&&r.port>=0&&r.port<=65535}o(Q2,"isValidSocksRemoteHost");function eV(r){return r&&(typeof r.host=="string"||typeof r.ipaddress=="string")&&typeof r.port=="number"&&r.port>=0&&r.port<=65535&&(r.type===4||r.type===5)}o(eV,"isValidSocksProxy");function tV(r){return typeof r=="number"&&r>0}o(tV,"isValidTimeoutValue");function tme(r){return new KO.Address4(r).toArray().reduce((t,i)=>(t<<8)+i,0)>>>0}o(tme,"ipv4ToInt32");cr.ipv4ToInt32=tme;function rme(r){let e=r>>>24&255,t=r>>>16&255,i=r>>>8&255,s=r&255;return[e,t,i,s].join(".")}o(rme,"int32ToIpv4");cr.int32ToIpv4=rme;function ime(r){if(Z2.isIPv4(r)){let e=new KO.Address4(r);return Buffer.from(e.toArray())}else if(Z2.isIPv6(r)){let e=new KO.Address6(r);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(ime,"ipToBuffer");cr.ipToBuffer=ime});var iV=g(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.ReceiveBuffer=void 0;var YO=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}};Im.ReceiveBuffer=YO});var sV=g(Gs=>{"use strict";var hc=Gs&&Gs.__awaiter||function(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return o(s,"adopt"),new(t||(t=Promise))(function(n,a){function c(h){try{u(i.next(h))}catch(f){a(f)}}o(c,"fulfilled");function l(h){try{u(i.throw(h))}catch(f){a(f)}}o(l,"rejected");function u(h){h.done?n(h.value):s(h.value).then(c,l)}o(u,"step"),u((i=i.apply(r,e||[])).next())})};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.SocksClientError=Gs.SocksClient=void 0;var sme=require("events"),fc=require("net"),Rt=D2(),A=MO(),Vt=rV(),nme=iV(),XO=BO();Object.defineProperty(Gs,"SocksClientError",{enumerable:!0,get:o(function(){return XO.SocksClientError},"get")});var ZO=JO(),QO=class r extends sme.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,Vt.validateSocksClientOptions)(e),this.setState(A.SocksClientState.Created)}static createConnection(e,t){return new Promise((i,s)=>{try{(0,Vt.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),i(a)):s(a)}let n=new r(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),i(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),i(a)):s(a)})})}static createConnectionChain(e,t){return new Promise((i,s)=>hc(this,void 0,void 0,function*(){try{(0,Vt.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),i(n)):s(n)}e.randomizeChain&&(0,XO.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],l=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 r.createConnection({command:"connect",proxy:c,destination:l,existing_socket:n});n=n||u.socket}typeof t=="function"?(t(null,{socket:n}),i({socket:n})):i({socket:n})}catch(n){typeof t=="function"?(t(n),i(n)):s(n)}}))}static createUDPFrame(e){let t=new Rt.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),fc.isIPv4(e.remoteHost.host)?(t.writeUInt8(A.Socks5HostType.IPv4),t.writeUInt32BE((0,Vt.ipv4ToInt32)(e.remoteHost.host))):fc.isIPv6(e.remoteHost.host)?(t.writeUInt8(A.Socks5HostType.IPv6),t.writeBuffer((0,Vt.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(A.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=Rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let i=t.readUInt8(),s=t.readUInt8(),n;s===A.Socks5HostType.IPv4?n=(0,Vt.int32ToIpv4)(t.readUInt32BE()):s===A.Socks5HostType.IPv6?n=ZO.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:i,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==A.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=i=>this.onDataReceivedHandler(i),this.onClose=()=>this.onCloseHandler(),this.onError=i=>this.onErrorHandler(i),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||A.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new fc.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(A.SocksClientState.Connecting),this.receiveBuffer=new nme.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",i=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let s=this.receiveBuffer.get(this.receiveBuffer.length);i.socket.emit("data",s)}i.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!==A.SocksClientState.Established&&this.state!==A.SocksClientState.BoundWaitingForConnection&&this.closeSocket(A.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(A.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(A.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==A.SocksClientState.Established&&this.state!==A.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===A.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===A.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===A.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===A.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(A.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(A.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!==A.SocksClientState.Error&&(this.setState(A.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new XO.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new Rt.SmartBuffer;t.writeUInt8(4),t.writeUInt8(A.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),fc.isIPv4(this.options.destination.host)?(t.writeBuffer((0,Vt.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=A.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==A.Socks4Response.Granted)this.closeSocket(`${A.ERRORS.Socks4ProxyRejectedConnection} - (${A.Socks4Response[e[1]]})`);else if(A.SocksCommand[this.options.command]===A.SocksCommand.bind){let t=Rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let i={port:t.readUInt16BE(),host:(0,Vt.int32ToIpv4)(t.readUInt32BE())};i.host==="0.0.0.0"&&(i.host=this.options.proxy.ipaddress),this.setState(A.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:i,socket:this.socket})}else this.setState(A.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==A.Socks4Response.Granted)this.closeSocket(`${A.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${A.Socks4Response[e[1]]})`);else{let t=Rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let i={port:t.readUInt16BE(),host:(0,Vt.int32ToIpv4)(t.readUInt32BE())};this.setState(A.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:i,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new Rt.SmartBuffer,t=[A.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(A.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 i of t)e.writeUInt8(i);this.nextRequiredPacketBufferSize=A.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(A.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(A.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===A.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(A.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===A.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=A.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===A.Socks5Auth.UserPass?(this.socks5ChosenAuthType=A.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(A.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",i=new Rt.SmartBuffer;i.writeUInt8(1),i.writeUInt8(Buffer.byteLength(e)),i.writeString(e),i.writeUInt8(Buffer.byteLength(t)),i.writeString(t),this.nextRequiredPacketBufferSize=A.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(i.toBuffer()),this.setState(A.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return hc(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(A.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return hc(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return hc(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return hc(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return hc(this,void 0,void 0,function*(){this.setState(A.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===A.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===A.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(A.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new Rt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(A.SocksCommand[this.options.command]),e.writeUInt8(0),fc.isIPv4(this.options.destination.host)?(e.writeUInt8(A.Socks5HostType.IPv4),e.writeBuffer((0,Vt.ipToBuffer)(this.options.destination.host))):fc.isIPv6(this.options.destination.host)?(e.writeUInt8(A.Socks5HostType.IPv6),e.writeBuffer((0,Vt.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(A.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(A.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==A.Socks5Response.Granted)this.closeSocket(`${A.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${A.Socks5Response[e[1]]}`);else{let t=e[3],i,s;if(t===A.Socks5HostType.IPv4){let n=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=Rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),i={host:(0,Vt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},i.host==="0.0.0.0"&&(i.host=this.options.proxy.ipaddress)}else if(t===A.Socks5HostType.Hostname){let n=e[4],a=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}s=Rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),i={host:s.readString(n),port:s.readUInt16BE()}}else if(t===A.Socks5HostType.IPv6){let n=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=Rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),i={host:ZO.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(A.SocksClientState.ReceivedFinalResponse),A.SocksCommand[this.options.command]===A.SocksCommand.connect?(this.setState(A.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:i,socket:this.socket})):A.SocksCommand[this.options.command]===A.SocksCommand.bind?(this.setState(A.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:i,socket:this.socket})):A.SocksCommand[this.options.command]===A.SocksCommand.associate&&(this.setState(A.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:i,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==A.Socks5Response.Granted)this.closeSocket(`${A.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${A.Socks5Response[e[1]]}`);else{let t=e[3],i,s;if(t===A.Socks5HostType.IPv4){let n=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=Rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),i={host:(0,Vt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},i.host==="0.0.0.0"&&(i.host=this.options.proxy.ipaddress)}else if(t===A.Socks5HostType.Hostname){let n=e[4],a=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}s=Rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),i={host:s.readString(n),port:s.readUInt16BE()}}else if(t===A.Socks5HostType.IPv6){let n=A.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=Rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),i={host:ZO.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(A.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:i,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Gs.SocksClient=QO});var nV=g(co=>{"use strict";var ome=co&&co.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),ame=co&&co.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ome(e,r,t)};Object.defineProperty(co,"__esModule",{value:!0});ame(sV(),co)});var oV=g(lr=>{"use strict";var cme=lr&&lr.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),lme=lr&&lr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),eI=lr&&lr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&cme(e,r,t);return lme(e,r),e},ume=lr&&lr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lr,"__esModule",{value:!0});lr.SocksProxyAgent=void 0;var hme=nV(),fme=lh(),dme=ume(io()),pme=eI(require("dns")),gme=eI(require("net")),mme=eI(require("tls")),yme=require("url"),Tm=(0,dme.default)("socks-proxy-agent"),Sme=o(r=>r.servername===void 0&&r.host&&!gme.isIP(r.host)?{...r,servername:r.host}:r,"setServernameFromNonIpHost");function wme(r){let e=!1,t=5,i=r.hostname,s=parseInt(r.port,10)||1080;switch(r.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(r.protocol)}`)}let n={host:i,port:s,type:t};return r.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(r.username),enumerable:!1}),r.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(r.password),enumerable:!1}),{lookup:e,proxy:n}}o(wme,"parseSocksURL");var Rm=class extends fme.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let i=typeof e=="string"?new yme.URL(e):e,{proxy:s,lookup:n}=wme(i);this.shouldLookup=n,this.proxy=s,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:i,proxy:s,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:l=pme.lookup}=t;i&&(a=await new Promise((d,p)=>{l(a,{},(m,y)=>{m?p(m):d(y)})}));let u={proxy:s,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},h=o(d=>{e.destroy(),f.destroy(),d&&d.destroy()},"cleanup");Tm("Creating socks proxy connection: %o",u);let{socket:f}=await hme.SocksClient.createConnection(u);if(Tm("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>h())),t.secureEndpoint){Tm("Upgrading socket connection to TLS");let d=mme.connect({...vme(Sme(t),"host","path","port"),socket:f});return d.once("error",p=>{Tm("Socket TLS error",p.message),h(d)}),d}return f}};Rm.protocols=["socks","socks4","socks4a","socks5","socks5h"];lr.SocksProxyAgent=Rm;function vme(r,...e){let t={},i;for(i in r)e.includes(i)||(t[i]=r[i]);return t}o(vme,"omit")});var oI=g((DGe,aV)=>{"use strict";var tI=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}},rI=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},iI=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},sI=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let i="Response timeout ";t&&(i+=`from proxy \`${t.host}\` `),i+=`connecting to host \`${e.host}\``,super(i),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},nI=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let i="Transfer timeout ";t&&(i+=`from proxy \`${t.host}\` `),i+=`for \`${e.host}\``,super(i),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};aV.exports={InvalidProxyProtocolError:tI,ConnectionTimeoutError:rI,IdleTimeoutError:iI,ResponseTimeoutError:sI,TransferTimeoutError:nI}});var aI=g((MGe,lV)=>{"use strict";var{HttpProxyAgent:Eme}=E2(),{HttpsProxyAgent:_me}=A2(),{SocksProxyAgent:cV}=oV(),{LRUCache:bme}=Pi(),{InvalidProxyProtocolError:Ome}=oI(),Ime=new bme({max:20}),Tme=new Set(cV.protocols),Rme=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),hh=Object.entries(process.env).reduce((r,[e,t])=>(e=e.toLowerCase(),Rme.has(e)&&(r[e]=t),r),{}),Ame=o(r=>{r=new URL(r);let e=r.protocol.slice(0,-1);if(Tme.has(e))return cV;if(e==="https"||e==="http")return[Eme,_me];throw new Ome(r)},"getProxyAgent"),Cme=o((r,e)=>{if(typeof e=="string"&&(e=e.split(",").map(i=>i.trim()).filter(Boolean)),!e||!e.length)return!1;let t=r.hostname.split(".").reverse();return e.some(i=>{let s=i.split(".").filter(Boolean).reverse();if(!s.length)return!1;for(let n=0;n<s.length;n++)if(t[n]!==s[n])return!1;return!0})},"isNoProxy"),kme=o((r,{proxy:e,noProxy:t})=>(r=new URL(r),e||(e=r.protocol==="https:"?hh.https_proxy:hh.https_proxy||hh.http_proxy||hh.proxy),t||(t=hh.no_proxy),!e||Cme(r,t)?null:new URL(e)),"getProxy");lV.exports={getProxyAgent:Ame,getProxy:kme,proxyCache:Ime}});var fV=g((qGe,hV)=>{"use strict";var Pme=require("net"),Nme=require("tls"),{once:uV}=require("events"),xme=require("timers/promises"),{normalizeOptions:Dme,cacheOptions:Lme}=AO(),{getProxy:Mme,getProxyAgent:Fme,proxyCache:cI}=aI(),Am=oI(),{Agent:Bme}=lh();hV.exports=class extends Bme{static{o(this,"Agent")}#e;#t;#r;#i;#s;constructor(e={}){let{timeouts:t,proxy:i,noProxy:s,...n}=Dme(e);super(n),this.#e=n,this.#t=t,i&&(this.#r=new URL(i),this.#i=s,this.#s=Fme(i))}get proxy(){return this.#r?{url:this.#r}:{}}#o(e){if(!this.#r)return;let t=Mme(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#r,noProxy:this.#i});if(!t)return;let i=Lme({...e,...this.#e,timeouts:this.#t,proxy:t});if(cI.has(i))return cI.get(i);let s=this.#s;Array.isArray(s)&&(s=this.isSecureEndpoint(e)?s[1]:s[0]);let n=new s(t,{...this.#e,socketOptions:{family:this.#e.family}});return cI.set(i,n),n}async#n({promises:e,options:t,timeout:i},s=new AbortController){if(i){let a=xme.setTimeout(i,null,{signal:s.signal}).then(()=>{throw new Am.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),s.abort()}catch(a){throw s.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let i,s=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#o(t);if(a){let h=Date.now();i=await this.#n({options:t,timeout:s,promises:[a.connect(e,t)]}),s&&(s=s-(Date.now()-h))}else i=(n?Nme:Pme).connect(t);i.setKeepAlive(this.keepAlive,this.keepAliveMsecs),i.setNoDelay(this.keepAlive);let c=new AbortController,{signal:l}=c,u=i[n?"secureConnecting":"connecting"]?uV(i,n?"secureConnect":"connect",{signal:l}):Promise.resolve();return await this.#n({options:t,timeout:s,promises:[u,uV(i,"error",{signal:l}).then(h=>{throw h[0]})]},c),this.#t.idle&&i.setTimeout(this.#t.idle,()=>{i.destroy(new Am.IdleTimeoutError(`${t.host}:${t.port}`))}),i}addRequest(e,t){let i=this.#o(t);if(i?.setRequestProps&&i.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let s;e.once("finish",()=>{setTimeout(()=>{e.destroy(new Am.ResponseTimeoutError(e,this.#r))},this.#t.response)}),e.once("response",()=>{clearTimeout(s)})}if(this.#t.transfer){let s;e.once("response",n=>{setTimeout(()=>{n.destroy(new Am.TransferTimeoutError(e,this.#r))},this.#t.transfer),n.once("close",()=>{clearTimeout(s)})})}return super.addRequest(e,t)}}});var mV=g(($Ge,gV)=>{"use strict";var{LRUCache:qme}=Pi(),{normalizeOptions:jme,cacheOptions:$me}=AO(),{getProxy:Ume,proxyCache:dV}=aI(),pV=RO(),Cm=fV(),fh=new qme({max:20}),Vme=o((r,{agent:e,proxy:t,noProxy:i,...s}={})=>{if(e!=null)return e;r=new URL(r);let n=Ume(r,{proxy:t,noProxy:i}),a={...jme(s),proxy:n},c=$me({...a,secureEndpoint:r.protocol==="https:"});if(fh.has(c))return fh.get(c);let l=new Cm(a);return fh.set(c,l),l},"getAgent");gV.exports={getAgent:Vme,Agent:Cm,HttpAgent:Cm,HttpsAgent:Cm,cache:{proxy:dV,agent:fh,dns:pV.cache,clear:o(()=>{dV.clear(),fh.clear(),pV.cache.clear()},"clear")}}});var yV=g((VGe,zme)=>{zme.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 Pm=g((zGe,wV)=>{var{Minipass:Gme}=ee(),km=Qa(),Hme=Cn(),Wme=Ft(),{log:SV}=se(),Jme=TO(),{getAgent:Kme}=mV(),lI=yV(),Yme=`${lI.name}/${lI.version} (+https://npm.im/${lI.name})`,Zme=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],Xme=["request-timeout"],Qme=o((r,e)=>{let t=Kme(r.url,{...e,signal:void 0});r.headers.has("connection")||r.headers.set("connection",t?"keep-alive":"close"),r.headers.has("user-agent")||r.headers.set("user-agent",Yme);let i={...e,agent:t,redirect:"manual"};return Hme(async(s,n)=>{let a=new km.Request(r,i);try{let c=await km(a,i);if(i.integrity&&c.status===200){let h=Wme.integrityStream({algorithms:i.algorithms,integrity:i.integrity,size:i.size}),f=new Jme({events:["integrity","size"]},c.body,h);h.on("integrity",d=>f.emit("integrity",d)),h.on("size",d=>f.emit("size",d)),c=new km.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let l=Gme.isStream(a.body);return a.method!=="POST"&&!l&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),SV.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),s(c)):c}catch(c){let l=c.code==="EPROMISERETRY"?c.retried.code:c.code,u=c.retried instanceof km.Response||Zme.includes(l)&&Xme.includes(c.type);if(a.method==="POST"||u)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),SV.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),s(c)}},e.retry).catch(s=>{if(s.status>=400&&s.type!=="system")return s;throw s})},"remoteFetch");wV.exports=Qme});var IV=g((HGe,OV)=>{var{Request:vV,Response:uI}=Qa(),{Minipass:EV}=ee(),eye=Rp(),lo=Qr(),tye=require("url"),rye=TO(),iye=bO(),hI=ZU(),sye=Pm(),dh=o((r,e)=>Object.prototype.hasOwnProperty.call(r,e),"hasOwnProperty"),nye=["accept-charset","accept-encoding","accept-language","accept","cache-control"],bV=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],_V=o((r,e,t)=>{let i={time:Date.now(),url:r.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:r.compress}};e.status!==200&&e.status!==304&&(i.status=e.status);for(let a of nye)r.headers.has(a)&&(i.reqHeaders[a]=r.headers.get(a));let s=r.headers.get("host"),n=new tye.URL(r.url);if(s&&n.host!==s&&(i.reqHeaders.host=s),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let l of c)r.headers.has(l)&&(i.reqHeaders[l]=r.headers.get(l))}}for(let a of bV)e.headers.has(a)&&(i.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(i.resHeaders[a]=e.headers.get(a));return i},"getMetadata"),Nm=Symbol("request"),xm=Symbol("response"),Dm=Symbol("policy"),fI=class r{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:i,options:s}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=hI(t),this.options=s,this[Nm]=t,this[xm]=i,this[Dm]=null}static async find(e,t){try{var i=await lo.index.compact(t.cachePath,hI(e),(n,a)=>{let c=new r({entry:n,options:t}),l=new r({entry:a,options:t});return c.policy.satisfies(l.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 s;for(let n of i){let a=new r({entry:n,options:t});if(a.policy.satisfies(e)){s=a;break}}return s}static async invalidate(e,t){let i=hI(e);try{await lo.rm.entry(t.cachePath,i,{removeFully:!0})}catch{}}get request(){return this[Nm]||(this[Nm]=new vV(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[Nm]}get response(){return this[xm]||(this[xm]=new uI(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[xm]}get policy(){return this[Dm]||(this[Dm]=new iye({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[Dm]}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"),i={algorithms:this.options.algorithms,metadata:_V(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},s=null;if(this.response.status===200){let a,c,l=new Promise((h,f)=>{a=h,c=f}).catch(h=>{s.emit("error",h)});s=new rye({events:["integrity","size"]},new eye({flush(){return l}})),s.hasIntegrityEmitter=!0;let u=o(()=>{let h=new EV,f=lo.put.stream(this.options.cachePath,this.key,i);f.on("integrity",d=>s.emit("integrity",d)),f.on("size",d=>s.emit("size",d)),h.pipe(f),f.promise().then(a,c),s.unshift(h),s.unshift(this.response.body)},"onResume");s.once("resume",u),s.once("end",()=>s.removeListener("resume",u))}else await lo.index.insert(this.options.cachePath,this.key,null,i);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 uI(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,i){let s;if(e==="HEAD"||[301,308].includes(this.response.status))s=this.response;else{let n=new EV,a={...this.policy.responseHeaders()},c=o(()=>{let l=lo.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});l.on("error",async u=>{l.pause(),u.code==="EINTEGRITY"&&await lo.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(u.code==="ENOENT"||u.code==="EINTEGRITY")&&await r.invalidate(this.request,this.options),n.emit("error",u),l.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),l.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),s=new uI(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return s.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),s.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),s.headers.set("x-local-cache-key",encodeURIComponent(this.key)),s.headers.set("x-local-cache-mode","stream"),s.headers.set("x-local-cache-status",i),s.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(e,t){let i=new vV(e,{headers:this.policy.revalidationHeaders(e)});try{var s=await sye(i,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(i,s)){let a=_V(e,s,t);for(let c of bV)!dh(a.resHeaders,c)&&dh(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let l=dh(a.resHeaders,c),u=dh(this.entry.metadata.resHeaders,c),h=dh(this.policy.response.headers,c);!l&&u&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!h&&l&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await lo.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 r({request:e,response:s,options:t}).store("updated")}};OV.exports=fI});var AV=g((JGe,RV)=>{var{NotCachedError:oye}=JU(),dI=IV(),aye=Pm(),TV=o(async(r,e)=>{let t=await dI.find(r,e);if(!t){if(e.cache==="only-if-cached")throw new oye(r.url);let s=await aye(r,e);return new dI({request:r,response:s,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(r,e);let i=t.policy.needsRevalidation(r);return e.cache==="force-cache"||e.cache==="only-if-cached"||!i?t.respond(r.method,e,i?"stale":"hit"):t.revalidate(r,e)},"cacheFetch");TV.invalidate=async(r,e)=>{if(e.cachePath)return dI.invalidate(r,e)};RV.exports=TV});var NV=g((YGe,PV)=>{"use strict";var{FetchError:pI,Request:cye,isRedirect:lye}=Qa(),gI=require("url"),uye=bO(),CV=AV(),hye=Pm(),fye=o((r,e,t)=>{if(!lye(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new pI(`redirect mode is set to error: ${r.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new pI(`redirect location header missing for: ${r.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(r.counter>=r.follow)throw new pI(`maximum redirect reached at: ${r.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),dye=o((r,e,t)=>{let i={...t},s=e.headers.get("location"),n=new gI.URL(s,/^https?:/.test(s)?void 0:r.url);return new gI.URL(r.url).hostname!==n.hostname&&(r.headers.delete("authorization"),r.headers.delete("cookie")),(e.status===303||r.method==="POST"&&[301,302].includes(e.status))&&(i.method="GET",i.body=null,r.headers.delete("content-length")),i.headers={},r.headers.forEach((c,l)=>{i.headers[l]=c}),i.counter=++r.counter,{request:new cye(gI.format(n),i),options:i}},"getRedirect"),kV=o(async(r,e)=>{let t=uye.storable(r,e)?await CV(r,e):await hye(r,e);if(!["GET","HEAD"].includes(r.method)&&t.status>=200&&t.status<=399&&await CV.invalidate(r,e),!fye(r,t,e))return t;let i=dye(r,t,e);return kV(i.request,i.options)},"fetch");PV.exports=kV});var ph=g((XGe,dc)=>{var{FetchError:pye,Headers:gye,Request:xV,Response:mye}=Qa(),yye=wU(),Sye=NV(),Lm=o((r,e)=>{let t=yye(e),i=new xV(r,t);return Sye(i,t)},"makeFetchHappen");Lm.defaults=(r,e={},t=Lm)=>{typeof r=="object"&&(e=r,r=null);let i=o((s,n={})=>{let a=s||r,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return i.defaults=(s,n={})=>Lm.defaults(s,n,i),i};dc.exports=Lm;dc.exports.FetchError=pye;dc.exports.Headers=gye;dc.exports.Request=xV;dc.exports.Response=mye});var rz=g((eHe,tz)=>{var H={},JV=H.LEFT_BRACE=1,Bm=H.RIGHT_BRACE=2,KV=H.LEFT_BRACKET=3,SI=H.RIGHT_BRACKET=4,qm=H.COLON=5,jm=H.COMMA=6,YV=H.TRUE=7,ZV=H.FALSE=8,XV=H.NULL=9,$m=H.STRING=10,QV=H.NUMBER=11,uo=H.START=17,ez=H.STOP=18,DV=H.TRUE1=33,LV=H.TRUE2=34,MV=H.TRUE3=35,FV=H.FALSE1=49,BV=H.FALSE2=50,qV=H.FALSE3=51,jV=H.FALSE4=52,$V=H.NULL1=65,UV=H.NULL2=66,VV=H.NULL3=67,zV=H.NUMBER1=81,mI=H.NUMBER3=83,Br=H.STRING1=97,GV=H.STRING2=98,HV=H.STRING3=99,wye=H.STRING4=100,vye=H.STRING5=101,WV=H.STRING6=102,pc=H.VALUE=113,yI=H.KEY=114,Mm=H.OBJECT=129,Fm=H.ARRAY=130,Eye=92,_ye=47,bye=8,Oye=12,Iye=10,Tye=13,Rye=9,Um=64*1024;function Hs(){this.tState=uo,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(Um):new Buffer(Um),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=pc,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.offset=-1}o(Hs,"Parser");Hs.toknam=function(r){for(var e=Object.keys(H),t=0,i=e.length;t<i;t++){var s=e[t];if(H[s]===r)return s}return r&&"0x"+r.toString(16)};var ur=Hs.prototype;ur.onError=function(r){throw r};ur.charError=function(r,e){this.tState=ez,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(r[e]))+" at position "+e+" in state "+Hs.toknam(this.tState)))};ur.appendStringChar=function(r){this.stringBufferOffset>=Um&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=r};ur.appendStringBuf=function(r,e,t){var i=r.length;typeof e=="number"&&(typeof t=="number"?t<0?i=r.length-e+t:i=t-e:i=r.length-e),i<0&&(i=0),this.stringBufferOffset+i>Um&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),r.copy(this.stringBuffer,this.stringBufferOffset,e,t),this.stringBufferOffset+=i};ur.write=function(r){typeof r=="string"&&(r=new Buffer(r));for(var e,t=0,i=r.length;t<i;t++)if(this.tState===uo){if(e=r[t],this.offset++,e===123)this.onToken(JV,"{");else if(e===125)this.onToken(Bm,"}");else if(e===91)this.onToken(KV,"[");else if(e===93)this.onToken(SI,"]");else if(e===58)this.onToken(qm,":");else if(e===44)this.onToken(jm,",");else if(e===116)this.tState=DV;else if(e===102)this.tState=FV;else if(e===110)this.tState=$V;else if(e===34)this.string="",this.stringBufferOffset=0,this.tState=Br;else if(e===45)this.string="-",this.tState=zV;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=mI;else if(!(e===32||e===9||e===10||e===13))return this.charError(r,t)}else if(this.tState===Br)if(e=r[t],this.bytes_remaining>0){for(var s=0;s<this.bytes_remaining;s++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+s]=r[s];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,t=t+s-1}else if(this.bytes_remaining===0&&e>=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+t+" in state "+Hs.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+t>r.length){for(var n=0;n<=r.length-1-t;n++)this.temp_buffs[this.bytes_in_sequence][n]=r[t+n];this.bytes_remaining=t+this.bytes_in_sequence-r.length,t=r.length-1}else this.appendStringBuf(r,t,t+this.bytes_in_sequence),t=t+this.bytes_in_sequence-1}else if(e===34)this.tState=uo,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken($m,this.string),this.offset+=Buffer.byteLength(this.string,"utf8")+1,this.string=void 0;else if(e===92)this.tState=GV;else if(e>=32)this.appendStringChar(e);else return this.charError(r,t);else if(this.tState===GV)if(e=r[t],e===34)this.appendStringChar(e),this.tState=Br;else if(e===92)this.appendStringChar(Eye),this.tState=Br;else if(e===47)this.appendStringChar(_ye),this.tState=Br;else if(e===98)this.appendStringChar(bye),this.tState=Br;else if(e===102)this.appendStringChar(Oye),this.tState=Br;else if(e===110)this.appendStringChar(Iye),this.tState=Br;else if(e===114)this.appendStringChar(Tye),this.tState=Br;else if(e===116)this.appendStringChar(Rye),this.tState=Br;else if(e===117)this.unicode="",this.tState=HV;else return this.charError(r,t);else if(this.tState===HV||this.tState===wye||this.tState===vye||this.tState===WV)if(e=r[t],e>=48&&e<64||e>64&&e<=70||e>96&&e<=102){if(this.unicode+=String.fromCharCode(e),this.tState++===WV){var a=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&a>=56320&&a<57344?(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,a))),this.highSurrogate=void 0):this.highSurrogate===void 0&&a>=55296&&a<56320?this.highSurrogate=a:(this.highSurrogate!==void 0&&(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new Buffer(String.fromCharCode(a)))),this.tState=Br}}else return this.charError(r,t);else if(this.tState===zV||this.tState===mI)switch(e=r[t],e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(e),this.tState=mI;break;default:this.tState=uo;var c=Number(this.string);if(isNaN(c))return this.charError(r,t);this.string.match(/[0-9]+/)==this.string&&c.toString()!=this.string?this.onToken($m,this.string):this.onToken(QV,c),this.offset+=this.string.length-1,this.string=void 0,t--;break}else if(this.tState===DV)if(r[t]===114)this.tState=LV;else return this.charError(r,t);else if(this.tState===LV)if(r[t]===117)this.tState=MV;else return this.charError(r,t);else if(this.tState===MV)if(r[t]===101)this.tState=uo,this.onToken(YV,!0),this.offset+=3;else return this.charError(r,t);else if(this.tState===FV)if(r[t]===97)this.tState=BV;else return this.charError(r,t);else if(this.tState===BV)if(r[t]===108)this.tState=qV;else return this.charError(r,t);else if(this.tState===qV)if(r[t]===115)this.tState=jV;else return this.charError(r,t);else if(this.tState===jV)if(r[t]===101)this.tState=uo,this.onToken(ZV,!1),this.offset+=4;else return this.charError(r,t);else if(this.tState===$V)if(r[t]===117)this.tState=UV;else return this.charError(r,t);else if(this.tState===UV)if(r[t]===108)this.tState=VV;else return this.charError(r,t);else if(this.tState===VV)if(r[t]===108)this.tState=uo,this.onToken(XV,null),this.offset+=3;else return this.charError(r,t)};ur.onToken=function(r,e){};ur.parseError=function(r,e){this.tState=ez,this.onError(new Error("Unexpected "+Hs.toknam(r)+(e?"("+JSON.stringify(e)+")":"")+" in state "+Hs.toknam(this.state)))};ur.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})};ur.pop=function(){var r=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(r),this.mode||(this.state=pc)};ur.emit=function(r){this.mode&&(this.state=jm),this.onValue(r)};ur.onValue=function(r){};ur.onToken=function(r,e){if(this.state===pc)if(r===$m||r===QV||r===YV||r===ZV||r===XV)this.value&&(this.value[this.key]=e),this.emit(e);else if(r===JV)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=yI,this.mode=Mm;else if(r===KV)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=Fm,this.state=pc;else if(r===Bm)if(this.mode===Mm)this.pop();else return this.parseError(r,e);else if(r===SI)if(this.mode===Fm)this.pop();else return this.parseError(r,e);else return this.parseError(r,e);else if(this.state===yI)if(r===$m)this.key=e,this.state=qm;else if(r===Bm)this.pop();else return this.parseError(r,e);else if(this.state===qm)if(r===qm)this.state=pc;else return this.parseError(r,e);else if(this.state===jm)if(r===jm)this.mode===Fm?(this.key++,this.state=pc):this.mode===Mm&&(this.state=yI);else if(r===SI&&this.mode===Fm||r===Bm&&this.mode===Mm)this.pop();else return this.parseError(r,e);else return this.parseError(r,e)};Hs.C=H;tz.exports=Hs});var nz=g((rHe,sz)=>{var Aye=rz(),{Minipass:Cye}=ee(),Vm=class extends Error{static{o(this,"JSONStreamError")}constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return"JSONStreamError"}},iz=o((r,e)=>typeof r=="string"?String(e)===r:r&&typeof r.test=="function"?r.test(e):typeof r=="boolean"||typeof r=="object"?r:typeof r=="function"?r(e):!1,"check"),wI=class r extends Cye{static{o(this,"JSONStream")}#e=0;#t=!1;#r=null;#i=null;#s=null;#o;#n;#c=null;#a=null;constructor(e){super({...e,objectMode:!0});let t=this.#n=new Aye;t.onValue=i=>this.#u(i),this.#o=t.onToken,t.onToken=(i,s)=>this.#f(i,s),t.onError=i=>this.#l(i),this.#c=typeof e.path=="string"?e.path.split(".").map(i=>i==="$*"?{emitKey:!0}:i==="*"?!0:i===""?{recurse:!0}:i):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map=="function"&&(this.#s=e.map)}#h(e,t){this.#i!==!1&&(this.#i=this.#i||{},this.#i[e]=t),this.#r!==!1&&this.#i===!1&&(this.#r=this.#r||{},this.#r[e]=t)}#l(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit("error",new Vm(e,t))}#f(e,t){let i=this.#n;if(this.#o.call(this.#n,e,t),i.stack.length===0&&this.#a){let s=this.#a;this.#c||super.write(s),this.#a=null,this.#e=0}}#u(e){let t=this.#n;if(this.#a=e,!this.#c)return;let i=0,s=0,n=!1;for(;i<this.#c.length;){let c=this.#c[i];if(s++,c&&!c.recurse){let l=s===t.stack.length?t:t.stack[s];if(!l)return;if(!iz(c,l.key)){this.#h(l.key,e);return}n=!!c.emitKey,i++}else{if(i++,i>=this.#c.length)return;let l=this.#c[i];if(!l)return;for(;;){let u=s===t.stack.length?t:t.stack[s];if(!u)return;if(iz(l,u.key)){i++,Object.isFrozen(t.stack[s])||(t.stack[s].value=null);break}else this.#h(u.key,e);s++}}}if(this.#i){let c=this.#i;this.#i=!1,this.emit("header",c)}if(s!==t.stack.length)return;this.#e++;let a=t.stack.slice(1).map(c=>c.key).concat([t.key]);if(e!=null){let c=this.#s?this.#s(e,a):e;if(c!=null){let l=n?{value:c}:c;n&&(l.key=t.key),super.write(l)}}t.value&&delete t.value[t.key];for(let c of t.stack)c.value=null}write(e,t){if(typeof e=="string")e=Buffer.from(e,t);else if(!Buffer.isBuffer(e))return this.emit("error",new TypeError("Can only parse JSON from string or buffer input"));return this.#n.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let i=this.#i;this.#i=null;let s=this.#r;return this.#r=null,i&&this.emit("header",i),s&&this.emit("footer",s),super.end()}static get JSONStreamError(){return Vm}static parse(e,t){return new r({path:e,map:t})}};sz.exports=wI});var ho=g((sHe,gc)=>{"use strict";var{HttpErrorAuthOTP:kye}=Y0(),Pye=fU(),az=yU(),Nye=ph(),xye=nz(),Dye=ye(),Lye=require("querystring"),zm=require("url"),oz=ku(),{Minipass:Mye}=ee(),Gm=uO(),Fye=o(r=>{try{return!!new zm.URL(r)}catch{return!1}},"urlIsValid");gc.exports=Hm;function Hm(r,e={}){let t={...Gm,...e},i=Fye(r),s=t.registry||Gm.registry;i||(s=t.registry=t.spec&&cz(t.spec,t)||t.registry||s,r=`${s.trim().replace(/\/?$/g,"")}/${r.trim().replace(/^\//,"")}`,new zm.URL(r));let n=t.method||"GET",a=Date.now(),c=az(r,t),l=$ye(r,c,t),u=t.body,h=Mye.isStream(u),f=u&&typeof u=="object"&&typeof u.then=="function";if(u&&!h&&!f&&typeof u!="string"&&!Buffer.isBuffer(u)?(l["content-type"]=l["content-type"]||"application/json",u=JSON.stringify(u)):u&&!l["content-type"]&&(l["content-type"]="application/octet-stream"),t.gzip)if(l["content-encoding"]="gzip",h){let m=new oz.Gzip;u.on("error",y=>m.emit("error",y)),u=u.pipe(m)}else f||(u=new oz.Gzip().end(u).concat());let d=new zm.URL(r);if(t.query){let m=typeof t.query=="string"?Lye.parse(t.query):t.query;Object.keys(m).forEach(y=>{m[y]!==void 0&&d.searchParams.set(y,m[y])}),r=zm.format(d)}d.searchParams.get("write")==="true"&&n==="GET"&&(t.offline=!1,t.preferOffline=!1,t.preferOnline=!0);let p=o(async m=>{let y=Nye(r,{agent:t.agent,algorithms:t.algorithms,body:m,cache:jye(t),cachePath:t.cache,ca:t.ca,cert:c.cert||t.cert,headers:l,integrity:t.integrity,key:c.key||t.key,localAddress:t.localAddress,maxSockets:t.maxSockets,memoize:t.memoize,method:n,noProxy:t.noProxy,proxy:t.httpsProxy||t.proxy,retry:t.retry?t.retry:{retries:t.fetchRetries,factor:t.fetchRetryFactor,minTimeout:t.fetchRetryMintimeout,maxTimeout:t.fetchRetryMaxtimeout},strictSSL:t.strictSSL,timeout:t.timeout||3e4}).then(w=>Pye({method:n,uri:r,res:w,registry:s,startTime:a,auth:c,opts:t}));return typeof t.otpPrompt=="function"?y.catch(async w=>{if(w instanceof kye){let S;try{S=await t.otpPrompt()}catch{}if(!S)throw w;return Hm(r,{...t,otp:S})}throw w}):y},"doFetch");return Promise.resolve(u).then(p)}o(Hm,"regFetch");gc.exports.getAuth=az;gc.exports.json=Bye;function Bye(r,e){return Hm(r,e).then(t=>t.json())}o(Bye,"fetchJSON");gc.exports.json.stream=qye;function qye(r,e,t={}){let i={...Gm,...t},s=xye.parse(e,i.mapJSON);return Hm(r,i).then(n=>n.body.on("error",a=>s.emit("error",a)).pipe(s)).catch(n=>s.emit("error",n)),s}o(qye,"fetchJSONStream");gc.exports.pickRegistry=cz;function cz(r,e={}){r=Dye(r);let t=r.scope&&e[r.scope.replace(/^@?/,"@")+":registry"];return!t&&e.scope&&(t=e[e.scope.replace(/^@?/,"@")+":registry"]),t||(t=e.registry||Gm.registry),t}o(cz,"pickRegistry");function jye(r){return r.offline?"only-if-cached":r.preferOffline?"force-cache":r.preferOnline?"no-cache":"default"}o(jye,"getCacheMode");function $ye(r,e,t){let i=Object.assign({"user-agent":t.userAgent},t.headers||{});return t.authType&&(i["npm-auth-type"]=t.authType),t.scope&&(i["npm-scope"]=t.scope),t.npmSession&&(i["npm-session"]=t.npmSession),t.npmCommand&&(i["npm-command"]=t.npmCommand),e.token?i.authorization=`Bearer ${e.token}`:e.auth&&(i.authorization=`Basic ${e.auth}`),t.otp&&(i["npm-otp"]=t.otp),i}o($ye,"getHeaders")});var vI=g((oHe,Uye)=>{Uye.exports={name:"pacote",version:"21.0.3",description:"JavaScript package downloader",author:"GitHub Inc.",bin:{pacote:"bin/index.js"},license:"ISC",main:"lib/index.js",scripts:{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:{timeout:300,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/arborist":"^9.0.2","@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","hosted-git-info":"^9.0.0","mutate-fs":"^2.1.1",nock:"^13.2.4","npm-registry-mock":"^1.3.2",rimraf:"^6.0.1",tap:"^16.0.1"},files:["bin/","lib/"],keywords:["packages","npm","git"],dependencies:{"@npmcli/git":"^7.0.0","@npmcli/installed-package-contents":"^3.0.0","@npmcli/package-json":"^7.0.0","@npmcli/promise-spawn":"^8.0.0","@npmcli/run-script":"^10.0.0",cacache:"^20.0.0","fs-minipass":"^3.0.0",minipass:"^7.0.2","npm-package-arg":"^13.0.0","npm-packlist":"^10.0.1","npm-pick-manifest":"^11.0.1","npm-registry-fetch":"^19.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",sigstore:"^4.0.0",ssri:"^12.0.0",tar:"^7.4.3"},engines:{node:"^20.17.0 || >=22.9.0"},repository:{type:"git",url:"git+https://github.com/npm/pacote.git"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.4",windowsCI:!1,publish:"true"}}});var gh=g((aHe,fz)=>{var Vye=ho(),{Minipass:zye}=ee(),Gye=Zn(),lz=Ya(),uz=Yn(),hz=vI().version,EI=class extends Gye{static{o(this,"RemoteFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec;let i=new URL(this.resolved);this.replaceRegistryHost!=="never"&&(this.replaceRegistryHost==="always"||this.replaceRegistryHost===i.host)&&(this.resolved=new URL(i.pathname,this.registry).href);let s=this.spec.name?`${this.spec.name}@`:"";this.pkgid=t.pkgid?t.pkgid:`remote:${s}${this.resolved}`}get[uz.cacheFetches](){return!1}[uz.tarballFromResolved](){let e=new zye;e.hasIntegrityEmitter=!0;let t={...this.opts,headers:this.#e(),spec:this.spec,integrity:this.integrity,algorithms:[this.pickIntegrityAlgorithm()]};return Vye(this.resolved,t).then(i=>{i.body.on("error",s=>e.emit("error",s)),i.body.on("integrity",s=>{this.integrity=s,e.emit("integrity",s)}),i.body.pipe(e)}).catch(i=>e.emit("error",i)),e}#e(){return{"user-agent":this.opts.userAgent||`pacote/${hz} node/${process.version}`,...this.opts.headers||{},"pacote-version":hz,"pacote-req-type":"tarball","pacote-pkg-id":this.pkgid,...this.integrity?{"pacote-integrity":String(this.integrity)}:{},...this.opts.headers||{}}}get types(){return["remote"]}packument(){return lz.prototype.packument.apply(this)}manifest(){return lz.prototype.manifest.apply(this)}};fz.exports=EI});var pz=g((lHe,dz)=>{var Hye=o((r,e)=>{if(r.hosted){let t=r.hosted,i={noCommittish:!0};return`${t.https&&t.auth?t.https(i):t.shortcut(i)}#${e}`}else return r.rawSpec.replace(/#.*$/,"")+`#${e}`},"addGitSha");dz.exports=Hye});var mz=g((hHe,gz)=>{var Wye=Qo();gz.exports=(r,e,t,i,s)=>{let n=r.endsWith(".js"),a=n?process.execPath:r,c=(n?[r]:[]).concat(e);return Wye(a,c,{cwd:t,env:i},s)}});var bI=g((fHe,vz)=>{var Jye=Qr(),Wm=Gj(),Kye=ye(),Yye=Zu(),{Minipass:Zye}=ee(),{log:yz}=se(),Xye=Jg(),Qye=Zn(),Sz=Ya(),eSe=gh(),Jm=Yn(),tSe=pz(),rSe=mz(),iSe=/^[a-f0-9]{40}$/,Km=o((r,e)=>r.sshurl&&!(r.https&&r.auth)&&wz(r.sshurl(e))||r.https&&wz(r.https(e)),"repoUrl"),wz=o(r=>r&&`git+${r}`.replace(/^(git\+)+/,"git+"),"addGitPlus"),_I=class extends Qye{static{o(this,"GitFetcher")}constructor(e,t){super(e,t),this.opts.integrity&&(delete this.opts.integrity,yz.warn(`skipping integrity check for git dependency ${this.spec.fetchSpec}`)),this.resolvedRef=null,this.spec.hosted&&(this.from=this.spec.hosted.shortcut({noCommittish:!1})),this.spec.gitCommittish&&iSe.test(this.spec.gitCommittish)?(this.resolvedSha=this.spec.gitCommittish,this.resolved=this.spec.hosted?Km(this.spec.hosted,{noCommittish:!1}):this.spec.rawSpec):this.resolvedSha="",this.Arborist=t.Arborist||null}static repoUrl(e,t){return Km(e,t)}get types(){return["git"]}resolve(){if(this.resolved)return super.resolve();let e=this.spec.hosted;return e?this.#e(e):this.#t(this.spec.fetchSpec)}#e(e){return this.#t(e.https&&e.https()).catch(t=>{if(t instanceof Wm.errors.GitPathspecError)throw t;let i=e.sshurl&&e.sshurl();if(!i||e.auth)throw t;return this.#t(i)})}#t(e){if(!e)return Promise.reject(new Error(`No git url for ${this.spec}`));let t=this.spec.gitRange,i=this.spec.name;return Wm.revs(e,this.opts).then(s=>t?Yye({versions:s.versions,"dist-tags":s["dist-tags"],name:i},t,this.opts):this.spec.gitCommittish?s.refs[this.spec.gitCommittish]||s.refs[s.shas[this.spec.gitCommittish]]:s.refs.HEAD).then(s=>!s||!s.sha?this.#s():(this.resolvedRef=s,this.resolvedSha=s.sha,this.#i(s.sha),this.resolved))}#r(e){this.resolved=this.spec.hosted?Km(Kye(e).hosted,{noCommittish:!1}):e}#i(e){this.#r(tSe(this.spec,e))}#s(){return this.#n(()=>this.resolved)}#o(e){return this[Jm.readPackageJson](e).then(t=>{let i=t.scripts;if(!t.workspaces&&(!i||!(i.postinstall||i.build||i.preinstall||i.install||i.prepack||i.prepare)))return;let s=process.env._PACOTE_NO_PREPARE_?process.env._PACOTE_NO_PREPARE_.split(`
59
+ `):[];if(s.includes(this.resolved)){yz.info("prepare","skip prepare, already seen",this.resolved);return}return s.push(this.resolved),rSe(this.npmBin,[].concat(this.npmInstallCmd).concat(this.npmCliConfig),e,{...process.env,_PACOTE_NO_PREPARE_:s.join(`
60
+ `)},{message:"git dep preparation failed"})})}[Jm.tarballFromResolved](){let e=new Zye;return e.resolved=this.resolved,e.from=this.from,this.#n(t=>this.#o(t).then(()=>new Promise((i,s)=>{if(!this.Arborist)throw new Error("GitFetcher requires an Arborist constructor to pack a tarball");let a=new Xye(`file:${t}`,{...this.opts,Arborist:this.Arborist,resolved:null,integrity:null})[Jm.tarballFromResolved]();a.on("error",s),a.on("end",i),a.pipe(e)}))).catch(t=>e.emit("error",t)),e}#n(e,t=!0){let i={tmpPrefix:"git-clone"},s=this.resolvedSha||this.spec.gitCommittish,n=this.spec.hosted,a=this.resolved;return t=t&&n&&a===Km(n,{noCommittish:!1})&&n.tarball,Jye.tmp.withTmp(this.cache,i,async c=>{if(t){let u=this.spec.name?`${this.spec.name}@`:"";return new eSe(n.tarball({noCommittish:!1}),{...this.opts,allowGitIgnore:!0,pkgid:`git:${u}${this.resolved}`,resolved:this.resolved,integrity:null}).extract(c).then(()=>e(c),h=>{if(h.constructor.name.match(/^Http/))return this.#n(e,!1);throw h})}let l=await(n?this.#c(s,c):this.#a(this.spec.fetchSpec,s,c));return this.resolvedSha=l,this.resolved||await this.#i(l),e(c)})}#c(e,t){let i=this.spec.hosted;return this.#a(i.https({noCommittish:!0}),e,t).catch(s=>{if(s instanceof Wm.errors.GitPathspecError)throw s;let n=i.sshurl&&i.sshurl({noCommittish:!0});if(!n||i.auth)throw s;return this.#a(n,e,t)})}#a(e,t,i){let{opts:s,spec:n}=this;return Wm.clone(e,t,i,{...s,spec:n})}manifest(){return this.package?Promise.resolve(this.package):this.spec.hosted&&this.resolved?Sz.prototype.manifest.apply(this):this.#n(e=>this[Jm.readPackageJson](e).then(t=>this.package={...t,_resolved:this.resolved,_from:this.from}))}packument(){return Sz.prototype.packument.apply(this)}};vz.exports=_I});var OI=g(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Signature=Ws.Envelope=void 0;Ws.Envelope={fromJSON(r){return{payload:Ym(r.payload)?Buffer.from(Ez(r.payload)):Buffer.alloc(0),payloadType:Ym(r.payloadType)?globalThis.String(r.payloadType):"",signatures:globalThis.Array.isArray(r?.signatures)?r.signatures.map(e=>Ws.Signature.fromJSON(e)):[]}},toJSON(r){let e={};return r.payload.length!==0&&(e.payload=_z(r.payload)),r.payloadType!==""&&(e.payloadType=r.payloadType),r.signatures?.length&&(e.signatures=r.signatures.map(t=>Ws.Signature.toJSON(t))),e}};Ws.Signature={fromJSON(r){return{sig:Ym(r.sig)?Buffer.from(Ez(r.sig)):Buffer.alloc(0),keyid:Ym(r.keyid)?globalThis.String(r.keyid):""}},toJSON(r){let e={};return r.sig.length!==0&&(e.sig=_z(r.sig)),r.keyid!==""&&(e.keyid=r.keyid),e}};function Ez(r){return Uint8Array.from(globalThis.Buffer.from(r,"base64"))}o(Ez,"bytesFromBase64");function _z(r){return globalThis.Buffer.from(r).toString("base64")}o(_z,"base64FromBytes");function Ym(r){return r!=null}o(Ym,"isSet")});var Oz=g(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.Timestamp=void 0;Zm.Timestamp={fromJSON(r){return{seconds:bz(r.seconds)?globalThis.String(r.seconds):"0",nanos:bz(r.nanos)?globalThis.Number(r.nanos):0}},toJSON(r){let e={};return r.seconds!=="0"&&(e.seconds=r.seconds),r.nanos!==0&&(e.nanos=Math.round(r.nanos)),e}};function bz(r){return r!=null}o(bz,"isSet")});var mc=g(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.TimeRange=q.X509CertificateChain=q.SubjectAlternativeName=q.X509Certificate=q.DistinguishedName=q.ObjectIdentifierValuePair=q.ObjectIdentifier=q.PublicKeyIdentifier=q.PublicKey=q.RFC3161SignedTimestamp=q.LogId=q.MessageSignature=q.HashOutput=q.SubjectAlternativeNameType=q.PublicKeyDetails=q.HashAlgorithm=void 0;q.hashAlgorithmFromJSON=Tz;q.hashAlgorithmToJSON=Rz;q.publicKeyDetailsFromJSON=Az;q.publicKeyDetailsToJSON=Cz;q.subjectAlternativeNameTypeFromJSON=kz;q.subjectAlternativeNameTypeToJSON=Pz;var sSe=Oz(),At;(function(r){r[r.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",r[r.SHA2_256=1]="SHA2_256",r[r.SHA2_384=2]="SHA2_384",r[r.SHA2_512=3]="SHA2_512",r[r.SHA3_256=4]="SHA3_256",r[r.SHA3_384=5]="SHA3_384"})(At||(q.HashAlgorithm=At={}));function Tz(r){switch(r){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return At.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return At.SHA2_256;case 2:case"SHA2_384":return At.SHA2_384;case 3:case"SHA2_512":return At.SHA2_512;case 4:case"SHA3_256":return At.SHA3_256;case 5:case"SHA3_384":return At.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum HashAlgorithm")}}o(Tz,"hashAlgorithmFromJSON");function Rz(r){switch(r){case At.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case At.SHA2_256:return"SHA2_256";case At.SHA2_384:return"SHA2_384";case At.SHA2_512:return"SHA2_512";case At.SHA3_256:return"SHA3_256";case At.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum HashAlgorithm")}}o(Rz,"hashAlgorithmToJSON");var B;(function(r){r[r.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",r[r.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",r[r.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",r[r.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",r[r.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",r[r.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",r[r.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",r[r.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",r[r.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",r[r.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",r[r.PKIX_RSA_PSS_4096_SHA256=18]="PKIX_RSA_PSS_4096_SHA256",r[r.PKIX_ECDSA_P256_HMAC_SHA_256=6]="PKIX_ECDSA_P256_HMAC_SHA_256",r[r.PKIX_ECDSA_P256_SHA_256=5]="PKIX_ECDSA_P256_SHA_256",r[r.PKIX_ECDSA_P384_SHA_384=12]="PKIX_ECDSA_P384_SHA_384",r[r.PKIX_ECDSA_P521_SHA_512=13]="PKIX_ECDSA_P521_SHA_512",r[r.PKIX_ED25519=7]="PKIX_ED25519",r[r.PKIX_ED25519_PH=8]="PKIX_ED25519_PH",r[r.PKIX_ECDSA_P384_SHA_256=19]="PKIX_ECDSA_P384_SHA_256",r[r.PKIX_ECDSA_P521_SHA_256=20]="PKIX_ECDSA_P521_SHA_256",r[r.LMS_SHA256=14]="LMS_SHA256",r[r.LMOTS_SHA256=15]="LMOTS_SHA256",r[r.ML_DSA_65=21]="ML_DSA_65",r[r.ML_DSA_87=22]="ML_DSA_87"})(B||(q.PublicKeyDetails=B={}));function Az(r){switch(r){case 0:case"PUBLIC_KEY_DETAILS_UNSPECIFIED":return B.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case"PKCS1_RSA_PKCS1V5":return B.PKCS1_RSA_PKCS1V5;case 2:case"PKCS1_RSA_PSS":return B.PKCS1_RSA_PSS;case 3:case"PKIX_RSA_PKCS1V5":return B.PKIX_RSA_PKCS1V5;case 4:case"PKIX_RSA_PSS":return B.PKIX_RSA_PSS;case 9:case"PKIX_RSA_PKCS1V15_2048_SHA256":return B.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case"PKIX_RSA_PKCS1V15_3072_SHA256":return B.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case"PKIX_RSA_PKCS1V15_4096_SHA256":return B.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case"PKIX_RSA_PSS_2048_SHA256":return B.PKIX_RSA_PSS_2048_SHA256;case 17:case"PKIX_RSA_PSS_3072_SHA256":return B.PKIX_RSA_PSS_3072_SHA256;case 18:case"PKIX_RSA_PSS_4096_SHA256":return B.PKIX_RSA_PSS_4096_SHA256;case 6:case"PKIX_ECDSA_P256_HMAC_SHA_256":return B.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case"PKIX_ECDSA_P256_SHA_256":return B.PKIX_ECDSA_P256_SHA_256;case 12:case"PKIX_ECDSA_P384_SHA_384":return B.PKIX_ECDSA_P384_SHA_384;case 13:case"PKIX_ECDSA_P521_SHA_512":return B.PKIX_ECDSA_P521_SHA_512;case 7:case"PKIX_ED25519":return B.PKIX_ED25519;case 8:case"PKIX_ED25519_PH":return B.PKIX_ED25519_PH;case 19:case"PKIX_ECDSA_P384_SHA_256":return B.PKIX_ECDSA_P384_SHA_256;case 20:case"PKIX_ECDSA_P521_SHA_256":return B.PKIX_ECDSA_P521_SHA_256;case 14:case"LMS_SHA256":return B.LMS_SHA256;case 15:case"LMOTS_SHA256":return B.LMOTS_SHA256;case 21:case"ML_DSA_65":return B.ML_DSA_65;case 22:case"ML_DSA_87":return B.ML_DSA_87;default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum PublicKeyDetails")}}o(Az,"publicKeyDetailsFromJSON");function Cz(r){switch(r){case B.PUBLIC_KEY_DETAILS_UNSPECIFIED:return"PUBLIC_KEY_DETAILS_UNSPECIFIED";case B.PKCS1_RSA_PKCS1V5:return"PKCS1_RSA_PKCS1V5";case B.PKCS1_RSA_PSS:return"PKCS1_RSA_PSS";case B.PKIX_RSA_PKCS1V5:return"PKIX_RSA_PKCS1V5";case B.PKIX_RSA_PSS:return"PKIX_RSA_PSS";case B.PKIX_RSA_PKCS1V15_2048_SHA256:return"PKIX_RSA_PKCS1V15_2048_SHA256";case B.PKIX_RSA_PKCS1V15_3072_SHA256:return"PKIX_RSA_PKCS1V15_3072_SHA256";case B.PKIX_RSA_PKCS1V15_4096_SHA256:return"PKIX_RSA_PKCS1V15_4096_SHA256";case B.PKIX_RSA_PSS_2048_SHA256:return"PKIX_RSA_PSS_2048_SHA256";case B.PKIX_RSA_PSS_3072_SHA256:return"PKIX_RSA_PSS_3072_SHA256";case B.PKIX_RSA_PSS_4096_SHA256:return"PKIX_RSA_PSS_4096_SHA256";case B.PKIX_ECDSA_P256_HMAC_SHA_256:return"PKIX_ECDSA_P256_HMAC_SHA_256";case B.PKIX_ECDSA_P256_SHA_256:return"PKIX_ECDSA_P256_SHA_256";case B.PKIX_ECDSA_P384_SHA_384:return"PKIX_ECDSA_P384_SHA_384";case B.PKIX_ECDSA_P521_SHA_512:return"PKIX_ECDSA_P521_SHA_512";case B.PKIX_ED25519:return"PKIX_ED25519";case B.PKIX_ED25519_PH:return"PKIX_ED25519_PH";case B.PKIX_ECDSA_P384_SHA_256:return"PKIX_ECDSA_P384_SHA_256";case B.PKIX_ECDSA_P521_SHA_256:return"PKIX_ECDSA_P521_SHA_256";case B.LMS_SHA256:return"LMS_SHA256";case B.LMOTS_SHA256:return"LMOTS_SHA256";case B.ML_DSA_65:return"ML_DSA_65";case B.ML_DSA_87:return"ML_DSA_87";default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum PublicKeyDetails")}}o(Cz,"publicKeyDetailsToJSON");var pi;(function(r){r[r.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]="SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED",r[r.EMAIL=1]="EMAIL",r[r.URI=2]="URI",r[r.OTHER_NAME=3]="OTHER_NAME"})(pi||(q.SubjectAlternativeNameType=pi={}));function kz(r){switch(r){case 0:case"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED":return pi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case"EMAIL":return pi.EMAIL;case 2:case"URI":return pi.URI;case 3:case"OTHER_NAME":return pi.OTHER_NAME;default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum SubjectAlternativeNameType")}}o(kz,"subjectAlternativeNameTypeFromJSON");function Pz(r){switch(r){case pi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED";case pi.EMAIL:return"EMAIL";case pi.URI:return"URI";case pi.OTHER_NAME:return"OTHER_NAME";default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum SubjectAlternativeNameType")}}o(Pz,"subjectAlternativeNameTypeToJSON");q.HashOutput={fromJSON(r){return{algorithm:Me(r.algorithm)?Tz(r.algorithm):0,digest:Me(r.digest)?Buffer.from(fo(r.digest)):Buffer.alloc(0)}},toJSON(r){let e={};return r.algorithm!==0&&(e.algorithm=Rz(r.algorithm)),r.digest.length!==0&&(e.digest=po(r.digest)),e}};q.MessageSignature={fromJSON(r){return{messageDigest:Me(r.messageDigest)?q.HashOutput.fromJSON(r.messageDigest):void 0,signature:Me(r.signature)?Buffer.from(fo(r.signature)):Buffer.alloc(0)}},toJSON(r){let e={};return r.messageDigest!==void 0&&(e.messageDigest=q.HashOutput.toJSON(r.messageDigest)),r.signature.length!==0&&(e.signature=po(r.signature)),e}};q.LogId={fromJSON(r){return{keyId:Me(r.keyId)?Buffer.from(fo(r.keyId)):Buffer.alloc(0)}},toJSON(r){let e={};return r.keyId.length!==0&&(e.keyId=po(r.keyId)),e}};q.RFC3161SignedTimestamp={fromJSON(r){return{signedTimestamp:Me(r.signedTimestamp)?Buffer.from(fo(r.signedTimestamp)):Buffer.alloc(0)}},toJSON(r){let e={};return r.signedTimestamp.length!==0&&(e.signedTimestamp=po(r.signedTimestamp)),e}};q.PublicKey={fromJSON(r){return{rawBytes:Me(r.rawBytes)?Buffer.from(fo(r.rawBytes)):void 0,keyDetails:Me(r.keyDetails)?Az(r.keyDetails):0,validFor:Me(r.validFor)?q.TimeRange.fromJSON(r.validFor):void 0}},toJSON(r){let e={};return r.rawBytes!==void 0&&(e.rawBytes=po(r.rawBytes)),r.keyDetails!==0&&(e.keyDetails=Cz(r.keyDetails)),r.validFor!==void 0&&(e.validFor=q.TimeRange.toJSON(r.validFor)),e}};q.PublicKeyIdentifier={fromJSON(r){return{hint:Me(r.hint)?globalThis.String(r.hint):""}},toJSON(r){let e={};return r.hint!==""&&(e.hint=r.hint),e}};q.ObjectIdentifier={fromJSON(r){return{id:globalThis.Array.isArray(r?.id)?r.id.map(e=>globalThis.Number(e)):[]}},toJSON(r){let e={};return r.id?.length&&(e.id=r.id.map(t=>Math.round(t))),e}};q.ObjectIdentifierValuePair={fromJSON(r){return{oid:Me(r.oid)?q.ObjectIdentifier.fromJSON(r.oid):void 0,value:Me(r.value)?Buffer.from(fo(r.value)):Buffer.alloc(0)}},toJSON(r){let e={};return r.oid!==void 0&&(e.oid=q.ObjectIdentifier.toJSON(r.oid)),r.value.length!==0&&(e.value=po(r.value)),e}};q.DistinguishedName={fromJSON(r){return{organization:Me(r.organization)?globalThis.String(r.organization):"",commonName:Me(r.commonName)?globalThis.String(r.commonName):""}},toJSON(r){let e={};return r.organization!==""&&(e.organization=r.organization),r.commonName!==""&&(e.commonName=r.commonName),e}};q.X509Certificate={fromJSON(r){return{rawBytes:Me(r.rawBytes)?Buffer.from(fo(r.rawBytes)):Buffer.alloc(0)}},toJSON(r){let e={};return r.rawBytes.length!==0&&(e.rawBytes=po(r.rawBytes)),e}};q.SubjectAlternativeName={fromJSON(r){return{type:Me(r.type)?kz(r.type):0,identity:Me(r.regexp)?{$case:"regexp",regexp:globalThis.String(r.regexp)}:Me(r.value)?{$case:"value",value:globalThis.String(r.value)}:void 0}},toJSON(r){let e={};return r.type!==0&&(e.type=Pz(r.type)),r.identity?.$case==="regexp"?e.regexp=r.identity.regexp:r.identity?.$case==="value"&&(e.value=r.identity.value),e}};q.X509CertificateChain={fromJSON(r){return{certificates:globalThis.Array.isArray(r?.certificates)?r.certificates.map(e=>q.X509Certificate.fromJSON(e)):[]}},toJSON(r){let e={};return r.certificates?.length&&(e.certificates=r.certificates.map(t=>q.X509Certificate.toJSON(t))),e}};q.TimeRange={fromJSON(r){return{start:Me(r.start)?Iz(r.start):void 0,end:Me(r.end)?Iz(r.end):void 0}},toJSON(r){let e={};return r.start!==void 0&&(e.start=r.start.toISOString()),r.end!==void 0&&(e.end=r.end.toISOString()),e}};function fo(r){return Uint8Array.from(globalThis.Buffer.from(r,"base64"))}o(fo,"bytesFromBase64");function po(r){return globalThis.Buffer.from(r).toString("base64")}o(po,"base64FromBytes");function nSe(r){let e=(globalThis.Number(r.seconds)||0)*1e3;return e+=(r.nanos||0)/1e6,new globalThis.Date(e)}o(nSe,"fromTimestamp");function Iz(r){return r instanceof globalThis.Date?r:typeof r=="string"?new globalThis.Date(r):nSe(sSe.Timestamp.fromJSON(r))}o(Iz,"fromJsonTimestamp");function Me(r){return r!=null}o(Me,"isSet")});var II=g(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.TransparencyLogEntry=Fe.InclusionPromise=Fe.InclusionProof=Fe.Checkpoint=Fe.KindVersion=void 0;var Nz=mc();Fe.KindVersion={fromJSON(r){return{kind:mt(r.kind)?globalThis.String(r.kind):"",version:mt(r.version)?globalThis.String(r.version):""}},toJSON(r){let e={};return r.kind!==""&&(e.kind=r.kind),r.version!==""&&(e.version=r.version),e}};Fe.Checkpoint={fromJSON(r){return{envelope:mt(r.envelope)?globalThis.String(r.envelope):""}},toJSON(r){let e={};return r.envelope!==""&&(e.envelope=r.envelope),e}};Fe.InclusionProof={fromJSON(r){return{logIndex:mt(r.logIndex)?globalThis.String(r.logIndex):"0",rootHash:mt(r.rootHash)?Buffer.from(Xm(r.rootHash)):Buffer.alloc(0),treeSize:mt(r.treeSize)?globalThis.String(r.treeSize):"0",hashes:globalThis.Array.isArray(r?.hashes)?r.hashes.map(e=>Buffer.from(Xm(e))):[],checkpoint:mt(r.checkpoint)?Fe.Checkpoint.fromJSON(r.checkpoint):void 0}},toJSON(r){let e={};return r.logIndex!=="0"&&(e.logIndex=r.logIndex),r.rootHash.length!==0&&(e.rootHash=Qm(r.rootHash)),r.treeSize!=="0"&&(e.treeSize=r.treeSize),r.hashes?.length&&(e.hashes=r.hashes.map(t=>Qm(t))),r.checkpoint!==void 0&&(e.checkpoint=Fe.Checkpoint.toJSON(r.checkpoint)),e}};Fe.InclusionPromise={fromJSON(r){return{signedEntryTimestamp:mt(r.signedEntryTimestamp)?Buffer.from(Xm(r.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(r){let e={};return r.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=Qm(r.signedEntryTimestamp)),e}};Fe.TransparencyLogEntry={fromJSON(r){return{logIndex:mt(r.logIndex)?globalThis.String(r.logIndex):"0",logId:mt(r.logId)?Nz.LogId.fromJSON(r.logId):void 0,kindVersion:mt(r.kindVersion)?Fe.KindVersion.fromJSON(r.kindVersion):void 0,integratedTime:mt(r.integratedTime)?globalThis.String(r.integratedTime):"0",inclusionPromise:mt(r.inclusionPromise)?Fe.InclusionPromise.fromJSON(r.inclusionPromise):void 0,inclusionProof:mt(r.inclusionProof)?Fe.InclusionProof.fromJSON(r.inclusionProof):void 0,canonicalizedBody:mt(r.canonicalizedBody)?Buffer.from(Xm(r.canonicalizedBody)):Buffer.alloc(0)}},toJSON(r){let e={};return r.logIndex!=="0"&&(e.logIndex=r.logIndex),r.logId!==void 0&&(e.logId=Nz.LogId.toJSON(r.logId)),r.kindVersion!==void 0&&(e.kindVersion=Fe.KindVersion.toJSON(r.kindVersion)),r.integratedTime!=="0"&&(e.integratedTime=r.integratedTime),r.inclusionPromise!==void 0&&(e.inclusionPromise=Fe.InclusionPromise.toJSON(r.inclusionPromise)),r.inclusionProof!==void 0&&(e.inclusionProof=Fe.InclusionProof.toJSON(r.inclusionProof)),r.canonicalizedBody.length!==0&&(e.canonicalizedBody=Qm(r.canonicalizedBody)),e}};function Xm(r){return Uint8Array.from(globalThis.Buffer.from(r,"base64"))}o(Xm,"bytesFromBase64");function Qm(r){return globalThis.Buffer.from(r).toString("base64")}o(Qm,"base64FromBytes");function mt(r){return r!=null}o(mt,"isSet")});var TI=g(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.Bundle=hr.VerificationMaterial=hr.TimestampVerificationData=void 0;var xz=OI(),gi=mc(),Dz=II();hr.TimestampVerificationData={fromJSON(r){return{rfc3161Timestamps:globalThis.Array.isArray(r?.rfc3161Timestamps)?r.rfc3161Timestamps.map(e=>gi.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(r){let e={};return r.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=r.rfc3161Timestamps.map(t=>gi.RFC3161SignedTimestamp.toJSON(t))),e}};hr.VerificationMaterial={fromJSON(r){return{content:Js(r.publicKey)?{$case:"publicKey",publicKey:gi.PublicKeyIdentifier.fromJSON(r.publicKey)}:Js(r.x509CertificateChain)?{$case:"x509CertificateChain",x509CertificateChain:gi.X509CertificateChain.fromJSON(r.x509CertificateChain)}:Js(r.certificate)?{$case:"certificate",certificate:gi.X509Certificate.fromJSON(r.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(r?.tlogEntries)?r.tlogEntries.map(e=>Dz.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:Js(r.timestampVerificationData)?hr.TimestampVerificationData.fromJSON(r.timestampVerificationData):void 0}},toJSON(r){let e={};return r.content?.$case==="publicKey"?e.publicKey=gi.PublicKeyIdentifier.toJSON(r.content.publicKey):r.content?.$case==="x509CertificateChain"?e.x509CertificateChain=gi.X509CertificateChain.toJSON(r.content.x509CertificateChain):r.content?.$case==="certificate"&&(e.certificate=gi.X509Certificate.toJSON(r.content.certificate)),r.tlogEntries?.length&&(e.tlogEntries=r.tlogEntries.map(t=>Dz.TransparencyLogEntry.toJSON(t))),r.timestampVerificationData!==void 0&&(e.timestampVerificationData=hr.TimestampVerificationData.toJSON(r.timestampVerificationData)),e}};hr.Bundle={fromJSON(r){return{mediaType:Js(r.mediaType)?globalThis.String(r.mediaType):"",verificationMaterial:Js(r.verificationMaterial)?hr.VerificationMaterial.fromJSON(r.verificationMaterial):void 0,content:Js(r.messageSignature)?{$case:"messageSignature",messageSignature:gi.MessageSignature.fromJSON(r.messageSignature)}:Js(r.dsseEnvelope)?{$case:"dsseEnvelope",dsseEnvelope:xz.Envelope.fromJSON(r.dsseEnvelope)}:void 0}},toJSON(r){let e={};return r.mediaType!==""&&(e.mediaType=r.mediaType),r.verificationMaterial!==void 0&&(e.verificationMaterial=hr.VerificationMaterial.toJSON(r.verificationMaterial)),r.content?.$case==="messageSignature"?e.messageSignature=gi.MessageSignature.toJSON(r.content.messageSignature):r.content?.$case==="dsseEnvelope"&&(e.dsseEnvelope=xz.Envelope.toJSON(r.content.dsseEnvelope)),e}};function Js(r){return r!=null}o(Js,"isSet")});var RI=g(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.ClientTrustConfig=j.ServiceConfiguration=j.Service=j.SigningConfig=j.TrustedRoot=j.CertificateAuthority=j.TransparencyLogInstance=j.ServiceSelector=void 0;j.serviceSelectorFromJSON=Lz;j.serviceSelectorToJSON=Mz;var at=mc(),mi;(function(r){r[r.SERVICE_SELECTOR_UNDEFINED=0]="SERVICE_SELECTOR_UNDEFINED",r[r.ALL=1]="ALL",r[r.ANY=2]="ANY",r[r.EXACT=3]="EXACT"})(mi||(j.ServiceSelector=mi={}));function Lz(r){switch(r){case 0:case"SERVICE_SELECTOR_UNDEFINED":return mi.SERVICE_SELECTOR_UNDEFINED;case 1:case"ALL":return mi.ALL;case 2:case"ANY":return mi.ANY;case 3:case"EXACT":return mi.EXACT;default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum ServiceSelector")}}o(Lz,"serviceSelectorFromJSON");function Mz(r){switch(r){case mi.SERVICE_SELECTOR_UNDEFINED:return"SERVICE_SELECTOR_UNDEFINED";case mi.ALL:return"ALL";case mi.ANY:return"ANY";case mi.EXACT:return"EXACT";default:throw new globalThis.Error("Unrecognized enum value "+r+" for enum ServiceSelector")}}o(Mz,"serviceSelectorToJSON");j.TransparencyLogInstance={fromJSON(r){return{baseUrl:Se(r.baseUrl)?globalThis.String(r.baseUrl):"",hashAlgorithm:Se(r.hashAlgorithm)?(0,at.hashAlgorithmFromJSON)(r.hashAlgorithm):0,publicKey:Se(r.publicKey)?at.PublicKey.fromJSON(r.publicKey):void 0,logId:Se(r.logId)?at.LogId.fromJSON(r.logId):void 0,checkpointKeyId:Se(r.checkpointKeyId)?at.LogId.fromJSON(r.checkpointKeyId):void 0,operator:Se(r.operator)?globalThis.String(r.operator):""}},toJSON(r){let e={};return r.baseUrl!==""&&(e.baseUrl=r.baseUrl),r.hashAlgorithm!==0&&(e.hashAlgorithm=(0,at.hashAlgorithmToJSON)(r.hashAlgorithm)),r.publicKey!==void 0&&(e.publicKey=at.PublicKey.toJSON(r.publicKey)),r.logId!==void 0&&(e.logId=at.LogId.toJSON(r.logId)),r.checkpointKeyId!==void 0&&(e.checkpointKeyId=at.LogId.toJSON(r.checkpointKeyId)),r.operator!==""&&(e.operator=r.operator),e}};j.CertificateAuthority={fromJSON(r){return{subject:Se(r.subject)?at.DistinguishedName.fromJSON(r.subject):void 0,uri:Se(r.uri)?globalThis.String(r.uri):"",certChain:Se(r.certChain)?at.X509CertificateChain.fromJSON(r.certChain):void 0,validFor:Se(r.validFor)?at.TimeRange.fromJSON(r.validFor):void 0,operator:Se(r.operator)?globalThis.String(r.operator):""}},toJSON(r){let e={};return r.subject!==void 0&&(e.subject=at.DistinguishedName.toJSON(r.subject)),r.uri!==""&&(e.uri=r.uri),r.certChain!==void 0&&(e.certChain=at.X509CertificateChain.toJSON(r.certChain)),r.validFor!==void 0&&(e.validFor=at.TimeRange.toJSON(r.validFor)),r.operator!==""&&(e.operator=r.operator),e}};j.TrustedRoot={fromJSON(r){return{mediaType:Se(r.mediaType)?globalThis.String(r.mediaType):"",tlogs:globalThis.Array.isArray(r?.tlogs)?r.tlogs.map(e=>j.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(r?.certificateAuthorities)?r.certificateAuthorities.map(e=>j.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(r?.ctlogs)?r.ctlogs.map(e=>j.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(r?.timestampAuthorities)?r.timestampAuthorities.map(e=>j.CertificateAuthority.fromJSON(e)):[]}},toJSON(r){let e={};return r.mediaType!==""&&(e.mediaType=r.mediaType),r.tlogs?.length&&(e.tlogs=r.tlogs.map(t=>j.TransparencyLogInstance.toJSON(t))),r.certificateAuthorities?.length&&(e.certificateAuthorities=r.certificateAuthorities.map(t=>j.CertificateAuthority.toJSON(t))),r.ctlogs?.length&&(e.ctlogs=r.ctlogs.map(t=>j.TransparencyLogInstance.toJSON(t))),r.timestampAuthorities?.length&&(e.timestampAuthorities=r.timestampAuthorities.map(t=>j.CertificateAuthority.toJSON(t))),e}};j.SigningConfig={fromJSON(r){return{mediaType:Se(r.mediaType)?globalThis.String(r.mediaType):"",caUrls:globalThis.Array.isArray(r?.caUrls)?r.caUrls.map(e=>j.Service.fromJSON(e)):[],oidcUrls:globalThis.Array.isArray(r?.oidcUrls)?r.oidcUrls.map(e=>j.Service.fromJSON(e)):[],rekorTlogUrls:globalThis.Array.isArray(r?.rekorTlogUrls)?r.rekorTlogUrls.map(e=>j.Service.fromJSON(e)):[],rekorTlogConfig:Se(r.rekorTlogConfig)?j.ServiceConfiguration.fromJSON(r.rekorTlogConfig):void 0,tsaUrls:globalThis.Array.isArray(r?.tsaUrls)?r.tsaUrls.map(e=>j.Service.fromJSON(e)):[],tsaConfig:Se(r.tsaConfig)?j.ServiceConfiguration.fromJSON(r.tsaConfig):void 0}},toJSON(r){let e={};return r.mediaType!==""&&(e.mediaType=r.mediaType),r.caUrls?.length&&(e.caUrls=r.caUrls.map(t=>j.Service.toJSON(t))),r.oidcUrls?.length&&(e.oidcUrls=r.oidcUrls.map(t=>j.Service.toJSON(t))),r.rekorTlogUrls?.length&&(e.rekorTlogUrls=r.rekorTlogUrls.map(t=>j.Service.toJSON(t))),r.rekorTlogConfig!==void 0&&(e.rekorTlogConfig=j.ServiceConfiguration.toJSON(r.rekorTlogConfig)),r.tsaUrls?.length&&(e.tsaUrls=r.tsaUrls.map(t=>j.Service.toJSON(t))),r.tsaConfig!==void 0&&(e.tsaConfig=j.ServiceConfiguration.toJSON(r.tsaConfig)),e}};j.Service={fromJSON(r){return{url:Se(r.url)?globalThis.String(r.url):"",majorApiVersion:Se(r.majorApiVersion)?globalThis.Number(r.majorApiVersion):0,validFor:Se(r.validFor)?at.TimeRange.fromJSON(r.validFor):void 0,operator:Se(r.operator)?globalThis.String(r.operator):""}},toJSON(r){let e={};return r.url!==""&&(e.url=r.url),r.majorApiVersion!==0&&(e.majorApiVersion=Math.round(r.majorApiVersion)),r.validFor!==void 0&&(e.validFor=at.TimeRange.toJSON(r.validFor)),r.operator!==""&&(e.operator=r.operator),e}};j.ServiceConfiguration={fromJSON(r){return{selector:Se(r.selector)?Lz(r.selector):0,count:Se(r.count)?globalThis.Number(r.count):0}},toJSON(r){let e={};return r.selector!==0&&(e.selector=Mz(r.selector)),r.count!==0&&(e.count=Math.round(r.count)),e}};j.ClientTrustConfig={fromJSON(r){return{mediaType:Se(r.mediaType)?globalThis.String(r.mediaType):"",trustedRoot:Se(r.trustedRoot)?j.TrustedRoot.fromJSON(r.trustedRoot):void 0,signingConfig:Se(r.signingConfig)?j.SigningConfig.fromJSON(r.signingConfig):void 0}},toJSON(r){let e={};return r.mediaType!==""&&(e.mediaType=r.mediaType),r.trustedRoot!==void 0&&(e.trustedRoot=j.TrustedRoot.toJSON(r.trustedRoot)),r.signingConfig!==void 0&&(e.signingConfig=j.SigningConfig.toJSON(r.signingConfig)),e}};function Se(r){return r!=null}o(Se,"isSet")});var qz=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.Input=$.Artifact=$.ArtifactVerificationOptions_ObserverTimestampOptions=$.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=$.ArtifactVerificationOptions_TimestampAuthorityOptions=$.ArtifactVerificationOptions_CtlogOptions=$.ArtifactVerificationOptions_TlogOptions=$.ArtifactVerificationOptions=$.PublicKeyIdentities=$.CertificateIdentities=$.CertificateIdentity=void 0;var Fz=TI(),Ks=mc(),Bz=RI();$.CertificateIdentity={fromJSON(r){return{issuer:ce(r.issuer)?globalThis.String(r.issuer):"",san:ce(r.san)?Ks.SubjectAlternativeName.fromJSON(r.san):void 0,oids:globalThis.Array.isArray(r?.oids)?r.oids.map(e=>Ks.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(r){let e={};return r.issuer!==""&&(e.issuer=r.issuer),r.san!==void 0&&(e.san=Ks.SubjectAlternativeName.toJSON(r.san)),r.oids?.length&&(e.oids=r.oids.map(t=>Ks.ObjectIdentifierValuePair.toJSON(t))),e}};$.CertificateIdentities={fromJSON(r){return{identities:globalThis.Array.isArray(r?.identities)?r.identities.map(e=>$.CertificateIdentity.fromJSON(e)):[]}},toJSON(r){let e={};return r.identities?.length&&(e.identities=r.identities.map(t=>$.CertificateIdentity.toJSON(t))),e}};$.PublicKeyIdentities={fromJSON(r){return{publicKeys:globalThis.Array.isArray(r?.publicKeys)?r.publicKeys.map(e=>Ks.PublicKey.fromJSON(e)):[]}},toJSON(r){let e={};return r.publicKeys?.length&&(e.publicKeys=r.publicKeys.map(t=>Ks.PublicKey.toJSON(t))),e}};$.ArtifactVerificationOptions={fromJSON(r){return{signers:ce(r.certificateIdentities)?{$case:"certificateIdentities",certificateIdentities:$.CertificateIdentities.fromJSON(r.certificateIdentities)}:ce(r.publicKeys)?{$case:"publicKeys",publicKeys:$.PublicKeyIdentities.fromJSON(r.publicKeys)}:void 0,tlogOptions:ce(r.tlogOptions)?$.ArtifactVerificationOptions_TlogOptions.fromJSON(r.tlogOptions):void 0,ctlogOptions:ce(r.ctlogOptions)?$.ArtifactVerificationOptions_CtlogOptions.fromJSON(r.ctlogOptions):void 0,tsaOptions:ce(r.tsaOptions)?$.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(r.tsaOptions):void 0,integratedTsOptions:ce(r.integratedTsOptions)?$.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(r.integratedTsOptions):void 0,observerOptions:ce(r.observerOptions)?$.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(r.observerOptions):void 0}},toJSON(r){let e={};return r.signers?.$case==="certificateIdentities"?e.certificateIdentities=$.CertificateIdentities.toJSON(r.signers.certificateIdentities):r.signers?.$case==="publicKeys"&&(e.publicKeys=$.PublicKeyIdentities.toJSON(r.signers.publicKeys)),r.tlogOptions!==void 0&&(e.tlogOptions=$.ArtifactVerificationOptions_TlogOptions.toJSON(r.tlogOptions)),r.ctlogOptions!==void 0&&(e.ctlogOptions=$.ArtifactVerificationOptions_CtlogOptions.toJSON(r.ctlogOptions)),r.tsaOptions!==void 0&&(e.tsaOptions=$.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(r.tsaOptions)),r.integratedTsOptions!==void 0&&(e.integratedTsOptions=$.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(r.integratedTsOptions)),r.observerOptions!==void 0&&(e.observerOptions=$.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(r.observerOptions)),e}};$.ArtifactVerificationOptions_TlogOptions={fromJSON(r){return{threshold:ce(r.threshold)?globalThis.Number(r.threshold):0,performOnlineVerification:ce(r.performOnlineVerification)?globalThis.Boolean(r.performOnlineVerification):!1,disable:ce(r.disable)?globalThis.Boolean(r.disable):!1}},toJSON(r){let e={};return r.threshold!==0&&(e.threshold=Math.round(r.threshold)),r.performOnlineVerification!==!1&&(e.performOnlineVerification=r.performOnlineVerification),r.disable!==!1&&(e.disable=r.disable),e}};$.ArtifactVerificationOptions_CtlogOptions={fromJSON(r){return{threshold:ce(r.threshold)?globalThis.Number(r.threshold):0,disable:ce(r.disable)?globalThis.Boolean(r.disable):!1}},toJSON(r){let e={};return r.threshold!==0&&(e.threshold=Math.round(r.threshold)),r.disable!==!1&&(e.disable=r.disable),e}};$.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(r){return{threshold:ce(r.threshold)?globalThis.Number(r.threshold):0,disable:ce(r.disable)?globalThis.Boolean(r.disable):!1}},toJSON(r){let e={};return r.threshold!==0&&(e.threshold=Math.round(r.threshold)),r.disable!==!1&&(e.disable=r.disable),e}};$.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(r){return{threshold:ce(r.threshold)?globalThis.Number(r.threshold):0,disable:ce(r.disable)?globalThis.Boolean(r.disable):!1}},toJSON(r){let e={};return r.threshold!==0&&(e.threshold=Math.round(r.threshold)),r.disable!==!1&&(e.disable=r.disable),e}};$.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(r){return{threshold:ce(r.threshold)?globalThis.Number(r.threshold):0,disable:ce(r.disable)?globalThis.Boolean(r.disable):!1}},toJSON(r){let e={};return r.threshold!==0&&(e.threshold=Math.round(r.threshold)),r.disable!==!1&&(e.disable=r.disable),e}};$.Artifact={fromJSON(r){return{data:ce(r.artifactUri)?{$case:"artifactUri",artifactUri:globalThis.String(r.artifactUri)}:ce(r.artifact)?{$case:"artifact",artifact:Buffer.from(oSe(r.artifact))}:ce(r.artifactDigest)?{$case:"artifactDigest",artifactDigest:Ks.HashOutput.fromJSON(r.artifactDigest)}:void 0}},toJSON(r){let e={};return r.data?.$case==="artifactUri"?e.artifactUri=r.data.artifactUri:r.data?.$case==="artifact"?e.artifact=aSe(r.data.artifact):r.data?.$case==="artifactDigest"&&(e.artifactDigest=Ks.HashOutput.toJSON(r.data.artifactDigest)),e}};$.Input={fromJSON(r){return{artifactTrustRoot:ce(r.artifactTrustRoot)?Bz.TrustedRoot.fromJSON(r.artifactTrustRoot):void 0,artifactVerificationOptions:ce(r.artifactVerificationOptions)?$.ArtifactVerificationOptions.fromJSON(r.artifactVerificationOptions):void 0,bundle:ce(r.bundle)?Fz.Bundle.fromJSON(r.bundle):void 0,artifact:ce(r.artifact)?$.Artifact.fromJSON(r.artifact):void 0}},toJSON(r){let e={};return r.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=Bz.TrustedRoot.toJSON(r.artifactTrustRoot)),r.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=$.ArtifactVerificationOptions.toJSON(r.artifactVerificationOptions)),r.bundle!==void 0&&(e.bundle=Fz.Bundle.toJSON(r.bundle)),r.artifact!==void 0&&(e.artifact=$.Artifact.toJSON(r.artifact)),e}};function oSe(r){return Uint8Array.from(globalThis.Buffer.from(r,"base64"))}o(oSe,"bytesFromBase64");function aSe(r){return globalThis.Buffer.from(r).toString("base64")}o(aSe,"base64FromBytes");function ce(r){return r!=null}o(ce,"isSet")});var mh=g(fr=>{"use strict";var cSe=fr&&fr.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),yc=fr&&fr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cSe(e,r,t)};Object.defineProperty(fr,"__esModule",{value:!0});yc(OI(),fr);yc(TI(),fr);yc(mc(),fr);yc(II(),fr);yc(RI(),fr);yc(qz(),fr)});var ey=g(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.BUNDLE_V03_MEDIA_TYPE=Ct.BUNDLE_V03_LEGACY_MEDIA_TYPE=Ct.BUNDLE_V02_MEDIA_TYPE=Ct.BUNDLE_V01_MEDIA_TYPE=void 0;Ct.isBundleWithCertificateChain=lSe;Ct.isBundleWithPublicKey=uSe;Ct.isBundleWithMessageSignature=hSe;Ct.isBundleWithDsseEnvelope=fSe;Ct.BUNDLE_V01_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.1";Ct.BUNDLE_V02_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.2";Ct.BUNDLE_V03_LEGACY_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.3";Ct.BUNDLE_V03_MEDIA_TYPE="application/vnd.dev.sigstore.bundle.v0.3+json";function lSe(r){return r.verificationMaterial.content.$case==="x509CertificateChain"}o(lSe,"isBundleWithCertificateChain");function uSe(r){return r.verificationMaterial.content.$case==="publicKey"}o(uSe,"isBundleWithPublicKey");function hSe(r){return r.content.$case==="messageSignature"}o(hSe,"isBundleWithMessageSignature");function fSe(r){return r.content.$case==="dsseEnvelope"}o(fSe,"isBundleWithDsseEnvelope")});var $z=g(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.toMessageSignatureBundle=pSe;ry.toDSSEBundle=gSe;var dSe=mh(),ty=ey();function pSe(r){return{mediaType:r.certificateChain?ty.BUNDLE_V02_MEDIA_TYPE:ty.BUNDLE_V03_MEDIA_TYPE,content:{$case:"messageSignature",messageSignature:{messageDigest:{algorithm:dSe.HashAlgorithm.SHA2_256,digest:r.digest},signature:r.signature}},verificationMaterial:jz(r)}}o(pSe,"toMessageSignatureBundle");function gSe(r){return{mediaType:r.certificateChain?ty.BUNDLE_V02_MEDIA_TYPE:ty.BUNDLE_V03_MEDIA_TYPE,content:{$case:"dsseEnvelope",dsseEnvelope:mSe(r)},verificationMaterial:jz(r)}}o(gSe,"toDSSEBundle");function mSe(r){return{payloadType:r.artifactType,payload:r.artifact,signatures:[ySe(r)]}}o(mSe,"toEnvelope");function ySe(r){return{keyid:r.keyHint||"",sig:r.signature}}o(ySe,"toSignature");function jz(r){return{content:SSe(r),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}o(jz,"toVerificationMaterial");function SSe(r){return r.certificate?r.certificateChain?{$case:"x509CertificateChain",x509CertificateChain:{certificates:[{rawBytes:r.certificate}]}}:{$case:"certificate",certificate:{rawBytes:r.certificate}}:{$case:"publicKey",publicKey:{hint:r.keyHint||""}}}o(SSe,"toKeyContent")});var CI=g(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.ValidationError=void 0;var AI=class extends Error{static{o(this,"ValidationError")}constructor(e,t){super(e),this.fields=t}};iy.ValidationError=AI});var kI=g(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.assertBundle=wSe;go.assertBundleV01=Uz;go.isBundleV01=vSe;go.assertBundleV02=ESe;go.assertBundleLatest=_Se;var sy=CI();function wSe(r){let e=ny(r);if(e.length>0)throw new sy.ValidationError("invalid bundle",e)}o(wSe,"assertBundle");function Uz(r){let e=[];if(e.push(...ny(r)),e.push(...bSe(r)),e.length>0)throw new sy.ValidationError("invalid v0.1 bundle",e)}o(Uz,"assertBundleV01");function vSe(r){try{return Uz(r),!0}catch{return!1}}o(vSe,"isBundleV01");function ESe(r){let e=[];if(e.push(...ny(r)),e.push(...Vz(r)),e.length>0)throw new sy.ValidationError("invalid v0.2 bundle",e)}o(ESe,"assertBundleV02");function _Se(r){let e=[];if(e.push(...ny(r)),e.push(...Vz(r)),e.push(...OSe(r)),e.length>0)throw new sy.ValidationError("invalid bundle",e)}o(_Se,"assertBundleLatest");function ny(r){let e=[];if((r.mediaType===void 0||!r.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/)&&!r.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))&&e.push("mediaType"),r.content===void 0)e.push("content");else switch(r.content.$case){case"messageSignature":r.content.messageSignature.messageDigest===void 0?e.push("content.messageSignature.messageDigest"):r.content.messageSignature.messageDigest.digest.length===0&&e.push("content.messageSignature.messageDigest.digest"),r.content.messageSignature.signature.length===0&&e.push("content.messageSignature.signature");break;case"dsseEnvelope":r.content.dsseEnvelope.payload.length===0&&e.push("content.dsseEnvelope.payload"),r.content.dsseEnvelope.signatures.length!==1?e.push("content.dsseEnvelope.signatures"):r.content.dsseEnvelope.signatures[0].sig.length===0&&e.push("content.dsseEnvelope.signatures[0].sig");break}if(r.verificationMaterial===void 0)e.push("verificationMaterial");else{if(r.verificationMaterial.content===void 0)e.push("verificationMaterial.content");else switch(r.verificationMaterial.content.$case){case"x509CertificateChain":r.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push("verificationMaterial.content.x509CertificateChain.certificates"),r.verificationMaterial.content.x509CertificateChain.certificates.forEach((t,i)=>{t.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${i}].rawBytes`)});break;case"certificate":r.verificationMaterial.content.certificate.rawBytes.length===0&&e.push("verificationMaterial.content.certificate.rawBytes");break}r.verificationMaterial.tlogEntries===void 0?e.push("verificationMaterial.tlogEntries"):r.verificationMaterial.tlogEntries.length>0&&r.verificationMaterial.tlogEntries.forEach((t,i)=>{t.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${i}].logId`),t.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${i}].kindVersion`)})}return e}o(ny,"validateBundleBase");function bSe(r){let e=[];return r.verificationMaterial&&r.verificationMaterial.tlogEntries?.length>0&&r.verificationMaterial.tlogEntries.forEach((t,i)=>{t.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${i}].inclusionPromise`)}),e}o(bSe,"validateInclusionPromise");function Vz(r){let e=[];return r.verificationMaterial&&r.verificationMaterial.tlogEntries?.length>0&&r.verificationMaterial.tlogEntries.forEach((t,i)=>{t.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${i}].inclusionProof`):t.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${i}].inclusionProof.checkpoint`)}),e}o(Vz,"validateInclusionProof");function OSe(r){let e=[];return r.verificationMaterial?.content?.$case==="x509CertificateChain"&&e.push("verificationMaterial.content.$case"),e}o(OSe,"validateNoCertificateChain")});var Gz=g(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.envelopeToJSON=yi.envelopeFromJSON=yi.bundleToJSON=yi.bundleFromJSON=void 0;var oy=mh(),zz=ey(),PI=kI(),ISe=o(r=>{let e=oy.Bundle.fromJSON(r);switch(e.mediaType){case zz.BUNDLE_V01_MEDIA_TYPE:(0,PI.assertBundleV01)(e);break;case zz.BUNDLE_V02_MEDIA_TYPE:(0,PI.assertBundleV02)(e);break;default:(0,PI.assertBundleLatest)(e);break}return e},"bundleFromJSON");yi.bundleFromJSON=ISe;var TSe=o(r=>oy.Bundle.toJSON(r),"bundleToJSON");yi.bundleToJSON=TSe;var RSe=o(r=>oy.Envelope.fromJSON(r),"envelopeFromJSON");yi.envelopeFromJSON=RSe;var ASe=o(r=>oy.Envelope.toJSON(r),"envelopeToJSON");yi.envelopeToJSON=ASe});var Sh=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.isBundleV01=V.assertBundleV02=V.assertBundleV01=V.assertBundleLatest=V.assertBundle=V.envelopeToJSON=V.envelopeFromJSON=V.bundleToJSON=V.bundleFromJSON=V.ValidationError=V.isBundleWithPublicKey=V.isBundleWithMessageSignature=V.isBundleWithDsseEnvelope=V.isBundleWithCertificateChain=V.BUNDLE_V03_MEDIA_TYPE=V.BUNDLE_V03_LEGACY_MEDIA_TYPE=V.BUNDLE_V02_MEDIA_TYPE=V.BUNDLE_V01_MEDIA_TYPE=V.toMessageSignatureBundle=V.toDSSEBundle=void 0;var Hz=$z();Object.defineProperty(V,"toDSSEBundle",{enumerable:!0,get:o(function(){return Hz.toDSSEBundle},"get")});Object.defineProperty(V,"toMessageSignatureBundle",{enumerable:!0,get:o(function(){return Hz.toMessageSignatureBundle},"get")});var Ys=ey();Object.defineProperty(V,"BUNDLE_V01_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Ys.BUNDLE_V01_MEDIA_TYPE},"get")});Object.defineProperty(V,"BUNDLE_V02_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Ys.BUNDLE_V02_MEDIA_TYPE},"get")});Object.defineProperty(V,"BUNDLE_V03_LEGACY_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Ys.BUNDLE_V03_LEGACY_MEDIA_TYPE},"get")});Object.defineProperty(V,"BUNDLE_V03_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Ys.BUNDLE_V03_MEDIA_TYPE},"get")});Object.defineProperty(V,"isBundleWithCertificateChain",{enumerable:!0,get:o(function(){return Ys.isBundleWithCertificateChain},"get")});Object.defineProperty(V,"isBundleWithDsseEnvelope",{enumerable:!0,get:o(function(){return Ys.isBundleWithDsseEnvelope},"get")});Object.defineProperty(V,"isBundleWithMessageSignature",{enumerable:!0,get:o(function(){return Ys.isBundleWithMessageSignature},"get")});Object.defineProperty(V,"isBundleWithPublicKey",{enumerable:!0,get:o(function(){return Ys.isBundleWithPublicKey},"get")});var CSe=CI();Object.defineProperty(V,"ValidationError",{enumerable:!0,get:o(function(){return CSe.ValidationError},"get")});var ay=Gz();Object.defineProperty(V,"bundleFromJSON",{enumerable:!0,get:o(function(){return ay.bundleFromJSON},"get")});Object.defineProperty(V,"bundleToJSON",{enumerable:!0,get:o(function(){return ay.bundleToJSON},"get")});Object.defineProperty(V,"envelopeFromJSON",{enumerable:!0,get:o(function(){return ay.envelopeFromJSON},"get")});Object.defineProperty(V,"envelopeToJSON",{enumerable:!0,get:o(function(){return ay.envelopeToJSON},"get")});var yh=kI();Object.defineProperty(V,"assertBundle",{enumerable:!0,get:o(function(){return yh.assertBundle},"get")});Object.defineProperty(V,"assertBundleLatest",{enumerable:!0,get:o(function(){return yh.assertBundleLatest},"get")});Object.defineProperty(V,"assertBundleV01",{enumerable:!0,get:o(function(){return yh.assertBundleV01},"get")});Object.defineProperty(V,"assertBundleV02",{enumerable:!0,get:o(function(){return yh.assertBundleV02},"get")});Object.defineProperty(V,"isBundleV01",{enumerable:!0,get:o(function(){return yh.isBundleV01},"get")})});var wh=g(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.ByteStream=void 0;var NI=class extends Error{static{o(this,"StreamError")}},cy=class r{static{o(this,"ByteStream")}constructor(e){this.start=0,e?(this.buf=e,this.view=Buffer.from(e)):(this.buf=new ArrayBuffer(0),this.view=Buffer.from(this.buf))}get buffer(){return this.view.subarray(0,this.start)}get length(){return this.view.byteLength}get position(){return this.start}seek(e){this.start=e}slice(e,t){let i=e+t;if(i>this.length)throw new NI("request past end of buffer");return this.view.subarray(e,i)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let t=new Uint16Array([e]),i=new Uint8Array(t.buffer);this.view[this.start]=i[1],this.view[this.start+1]=i[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let t=new Uint32Array([e]),i=new Uint8Array(t.buffer);this.view[this.start]=i[2],this.view[this.start+1]=i[1],this.view[this.start+2]=i[0],this.start+=3}appendView(e){this.ensureCapacity(e.length),this.view.set(e,this.start),this.start+=e.length}getBlock(e){if(e<=0)return Buffer.alloc(0);if(this.start+e>this.view.length)throw new Error("request past end of buffer");let t=this.view.subarray(this.start,this.start+e);return this.start+=e,t}getUint8(){return this.getBlock(1)[0]}getUint16(){let e=this.getBlock(2);return e[0]<<8|e[1]}ensureCapacity(e){if(this.start+e>this.view.byteLength){let t=r.BLOCK_SIZE+(e>r.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+t)}}realloc(e){let t=new ArrayBuffer(e),i=Buffer.from(t);i.set(this.view),this.buf=t,this.view=i}};ly.ByteStream=cy;cy.BLOCK_SIZE=1024});var uy=g(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.ASN1TypeError=Sc.ASN1ParseError=void 0;var xI=class extends Error{static{o(this,"ASN1ParseError")}};Sc.ASN1ParseError=xI;var DI=class extends Error{static{o(this,"ASN1TypeError")}};Sc.ASN1TypeError=DI});var Jz=g(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.decodeLength=kSe;hy.encodeLength=PSe;var Wz=uy();function kSe(r){let e=r.getUint8();if((e&128)===0)return e;let t=e&127;if(t>6)throw new Wz.ASN1ParseError("length exceeds 6 byte limit");let i=0;for(let s=0;s<t;s++)i=i*256+r.getUint8();if(i===0)throw new Wz.ASN1ParseError("indefinite length encoding not supported");return i}o(kSe,"decodeLength");function PSe(r){if(r<128)return Buffer.from([r]);let e=BigInt(r),t=[];for(;e>0n;)t.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|t.length,...t])}o(PSe,"encodeLength")});var Yz=g(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.parseInteger=DSe;Zs.parseStringASCII=Kz;Zs.parseTime=LSe;Zs.parseOID=MSe;Zs.parseBoolean=FSe;Zs.parseBitString=BSe;var NSe=/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/,xSe=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;function DSe(r){let e=0,t=r.length,i=r[e],s=i>127,n=s?255:0;for(;i==n&&++e<t;)i=r[e];if(t-e===0)return BigInt(s?-1:0);i=s?i-256:i;let c=BigInt(i);for(let l=e+1;l<t;++l)c=c*BigInt(256)+BigInt(r[l]);return c}o(DSe,"parseInteger");function Kz(r){return r.toString("ascii")}o(Kz,"parseStringASCII");function LSe(r,e){let t=Kz(r),i=e?NSe.exec(t):xSe.exec(t);if(!i)throw new Error("invalid time");if(e){let s=Number(i[1]);s+=s>=50?1900:2e3,i[1]=s.toString()}return new Date(`${i[1]}-${i[2]}-${i[3]}T${i[4]}:${i[5]}:${i[6]}Z`)}o(LSe,"parseTime");function MSe(r){let e=0,t=r.length,i=r[e++],s=Math.floor(i/40),n=i%40,a=`${s}.${n}`,c=0;for(;e<t;++e)i=r[e],c=(c<<7)+(i&127),(i&128)===0&&(a+=`.${c}`,c=0);return a}o(MSe,"parseOID");function FSe(r){return r[0]!==0}o(FSe,"parseBoolean");function BSe(r){let e=r[0],t=1,i=r.length,s=[];for(let n=t;n<i;++n){let a=r[n],c=n===i-1?e:0;for(let l=7;l>=c;--l)s.push(a>>l&1)}return s}o(BSe,"parseBitString")});var Xz=g(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.ASN1Tag=void 0;var Zz=uy(),mo={BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,OBJECT_IDENTIFIER:6,SEQUENCE:16,SET:17,PRINTABLE_STRING:19,UTC_TIME:23,GENERALIZED_TIME:24},LI={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},MI=class{static{o(this,"ASN1Tag")}constructor(e){if(this.number=e&31,this.constructed=(e&32)===32,this.class=e>>6,this.number===31)throw new Zz.ASN1ParseError("long form tags not supported");if(this.class===LI.UNIVERSAL&&this.number===0)throw new Zz.ASN1ParseError("unsupported tag 0x00")}isUniversal(){return this.class===LI.UNIVERSAL}isContextSpecific(e){let t=this.class===LI.CONTEXT_SPECIFIC;return e!==void 0?t&&this.number===e:t}isBoolean(){return this.isUniversal()&&this.number===mo.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===mo.INTEGER}isBitString(){return this.isUniversal()&&this.number===mo.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===mo.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===mo.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===mo.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===mo.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};fy.ASN1Tag=MI});var rG=g(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.ASN1Obj=void 0;var FI=wh(),yo=uy(),eG=Jz(),wc=Yz(),qSe=Xz(),dy=class{static{o(this,"ASN1Obj")}constructor(e,t,i){this.tag=e,this.value=t,this.subs=i}static parseBuffer(e){return tG(new FI.ByteStream(e))}toDER(){let e=new FI.ByteStream;if(this.subs.length>0)for(let s of this.subs)e.appendView(s.toDER());else e.appendView(this.value);let t=e.buffer,i=new FI.ByteStream;return i.appendChar(this.tag.toDER()),i.appendView((0,eG.encodeLength)(t.length)),i.appendView(t),i.buffer}toBoolean(){if(!this.tag.isBoolean())throw new yo.ASN1TypeError("not a boolean");return(0,wc.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new yo.ASN1TypeError("not an integer");return(0,wc.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new yo.ASN1TypeError("not an OID");return(0,wc.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,wc.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,wc.parseTime)(this.value,!1);default:throw new yo.ASN1TypeError("not a date")}}toBitString(){if(!this.tag.isBitString())throw new yo.ASN1TypeError("not a bit string");return(0,wc.parseBitString)(this.value)}};py.ASN1Obj=dy;function tG(r){let e=new qSe.ASN1Tag(r.getUint8()),t=(0,eG.decodeLength)(r),i=r.slice(r.position,t),s=r.position,n=[];if(e.constructed)n=Qz(r,t);else if(e.isOctetString())try{n=Qz(r,t)}catch{}return n.length===0&&r.seek(s+t),new dy(e,i,n)}o(tG,"parseStream");function Qz(r,e){let t=r.position+e;if(t>r.length)throw new yo.ASN1ParseError("invalid length");let i=[];for(;r.position<t;)i.push(tG(r));if(r.position!==t)throw new yo.ASN1ParseError("invalid length");return i}o(Qz,"collectSubs")});var my=g(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});gy.ASN1Obj=void 0;var jSe=rG();Object.defineProperty(gy,"ASN1Obj",{enumerable:!0,get:o(function(){return jSe.ASN1Obj},"get")})});var vc=g(Xs=>{"use strict";var $Se=Xs&&Xs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.createPublicKey=USe;Xs.digest=VSe;Xs.verify=zSe;Xs.bufferEqual=GSe;var vh=$Se(require("crypto"));function USe(r,e="spki"){return typeof r=="string"?vh.default.createPublicKey(r):vh.default.createPublicKey({key:r,format:"der",type:e})}o(USe,"createPublicKey");function VSe(r,...e){let t=vh.default.createHash(r);for(let i of e)t.update(i);return t.digest()}o(VSe,"digest");function zSe(r,e,t,i){try{return vh.default.verify(i,r,e,t)}catch{return!1}}o(zSe,"verify");function GSe(r,e){try{return vh.default.timingSafeEqual(r,e)}catch{return!1}}o(GSe,"bufferEqual")});var iG=g(BI=>{"use strict";Object.defineProperty(BI,"__esModule",{value:!0});BI.preAuthEncoding=WSe;var HSe="DSSEv1";function WSe(r,e){let t=[HSe,r.length,r,e.length,""].join(" ");return Buffer.concat([Buffer.from(t,"ascii"),e])}o(WSe,"preAuthEncoding")});var oG=g(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.base64Encode=JSe;yy.base64Decode=KSe;var sG="base64",nG="utf-8";function JSe(r){return Buffer.from(r,nG).toString(sG)}o(JSe,"base64Encode");function KSe(r){return Buffer.from(r,sG).toString(nG)}o(KSe,"base64Decode")});var aG=g(jI=>{"use strict";Object.defineProperty(jI,"__esModule",{value:!0});jI.canonicalize=qI;function qI(r){let e="";if(r===null||typeof r!="object"||r.toJSON!=null)e+=JSON.stringify(r);else if(Array.isArray(r)){e+="[";let t=!0;r.forEach(i=>{t||(e+=","),t=!1,e+=qI(i)}),e+="]"}else{e+="{";let t=!0;Object.keys(r).sort().forEach(i=>{t||(e+=","),t=!1,e+=JSON.stringify(i),e+=":",e+=qI(r[i])}),e+="}"}return e}o(qI,"canonicalize")});var $I=g(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.toDER=XSe;Sy.fromDER=QSe;var YSe=/-----BEGIN (.*)-----/,ZSe=/-----END (.*)-----/;function XSe(r){let e="";return r.split(`
61
+ `).forEach(t=>{t.match(YSe)||t.match(ZSe)||(e+=t)}),Buffer.from(e,"base64")}o(XSe,"toDER");function QSe(r,e="CERTIFICATE"){let i=r.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${e}-----`,...i,`-----END ${e}-----`].join(`
62
+ `).concat(`
63
+ `)}o(QSe,"fromDER")});var wy=g(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.SHA2_HASH_ALGOS=Ec.ECDSA_SIGNATURE_ALGOS=void 0;Ec.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};Ec.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var VI=g(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.RFC3161TimestampVerificationError=void 0;var UI=class extends Error{static{o(this,"RFC3161TimestampVerificationError")}};vy.RFC3161TimestampVerificationError=UI});var lG=g(Si=>{"use strict";var ewe=Si&&Si.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),twe=Si&&Si.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),rwe=Si&&Si.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&ewe(t,e,i[s]);return twe(t,e),t}})();Object.defineProperty(Si,"__esModule",{value:!0});Si.TSTInfo=void 0;var cG=rwe(vc()),iwe=wy(),swe=VI(),zI=class{static{o(this,"TSTInfo")}constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return iwe.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let t=cG.digest(this.messageImprintHashAlgorithm,e);if(!cG.bufferEqual(t,this.messageImprintHashedMessage))throw new swe.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};Si.TSTInfo=zI});var hG=g(wi=>{"use strict";var nwe=wi&&wi.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),owe=wi&&wi.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),awe=wi&&wi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&nwe(t,e,i[s]);return owe(t,e),t}})();Object.defineProperty(wi,"__esModule",{value:!0});wi.RFC3161Timestamp=void 0;var cwe=my(),GI=awe(vc()),uG=wy(),Eh=VI(),lwe=lG(),uwe="1.2.840.113549.1.7.2",hwe="1.2.840.113549.1.9.16.1.4",fwe="1.2.840.113549.1.9.4",HI=class r{static{o(this,"RFC3161Timestamp")}constructor(e){this.root=e}static parse(e){let t=cwe.ASN1Obj.parseBuffer(e);return new r(t)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return uG.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return uG.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new lwe.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,t){if(!this.timeStampTokenObj)throw new Eh.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==uwe)throw new Eh.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==hwe)throw new Eh.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(t)}verifyMessageDigest(){let e=GI.digest(this.signerDigestAlgorithm,this.tstInfo.raw),t=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!GI.bufferEqual(e,t))throw new Eh.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(e){let t=this.signedAttrsObj.toDER();if(t[0]=49,!GI.verify(t,e,this.signatureValue,this.signatureAlgorithm))throw new Eh.RFC3161TimestampVerificationError("signature verification failed")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(t=>t.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let e=this.signedDataObj;return e.subs[e.subs.length-1]}get signerInfoObj(){return this.signerInfosObj.subs[0]}get eContentTypeObj(){return this.encapContentInfoObj.subs[0]}get eContentObj(){return this.encapContentInfoObj.subs[1]}get signedAttrsObj(){return this.signerInfoObj.subs.find(t=>t.tag.isContextSpecific(0))}get messageDigestAttributeObj(){return this.signedAttrsObj.subs.find(t=>t.subs[0].tag.isOID()&&t.subs[0].toOID()===fwe)}get signerSidObj(){return this.signerInfoObj.subs[1]}get signerDigestAlgorithmObj(){return this.signerInfoObj.subs[2]}get signatureAlgorithmObj(){return this.signerInfoObj.subs[4]}get signatureValueObj(){return this.signerInfoObj.subs[5]}};wi.RFC3161Timestamp=HI});var fG=g(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.RFC3161Timestamp=void 0;var dwe=hG();Object.defineProperty(Ey,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return dwe.RFC3161Timestamp},"get")})});var pG=g(vi=>{"use strict";var pwe=vi&&vi.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),gwe=vi&&vi.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),mwe=vi&&vi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&pwe(t,e,i[s]);return gwe(t,e),t}})();Object.defineProperty(vi,"__esModule",{value:!0});vi.SignedCertificateTimestamp=void 0;var ywe=mwe(vc()),dG=wh(),WI=class r{static{o(this,"SignedCertificateTimestamp")}constructor(e){this.version=e.version,this.logID=e.logID,this.timestamp=e.timestamp,this.extensions=e.extensions,this.hashAlgorithm=e.hashAlgorithm,this.signatureAlgorithm=e.signatureAlgorithm,this.signature=e.signature}get datetime(){return new Date(Number(this.timestamp.readBigInt64BE()))}get algorithm(){switch(this.hashAlgorithm){case 0:return"none";case 1:return"md5";case 2:return"sha1";case 3:return"sha224";case 4:return"sha256";case 5:return"sha384";case 6:return"sha512";default:return"unknown"}}verify(e,t){let i=new dG.ByteStream;return i.appendChar(this.version),i.appendChar(0),i.appendView(this.timestamp),i.appendUint16(1),i.appendView(e),i.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&i.appendView(this.extensions),ywe.verify(i.buffer,t,this.signature,this.algorithm)}static parse(e){let t=new dG.ByteStream(e),i=t.getUint8(),s=t.getBlock(32),n=t.getBlock(8),a=t.getUint16(),c=t.getBlock(a),l=t.getUint8(),u=t.getUint8(),h=t.getUint16(),f=t.getBlock(h);if(t.position!==e.length)throw new Error("SCT buffer length mismatch");return new r({version:i,logID:s,timestamp:n,extensions:c,hashAlgorithm:l,signatureAlgorithm:u,signature:f})}};vi.SignedCertificateTimestamp=WI});var eT=g(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.X509SCTExtension=ct.X509SubjectKeyIDExtension=ct.X509AuthorityKeyIDExtension=ct.X509SubjectAlternativeNameExtension=ct.X509KeyUsageExtension=ct.X509BasicConstraintsExtension=ct.X509Extension=void 0;var Swe=wh(),wwe=pG(),ns=class{static{o(this,"X509Extension")}constructor(e){this.root=e}get oid(){return this.root.subs[0].toOID()}get critical(){return this.root.subs.length===3?this.root.subs[1].toBoolean():!1}get value(){return this.extnValueObj.value}get valueObj(){return this.extnValueObj}get extnValueObj(){return this.root.subs[this.root.subs.length-1]}};ct.X509Extension=ns;var JI=class extends ns{static{o(this,"X509BasicConstraintsExtension")}get isCA(){return this.sequence.subs[0]?.toBoolean()??!1}get pathLenConstraint(){return this.sequence.subs.length>1?this.sequence.subs[1].toInteger():void 0}get sequence(){return this.extnValueObj.subs[0]}};ct.X509BasicConstraintsExtension=JI;var KI=class extends ns{static{o(this,"X509KeyUsageExtension")}get digitalSignature(){return this.bitString[0]===1}get keyCertSign(){return this.bitString[5]===1}get crlSign(){return this.bitString[6]===1}get bitString(){return this.extnValueObj.subs[0].toBitString()}};ct.X509KeyUsageExtension=KI;var YI=class extends ns{static{o(this,"X509SubjectAlternativeNameExtension")}get rfc822Name(){return this.findGeneralName(1)?.value.toString("ascii")}get uri(){return this.findGeneralName(6)?.value.toString("ascii")}otherName(e){let t=this.findGeneralName(0);return t===void 0||t.subs[0].toOID()!==e?void 0:t.subs[1].subs[0].value.toString("ascii")}findGeneralName(e){return this.generalNames.find(t=>t.tag.isContextSpecific(e))}get generalNames(){return this.extnValueObj.subs[0].subs}};ct.X509SubjectAlternativeNameExtension=YI;var ZI=class extends ns{static{o(this,"X509AuthorityKeyIDExtension")}get keyIdentifier(){return this.findSequenceMember(0)?.value}findSequenceMember(e){return this.sequence.subs.find(t=>t.tag.isContextSpecific(e))}get sequence(){return this.extnValueObj.subs[0]}};ct.X509AuthorityKeyIDExtension=ZI;var XI=class extends ns{static{o(this,"X509SubjectKeyIDExtension")}get keyIdentifier(){return this.extnValueObj.subs[0].value}};ct.X509SubjectKeyIDExtension=XI;var QI=class extends ns{static{o(this,"X509SCTExtension")}constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,t=new Swe.ByteStream(e),i=t.getUint16()+2,s=[];for(;t.position<i;){let n=t.getUint16(),a=t.getBlock(n);s.push(wwe.SignedCertificateTimestamp.parse(a))}if(t.position!==i)throw new Error("SCT list length does not match actual length");return s}};ct.X509SCTExtension=QI});var yG=g(zt=>{"use strict";var vwe=zt&&zt.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Ewe=zt&&zt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),mG=zt&&zt.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&vwe(t,e,i[s]);return Ewe(t,e),t}})();Object.defineProperty(zt,"__esModule",{value:!0});zt.X509Certificate=zt.EXTENSION_OID_SCT=void 0;var _we=my(),gG=mG(vc()),bwe=wy(),Owe=mG($I()),So=eT(),Iwe="2.5.29.14",Twe="2.5.29.15",Rwe="2.5.29.17",Awe="2.5.29.19",Cwe="2.5.29.35";zt.EXTENSION_OID_SCT="1.3.6.1.4.1.11129.2.4.2";var tT=class r{static{o(this,"X509Certificate")}constructor(e){this.root=e}static parse(e){let t=typeof e=="string"?Owe.toDER(e):e,i=_we.ASN1Obj.parseBuffer(t);return new r(i)}get tbsCertificate(){return this.tbsCertificateObj}get version(){return`v${(this.versionObj.subs[0].toInteger()+BigInt(1)).toString()}`}get serialNumber(){return this.serialNumberObj.value}get notBefore(){return this.validityObj.subs[0].toDate()}get notAfter(){return this.validityObj.subs[1].toDate()}get issuer(){return this.issuerObj.value}get subject(){return this.subjectObj.value}get publicKey(){return this.subjectPublicKeyInfoObj.toDER()}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return bwe.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value.subarray(1)}get subjectAltName(){let e=this.extSubjectAltName;return e?.uri||e?.rfc822Name}get extensions(){return this.extensionsObj?.subs[0]?.subs||[]}get extKeyUsage(){let e=this.findExtension(Twe);return e?new So.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(Awe);return e?new So.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(Rwe);return e?new So.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(Cwe);return e?new So.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(Iwe);return e?new So.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(zt.EXTENSION_OID_SCT);return e?new So.X509SCTExtension(e):void 0}get isCA(){let e=this.extBasicConstraints?.isCA||!1;return this.extKeyUsage?e&&this.extKeyUsage.keyCertSign:e}extension(e){let t=this.findExtension(e);return t?new So.X509Extension(t):void 0}verify(e){let t=e?.publicKey||this.publicKey,i=gG.createPublicKey(t);return gG.verify(this.tbsCertificate.toDER(),i,this.signatureValue,this.signatureAlgorithm)}validForDate(e){return this.notBefore<=e&&e<=this.notAfter}equals(e){return this.root.toDER().equals(e.root.toDER())}clone(){let e=this.root.toDER(),t=Buffer.alloc(e.length);return e.copy(t),r.parse(t)}findExtension(e){return this.extensions.find(t=>t.subs[0].toOID()===e)}get tbsCertificateObj(){return this.root.subs[0]}get signatureAlgorithmObj(){return this.root.subs[1]}get signatureValueObj(){return this.root.subs[2]}get versionObj(){return this.tbsCertificateObj.subs[0]}get serialNumberObj(){return this.tbsCertificateObj.subs[1]}get issuerObj(){return this.tbsCertificateObj.subs[3]}get validityObj(){return this.tbsCertificateObj.subs[4]}get subjectObj(){return this.tbsCertificateObj.subs[5]}get subjectPublicKeyInfoObj(){return this.tbsCertificateObj.subs[6]}get extensionsObj(){return this.tbsCertificateObj.subs.find(e=>e.tag.isContextSpecific(3))}};zt.X509Certificate=tT});var wG=g(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.X509SCTExtension=Qs.X509Certificate=Qs.EXTENSION_OID_SCT=void 0;var SG=yG();Object.defineProperty(Qs,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return SG.EXTENSION_OID_SCT},"get")});Object.defineProperty(Qs,"X509Certificate",{enumerable:!0,get:o(function(){return SG.X509Certificate},"get")});var kwe=eT();Object.defineProperty(Qs,"X509SCTExtension",{enumerable:!0,get:o(function(){return kwe.X509SCTExtension},"get")})});var kt=g(ie=>{"use strict";var Pwe=ie&&ie.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Nwe=ie&&ie.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),_h=ie&&ie.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&Pwe(t,e,i[s]);return Nwe(t,e),t}})();Object.defineProperty(ie,"__esModule",{value:!0});ie.X509SCTExtension=ie.X509Certificate=ie.EXTENSION_OID_SCT=ie.ByteStream=ie.RFC3161Timestamp=ie.pem=ie.json=ie.encoding=ie.dsse=ie.crypto=ie.ASN1Obj=void 0;var xwe=my();Object.defineProperty(ie,"ASN1Obj",{enumerable:!0,get:o(function(){return xwe.ASN1Obj},"get")});ie.crypto=_h(vc());ie.dsse=_h(iG());ie.encoding=_h(oG());ie.json=_h(aG());ie.pem=_h($I());var Dwe=fG();Object.defineProperty(ie,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return Dwe.RFC3161Timestamp},"get")});var Lwe=wh();Object.defineProperty(ie,"ByteStream",{enumerable:!0,get:o(function(){return Lwe.ByteStream},"get")});var rT=wG();Object.defineProperty(ie,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return rT.EXTENSION_OID_SCT},"get")});Object.defineProperty(ie,"X509Certificate",{enumerable:!0,get:o(function(){return rT.X509Certificate},"get")});Object.defineProperty(ie,"X509SCTExtension",{enumerable:!0,get:o(function(){return rT.X509SCTExtension},"get")})});var vG=g(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});iT.extractJWTSubject=Fwe;var Mwe=kt();function Fwe(r){let e=r.split(".",3),t=JSON.parse(Mwe.encoding.base64Decode(e[1]));if(t.email){if(!t.email_verified)throw new Error("JWT email not verified by issuer");return t.email}if(t.sub)return t.sub;throw new Error("JWT subject not found")}o(Fwe,"extractJWTSubject")});var EG=g((xWe,Bwe)=>{Bwe.exports={name:"@sigstore/sign",version:"4.0.1",description:"Sigstore signing library",main:"dist/index.js",types:"dist/index.d.ts",scripts:{clean:"shx rm -rf dist *.tsbuildinfo",build:"tsc --build",test:"jest"},files:["dist"],author:"bdehamer@github.com",license:"Apache-2.0",repository:{type:"git",url:"git+https://github.com/sigstore/sigstore-js.git"},bugs:{url:"https://github.com/sigstore/sigstore-js/issues"},homepage:"https://github.com/sigstore/sigstore-js/tree/main/packages/sign#readme",publishConfig:{provenance:!0},devDependencies:{"@sigstore/jest":"^0.0.0","@sigstore/mock":"^0.11.0","@sigstore/rekor-types":"^4.0.0","@types/make-fetch-happen":"^10.0.4","@types/promise-retry":"^1.1.6"},dependencies:{"@sigstore/bundle":"^4.0.0","@sigstore/core":"^3.0.0","@sigstore/protobuf-specs":"^0.5.0","make-fetch-happen":"^15.0.2","proc-log":"^5.0.0","promise-retry":"^2.0.1"},engines:{node:"^20.17.0 || >=22.9.0"}}});var bG=g(_c=>{"use strict";var qwe=_c&&_c.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_c,"__esModule",{value:!0});_c.getUserAgent=void 0;var _G=qwe(require("os")),jwe=o(()=>{let r=EG().version,e=process.version,t=_G.default.platform(),i=_G.default.arch();return`sigstore-js/${r} (Node ${e}) (${t}/${i})`},"getUserAgent");_c.getUserAgent=jwe});var en=g(Re=>{"use strict";var $we=Re&&Re.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Uwe=Re&&Re.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),OG=Re&&Re.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&$we(t,e,i[s]);return Uwe(t,e),t}})();Object.defineProperty(Re,"__esModule",{value:!0});Re.ua=Re.oidc=Re.pem=Re.json=Re.encoding=Re.dsse=Re.crypto=void 0;var bh=kt();Object.defineProperty(Re,"crypto",{enumerable:!0,get:o(function(){return bh.crypto},"get")});Object.defineProperty(Re,"dsse",{enumerable:!0,get:o(function(){return bh.dsse},"get")});Object.defineProperty(Re,"encoding",{enumerable:!0,get:o(function(){return bh.encoding},"get")});Object.defineProperty(Re,"json",{enumerable:!0,get:o(function(){return bh.json},"get")});Object.defineProperty(Re,"pem",{enumerable:!0,get:o(function(){return bh.pem},"get")});Re.oidc=OG(vG());Re.ua=OG(bG())});var nT=g(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.BaseBundleBuilder=void 0;var sT=class{static{o(this,"BaseBundleBuilder")}constructor(e){this.signer=e.signer,this.witnesses=e.witnesses}async create(e){let t=await this.prepare(e).then(c=>this.signer.sign(c)),i=await this.package(e,t),s=await Promise.all(this.witnesses.map(c=>c.testify(i.content,Vwe(t.key)))),n=[],a=[];return s.forEach(({tlogEntries:c,rfc3161Timestamps:l})=>{n.push(...c??[]),a.push(...l??[])}),i.verificationMaterial.tlogEntries=n,i.verificationMaterial.timestampVerificationData={rfc3161Timestamps:a},i}async prepare(e){return e.data}};_y.BaseBundleBuilder=sT;function Vwe(r){switch(r.$case){case"publicKey":return r.publicKey;case"x509Certificate":return r.certificate}}o(Vwe,"publicKey")});var aT=g(Ei=>{"use strict";var zwe=Ei&&Ei.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),Gwe=Ei&&Ei.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Hwe=Ei&&Ei.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&zwe(t,e,i[s]);return Gwe(t,e),t}})();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.toMessageSignatureBundle=Wwe;Ei.toDSSEBundle=Jwe;var IG=Hwe(Sh()),oT=en();function Wwe(r,e){let t=oT.crypto.digest("sha256",r.data);return IG.toMessageSignatureBundle({digest:t,signature:e.signature,certificate:e.key.$case==="x509Certificate"?oT.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:!0})}o(Wwe,"toMessageSignatureBundle");function Jwe(r,e,t){return IG.toDSSEBundle({artifact:r.data,artifactType:r.type,signature:e.signature,certificate:e.key.$case==="x509Certificate"?oT.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:t})}o(Jwe,"toDSSEBundle")});var RG=g(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.DSSEBundleBuilder=void 0;var Kwe=en(),Ywe=nT(),Zwe=aT(),cT=class extends Ywe.BaseBundleBuilder{static{o(this,"DSSEBundleBuilder")}constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let t=TG(e);return Kwe.dsse.preAuthEncoding(t.type,t.data)}async package(e,t){return(0,Zwe.toDSSEBundle)(TG(e),t,this.certificateChain)}};by.DSSEBundleBuilder=cT;function TG(r){return{...r,type:r.type??""}}o(TG,"artifactDefaults")});var AG=g(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.MessageSignatureBundleBuilder=void 0;var Xwe=nT(),Qwe=aT(),lT=class extends Xwe.BaseBundleBuilder{static{o(this,"MessageSignatureBundleBuilder")}constructor(e){super(e)}async package(e,t){return(0,Qwe.toMessageSignatureBundle)(e,t)}};Oy.MessageSignatureBundleBuilder=lT});var CG=g(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.MessageSignatureBundleBuilder=bc.DSSEBundleBuilder=void 0;var eve=RG();Object.defineProperty(bc,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return eve.DSSEBundleBuilder},"get")});var tve=AG();Object.defineProperty(bc,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return tve.MessageSignatureBundleBuilder},"get")})});var Ty=g(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});Iy.HTTPError=void 0;var uT=class extends Error{static{o(this,"HTTPError")}constructor({status:e,message:t,location:i}){super(`(${e}) ${t}`),this.statusCode=e,this.location=i}};Iy.HTTPError=uT});var Oc=g(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.InternalError=void 0;Oh.internalError=ive;var rve=Ty(),Ry=class extends Error{static{o(this,"InternalError")}constructor({code:e,message:t,cause:i}){super(t),this.name=this.constructor.name,this.cause=i,this.code=e}};Oh.InternalError=Ry;function ive(r,e,t){throw r instanceof rve.HTTPError&&(t+=` - ${r.message}`),new Ry({code:e,message:t,cause:r})}o(ive,"internalError")});var kG=g(Ic=>{"use strict";var sve=Ic&&Ic.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.CIContextProvider=void 0;var nve=sve(ph()),ove=[ave,cve],hT=class{static{o(this,"CIContextProvider")}constructor(e="sigstore"){this.audience=e}async getToken(){return Promise.any(ove.map(e=>e(this.audience))).catch(()=>Promise.reject("CI: no tokens available"))}};Ic.CIContextProvider=hT;async function ave(r){if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL||!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN)return Promise.reject("no token available");let e=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);return e.searchParams.append("audience",r),(await(0,nve.default)(e.href,{retry:2,headers:{Accept:"application/json",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(i=>i.value)}o(ave,"getGHAToken");async function cve(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject("no token available")}o(cve,"getEnv")});var PG=g(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.CIContextProvider=void 0;var lve=kG();Object.defineProperty(Ay,"CIContextProvider",{enumerable:!0,get:o(function(){return lve.CIContextProvider},"get")})});var Cy=g(Ih=>{"use strict";var xG=Ih&&Ih.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ih,"__esModule",{value:!0});Ih.fetchWithRetry=Eve;var uve=require("http2"),hve=xG(ph()),NG=se(),fve=xG(Cn()),dve=en(),pve=Ty(),{HTTP2_HEADER_LOCATION:gve,HTTP2_HEADER_CONTENT_TYPE:mve,HTTP2_HEADER_USER_AGENT:yve,HTTP_STATUS_INTERNAL_SERVER_ERROR:Sve,HTTP_STATUS_TOO_MANY_REQUESTS:wve,HTTP_STATUS_REQUEST_TIMEOUT:vve}=uve.constants;async function Eve(r,e){return(0,fve.default)(async(t,i)=>{let s=e.method||"POST",n={[yve]:dve.ua.getUserAgent(),...e.headers},a=await(0,hve.default)(r,{method:s,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(c=>(NG.log.http("fetch",`${s} ${r} attempt ${i} failed with ${c}`),t(c)));if(a.ok)return a;{let c=await _ve(a);if(NG.log.http("fetch",`${s} ${r} attempt ${i} failed with ${a.status}`),bve(a.status))return t(c);throw c}},Ove(e.retry))}o(Eve,"fetchWithRetry");var _ve=o(async r=>{let e=r.statusText,t=r.headers.get(gve)||void 0;if(r.headers.get(mve)?.includes("application/json"))try{e=(await r.json()).message||e}catch{}return new pve.HTTPError({status:r.status,message:e,location:t})},"errorFromResponse"),bve=o(r=>[vve,wve].includes(r)||r>=Sve,"retryable"),Ove=o(r=>typeof r=="boolean"?{retries:r?1:0}:typeof r=="number"?{retries:r}:{retries:0,...r},"retryOpts")});var DG=g(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});ky.Fulcio=void 0;var Ive=Cy(),fT=class{static{o(this,"Fulcio")}constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:t,retry:i,timeout:s}=this.options,n=`${t}/api/v2/signingCert`;return(await(0,Ive.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:s,retry:i})).json()}};ky.Fulcio=fT});var LG=g(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.CAClient=void 0;var Tve=Oc(),Rve=DG(),dT=class{static{o(this,"CAClient")}constructor(e){this.fulcio=new Rve.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,t,i){let s=Ave(e,t,i);try{let n=await this.fulcio.createSigningCertificate(s);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,Tve.internalError)(n,"CA_CREATE_SIGNING_CERTIFICATE_ERROR","error creating signing certificate")}}};Py.CAClient=dT;function Ave(r,e,t){return{credentials:{oidcIdentityToken:r},publicKeyRequest:{publicKey:{algorithm:"ECDSA",content:e},proofOfPossession:t.toString("base64")}}}o(Ave,"toCertificateRequest")});var FG=g(Tc=>{"use strict";var Cve=Tc&&Tc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Tc,"__esModule",{value:!0});Tc.EphemeralSigner=void 0;var MG=Cve(require("crypto")),kve="ec",Pve="P-256",pT=class{static{o(this,"EphemeralSigner")}constructor(){this.keypair=MG.default.generateKeyPairSync(kve,{namedCurve:Pve})}async sign(e){let t=MG.default.sign(null,e,this.keypair.privateKey),i=this.keypair.publicKey.export({format:"pem",type:"spki"}).toString("ascii");return{signature:t,key:{$case:"publicKey",publicKey:i}}}};Tc.EphemeralSigner=pT});var BG=g(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.FulcioSigner=wo.DEFAULT_FULCIO_URL=void 0;var gT=Oc(),Nve=en(),xve=LG(),Dve=FG();wo.DEFAULT_FULCIO_URL="https://fulcio.sigstore.dev";var mT=class{static{o(this,"FulcioSigner")}constructor(e){this.ca=new xve.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||wo.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new Dve.EphemeralSigner}async sign(e){let t=await this.getIdentityToken(),i;try{i=Nve.oidc.extractJWTSubject(t)}catch(c){throw new gT.InternalError({code:"IDENTITY_TOKEN_PARSE_ERROR",message:`invalid identity token: ${t}`,cause:c})}let s=await this.keyHolder.sign(Buffer.from(i));if(s.key.$case!=="publicKey")throw new gT.InternalError({code:"CA_CREATE_SIGNING_CERTIFICATE_ERROR",message:"unexpected format for signing key"});let n=await this.ca.createSigningCertificate(t,s.key.publicKey,s.signature);return{signature:(await this.keyHolder.sign(e)).signature,key:{$case:"x509Certificate",certificate:n[0]}}}async getIdentityToken(){try{return await this.identityProvider.getToken()}catch(e){throw new gT.InternalError({code:"IDENTITY_TOKEN_READ_ERROR",message:"error retrieving identity token",cause:e})}}};wo.FulcioSigner=mT});var jG=g(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.FulcioSigner=Rc.DEFAULT_FULCIO_URL=void 0;var qG=BG();Object.defineProperty(Rc,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return qG.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(Rc,"FulcioSigner",{enumerable:!0,get:o(function(){return qG.FulcioSigner},"get")})});var VG=g(Ny=>{"use strict";Object.defineProperty(Ny,"__esModule",{value:!0});Ny.Rekor=void 0;var $G=Cy(),yT=class{static{o(this,"Rekor")}constructor(e){this.options=e}async createEntry(e){let{baseURL:t,timeout:i,retry:s}=this.options,n=`${t}/api/v1/log/entries`,c=await(await(0,$G.fetchWithRetry)(n,{headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e),timeout:i,retry:s})).json();return UG(c)}async getEntry(e){let{baseURL:t,timeout:i,retry:s}=this.options,n=`${t}/api/v1/log/entries/${e}`,c=await(await(0,$G.fetchWithRetry)(n,{method:"GET",headers:{Accept:"application/json"},timeout:i,retry:s})).json();return UG(c)}};Ny.Rekor=yT;function UG(r){let e=Object.entries(r);if(e.length!=1)throw new Error("Received multiple entries in Rekor response");let[t,i]=e[0];return{...i,uuid:t}}o(UG,"entryFromResponse")});var GG=g(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.TLogClient=void 0;var zG=Oc(),Lve=Ty(),Mve=VG(),ST=class{static{o(this,"TLogClient")}constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new Mve.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let t;try{t=await this.rekor.createEntry(e)}catch(i){if(Fve(i)&&this.fetchOnConflict){let s=i.location.split("/").pop()||"";try{t=await this.rekor.getEntry(s)}catch(n){(0,zG.internalError)(n,"TLOG_FETCH_ENTRY_ERROR","error fetching tlog entry")}}else(0,zG.internalError)(i,"TLOG_CREATE_ENTRY_ERROR","error creating tlog entry")}return t}};xy.TLogClient=ST;function Fve(r){return r instanceof Lve.HTTPError&&r.statusCode===409&&r.location!==void 0}o(Fve,"entryExistsError")});var HG=g(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});wT.toProposedEntry=qve;var Bve=Sh(),tn=en(),Th="sha256";function qve(r,e,t="dsse"){switch(r.$case){case"dsseEnvelope":return t==="intoto"?Uve(r.dsseEnvelope,e):$ve(r.dsseEnvelope,e);case"messageSignature":return jve(r.messageSignature,e)}}o(qve,"toProposedEntry");function jve(r,e){let t=r.messageDigest.digest.toString("hex"),i=r.signature.toString("base64"),s=tn.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"hashedrekord",spec:{data:{hash:{algorithm:Th,value:t}},signature:{content:i,publicKey:{content:s}}}}}o(jve,"toProposedHashedRekordEntry");function $ve(r,e){let t=JSON.stringify((0,Bve.envelopeToJSON)(r)),i=tn.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"dsse",spec:{proposedContent:{envelope:t,verifiers:[i]}}}}o($ve,"toProposedDSSEEntry");function Uve(r,e){let t=tn.crypto.digest(Th,r.payload).toString("hex"),i=Vve(r,e),s=tn.encoding.base64Encode(r.payload.toString("base64")),n=tn.encoding.base64Encode(r.signatures[0].sig.toString("base64")),a=r.signatures[0].keyid,c=tn.encoding.base64Encode(e),l={payloadType:r.payloadType,payload:s,signatures:[{sig:n,publicKey:c}]};return a.length>0&&(l.signatures[0].keyid=a),{apiVersion:"0.0.2",kind:"intoto",spec:{content:{envelope:l,hash:{algorithm:Th,value:i},payloadHash:{algorithm:Th,value:t}}}}}o(Uve,"toProposedIntotoEntry");function Vve(r,e){let t={payloadType:r.payloadType,payload:r.payload.toString("base64"),signatures:[{sig:r.signatures[0].sig.toString("base64"),publicKey:e}]};return r.signatures[0].keyid.length>0&&(t.signatures[0].keyid=r.signatures[0].keyid),tn.crypto.digest(Th,tn.json.canonicalize(t)).toString("hex")}o(Vve,"calculateDSSEHash")});var WG=g(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.RekorWitness=vo.DEFAULT_REKOR_URL=void 0;var zve=en(),Gve=GG(),Hve=HG();vo.DEFAULT_REKOR_URL="https://rekor.sigstore.dev";var vT=class{static{o(this,"RekorWitness")}constructor(e){this.entryType=e.entryType,this.tlog=new Gve.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||vo.DEFAULT_REKOR_URL})}async testify(e,t){let i=(0,Hve.toProposedEntry)(e,t,this.entryType),s=await this.tlog.createEntry(i);return Wve(s)}};vo.RekorWitness=vT;function Wve(r){let e=Buffer.from(r.logID,"hex"),t=zve.encoding.base64Decode(r.body),i=JSON.parse(t),s=r?.verification?.signedEntryTimestamp?Jve(r.verification.signedEntryTimestamp):void 0,n=r?.verification?.inclusionProof?Kve(r.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:r.logIndex.toString(),logId:{keyId:e},integratedTime:r.integratedTime.toString(),kindVersion:{kind:i.kind,version:i.apiVersion},inclusionPromise:s,inclusionProof:n,canonicalizedBody:Buffer.from(r.body,"base64")}]}}o(Wve,"toTransparencyLogEntry");function Jve(r){return{signedEntryTimestamp:Buffer.from(r,"base64")}}o(Jve,"inclusionPromise");function Kve(r){return{logIndex:r.logIndex.toString(),treeSize:r.treeSize.toString(),rootHash:Buffer.from(r.rootHash,"hex"),hashes:r.hashes.map(e=>Buffer.from(e,"hex")),checkpoint:{envelope:r.checkpoint}}}o(Kve,"inclusionProof")});var JG=g(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.TimestampAuthority=void 0;var Yve=Cy(),ET=class{static{o(this,"TimestampAuthority")}constructor(e){this.options=e}async createTimestamp(e){let{baseURL:t,timeout:i,retry:s}=this.options,n=`${t}/api/v1/timestamp`;return(await(0,Yve.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:i,retry:s})).buffer()}};Dy.TimestampAuthority=ET});var YG=g(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.TSAClient=void 0;var Zve=Oc(),Xve=JG(),Qve=en(),KG="sha256",_T=class{static{o(this,"TSAClient")}constructor(e){this.tsa=new Xve.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let t={artifactHash:Qve.crypto.digest(KG,e).toString("base64"),hashAlgorithm:KG};try{return await this.tsa.createTimestamp(t)}catch(i){(0,Zve.internalError)(i,"TSA_CREATE_TIMESTAMP_ERROR","error creating timestamp")}}};Ly.TSAClient=_T});var ZG=g(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.TSAWitness=void 0;var eEe=YG(),bT=class{static{o(this,"TSAWitness")}constructor(e){this.tsa=new eEe.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let t=tEe(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(t)}]}}};My.TSAWitness=bT;function tEe(r){switch(r.$case){case"dsseEnvelope":return r.dsseEnvelope.signatures[0].sig;case"messageSignature":return r.messageSignature.signature}}o(tEe,"extractSignature")});var QG=g(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.TSAWitness=rn.RekorWitness=rn.DEFAULT_REKOR_URL=void 0;var XG=WG();Object.defineProperty(rn,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return XG.DEFAULT_REKOR_URL},"get")});Object.defineProperty(rn,"RekorWitness",{enumerable:!0,get:o(function(){return XG.RekorWitness},"get")});var rEe=ZG();Object.defineProperty(rn,"TSAWitness",{enumerable:!0,get:o(function(){return rEe.TSAWitness},"get")})});var IT=g(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.TSAWitness=Be.RekorWitness=Be.DEFAULT_REKOR_URL=Be.FulcioSigner=Be.DEFAULT_FULCIO_URL=Be.CIContextProvider=Be.InternalError=Be.MessageSignatureBundleBuilder=Be.DSSEBundleBuilder=void 0;var eH=CG();Object.defineProperty(Be,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return eH.DSSEBundleBuilder},"get")});Object.defineProperty(Be,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return eH.MessageSignatureBundleBuilder},"get")});var iEe=Oc();Object.defineProperty(Be,"InternalError",{enumerable:!0,get:o(function(){return iEe.InternalError},"get")});var sEe=PG();Object.defineProperty(Be,"CIContextProvider",{enumerable:!0,get:o(function(){return sEe.CIContextProvider},"get")});var tH=jG();Object.defineProperty(Be,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return tH.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(Be,"FulcioSigner",{enumerable:!0,get:o(function(){return tH.FulcioSigner},"get")});var OT=QG();Object.defineProperty(Be,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return OT.DEFAULT_REKOR_URL},"get")});Object.defineProperty(Be,"RekorWitness",{enumerable:!0,get:o(function(){return OT.RekorWitness},"get")});Object.defineProperty(Be,"TSAWitness",{enumerable:!0,get:o(function(){return OT.TSAWitness},"get")})});var iH=g(Rh=>{"use strict";var rH=Rh&&Rh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rh,"__esModule",{value:!0});Rh.appDataPath=oEe;var nEe=rH(require("os")),Ac=rH(require("path"));function oEe(r){let e=nEe.default.homedir();switch(process.platform){case"darwin":{let t=Ac.default.join(e,"Library","Application Support");return Ac.default.join(t,r)}case"win32":{let t=process.env.LOCALAPPDATA||Ac.default.join(e,"AppData","Local");return Ac.default.join(t,r,"Data")}default:{let t=process.env.XDG_DATA_HOME||Ac.default.join(e,".local","share");return Ac.default.join(t,r)}}}o(oEe,"appDataPath")});var _i=g(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.UnsupportedAlgorithmError=Pt.CryptoError=Pt.LengthOrHashMismatchError=Pt.UnsignedMetadataError=Pt.RepositoryError=Pt.ValueError=void 0;var TT=class extends Error{static{o(this,"ValueError")}};Pt.ValueError=TT;var Ah=class extends Error{static{o(this,"RepositoryError")}};Pt.RepositoryError=Ah;var RT=class extends Ah{static{o(this,"UnsignedMetadataError")}};Pt.UnsignedMetadataError=RT;var AT=class extends Ah{static{o(this,"LengthOrHashMismatchError")}};Pt.LengthOrHashMismatchError=AT;var Fy=class extends Error{static{o(this,"CryptoError")}};Pt.CryptoError=Fy;var CT=class extends Fy{static{o(this,"UnsupportedAlgorithmError")}};Pt.UnsupportedAlgorithmError=CT});var nH=g(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.isDefined=aEe;sn.isObject=sH;sn.isStringArray=cEe;sn.isObjectArray=lEe;sn.isStringRecord=uEe;sn.isObjectRecord=hEe;function aEe(r){return r!==void 0}o(aEe,"isDefined");function sH(r){return typeof r=="object"&&r!==null}o(sH,"isObject");function cEe(r){return Array.isArray(r)&&r.every(e=>typeof e=="string")}o(cEe,"isStringArray");function lEe(r){return Array.isArray(r)&&r.every(sH)}o(lEe,"isObjectArray");function uEe(r){return typeof r=="object"&&r!==null&&Object.keys(r).every(e=>typeof e=="string")&&Object.values(r).every(e=>typeof e=="string")}o(uEe,"isStringRecord");function hEe(r){return typeof r=="object"&&r!==null&&Object.keys(r).every(e=>typeof e=="string")&&Object.values(r).every(e=>typeof e=="object"&&e!==null)}o(hEe,"isObjectRecord")});var PT=g((B3e,aH)=>{function kT(r){let e=[];if(typeof r=="string")e.push(oH(r));else if(typeof r=="boolean")e.push(JSON.stringify(r));else if(Number.isInteger(r))e.push(JSON.stringify(r));else if(r===null)e.push(JSON.stringify(r));else if(Array.isArray(r)){e.push("[");let t=!0;r.forEach(i=>{t||e.push(","),t=!1,e.push(kT(i))}),e.push("]")}else if(typeof r=="object"){e.push("{");let t=!0;Object.keys(r).sort().forEach(i=>{t||e.push(","),t=!1,e.push(oH(i)),e.push(":"),e.push(kT(r[i]))}),e.push("}")}else throw new TypeError("cannot encode "+r.toString());return e.join("")}o(kT,"canonicalize");function oH(r){return'"'+r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}o(oH,"canonicalizeString");aH.exports={canonicalize:kT}});var cH=g(Cc=>{"use strict";var fEe=Cc&&Cc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cc,"__esModule",{value:!0});Cc.verifySignature=void 0;var dEe=PT(),pEe=fEe(require("crypto")),gEe=o((r,e,t)=>{let i=Buffer.from((0,dEe.canonicalize)(r));return pEe.default.verify(void 0,i,e,Buffer.from(t,"hex"))},"verifySignature");Cc.verifySignature=gEe});var qr=g(dr=>{"use strict";var mEe=dr&&dr.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),yEe=dr&&dr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),lH=dr&&dr.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&mEe(t,e,i[s]);return yEe(t,e),t}})();Object.defineProperty(dr,"__esModule",{value:!0});dr.crypto=dr.guard=void 0;dr.guard=lH(nH());dr.crypto=lH(cH())});var Eo=g(os=>{"use strict";var SEe=os&&os.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(os,"__esModule",{value:!0});os.Signed=os.MetadataKind=void 0;os.isMetadataKind=vEe;var wEe=SEe(require("util")),Ch=_i(),NT=qr(),uH=["1","0","31"],xT;(function(r){r.Root="root",r.Timestamp="timestamp",r.Snapshot="snapshot",r.Targets="targets"})(xT||(os.MetadataKind=xT={}));function vEe(r){return typeof r=="string"&&Object.values(xT).includes(r)}o(vEe,"isMetadataKind");var DT=class r{static{o(this,"Signed")}specVersion;expires;version;unrecognizedFields;constructor(e){this.specVersion=e.specVersion||uH.join(".");let t=this.specVersion.split(".");if(!(t.length===2||t.length===3)||!t.every(i=>EEe(i)))throw new Ch.ValueError("Failed to parse specVersion");if(t[0]!=uH[0])throw new Ch.ValueError("Unsupported specVersion");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof r?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&wEe.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}isExpired(e){return e||(e=new Date),e>=new Date(this.expires)}static commonFieldsFromJSON(e){let{spec_version:t,expires:i,version:s,...n}=e;if(NT.guard.isDefined(t)){if(typeof t!="string")throw new TypeError("spec_version must be a string")}else throw new Ch.ValueError("spec_version is not defined");if(NT.guard.isDefined(i)){if(typeof i!="string")throw new TypeError("expires must be a string")}else throw new Ch.ValueError("expires is not defined");if(NT.guard.isDefined(s)){if(typeof s!="number")throw new TypeError("version must be a number")}else throw new Ch.ValueError("version is not defined");return{specVersion:t,expires:i,version:s,unrecognizedFields:n}}};os.Signed=DT;function EEe(r){return!isNaN(Number(r))}o(EEe,"isNumeric")});var kh=g(on=>{"use strict";var hH=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});on.TargetFile=on.MetaFile=void 0;var fH=hH(require("crypto")),qy=hH(require("util")),nn=_i(),By=qr(),LT=class r{static{o(this,"MetaFile")}version;length;hashes;unrecognizedFields;constructor(e){if(e.version<=0)throw new nn.ValueError("Metafile version must be at least 1");e.length!==void 0&&dH(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof r?this.version===e.version&&this.length===e.length&&qy.default.isDeepStrictEqual(this.hashes,e.hashes)&&qy.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new nn.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([t,i])=>{let s;try{s=fH.default.createHash(t)}catch{throw new nn.LengthOrHashMismatchError(`Hash algorithm ${t} not supported`)}let n=s.update(e).digest("hex");if(n!==i)throw new nn.LengthOrHashMismatchError(`Expected hash ${i} but got ${n}`)})}toJSON(){let e={version:this.version,...this.unrecognizedFields};return this.length!==void 0&&(e.length=this.length),this.hashes&&(e.hashes=this.hashes),e}static fromJSON(e){let{version:t,length:i,hashes:s,...n}=e;if(typeof t!="number")throw new TypeError("version must be a number");if(By.guard.isDefined(i)&&typeof i!="number")throw new TypeError("length must be a number");if(By.guard.isDefined(s)&&!By.guard.isStringRecord(s))throw new TypeError("hashes must be string keys and values");return new r({version:t,length:i,hashes:s,unrecognizedFields:n})}};on.MetaFile=LT;var MT=class r{static{o(this,"TargetFile")}length;path;hashes;unrecognizedFields;constructor(e){dH(e.length),this.length=e.length,this.path=e.path,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}get custom(){let e=this.unrecognizedFields.custom;return!e||Array.isArray(e)||typeof e!="object"?{}:e}equals(e){return e instanceof r?this.length===e.length&&this.path===e.path&&qy.default.isDeepStrictEqual(this.hashes,e.hashes)&&qy.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let t=0,i=Object.keys(this.hashes).reduce((s,n)=>{try{s[n]=fH.default.createHash(n)}catch{throw new nn.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return s},{});for await(let s of e)t+=s.length,Object.values(i).forEach(n=>{n.update(s)});if(t!==this.length)throw new nn.LengthOrHashMismatchError(`Expected length ${this.length} but got ${t}`);Object.entries(i).forEach(([s,n])=>{let a=this.hashes[s],c=n.digest("hex");if(c!==a)throw new nn.LengthOrHashMismatchError(`Expected hash ${a} but got ${c}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,t){let{length:i,hashes:s,...n}=t;if(typeof i!="number")throw new TypeError("length must be a number");if(!By.guard.isStringRecord(s))throw new TypeError("hashes must have string keys and values");return new r({length:i,path:e,hashes:s,unrecognizedFields:n})}};on.TargetFile=MT;function dH(r){if(r<0)throw new nn.ValueError("Length must be at least 0")}o(dH,"validateLength")});var pH=g(FT=>{"use strict";Object.defineProperty(FT,"__esModule",{value:!0});FT.encodeOIDString=bEe;var _Ee=6;function bEe(r){let e=r.split("."),t=parseInt(e[0],10)*40+parseInt(e[1],10),i=[];e.slice(2).forEach(n=>{let a=OEe(parseInt(n,10));i.push(...a)});let s=Buffer.from([t,...i]);return Buffer.from([_Ee,s.length,...s])}o(bEe,"encodeOIDString");function OEe(r){let e=[],t=0;for(;r>0;)e.unshift(r&127|t),r>>=7,t=128;return e}o(OEe,"encodeVariableLengthInteger")});var SH=g(Nh=>{"use strict";var IEe=Nh&&Nh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nh,"__esModule",{value:!0});Nh.getPublicKey=CEe;var kc=IEe(require("crypto")),Ph=_i(),BT=pH(),jy=48,gH=3,mH=0,TEe="1.3.101.112",REe="1.2.840.10045.2.1",AEe="1.2.840.10045.3.1.7",qT="-----BEGIN PUBLIC KEY-----";function CEe(r){switch(r.keyType){case"rsa":return kEe(r);case"ed25519":return PEe(r);case"ecdsa":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":return NEe(r);default:throw new Ph.UnsupportedAlgorithmError(`Unsupported key type: ${r.keyType}`)}}o(CEe,"getPublicKey");function kEe(r){if(!r.keyVal.startsWith(qT))throw new Ph.CryptoError("Invalid key format");let e=kc.default.createPublicKey(r.keyVal);switch(r.scheme){case"rsassa-pss-sha256":return{key:e,padding:kc.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new Ph.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${r.scheme}`)}}o(kEe,"getRSAPublicKey");function PEe(r){let e;if(r.keyVal.startsWith(qT))e=kc.default.createPublicKey(r.keyVal);else{if(!yH(r.keyVal))throw new Ph.CryptoError("Invalid key format");e=kc.default.createPublicKey({key:xEe.hexToDER(r.keyVal),format:"der",type:"spki"})}return{key:e}}o(PEe,"getED25519PublicKey");function NEe(r){let e;if(r.keyVal.startsWith(qT))e=kc.default.createPublicKey(r.keyVal);else{if(!yH(r.keyVal))throw new Ph.CryptoError("Invalid key format");e=kc.default.createPublicKey({key:DEe.hexToDER(r.keyVal),format:"der",type:"spki"})}return{key:e}}o(NEe,"getECDCSAPublicKey");var xEe={hexToDER:o(r=>{let e=Buffer.from(r,"hex"),t=(0,BT.encodeOIDString)(TEe),i=Buffer.concat([Buffer.concat([Buffer.from([jy]),Buffer.from([t.length]),t]),Buffer.concat([Buffer.from([gH]),Buffer.from([e.length+1]),Buffer.from([mH]),e])]);return Buffer.concat([Buffer.from([jy]),Buffer.from([i.length]),i])},"hexToDER")},DEe={hexToDER:o(r=>{let e=Buffer.from(r,"hex"),t=Buffer.concat([Buffer.from([gH]),Buffer.from([e.length+1]),Buffer.from([mH]),e]),i=Buffer.concat([(0,BT.encodeOIDString)(REe),(0,BT.encodeOIDString)(AEe)]),s=Buffer.concat([Buffer.from([jy]),Buffer.from([i.length]),i]);return Buffer.concat([Buffer.from([jy]),Buffer.from([s.length+t.length]),s,t])},"hexToDER")},yH=o(r=>/^[0-9a-fA-F]+$/.test(r),"isHex")});var $y=g(Pc=>{"use strict";var LEe=Pc&&Pc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pc,"__esModule",{value:!0});Pc.Key=void 0;var wH=LEe(require("util")),xh=_i(),vH=qr(),MEe=SH(),jT=class r{static{o(this,"Key")}keyID;keyType;scheme;keyVal;unrecognizedFields;constructor(e){let{keyID:t,keyType:i,scheme:s,keyVal:n,unrecognizedFields:a}=e;this.keyID=t,this.keyType=i,this.scheme=s,this.keyVal=n,this.unrecognizedFields=a||{}}verifySignature(e){let t=e.signatures[this.keyID];if(!t)throw new xh.UnsignedMetadataError("no signature for key found in metadata");if(!this.keyVal.public)throw new xh.UnsignedMetadataError("no public key found");let i=(0,MEe.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),s=e.signed.toJSON();try{if(!vH.crypto.verifySignature(s,i,t.sig))throw new xh.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof xh.UnsignedMetadataError?n:new xh.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof r?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&wH.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&wH.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keytype:this.keyType,scheme:this.scheme,keyval:this.keyVal,...this.unrecognizedFields}}static fromJSON(e,t){let{keytype:i,scheme:s,keyval:n,...a}=t;if(typeof i!="string")throw new TypeError("keytype must be a string");if(typeof s!="string")throw new TypeError("scheme must be a string");if(!vH.guard.isStringRecord(n))throw new TypeError("keyval must be a string record");return new r({keyID:e,keyType:i,scheme:s,keyVal:n,unrecognizedFields:a})}};Pc.Key=jT});var IH=g((e5e,OH)=>{"use strict";OH.exports=_H;function _H(r,e,t){r instanceof RegExp&&(r=EH(r,t)),e instanceof RegExp&&(e=EH(e,t));var i=bH(r,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+r.length,i[1]),post:t.slice(i[1]+e.length)}}o(_H,"balanced");function EH(r,e){var t=e.match(r);return t?t[0]:null}o(EH,"maybeMatch");_H.range=bH;function bH(r,e,t){var i,s,n,a,c,l=t.indexOf(r),u=t.indexOf(e,l+1),h=l;if(l>=0&&u>0){if(r===e)return[l,u];for(i=[],n=t.length;h>=0&&!c;)h==l?(i.push(h),l=t.indexOf(r,h+1)):i.length==1?c=[i.pop(),u]:(s=i.pop(),s<n&&(n=s,a=u),u=t.indexOf(e,h+1)),h=l<u&&l>=0?l:u;i.length&&(c=[n,a])}return c}o(bH,"range")});var xH=g((r5e,NH)=>{var TH=IH();NH.exports=qEe;var RH="\0SLASH"+Math.random()+"\0",AH="\0OPEN"+Math.random()+"\0",UT="\0CLOSE"+Math.random()+"\0",CH="\0COMMA"+Math.random()+"\0",kH="\0PERIOD"+Math.random()+"\0";function $T(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}o($T,"numeric");function FEe(r){return r.split("\\\\").join(RH).split("\\{").join(AH).split("\\}").join(UT).split("\\,").join(CH).split("\\.").join(kH)}o(FEe,"escapeBraces");function BEe(r){return r.split(RH).join("\\").split(AH).join("{").split(UT).join("}").split(CH).join(",").split(kH).join(".")}o(BEe,"unescapeBraces");function PH(r){if(!r)return[""];var e=[],t=TH("{","}",r);if(!t)return r.split(",");var i=t.pre,s=t.body,n=t.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var c=PH(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(PH,"parseCommaParts");function qEe(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Dh(FEe(r),!0).map(BEe)):[]}o(qEe,"expandTop");function jEe(r){return"{"+r+"}"}o(jEe,"embrace");function $Ee(r){return/^-?0\d/.test(r)}o($Ee,"isPadded");function UEe(r,e){return r<=e}o(UEe,"lte");function VEe(r,e){return r>=e}o(VEe,"gte");function Dh(r,e){var t=[],i=TH("{","}",r);if(!i)return[r];var s=i.pre,n=i.post.length?Dh(i.post,!1):[""];if(/\$$/.test(i.pre))for(var a=0;a<n.length;a++){var c=s+"{"+i.body+"}"+n[a];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),h=l||u,f=i.body.indexOf(",")>=0;if(!h&&!f)return i.post.match(/,(?!,).*\}/)?(r=i.pre+"{"+i.body+UT+i.post,Dh(r)):[r];var d;if(h)d=i.body.split(/\.\./);else if(d=PH(i.body),d.length===1&&(d=Dh(d[0],!1).map(jEe),d.length===1))return n.map(function(F){return i.pre+d[0]+F});var p;if(h){var m=$T(d[0]),y=$T(d[1]),w=Math.max(d[0].length,d[1].length),S=d.length==3?Math.abs($T(d[2])):1,v=UEe,_=y<m;_&&(S*=-1,v=VEe);var E=d.some($Ee);p=[];for(var b=m;v(b,y);b+=S){var O;if(u)O=String.fromCharCode(b),O==="\\"&&(O="");else if(O=String(b),E){var T=w-O.length;if(T>0){var I=new Array(T+1).join("0");b<0?O="-"+I+O.slice(1):O=I+O}}p.push(O)}}else{p=[];for(var L=0;L<d.length;L++)p.push.apply(p,Dh(d[L],!1))}for(var L=0;L<p.length;L++)for(var a=0;a<n.length;a++){var c=s+p[L]+n[a];(!e||h||c)&&t.push(c)}}return t}o(Dh,"expand")});var DH=g(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.assertValidPattern=void 0;var zEe=1024*64,GEe=o(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>zEe)throw new TypeError("pattern is too long")},"assertValidPattern");Uy.assertValidPattern=GEe});var MH=g(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});Vy.parseClass=void 0;var HEe={"[: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]},Lh=o(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),WEe=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),LH=o(r=>r.join(""),"rangesToString"),JEe=o((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],s=[],n=t+1,a=!1,c=!1,l=!1,u=!1,h=t,f="";e:for(;n<r.length;){let y=r.charAt(n);if((y==="!"||y==="^")&&n===t+1){u=!0,n++;continue}if(y==="]"&&a&&!l){h=n+1;break}if(a=!0,y==="\\"&&!l){l=!0,n++;continue}if(y==="["&&!l){for(let[w,[S,v,_]]of Object.entries(HEe))if(r.startsWith(w,n)){if(f)return["$.",!1,r.length-t,!0];n+=w.length,_?s.push(S):i.push(S),c=c||v;continue e}}if(l=!1,f){y>f?i.push(Lh(f)+"-"+Lh(y)):y===f&&i.push(Lh(y)),f="",n++;continue}if(r.startsWith("-]",n+1)){i.push(Lh(y+"-")),n+=2;continue}if(r.startsWith("-",n+1)){f=y,n+=2;continue}i.push(Lh(y)),n++}if(h<n)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,r.length-t,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let y=i[0].length===2?i[0].slice(-1):i[0];return[WEe(y),!1,h-t,!1]}let d="["+(u?"^":"")+LH(i)+"]",p="["+(u?"":"^")+LH(s)+"]";return[i.length&&s.length?"("+d+"|"+p+")":i.length?d:p,c,h-t,!0]},"parseClass");Vy.parseClass=JEe});var Gy=g(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});zy.unescape=void 0;var KEe=o((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");zy.unescape=KEe});var GT=g(Jy=>{"use strict";Object.defineProperty(Jy,"__esModule",{value:!0});Jy.AST=void 0;var YEe=MH(),Hy=Gy(),ZEe=new Set(["!","?","+","*","@"]),FH=o(r=>ZEe.has(r),"isExtglobType"),XEe="(?!(?:^|/)\\.\\.?(?:$|/))",Wy="(?!\\.)",QEe=new Set(["[","."]),e_e=new Set(["..","."]),t_e=new Set("().*{}+?[]^$\\!"),r_e=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zT="[^/]",BH=zT+"*?",qH=zT+"+?",VT=class r{static{o(this,"AST")}type;#e;#t;#r=!1;#i=[];#s;#o;#n;#c=!1;#a;#h;#l=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#n=this.#e===this?[]:this.#e.#n,e==="!"&&!this.#e.#c&&this.#n.push(this),this.#o=this.#s?this.#s.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#h=this.#i.map(e=>String(e)).join("")}#f(){if(this!==this.#e)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#n.pop();){if(e.type!=="!")continue;let t=e,i=t.#s;for(;i;){for(let s=t.#o+1;!i.type&&s<i.#i.length;s++)for(let n of e.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(i.#i[s])}t=i,i=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof r&&t.#s===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#c&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#o===0)return!0;let e=this.#s;for(let t=0;t<this.#o;t++){let i=e.#i[t];if(!(i instanceof r&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#s?.type==="!")return!0;if(!this.#s?.isEnd())return!1;if(!this.type)return this.#s?.isEnd();let e=this.#s?this.#s.#i.length:0;return this.#o===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new r(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#u(e,t,i,s){let n=!1,a=!1,c=-1,l=!1;if(t.type===null){let p=i,m="";for(;p<e.length;){let y=e.charAt(p++);if(n||y==="\\"){n=!n,m+=y;continue}if(a){p===c+1?(y==="^"||y==="!")&&(l=!0):y==="]"&&!(p===c+2&&l)&&(a=!1),m+=y;continue}else if(y==="["){a=!0,c=p,l=!1,m+=y;continue}if(!s.noext&&FH(y)&&e.charAt(p)==="("){t.push(m),m="";let w=new r(y,t);p=r.#u(e,w,p,s),t.push(w);continue}m+=y}return t.push(m),p}let u=i+1,h=new r(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==="!")&&(l=!0):p==="]"&&!(u===c+2&&l)&&(a=!1),d+=p;continue}else if(p==="["){a=!0,c=u,l=!1,d+=p;continue}if(FH(p)&&e.charAt(u)==="("){h.push(d),d="";let m=new r(p,h);h.push(m),u=r.#u(e,m,u,s);continue}if(p==="|"){h.push(d),d="",f.push(h),h=new r(null,t);continue}if(p===")")return d===""&&t.#i.length===0&&(t.#l=!0),h.push(d),d="",t.push(...f,h),u;d+=p}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],u}static fromGlob(e,t={}){let i=new r(null,void 0,t);return r.#u(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let c=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#f(),!this.type){let l=this.isStart()&&this.isEnd(),u=this.#i.map(p=>{let[m,y,w,S]=typeof p=="string"?r.#g(p,this.#t,l):p.toRegExpSource(e);return this.#t=this.#t||w,this.#r=this.#r||S,m}).join(""),h="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&e_e.has(this.#i[0]))){let m=QEe,y=t&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),w=!t&&!e&&m.has(u.charAt(0));h=y?XEe:w?Wy:""}let f="";return this.isEnd()&&this.#e.#c&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+u+f,(0,Hy.unescape)(u),this.#t=!!this.#t,this.#r]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let l=this.toString();return this.#i=[l],this.type=null,this.#t=void 0,[l,(0,Hy.unescape)(this.toString()),!1,!1]}let a=!i||e||t||!Wy?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?Wy:"")+qH;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Wy:"")+BH+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+l}return[c,(0,Hy.unescape)(n),this.#t=!!this.#t,this.#r]}#p(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,s,n,a]=t.toRegExpSource(e);return this.#r=this.#r||a,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#g(e,t,i=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let l=e.charAt(c);if(s){s=!1,n+=(t_e.has(l)?"\\":"")+l;continue}if(l==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(l==="["){let[u,h,f,d]=(0,YEe.parseClass)(e,c);if(f){n+=u,a=a||h,c+=f-1,t=t||d;continue}}if(l==="*"){i&&e==="*"?n+=qH:n+=BH,t=!0;continue}if(l==="?"){n+=zT,t=!0;continue}n+=r_e(l)}return[n,(0,Hy.unescape)(e),!!t,a]}};Jy.AST=VT});var HT=g(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.escape=void 0;var i_e=o((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape");Ky.escape=i_e});var HH=g(D=>{"use strict";var s_e=D&&D.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(D,"__esModule",{value:!0});D.unescape=D.escape=D.AST=D.Minimatch=D.match=D.makeRe=D.braceExpand=D.defaults=D.filter=D.GLOBSTAR=D.sep=D.minimatch=void 0;var n_e=s_e(xH()),Yy=DH(),UH=GT(),o_e=HT(),a_e=Gy(),c_e=o((r,e,t={})=>((0,Yy.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new _o(e,t).match(r)),"minimatch");D.minimatch=c_e;var l_e=/^\*+([^+@!?\*\[\(]*)$/,u_e=o(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),h_e=o(r=>e=>e.endsWith(r),"starDotExtTestDot"),f_e=o(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),d_e=o(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),p_e=/^\*+\.\*+$/,g_e=o(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),m_e=o(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),y_e=/^\.\*+$/,S_e=o(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),w_e=/^\*+$/,v_e=o(r=>r.length!==0&&!r.startsWith("."),"starTest"),E_e=o(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),__e=/^\?+([^+@!?\*\[\(]*)?$/,b_e=o(([r,e=""])=>{let t=VH([r]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),O_e=o(([r,e=""])=>{let t=zH([r]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),I_e=o(([r,e=""])=>{let t=zH([r]);return e?i=>t(i)&&i.endsWith(e):t},"qmarksTestDot"),T_e=o(([r,e=""])=>{let t=VH([r]);return e?i=>t(i)&&i.endsWith(e):t},"qmarksTest"),VH=o(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),zH=o(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),GH=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",jH={win32:{sep:"\\"},posix:{sep:"/"}};D.sep=GH==="win32"?jH.win32.sep:jH.posix.sep;D.minimatch.sep=D.sep;D.GLOBSTAR=Symbol("globstar **");D.minimatch.GLOBSTAR=D.GLOBSTAR;var R_e="[^/]",A_e=R_e+"*?",C_e="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",k_e="(?:(?!(?:\\/|^)\\.).)*?",P_e=o((r,e={})=>t=>(0,D.minimatch)(t,r,e),"filter");D.filter=P_e;D.minimatch.filter=D.filter;var pr=o((r,e={})=>Object.assign({},r,e),"ext"),N_e=o(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return D.minimatch;let e=D.minimatch;return Object.assign(o((i,s,n={})=>e(i,s,pr(r,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,pr(r,n))}static defaults(s){return e.defaults(pr(r,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,pr(r,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,pr(r,n))}},unescape:o((i,s={})=>e.unescape(i,pr(r,s)),"unescape"),escape:o((i,s={})=>e.escape(i,pr(r,s)),"escape"),filter:o((i,s={})=>e.filter(i,pr(r,s)),"filter"),defaults:o(i=>e.defaults(pr(r,i)),"defaults"),makeRe:o((i,s={})=>e.makeRe(i,pr(r,s)),"makeRe"),braceExpand:o((i,s={})=>e.braceExpand(i,pr(r,s)),"braceExpand"),match:o((i,s,n={})=>e.match(i,s,pr(r,n)),"match"),sep:e.sep,GLOBSTAR:D.GLOBSTAR})},"defaults");D.defaults=N_e;D.minimatch.defaults=D.defaults;var x_e=o((r,e={})=>((0,Yy.assertValidPattern)(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,n_e.default)(r)),"braceExpand");D.braceExpand=x_e;D.minimatch.braceExpand=D.braceExpand;var D_e=o((r,e={})=>new _o(r,e).makeRe(),"makeRe");D.makeRe=D_e;D.minimatch.makeRe=D.makeRe;var L_e=o((r,e,t={})=>{let i=new _o(e,t);return r=r.filter(s=>i.match(s)),i.options.nonull&&!r.length&&r.push(e),r},"match");D.match=L_e;D.minimatch.match=D.match;var $H=/[?*]|[+@!]\(.*?\)|\[|\]/,M_e=o(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),_o=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,Yy.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||GH,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 i=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=n[0]===""&&n[1]===""&&(n[2]==="?"||!$H.test(n[2]))&&!$H.test(n[3]),u=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(u)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(l=>this.parse(l))});if(this.debug(this.pattern,s),this.set=s.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 i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");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 i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let s=i;for(;t[s+1]==="**";)s++;s!==i&&t.splice(i,s-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,s)=>{let n=i[i.length-1];return s==="**"&&n==="**"?i:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(i.pop(),i):(i.push(s),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let a=s;for(;i[a+1]==="**";)a++;a>s&&i.splice(s+1,a-s);let c=i[s+1],l=i[s+2],u=i[s+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,i.splice(s,1);let h=i.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let c=i[a];a===1&&c===""&&i[0]===""||(c==="."||c==="")&&(t=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let n=0;for(;(n=i.indexOf("..",n+1))!==-1;){let a=i[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let l=n===1&&i[n+1]==="**"?["."]:[];i.splice(n-1,2,...l),i.length===0&&i.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let s=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(s){e[t]=[],e[i]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let s=0,n=0,a=[],c="";for(;s<e.length&&n<t.length;)if(e[s]===t[n])a.push(c==="b"?t[n]:e[s]),s++,n++;else if(i&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(i&&t[n]==="**"&&e[s]===t[n+1])a.push(t[n]),n++;else if(e[s]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[s]),s++,n++}else if(t[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),s++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let s=this.options;if(this.isWindows){let y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!S&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),_=w?3:y?0:void 0,E=v?3:S?0:void 0;if(typeof _=="number"&&typeof E=="number"){let[b,O]=[e[_],t[E]];b.toLowerCase()===O.toLowerCase()&&(t[E]=b,E>_?t=t.slice(E):_>E&&(e=e.slice(_)))}}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,l=e.length,u=t.length;a<l&&c<u;a++,c++){this.debug("matchOne loop");var h=t[c],f=e[a];if(this.debug(t,h,f),h===!1)return!1;if(h===D.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var d=a,p=c+1;if(p===u){for(this.debug("** at the end");a<l;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<l;){var m=e[d];if(this.debug(`
64
+ globstar while`,e,d,t,p,m),this.matchOne(e.slice(d),t.slice(p),i))return this.debug("globstar found match!",d,l,m),!0;if(m==="."||m===".."||!s.dot&&m.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(i&&(this.debug(`
65
+ >>> no match, partial?`,e,d,t,p),d===l))}let y;if(typeof h=="string"?(y=f===h,this.debug("string match",h,f,y)):(y=h.test(f),this.debug("pattern match",h,f,y)),!y)return!1}if(a===l&&c===u)return!0;if(a===l)return i;if(c===u)return a===l-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,D.braceExpand)(this.pattern,this.options)}parse(e){(0,Yy.assertValidPattern)(e);let t=this.options;if(e==="**")return D.GLOBSTAR;if(e==="")return"";let i,s=null;(i=e.match(w_e))?s=t.dot?E_e:v_e:(i=e.match(l_e))?s=(t.nocase?t.dot?d_e:f_e:t.dot?h_e:u_e)(i[1]):(i=e.match(__e))?s=(t.nocase?t.dot?O_e:b_e:t.dot?I_e:T_e)(i):(i=e.match(p_e))?s=t.dot?m_e:g_e:(i=e.match(y_e))&&(s=S_e);let n=UH.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),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,i=t.noglobstar?A_e:t.dot?C_e:k_e,s=new Set(t.nocase?["i"]:[]),n=e.map(l=>{let u=l.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?M_e(h):h===D.GLOBSTAR?D.GLOBSTAR:h._src});return u.forEach((h,f)=>{let d=u[f+1],p=u[f-1];h!==D.GLOBSTAR||p===D.GLOBSTAR||(p===void 0?d!==void 0&&d!==D.GLOBSTAR?u[f+1]="(?:\\/|"+i+"\\/)?"+d:u[f]=i:d===void 0?u[f-1]=p+"(?:\\/|"+i+")?":d!==D.GLOBSTAR&&(u[f-1]=p+"(?:\\/|\\/"+i+"\\/)"+d,u[f+1]=D.GLOBSTAR))}),u.filter(h=>h!==D.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].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 i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<n.length;c++){let l=n[c],u=s;if(i.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return D.minimatch.defaults(e).Minimatch}};D.Minimatch=_o;var F_e=GT();Object.defineProperty(D,"AST",{enumerable:!0,get:o(function(){return F_e.AST},"get")});var B_e=HT();Object.defineProperty(D,"escape",{enumerable:!0,get:o(function(){return B_e.escape},"get")});var q_e=Gy();Object.defineProperty(D,"unescape",{enumerable:!0,get:o(function(){return q_e.unescape},"get")});D.minimatch.AST=UH.AST;D.minimatch.Minimatch=_o;D.minimatch.escape=o_e.escape;D.minimatch.unescape=a_e.unescape});var KT=g(gr=>{"use strict";var WH=gr&&gr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gr,"__esModule",{value:!0});gr.SuccinctRoles=gr.DelegatedRole=gr.Role=gr.TOP_LEVEL_ROLE_NAMES=void 0;var JH=WH(require("crypto")),j_e=HH(),Zy=WH(require("util")),Xy=_i(),bo=qr();gr.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var Mh=class r{static{o(this,"Role")}keyIDs;threshold;unrecognizedFields;constructor(e){let{keyIDs:t,threshold:i,unrecognizedFields:s}=e;if($_e(t))throw new Xy.ValueError("duplicate key IDs found");if(i<1)throw new Xy.ValueError("threshold must be at least 1");this.keyIDs=t,this.threshold=i,this.unrecognizedFields=s||{}}equals(e){return e instanceof r?this.threshold===e.threshold&&Zy.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&Zy.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:t,threshold:i,...s}=e;if(!bo.guard.isStringArray(t))throw new TypeError("keyids must be an array");if(typeof i!="number")throw new TypeError("threshold must be a number");return new r({keyIDs:t,threshold:i,unrecognizedFields:s})}};gr.Role=Mh;function $_e(r){return new Set(r).size!==r.length}o($_e,"hasDuplicates");var WT=class r extends Mh{static{o(this,"DelegatedRole")}name;terminating;paths;pathHashPrefixes;constructor(e){super(e);let{name:t,terminating:i,paths:s,pathHashPrefixes:n}=e;if(this.name=t,this.terminating=i,e.paths&&e.pathHashPrefixes)throw new Xy.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=s,this.pathHashPrefixes=n}equals(e){return e instanceof r?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&Zy.default.isDeepStrictEqual(this.paths,e.paths)&&Zy.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(t=>V_e(e,t));if(this.pathHashPrefixes){let i=JH.default.createHash("sha256").update(e).digest("hex");return this.pathHashPrefixes.some(s=>i.startsWith(s))}return!1}toJSON(){let e={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(e.paths=this.paths),this.pathHashPrefixes&&(e.path_hash_prefixes=this.pathHashPrefixes),e}static fromJSON(e){let{keyids:t,threshold:i,name:s,terminating:n,paths:a,path_hash_prefixes:c,...l}=e;if(!bo.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof i!="number")throw new TypeError("threshold must be a number");if(typeof s!="string")throw new TypeError("name must be a string");if(typeof n!="boolean")throw new TypeError("terminating must be a boolean");if(bo.guard.isDefined(a)&&!bo.guard.isStringArray(a))throw new TypeError("paths must be an array of strings");if(bo.guard.isDefined(c)&&!bo.guard.isStringArray(c))throw new TypeError("path_hash_prefixes must be an array of strings");return new r({keyIDs:t,threshold:i,name:s,terminating:n,paths:a,pathHashPrefixes:c,unrecognizedFields:l})}};gr.DelegatedRole=WT;var U_e=o((r,e)=>r.map((t,i)=>[t,e[i]]),"zip");function V_e(r,e){let t=r.split("/"),i=e.split("/");return i.length!=t.length?!1:U_e(t,i).every(([s,n])=>(0,j_e.minimatch)(s,n))}o(V_e,"isTargetInPathPattern");var JT=class r extends Mh{static{o(this,"SuccinctRoles")}bitLength;namePrefix;numberOfBins;suffixLen;constructor(e){super(e);let{bitLength:t,namePrefix:i}=e;if(t<=0||t>32)throw new Xy.ValueError("bitLength must be between 1 and 32");this.bitLength=t,this.namePrefix=i,this.numberOfBins=Math.pow(2,t),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof r?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let s=JH.default.createHash("sha256").update(e).digest().subarray(0,4),n=32-this.bitLength,c=(s.readUInt32BE()>>>n).toString(16).padStart(this.suffixLen,"0");return`${this.namePrefix}-${c}`}*getRoles(){for(let e=0;e<this.numberOfBins;e++){let t=e.toString(16).padStart(this.suffixLen,"0");yield`${this.namePrefix}-${t}`}}isDelegatedRole(e){let t=this.namePrefix+"-";if(!e.startsWith(t))return!1;let i=e.slice(t.length,e.length);if(i.length!=this.suffixLen||!i.match(/^[0-9a-fA-F]+$/))return!1;let s=parseInt(i,16);return 0<=s&&s<this.numberOfBins}toJSON(){return{...super.toJSON(),bit_length:this.bitLength,name_prefix:this.namePrefix}}static fromJSON(e){let{keyids:t,threshold:i,bit_length:s,name_prefix:n,...a}=e;if(!bo.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof i!="number")throw new TypeError("threshold must be a number");if(typeof s!="number")throw new TypeError("bit_length must be a number");if(typeof n!="string")throw new TypeError("name_prefix must be a string");return new r({keyIDs:t,threshold:i,bitLength:s,namePrefix:n,unrecognizedFields:a})}};gr.SuccinctRoles=JT});var XT=g(Nc=>{"use strict";var z_e=Nc&&Nc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.Root=void 0;var KH=z_e(require("util")),YT=Eo(),YH=_i(),G_e=$y(),Qy=KT(),eS=qr(),ZT=class r extends YT.Signed{static{o(this,"Root")}type=YT.MetadataKind.Root;keys;roles;consistentSnapshot;constructor(e){if(super(e),this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=Qy.TOP_LEVEL_ROLE_NAMES.reduce((t,i)=>({...t,[i]:new Qy.Role({keyIDs:[],threshold:1})}),{});else{let t=new Set(Object.keys(e.roles));if(!Qy.TOP_LEVEL_ROLE_NAMES.every(i=>t.has(i)))throw new YH.ValueError("missing top-level role");this.roles=e.roles}}addKey(e,t){if(!this.roles[t])throw new YH.ValueError(`role ${t} does not exist`);this.roles[t].keyIDs.includes(e.keyID)||this.roles[t].keyIDs.push(e.keyID),this.keys[e.keyID]=e}equals(e){return e instanceof r?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&KH.default.isDeepStrictEqual(this.keys,e.keys)&&KH.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:H_e(this.keys),roles:W_e(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...i}=YT.Signed.commonFieldsFromJSON(e),{keys:s,roles:n,consistent_snapshot:a,...c}=t;if(typeof a!="boolean")throw new TypeError("consistent_snapshot must be a boolean");return new r({...i,keys:J_e(s),roles:K_e(n),consistentSnapshot:a,unrecognizedFields:c})}};Nc.Root=ZT;function H_e(r){return Object.entries(r).reduce((e,[t,i])=>({...e,[t]:i.toJSON()}),{})}o(H_e,"keysToJSON");function W_e(r){return Object.entries(r).reduce((e,[t,i])=>({...e,[t]:i.toJSON()}),{})}o(W_e,"rolesToJSON");function J_e(r){let e;if(eS.guard.isDefined(r)){if(!eS.guard.isObjectRecord(r))throw new TypeError("keys must be an object");e=Object.entries(r).reduce((t,[i,s])=>({...t,[i]:G_e.Key.fromJSON(i,s)}),{})}return e}o(J_e,"keysFromJSON");function K_e(r){let e;if(eS.guard.isDefined(r)){if(!eS.guard.isObjectRecord(r))throw new TypeError("roles must be an object");e=Object.entries(r).reduce((t,[i,s])=>({...t,[i]:Qy.Role.fromJSON(s)}),{})}return e}o(K_e,"rolesFromJSON")});var eR=g(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});tS.Signature=void 0;var QT=class r{static{o(this,"Signature")}keyID;sig;constructor(e){let{keyID:t,sig:i}=e;this.keyID=t,this.sig=i}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:t,sig:i}=e;if(typeof t!="string")throw new TypeError("keyid must be a string");if(typeof i!="string")throw new TypeError("sig must be a string");return new r({keyID:t,sig:i})}};tS.Signature=QT});var iR=g(xc=>{"use strict";var Y_e=xc&&xc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xc,"__esModule",{value:!0});xc.Snapshot=void 0;var Z_e=Y_e(require("util")),tR=Eo(),XH=kh(),ZH=qr(),rR=class r extends tR.Signed{static{o(this,"Snapshot")}type=tR.MetadataKind.Snapshot;meta;constructor(e){super(e),this.meta=e.meta||{"targets.json":new XH.MetaFile({version:1})}}equals(e){return e instanceof r?super.equals(e)&&Z_e.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:X_e(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...i}=tR.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new r({...i,meta:Q_e(s),unrecognizedFields:n})}};xc.Snapshot=rR;function X_e(r){return Object.entries(r).reduce((e,[t,i])=>({...e,[t]:i.toJSON()}),{})}o(X_e,"metaToJSON");function Q_e(r){let e;if(ZH.guard.isDefined(r))if(ZH.guard.isObjectRecord(r))e=Object.entries(r).reduce((t,[i,s])=>({...t,[i]:XH.MetaFile.fromJSON(s)}),{});else throw new TypeError("meta field is malformed");return e}o(Q_e,"metaFromJSON")});var QH=g(Dc=>{"use strict";var ebe=Dc&&Dc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.Delegations=void 0;var rS=ebe(require("util")),tbe=_i(),rbe=$y(),sR=KT(),iS=qr(),nR=class r{static{o(this,"Delegations")}keys;roles;unrecognizedFields;succinctRoles;constructor(e){if(this.keys=e.keys,this.unrecognizedFields=e.unrecognizedFields||{},e.roles&&Object.keys(e.roles).some(t=>sR.TOP_LEVEL_ROLE_NAMES.includes(t)))throw new tbe.ValueError("Delegated role name conflicts with top-level role name");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof r?rS.default.isDeepStrictEqual(this.keys,e.keys)&&rS.default.isDeepStrictEqual(this.roles,e.roles)&&rS.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&rS.default.isDeepStrictEqual(this.succinctRoles,e.succinctRoles):!1}*rolesForTarget(e){if(this.roles)for(let t of Object.values(this.roles))t.isDelegatedPath(e)&&(yield{role:t.name,terminating:t.terminating});else this.succinctRoles&&(yield{role:this.succinctRoles.getRoleForTarget(e),terminating:!0})}toJSON(){let e={keys:ibe(this.keys),...this.unrecognizedFields};return this.roles?e.roles=sbe(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:t,roles:i,succinct_roles:s,...n}=e,a;return iS.guard.isObject(s)&&(a=sR.SuccinctRoles.fromJSON(s)),new r({keys:nbe(t),roles:obe(i),unrecognizedFields:n,succinctRoles:a})}};Dc.Delegations=nR;function ibe(r){return Object.entries(r).reduce((e,[t,i])=>({...e,[t]:i.toJSON()}),{})}o(ibe,"keysToJSON");function sbe(r){return Object.values(r).map(e=>e.toJSON())}o(sbe,"rolesToJSON");function nbe(r){if(!iS.guard.isObjectRecord(r))throw new TypeError("keys is malformed");return Object.entries(r).reduce((e,[t,i])=>({...e,[t]:rbe.Key.fromJSON(t,i)}),{})}o(nbe,"keysFromJSON");function obe(r){let e;if(iS.guard.isDefined(r)){if(!iS.guard.isObjectArray(r))throw new TypeError("roles is malformed");e=r.reduce((t,i)=>{let s=sR.DelegatedRole.fromJSON(i);return{...t,[s.name]:s}},{})}return e}o(obe,"rolesFromJSON")});var cR=g(Lc=>{"use strict";var abe=Lc&&Lc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Targets=void 0;var eW=abe(require("util")),oR=Eo(),cbe=QH(),lbe=kh(),sS=qr(),aR=class r extends oR.Signed{static{o(this,"Targets")}type=oR.MetadataKind.Targets;targets;delegations;constructor(e){super(e),this.targets=e.targets||{},this.delegations=e.delegations}addTarget(e){this.targets[e.path]=e}equals(e){return e instanceof r?super.equals(e)&&eW.default.isDeepStrictEqual(this.targets,e.targets)&&eW.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:ube(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:t,...i}=oR.Signed.commonFieldsFromJSON(e),{targets:s,delegations:n,...a}=t;return new r({...i,targets:hbe(s),delegations:fbe(n),unrecognizedFields:a})}};Lc.Targets=aR;function ube(r){return Object.entries(r).reduce((e,[t,i])=>({...e,[t]:i.toJSON()}),{})}o(ube,"targetsToJSON");function hbe(r){let e;if(sS.guard.isDefined(r))if(sS.guard.isObjectRecord(r))e=Object.entries(r).reduce((t,[i,s])=>({...t,[i]:lbe.TargetFile.fromJSON(i,s)}),{});else throw new TypeError("targets must be an object");return e}o(hbe,"targetsFromJSON");function fbe(r){let e;if(sS.guard.isDefined(r))if(sS.guard.isObject(r))e=cbe.Delegations.fromJSON(r);else throw new TypeError("delegations must be an object");return e}o(fbe,"delegationsFromJSON")});var fR=g(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});nS.Timestamp=void 0;var lR=Eo(),tW=kh(),uR=qr(),hR=class r extends lR.Signed{static{o(this,"Timestamp")}type=lR.MetadataKind.Timestamp;snapshotMeta;constructor(e){super(e),this.snapshotMeta=e.snapshotMeta||new tW.MetaFile({version:1})}equals(e){return e instanceof r?super.equals(e)&&this.snapshotMeta.equals(e.snapshotMeta):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,meta:{"snapshot.json":this.snapshotMeta.toJSON()},...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...i}=lR.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new r({...i,snapshotMeta:dbe(s),unrecognizedFields:n})}};nS.Timestamp=hR;function dbe(r){let e;if(uR.guard.isDefined(r)){let t=r["snapshot.json"];if(!uR.guard.isDefined(t)||!uR.guard.isObject(t))throw new TypeError("missing snapshot.json in meta");e=tW.MetaFile.fromJSON(t)}return e}o(dbe,"snapshotMetaFromJSON")});var iW=g(Fc=>{"use strict";var pbe=Fc&&Fc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Metadata=void 0;var gbe=PT(),rW=pbe(require("util")),Mc=Eo(),Fh=_i(),mbe=XT(),ybe=eR(),Sbe=iR(),wbe=cR(),vbe=fR(),dR=qr(),pR=class r{static{o(this,"Metadata")}signed;signatures;unrecognizedFields;constructor(e,t,i){this.signed=e,this.signatures=t||{},this.unrecognizedFields=i||{}}sign(e,t=!0){let i=Buffer.from((0,gbe.canonicalize)(this.signed.toJSON())),s=e(i);t||(this.signatures={}),this.signatures[s.keyID]=s}verifyDelegate(e,t){let i,s={};switch(this.signed.type){case Mc.MetadataKind.Root:s=this.signed.keys,i=this.signed.roles[e];break;case Mc.MetadataKind.Targets:if(!this.signed.delegations)throw new Fh.ValueError(`No delegations found for ${e}`);s=this.signed.delegations.keys,this.signed.delegations.roles?i=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(i=this.signed.delegations.succinctRoles);break;default:throw new TypeError("invalid metadata type")}if(!i)throw new Fh.ValueError(`no delegation found for ${e}`);let n=new Set;if(i.keyIDs.forEach(a=>{let c=s[a];if(c)try{c.verifySignature(t),n.add(c.keyID)}catch{}}),n.size<i.threshold)throw new Fh.UnsignedMetadataError(`${e} was signed by ${n.size}/${i.threshold} keys`)}equals(e){return e instanceof r?this.signed.equals(e.signed)&&rW.default.isDeepStrictEqual(this.signatures,e.signatures)&&rW.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{signatures:Object.values(this.signatures).map(t=>t.toJSON()),signed:this.signed.toJSON(),...this.unrecognizedFields}}static fromJSON(e,t){let{signed:i,signatures:s,...n}=t;if(!dR.guard.isDefined(i)||!dR.guard.isObject(i))throw new TypeError("signed is not defined");if(e!==i._type)throw new Fh.ValueError(`expected '${e}', got ${i._type}`);if(!dR.guard.isObjectArray(s))throw new TypeError("signatures is not an array");let a;switch(e){case Mc.MetadataKind.Root:a=mbe.Root.fromJSON(i);break;case Mc.MetadataKind.Timestamp:a=vbe.Timestamp.fromJSON(i);break;case Mc.MetadataKind.Snapshot:a=Sbe.Snapshot.fromJSON(i);break;case Mc.MetadataKind.Targets:a=wbe.Targets.fromJSON(i);break;default:throw new TypeError("invalid metadata type")}let c={};return s.forEach(l=>{let u=ybe.Signature.fromJSON(l);if(c[u.keyID])throw new Fh.ValueError(`multiple signatures found for keyid: ${u.keyID}`);c[u.keyID]=u}),new r(a,c,n)}};Fc.Metadata=pR});var oS=g(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.Timestamp=we.Targets=we.Snapshot=we.Signature=we.Root=we.Metadata=we.Key=we.TargetFile=we.MetaFile=we.ValueError=we.MetadataKind=void 0;var Ebe=Eo();Object.defineProperty(we,"MetadataKind",{enumerable:!0,get:o(function(){return Ebe.MetadataKind},"get")});var _be=_i();Object.defineProperty(we,"ValueError",{enumerable:!0,get:o(function(){return _be.ValueError},"get")});var sW=kh();Object.defineProperty(we,"MetaFile",{enumerable:!0,get:o(function(){return sW.MetaFile},"get")});Object.defineProperty(we,"TargetFile",{enumerable:!0,get:o(function(){return sW.TargetFile},"get")});var bbe=$y();Object.defineProperty(we,"Key",{enumerable:!0,get:o(function(){return bbe.Key},"get")});var Obe=iW();Object.defineProperty(we,"Metadata",{enumerable:!0,get:o(function(){return Obe.Metadata},"get")});var Ibe=XT();Object.defineProperty(we,"Root",{enumerable:!0,get:o(function(){return Ibe.Root},"get")});var Tbe=eR();Object.defineProperty(we,"Signature",{enumerable:!0,get:o(function(){return Tbe.Signature},"get")});var Rbe=iR();Object.defineProperty(we,"Snapshot",{enumerable:!0,get:o(function(){return Rbe.Snapshot},"get")});var Abe=cR();Object.defineProperty(we,"Targets",{enumerable:!0,get:o(function(){return Abe.Targets},"get")});var Cbe=fR();Object.defineProperty(we,"Timestamp",{enumerable:!0,get:o(function(){return Cbe.Timestamp},"get")})});var cS=g(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.DownloadHTTPError=Ae.DownloadLengthMismatchError=Ae.DownloadError=Ae.ExpiredMetadataError=Ae.EqualVersionError=Ae.BadVersionError=Ae.RepositoryError=Ae.PersistError=Ae.RuntimeError=Ae.ValueError=void 0;var gR=class extends Error{static{o(this,"ValueError")}};Ae.ValueError=gR;var mR=class extends Error{static{o(this,"RuntimeError")}};Ae.RuntimeError=mR;var yR=class extends Error{static{o(this,"PersistError")}};Ae.PersistError=yR;var Bh=class extends Error{static{o(this,"RepositoryError")}};Ae.RepositoryError=Bh;var aS=class extends Bh{static{o(this,"BadVersionError")}};Ae.BadVersionError=aS;var SR=class extends aS{static{o(this,"EqualVersionError")}};Ae.EqualVersionError=SR;var wR=class extends Bh{static{o(this,"ExpiredMetadataError")}};Ae.ExpiredMetadataError=wR;var qh=class extends Error{static{o(this,"DownloadError")}};Ae.DownloadError=qh;var vR=class extends qh{static{o(this,"DownloadLengthMismatchError")}};Ae.DownloadLengthMismatchError=vR;var ER=class extends qh{static{o(this,"DownloadHTTPError")}statusCode;constructor(e,t){super(e),this.statusCode=t}};Ae.DownloadHTTPError=ER});var oW=g(Bc=>{"use strict";var bR=Bc&&Bc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bc,"__esModule",{value:!0});Bc.withTempFile=void 0;var _R=bR(require("fs/promises")),kbe=bR(require("os")),nW=bR(require("path")),Pbe=o(async r=>Nbe(async e=>r(nW.default.join(e,"tempfile"))),"withTempFile");Bc.withTempFile=Pbe;var Nbe=o(async r=>{let e=await _R.default.realpath(kbe.default.tmpdir()),t=await _R.default.mkdtemp(e+nW.default.sep);try{return await r(t)}finally{await _R.default.rm(t,{force:!0,recursive:!0,maxRetries:3})}},"withTempDir")});var IR=g(an=>{"use strict";var uS=an&&an.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(an,"__esModule",{value:!0});an.DefaultFetcher=an.BaseFetcher=void 0;var xbe=uS(io()),aW=uS(require("fs")),Dbe=uS(ph()),Lbe=uS(require("util")),cW=cS(),Mbe=oW(),Fbe=(0,xbe.default)("tuf:fetch"),lS=class{static{o(this,"BaseFetcher")}async downloadFile(e,t,i){return(0,Mbe.withTempFile)(async s=>{let n=await this.fetch(e),a=0,c=aW.default.createWriteStream(s);try{for await(let l of n){if(a+=l.length,a>t)throw new cW.DownloadLengthMismatchError("Max length reached");await Bbe(c,l)}}finally{await Lbe.default.promisify(c.close).bind(c)()}return i(s)})}async downloadBytes(e,t){return this.downloadFile(e,t,async i=>{let s=aW.default.createReadStream(i),n=[];for await(let a of s)n.push(a);return Buffer.concat(n)})}};an.BaseFetcher=lS;var OR=class extends lS{static{o(this,"DefaultFetcher")}timeout;retry;constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){Fbe("GET %s",e);let t=await(0,Dbe.default)(e,{timeout:this.timeout,retry:this.retry});if(!t.ok||!t?.body)throw new cW.DownloadHTTPError("Failed to download",t.status);return t.body}};an.DefaultFetcher=OR;var Bbe=o(async(r,e)=>new Promise((t,i)=>{r.write(e,s=>{s&&i(s),t(!0)})}),"writeBufferToStream")});var lW=g(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});hS.defaultConfig=void 0;hS.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var uW=g(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.TrustedMetadataStore=void 0;var qe=oS(),Oe=cS(),TR=class{static{o(this,"TrustedMetadataStore")}trustedSet={};referenceTime;constructor(e){this.referenceTime=new Date,this.loadTrustedRoot(e)}get root(){if(!this.trustedSet.root)throw new ReferenceError("No trusted root metadata");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(e){return this.trustedSet[e]}updateRoot(e){let t=JSON.parse(e.toString("utf8")),i=qe.Metadata.fromJSON(qe.MetadataKind.Root,t);if(i.signed.type!=qe.MetadataKind.Root)throw new Oe.RepositoryError(`Expected 'root', got ${i.signed.type}`);if(this.root.verifyDelegate(qe.MetadataKind.Root,i),i.signed.version!=this.root.signed.version+1)throw new Oe.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${i.signed.version}`);return i.verifyDelegate(qe.MetadataKind.Root,i),this.trustedSet.root=i,i}updateTimestamp(e){if(this.snapshot)throw new Oe.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new Oe.ExpiredMetadataError("Final root.json is expired");let t=JSON.parse(e.toString("utf8")),i=qe.Metadata.fromJSON(qe.MetadataKind.Timestamp,t);if(i.signed.type!=qe.MetadataKind.Timestamp)throw new Oe.RepositoryError(`Expected 'timestamp', got ${i.signed.type}`);if(this.root.verifyDelegate(qe.MetadataKind.Timestamp,i),this.timestamp){if(i.signed.version<this.timestamp.signed.version)throw new Oe.BadVersionError(`New timestamp version ${i.signed.version} is less than current version ${this.timestamp.signed.version}`);if(i.signed.version===this.timestamp.signed.version)throw new Oe.EqualVersionError(`New timestamp version ${i.signed.version} is equal to current version ${this.timestamp.signed.version}`);let s=this.timestamp.signed.snapshotMeta,n=i.signed.snapshotMeta;if(n.version<s.version)throw new Oe.BadVersionError(`New snapshot version ${n.version} is less than current version ${s.version}`)}return this.trustedSet.timestamp=i,this.checkFinalTimestamp(),i}updateSnapshot(e,t=!1){if(!this.timestamp)throw new Oe.RuntimeError("Cannot update snapshot before timestamp");if(this.targets)throw new Oe.RuntimeError("Cannot update snapshot after targets");this.checkFinalTimestamp();let i=this.timestamp.signed.snapshotMeta;t||i.verify(e);let s=JSON.parse(e.toString("utf8")),n=qe.Metadata.fromJSON(qe.MetadataKind.Snapshot,s);if(n.signed.type!=qe.MetadataKind.Snapshot)throw new Oe.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(qe.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([a,c])=>{let l=n.signed.meta[a];if(!l)throw new Oe.RepositoryError(`Missing file ${a} in new snapshot`);if(l.version<c.version)throw new Oe.BadVersionError(`New version ${l.version} of ${a} is less than current version ${c.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,t,i){if(!this.snapshot)throw new Oe.RuntimeError("Cannot update delegated targets before snapshot");this.checkFinalSnapsnot();let s=this.trustedSet[i];if(!s)throw new Oe.RuntimeError(`No trusted ${i} metadata`);let n=this.snapshot.signed.meta?.[`${t}.json`];if(!n)throw new Oe.RepositoryError(`Missing ${t}.json in snapshot`);n.verify(e);let a=JSON.parse(e.toString("utf8")),c=qe.Metadata.fromJSON(qe.MetadataKind.Targets,a);if(c.signed.type!=qe.MetadataKind.Targets)throw new Oe.RepositoryError(`Expected 'targets', got ${c.signed.type}`);s.verifyDelegate(t,c);let l=c.signed.version;if(l!=n.version)throw new Oe.BadVersionError(`Version ${l} of ${t} does not match snapshot version ${n.version}`);if(c.signed.isExpired(this.referenceTime))throw new Oe.ExpiredMetadataError(`${t}.json is expired`);this.trustedSet[t]=c}loadTrustedRoot(e){let t=JSON.parse(e.toString("utf8")),i=qe.Metadata.fromJSON(qe.MetadataKind.Root,t);if(i.signed.type!=qe.MetadataKind.Root)throw new Oe.RepositoryError(`Expected 'root', got ${i.signed.type}`);i.verifyDelegate(qe.MetadataKind.Root,i),this.trustedSet.root=i}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.timestamp.signed.isExpired(this.referenceTime))throw new Oe.ExpiredMetadataError("Final timestamp.json is expired")}checkFinalSnapsnot(){if(!this.snapshot)throw new ReferenceError("No trusted snapshot metadata");if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.snapshot.signed.isExpired(this.referenceTime))throw new Oe.ExpiredMetadataError("snapshot.json is expired");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new Oe.BadVersionError("Snapshot version doesn't match timestamp")}};fS.TrustedMetadataStore=TR});var hW=g(RR=>{"use strict";Object.defineProperty(RR,"__esModule",{value:!0});RR.join=jbe;var qbe=require("url");function jbe(r,e){return new qbe.URL($be(r)+Ube(e)).toString()}o(jbe,"join");function $be(r){return r.endsWith("/")?r:r+"/"}o($be,"ensureTrailingSlash");function Ube(r){return r.startsWith("/")?r.slice(1):r}o(Ube,"removeLeadingSlash")});var fW=g(mr=>{"use strict";var Vbe=mr&&mr.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),zbe=mr&&mr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),kR=mr&&mr.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&Vbe(t,e,i[s]);return zbe(t,e),t}})(),Gbe=mr&&mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(mr,"__esModule",{value:!0});mr.Updater=void 0;var bi=oS(),Hbe=Gbe(io()),qc=kR(require("fs")),dS=kR(require("path")),Wbe=lW(),Oo=cS(),Jbe=IR(),Kbe=uW(),jh=kR(hW()),AR=(0,Hbe.default)("tuf:cache"),CR=class{static{o(this,"Updater")}dir;metadataBaseUrl;targetDir;targetBaseUrl;forceCache;trustedSet;config;fetcher;constructor(e){let{metadataDir:t,metadataBaseUrl:i,targetDir:s,targetBaseUrl:n,fetcher:a,config:c}=e;this.dir=t,this.metadataBaseUrl=i,this.targetDir=s,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let l=this.loadLocalMetadata(bi.MetadataKind.Root);this.trustedSet=new Kbe.TrustedMetadataStore(l),this.config={...Wbe.defaultConfig,...c},this.fetcher=a||new Jbe.DefaultFetcher({timeout:this.config.fetchTimeout,retry:this.config.fetchRetries??this.config.fetchRetry})}async refresh(){if(this.forceCache)try{await this.loadTimestamp({checkRemote:!1})}catch{await this.loadRoot(),await this.loadTimestamp()}else await this.loadRoot(),await this.loadTimestamp();await this.loadSnapshot(),await this.loadTargets(bi.MetadataKind.Targets,bi.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,t,i){let s=t||this.generateTargetPath(e);if(!i){if(!this.targetBaseUrl)throw new Oo.ValueError("Target base URL not set");i=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let l=Object.values(e.hashes),{dir:u,base:h}=dS.parse(n),f=`${l[0]}.${h}`;n=u?`${u}/${f}`:f}let c=jh.join(i,n);return await this.fetcher.downloadFile(c,e.length,async l=>{await e.verify(qc.createReadStream(l)),AR("WRITE %s",s),qc.copyFileSync(l,s)}),s}async findCachedTarget(e,t){t||(t=this.generateTargetPath(e));try{if(qc.existsSync(t))return await e.verify(qc.createReadStream(t)),t}catch{return}}loadLocalMetadata(e){let t=dS.join(this.dir,`${e}.json`);return AR("READ %s",t),qc.readFileSync(t)}async loadRoot(){let t=this.trustedSet.root.signed.version+1,i=t+this.config.maxRootRotations;for(let s=t;s<i;s++){let n=jh.join(this.metadataBaseUrl,`${s}.root.json`);try{let a=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(a),this.persistMetadata(bi.MetadataKind.Root,a)}catch(a){if(a instanceof Oo.DownloadHTTPError&&[403,404].includes(a.statusCode))break;throw a}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let s=this.loadLocalMetadata(bi.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(s),!e)return}catch{}let t=jh.join(this.metadataBaseUrl,"timestamp.json"),i=await this.fetcher.downloadBytes(t,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(i)}catch(s){if(s instanceof Oo.EqualVersionError)return;throw s}this.persistMetadata(bi.MetadataKind.Timestamp,i)}async loadSnapshot(){try{let e=this.loadLocalMetadata(bi.MetadataKind.Snapshot);this.trustedSet.updateSnapshot(e,!0)}catch{if(!this.trustedSet.timestamp)throw new ReferenceError("No timestamp metadata");let t=this.trustedSet.timestamp.signed.snapshotMeta,i=t.length||this.config.snapshotMaxLength,s=this.trustedSet.root.signed.consistentSnapshot?t.version:void 0,n=jh.join(this.metadataBaseUrl,s?`${s}.snapshot.json`:"snapshot.json");try{let a=await this.fetcher.downloadBytes(n,i);this.trustedSet.updateSnapshot(a),this.persistMetadata(bi.MetadataKind.Snapshot,a)}catch(a){throw new Oo.RuntimeError(`Unable to load snapshot metadata error ${a}`)}}}async loadTargets(e,t){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let i=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(i,e,t)}catch{if(!this.trustedSet.snapshot)throw new ReferenceError("No snapshot metadata");let s=this.trustedSet.snapshot.signed.meta[`${e}.json`],n=s.length||this.config.targetsMaxLength,a=this.trustedSet.root.signed.consistentSnapshot?s.version:void 0,c=encodeURIComponent(e),l=jh.join(this.metadataBaseUrl,a?`${a}.${c}.json`:`${c}.json`);try{let u=await this.fetcher.downloadBytes(l,n);this.trustedSet.updateDelegatedTargets(u,e,t),this.persistMetadata(e,u)}catch(u){throw new Oo.RuntimeError(`Unable to load targets error ${u}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let t=[{roleName:bi.MetadataKind.Targets,parentRoleName:bi.MetadataKind.Root}],i=new Set;for(;i.size<=this.config.maxDelegations&&t.length>0;){let{roleName:s,parentRoleName:n}=t.pop();if(i.has(s))continue;let a=(await this.loadTargets(s,n))?.signed;if(!a)continue;let c=a.targets?.[e];if(c)return c;if(i.add(s),a.delegations){let l=[],u=a.delegations.rolesForTarget(e);for(let{role:h,terminating:f}of u)if(l.push({roleName:h,parentRoleName:s}),f){t.splice(0);break}l.reverse(),t.push(...l)}}}generateTargetPath(e){if(!this.targetDir)throw new Oo.ValueError("Target directory not set");let t=encodeURIComponent(e.path);return dS.join(this.targetDir,t)}persistMetadata(e,t){let i=encodeURIComponent(e);try{let s=dS.join(this.dir,`${i}.json`);AR("WRITE %s",s),qc.writeFileSync(s,t.toString("utf8"))}catch(s){throw new Oo.PersistError(`Failed to persist metadata ${i} error: ${s}`)}}};mr.Updater=CR});var dW=g(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.Updater=cn.BaseFetcher=cn.TargetFile=void 0;var Ybe=oS();Object.defineProperty(cn,"TargetFile",{enumerable:!0,get:o(function(){return Ybe.TargetFile},"get")});var Zbe=IR();Object.defineProperty(cn,"BaseFetcher",{enumerable:!0,get:o(function(){return Zbe.BaseFetcher},"get")});var Xbe=fW();Object.defineProperty(cn,"Updater",{enumerable:!0,get:o(function(){return Xbe.Updater},"get")})});var NR=g(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});pS.TUFError=void 0;var PR=class extends Error{static{o(this,"TUFError")}constructor({code:e,message:t,cause:i}){super(t),this.code=e,this.cause=i,this.name=this.constructor.name}};pS.TUFError=PR});var pW=g($h=>{"use strict";var Qbe=$h&&$h.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($h,"__esModule",{value:!0});$h.readTarget=t0e;var e0e=Qbe(require("fs")),gS=NR();async function t0e(r,e){let t=await r0e(r,e);return new Promise((i,s)=>{e0e.default.readFile(t,"utf-8",(n,a)=>{n?s(new gS.TUFError({code:"TUF_READ_TARGET_ERROR",message:`error reading target ${t}`,cause:n})):i(a)})})}o(t0e,"readTarget");async function r0e(r,e){let t;try{t=await r.getTargetInfo(e)}catch(s){throw new gS.TUFError({code:"TUF_REFRESH_METADATA_ERROR",message:"error refreshing TUF metadata",cause:s})}if(!t)throw new gS.TUFError({code:"TUF_FIND_TARGET_ERROR",message:`target ${e} not found`});let i=await r.findCachedTarget(t);if(!i)try{i=await r.downloadTarget(t)}catch(s){throw new gS.TUFError({code:"TUF_DOWNLOAD_TARGET_ERROR",message:`error downloading target ${i}`,cause:s})}return i}o(r0e,"getTargetPath")});var gW=g((t4e,i0e)=>{i0e.exports={"https://tuf-repo-cdn.sigstore.dev":{"root.json":"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiIgogIH0sCiAgewogICAia2V5aWQiOiAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICJzaWciOiAiMzA0NTAyMjEwMGJiZGRkNDY0ZjgwNjZjZWI4OGJhNzg3Mzc1YzEyY2Q2MzMwNjgwZTA4YzI5MTA3MDNlNjUzOGM3MWNjNzlhZDIwMjIwNTE5MGIwNmU0NTM3ZmU5NjFiM2VmODFmZTY4ZWRjZDAwODljMTlmOTE5YWZlZDQyM2I5YWFmZDcwMDY0MTE1MyIKICB9LAogIHsKICAgImtleWlkIjogIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAic2lnIjogIjMwNDQwMjIwNjkzMDZjZDUyNTdmNzMyYTc0MGMxYWZlNjBhOGU0MzNjNWRlNThlYWZlYWRiZTk5YzMzNmM5YzcxZDE5OGNmODAyMjAwZDc3Mzk1M2FlN2RiYzQ4ZDNlNWJhZDlhNmY2NGJhZmZmMTk2YjdlMmFkNGE1MmExOTUxOTM2N2Q0N2RjMDQyIgogIH0sCiAgewogICAia2V5aWQiOiAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICJzaWciOiAiMzA0NDAyMjA0ZDIxYTJlYzgwZGY2NmU2MWY2ZmUyOTEyOTUxZGM0N2RmODM2MDM2ZjhjMGFiMTA4MTZkMzc1ZTcxZGJmNzllMDIyMDU0N2FkY2UxYWZkZjA0ZTY3OTRlZmEyMDNkZDUyNjRjNmY3ZTBlZjc4ZTU3ZmU5MzRiMGQyNmNiOTk0ZWVjNzYiCiAgfSwKICB7CiAgICJrZXlpZCI6ICJhNjg3ZTViZjRmYWI4MmIwZWU1OGQ0NmUwNWM5NTM1MTQ1YTJjOWFmYjQ1OGY0M2Q0MmI0NWNhMGZkY2UyYTcwIiwKICAgInNpZyI6ICIzMDQ1MDIyMDYwODI2NDk2NTU3MTQ0ZWIxNjQ5ODkzZWQ1ZjZmNGVhNTQ1MzZmZWIwY2E4MmY4Yjg5YWU2NDFiZTM5NzQzZTUwMjIxMDBhZDcxMThiNWU5ZDQ4MzczMjYyMDZlNDEyZmM2ZGEyOTk5OTI1ZDExMDMyOGE3YzE2NmIwNmM2MjQzMzZjOTNmIgogIH0sCiAgewogICAia2V5aWQiOiAiMTgzZTY0ZjM3NjcwZGMxM2NhMGQyODk5NWEzMDUzZjM3NDA5NTRkZGNlNDQzMjFhNDFlNDY1MzRjZjQ0ZTYzMiIsCiAgICJzaWciOiAiMzA0NjAyMjEwMGQ4MTc5NDM5YzJlNzNlYjBjMTczM2FiZWU3ZmFmODMyZGNhZWE3MjYzZWRjYjQ5MTk4OTFjM2EyNDdmMDU5MjMwMjIxMDBlMWE0MzdlMDc5N2U4MDNmOWI3MmRjOWQyZDkyMTU1YjBhMjI3MGMyNGVmZGQ1ZjRiM2E1ZDhmMGIwZjQzMWE3IgogIH0KIF0sCiAic2lnbmVkIjogewogICJfdHlwZSI6ICJyb290IiwKICAiY29uc2lzdGVudF9zbmFwc2hvdCI6IHRydWUsCiAgImV4cGlyZXMiOiAiMjAyNi0wMS0yMlQxMzowNTo1OVoiLAogICJrZXlzIjogewogICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVdSaUdyNStqKzNKNVNzSCtadHI1bkUySDJ3TzdcbkJWK25PM3M5M2dMY2ExOHFUT3pIWTFvV3lBR0R5a01Tc0dUVUJTdDlEK0FuMEtmS3NEMm1mU000MlE9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1vbmxpbmUtdXJpIjogImdjcGttczpwcm9qZWN0cy9zaWdzdG9yZS1yb290LXNpZ25pbmcvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9yb290L2NyeXB0b0tleXMvdGltZXN0YW1wL2NyeXB0b0tleVZlcnNpb25zLzEiCiAgIH0sCiAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIjogewogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVNeHBQT0pDSVo1b3RHNDEwNmZHSnNlRVFpM1Y5XG5wa01ZUTR1eVY5VGoxTTdXSFhJeUxHK2prZnZ1RzBnbFExSlpiUlpaQlYzZ0FSNHNvamRHSElTZW93PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGxhbmNlIgogICB9LAogICAiMjJmNGNhZWM2ZDhlNmY5NTU1YWY2NmIzZDRjM2NiMDZhM2JiMjNmZGM3ZTM5YzkxNmM2MWY0NjJlNmY1MmIwNiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRXpCelZPbUhDUG9qTVZMU0kzNjRXaWlWOE5QckRcbjZJZ1J4Vmxpc2t6L3YreTNKRVI1bWNWR2NPTmxpRGNXTUM1SjJsZkhtalBOUGhiNEg3eG04THpmU0E9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAc2FudGlhZ290b3JyZXMiCiAgIH0sCiAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIjogewogICAgImtleWlkX2hhc2hfYWxnb3JpdGhtcyI6IFsKICAgICAic2hhMjU2IiwKICAgICAic2hhNTEyIgogICAgXSwKICAgICJrZXl0eXBlIjogImVjZHNhIiwKICAgICJrZXl2YWwiOiB7CiAgICAgInB1YmxpYyI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFaW5pa1NzQVFtWWtOZUg1ZVlxL0NuSXpMYWFjT1xueGxTYWF3UURPd3FLeS90Q3F4cTV4eFBTSmMyMUs0V0loczlHeU9rS2Z6dWVZM0dJTHpjTUpaNGNXdz09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS1cbiIKICAgIH0sCiAgICAic2NoZW1lIjogImVjZHNhLXNoYTItbmlzdHAyNTYiLAogICAgIngtdHVmLW9uLWNpLWtleW93bmVyIjogIkBib2JjYWxsYXdheSIKICAgfSwKICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiOiB7CiAgICAia2V5aWRfaGFzaF9hbGdvcml0aG1zIjogWwogICAgICJzaGEyNTYiLAogICAgICJzaGE1MTIiCiAgICBdLAogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUwZ2hyaDkyTHcxWXIzaWRHVjVXcUN0TURCOEN4XG4rRDhoZEM0dzJaTE5JcGxWUm9WR0xza1lhM2doZU15T2ppSjhrUGkxNWFRMi8vN1Arb2o3VXZKUEd3PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGpvc2h1YWdsIgogICB9LAogICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUVYc3ozU1pYRmI4ak1WNDJqNnBKbHlqYmpSOEtcbk4zQndvY2V4cTZMTUliNXFzV0tPUXZMTjE2TlVlZkxjNEhzd09vdW1Sc1ZWYWFqU3BRUzZmb2JrUnc9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAbW5tNjc4IgogICB9CiAgfSwKICAicm9sZXMiOiB7CiAgICJyb290IjogewogICAgImtleWlkcyI6IFsKICAgICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICAgIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIiwKICAgICAiYTY4N2U1YmY0ZmFiODJiMGVlNThkNDZlMDVjOTUzNTE0NWEyYzlhZmI0NThmNDNkNDJiNDVjYTBmZGNlMmE3MCIsCiAgICAgIjE4M2U2NGYzNzY3MGRjMTNjYTBkMjg5OTVhMzA1M2YzNzQwOTU0ZGRjZTQ0MzIxYTQxZTQ2NTM0Y2Y0NGU2MzIiCiAgICBdLAogICAgInRocmVzaG9sZCI6IDMKICAgfSwKICAgInNuYXBzaG90IjogewogICAgImtleWlkcyI6IFsKICAgICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSIKICAgIF0sCiAgICAidGhyZXNob2xkIjogMSwKICAgICJ4LXR1Zi1vbi1jaS1leHBpcnktcGVyaW9kIjogMzY1MCwKICAgICJ4LXR1Zi1vbi1jaS1zaWduaW5nLXBlcmlvZCI6IDM2NQogICB9LAogICAidGFyZ2V0cyI6IHsKICAgICJrZXlpZHMiOiBbCiAgICAgImU3MWE1NGQ1NDM4MzViYTg2YWRhZDk0NjAzNzljNzY0MWZiODcyNmQxNjRlYTc2NjgwMWExYzUyMmFiYTdlYTIiLAogICAgICIyMmY0Y2FlYzZkOGU2Zjk1NTVhZjY2YjNkNGMzY2IwNmEzYmIyM2ZkYzdlMzljOTE2YzYxZjQ2MmU2ZjUyYjA2IiwKICAgICAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiLAogICAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAzCiAgIH0sCiAgICJ0aW1lc3RhbXAiOiB7CiAgICAia2V5aWRzIjogWwogICAgICIwYzg3NDMyYzNiZjA5ZmQ5OTE4OWZkYzMyZmE1ZWFlZGY0ZTRhNWZhYzdiYWI3M2ZhMDRhMmUwZmM2NGFmNmY1IgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAxLAogICAgIngtdHVmLW9uLWNpLWV4cGlyeS1wZXJpb2QiOiA3LAogICAgIngtdHVmLW9uLWNpLXNpZ25pbmctcGVyaW9kIjogNgogICB9CiAgfSwKICAic3BlY192ZXJzaW9uIjogIjEuMCIsCiAgInZlcnNpb24iOiAxMywKICAieC10dWYtb24tY2ktZXhwaXJ5LXBlcmlvZCI6IDE5NywKICAieC10dWYtb24tY2ktc2lnbmluZy1wZXJpb2QiOiA0NgogfQp9",targets:{"trusted_root.json":"ewogICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRldi5zaWdzdG9yZS50cnVzdGVkcm9vdCtqc29uO3ZlcnNpb249MC4xIiwKICAidGxvZ3MiOiBbCiAgICB7CiAgICAgICJiYXNlVXJsIjogImh0dHBzOi8vcmVrb3Iuc2lnc3RvcmUuZGV2IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUyRzJZKzJ0YWJkVFY1QmNHaUJJeDBhOWZBRndya0JibUxTR3RrczRMM3FYNnlZWTB6dWZCbmhDOFVyL2l5NTVHaFdQLzlBL2JZMkxoQzMwTTkrUll0dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDEtMTJUMTE6NTM6MjdaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJ3Tkk5YXRRR2x6K1ZXZk82TFJ5Z0g0UVVmWS84VzRSRndpVDVpNVdSZ0IwPSIKICAgICAgfQogICAgfQogIF0sCiAgImNlcnRpZmljYXRlQXV0aG9yaXRpZXMiOiBbCiAgICB7CiAgICAgICJzdWJqZWN0IjogewogICAgICAgICJvcmdhbml6YXRpb24iOiAic2lnc3RvcmUuZGV2IiwKICAgICAgICAiY29tbW9uTmFtZSI6ICJzaWdzdG9yZSIKICAgICAgfSwKICAgICAgInVyaSI6ICJodHRwczovL2Z1bGNpby5zaWdzdG9yZS5kZXYiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCK0RDQ0FYNmdBd0lCQWdJVE5Wa0Rab0Npb2ZQRHN5N2RmbTZnZUxidWh6QUtCZ2dxaGtqT1BRUURBekFxTVJVd0V3WURWUVFLRXd4emFXZHpkRzl5WlM1a1pYWXhFVEFQQmdOVkJBTVRDSE5wWjNOMGIzSmxNQjRYRFRJeE1ETXdOekF6TWpBeU9Wb1hEVE14TURJeU16QXpNakF5T1Zvd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRCMk1CQUdCeXFHU000OUFnRUdCU3VCQkFBaUEySUFCTFN5QTdJaTVrK3BOTzhaRVdZMHlsZW1XRG93T2tOYTNrTCtHWkU1WjVHV2VoTDkvQTliUk5BM1JicnNaNWkwSmNhc3RhUkw3U3A1ZnAvakQ1ZHhxYy9VZFRWbmx2UzE2YW4rMllmc3dlL1F1TG9sUlVDcmNPRTIrMmlBNSt0emQ2Tm1NR1F3RGdZRFZSMFBBUUgvQkFRREFnRUdNQklHQTFVZEV3RUIvd1FJTUFZQkFmOENBUUV3SFFZRFZSME9CQllFRk1qRkhRQkJtaVFwTWxFazZ3MnVTdTFLQnRQc01COEdBMVVkSXdRWU1CYUFGTWpGSFFCQm1pUXBNbEVrNncydVN1MUtCdFBzTUFvR0NDcUdTTTQ5QkFNREEyZ0FNR1VDTUg4bGlXSmZNdWk2dlhYQmhqRGdZNE13c2xtTi9USnhWZS84M1dyRm9td21OZjA1NnkxWDQ4RjljNG0zYTNvelhBSXhBS2pSYXk1L2FqL2pzS0tHSWttUWF0akk4dXVwSHIvK0N4RnZhSldtcFlxTmtMREdSVSs5b3J6aDVoSTJScmN1YVE9PSIKICAgICAgICAgIH0KICAgICAgICBdCiAgICAgIH0sCiAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAic3RhcnQiOiAiMjAyMS0wMy0wN1QwMzoyMDoyOVoiLAogICAgICAgICJlbmQiOiAiMjAyMi0xMi0zMVQyMzo1OTo1OS45OTlaIgogICAgICB9CiAgICB9LAogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly9mdWxjaW8uc2lnc3RvcmUuZGV2IiwKICAgICAgImNlcnRDaGFpbiI6IHsKICAgICAgICAiY2VydGlmaWNhdGVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAicmF3Qnl0ZXMiOiAiTUlJQ0dqQ0NBYUdnQXdJQkFnSVVBTG5WaVZmblUwYnJKYXNtUmtIcm4vVW5mYVF3Q2dZSUtvWkl6ajBFQXdNd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRBZUZ3MHlNakEwTVRNeU1EQTJNVFZhRncwek1URXdNRFV4TXpVMk5UaGFNRGN4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWVNQndHQTFVRUF4TVZjMmxuYzNSdmNtVXRhVzUwWlhKdFpXUnBZWFJsTUhZd0VBWUhLb1pJemowQ0FRWUZLNEVFQUNJRFlnQUU4UlZTL3lzSCtOT3Z1RFp5UEladGlsZ1VGOU5sYXJZcEFkOUhQMXZCQkgxVTVDVjc3TFNTN3MwWmlING5FN0h2N3B0UzZMdnZSL1NUazc5OExWZ016TGxKNEhlSWZGM3RIU2FleExjWXBTQVNyMWtTME4vUmdCSnovOWpXQ2lYbm8zc3dlVEFPQmdOVkhROEJBZjhFQkFNQ0FRWXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUhBd013RWdZRFZSMFRBUUgvQkFnd0JnRUIvd0lCQURBZEJnTlZIUTRFRmdRVTM5UHB6MVlrRVpiNXFOanBLRldpeGk0WVpEOHdId1lEVlIwakJCZ3dGb0FVV01BZVg1RkZwV2FwZXN5UW9aTWkwQ3JGeGZvd0NnWUlLb1pJemowRUF3TURad0F3WkFJd1BDc1FLNERZaVpZRFBJYURpNUhGS25meFh4NkFTU1ZtRVJmc3luWUJpWDJYNlNKUm5aVTg0LzlEWmRuRnZ2eG1BakJPdDZRcEJsYzRKLzBEeHZrVENxcGNsdnppTDZCQ0NQbmpkbElCM1B1M0J4c1BteWdVWTdJaTJ6YmRDZGxpaW93PSIKICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCOXpDQ0FYeWdBd0lCQWdJVUFMWk5BUEZkeEhQd2plRGxvRHd5WUNoQU8vNHdDZ1lJS29aSXpqMEVBd013S2pFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNUkV3RHdZRFZRUURFd2h6YVdkemRHOXlaVEFlRncweU1URXdNRGN4TXpVMk5UbGFGdzB6TVRFd01EVXhNelUyTlRoYU1Db3hGVEFUQmdOVkJBb1RESE5wWjNOMGIzSmxMbVJsZGpFUk1BOEdBMVVFQXhNSWMybG5jM1J2Y21Vd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVQ3WGVGVDRyYjNQUUd3UzRJYWp0TGszL09sbnBnYW5nYUJjbFlwc1lCcjVpKzR5bkIwN2NlYjNMUDBPSU9aZHhleFg2OWM1aVZ1eUpSUStIejA1eWkrVUYzdUJXQWxIcGlTNXNoMCtIMkdIRTdTWHJrMUVDNW0xVHIxOUw5Z2c5MmpZekJoTUE0R0ExVWREd0VCL3dRRUF3SUJCakFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQjBHQTFVZERnUVdCQlJZd0I1ZmtVV2xacWw2ekpDaGt5TFFLc1hGK2pBZkJnTlZIU01FR0RBV2dCUll3QjVma1VXbFpxbDZ6SkNoa3lMUUtzWEYrakFLQmdncWhrak9QUVFEQXdOcEFEQm1BakVBajFuSGVYWnArMTNOV0JOYStFRHNEUDhHMVdXZzF0Q01XUC9XSFBxcGFWbzBqaHN3ZU5GWmdTczBlRTd3WUk0cUFqRUEyV0I5b3Q5OHNJa29GM3ZaWWRkMy9WdFdCNWI5VE5NZWE3SXgvc3RKNVRmY0xMZUFCTEU0Qk5KT3NRNHZuQkhKIgogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfSwKICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIyLTA0LTEzVDIwOjA2OjE1WiIKICAgICAgfQogICAgfQogIF0sCiAgImN0bG9ncyI6IFsKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi90ZXN0IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUViZndSK1JKdWRYc2NnUkJScEtYMVhGRHkzUHl1ZER4ei9TZm5SaTFmVDhla3BmQmQyTzF1b3o3anIzWjhuS3p4QTY5RVVRK2VGQ0ZJM3pldWJQV1U3dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDMtMTRUMDA6MDA6MDBaIiwKICAgICAgICAgICJlbmQiOiAiMjAyMi0xMC0zMVQyMzo1OTo1OS45OTlaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJDR0NTOENoUy8yaEYwZEZySjRTY1JXY1lyQlk5d3pqU2JlYThJZ1kyYjNJPSIKICAgICAgfQogICAgfSwKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi8yMDIyIiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVpUFNsRmkwQ21GVGZFakNVcUY5SHVDRWNZWE5LQWFZYWxJSm1CWjh5eWV6UGpUcWh4cktCcE1uYW9jVnRMSkJJMWVNM3VYblF6UUdBSmRKNGdzOUZ5dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjItMTAtMjBUMDA6MDA6MDBaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICIzVDB3YXNiSEVUSmpHUjRjbVdjM0FxSktYcmplUEszL2g0cHlnQzhwN280PSIKICAgICAgfQogICAgfQogIF0sCiAgInRpbWVzdGFtcEF1dGhvcml0aWVzIjogWwogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUtdHNhLXNlbGZzaWduZWQiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly90aW1lc3RhbXAuc2lnc3RvcmUuZGV2L2FwaS92MS90aW1lc3RhbXAiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlDRURDQ0FaYWdBd0lCQWdJVU9oTlVMd3lRWWU2OHdVTXZ5NHFPaXlvaml3d3dDZ1lJS29aSXpqMEVBd013T1RFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNU0F3SGdZRFZRUURFeGR6YVdkemRHOXlaUzEwYzJFdGMyVnNabk5wWjI1bFpEQWVGdzB5TlRBME1EZ3dOalU1TkROYUZ3MHpOVEEwTURZd05qVTVORE5hTUM0eEZUQVRCZ05WQkFvVERITnBaM04wYjNKbExtUmxkakVWTUJNR0ExVUVBeE1NYzJsbmMzUnZjbVV0ZEhOaE1IWXdFQVlIS29aSXpqMENBUVlGSzRFRUFDSURZZ0FFNHJhMlo4aEtOaWcyVDlrRmpDQVRvR0czMGpreStXUXYzQnpMK21LdmgxU0tOUi9Vd3V3c2ZOQ2c0c3J5b1lBZDhFNmlzb3ZWQTNNNGFvTmRtOVFEaTUwWjhuVEV5dnFnZkRQdFRJd1hJdGZpVy9BRmYxVjd1d2tia0FvajB4eGNvMm93YURBT0JnTlZIUThCQWY4RUJBTUNCNEF3SFFZRFZSME9CQllFRkluOWVVT0h6OUJsUnNNQ1JzY3NjMXQ5dE9zRE1COEdBMVVkSXdRWU1CYUFGSmpzQWU5L3UxSC8xSlVlYjRxSW1GTUhpYzYvTUJZR0ExVWRKUUVCL3dRTU1Bb0dDQ3NHQVFVRkJ3TUlNQW9HQ0NxR1NNNDlCQU1EQTJnQU1HVUNNRHRwc1YvNkthTzBxeUYvVU1zWDJhU1VYS1FGZG9HVHB0UUdjMGZ0cTFjc3VsSFBHRzZkc215TU5kM0pCK0czRVFJeEFPYWp2QmNqcEptS2I0TnYrMlRhb2o4VWM1K2I2aWg2RlhDQ0tyYVNxdXBlMDd6cXN3TWNYSlRlMWNFeHZIdnZsdz09IgogICAgICAgICAgfSwKICAgICAgICAgIHsKICAgICAgICAgICAgInJhd0J5dGVzIjogIk1JSUI5ekNDQVh5Z0F3SUJBZ0lVVjdmMEdMRE9vRXpJaDhMWFNXODBPSmlVcDE0d0NnWUlLb1pJemowRUF3TXdPVEVWTUJNR0ExVUVDaE1NYzJsbmMzUnZjbVV1WkdWMk1TQXdIZ1lEVlFRREV4ZHphV2R6ZEc5eVpTMTBjMkV0YzJWc1puTnBaMjVsWkRBZUZ3MHlOVEEwTURnd05qVTVORE5hRncwek5UQTBNRFl3TmpVNU5ETmFNRGt4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWdNQjRHQTFVRUF4TVhjMmxuYzNSdmNtVXRkSE5oTFhObGJHWnphV2R1WldRd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVFVUU50ZlJUL291M1lBVGE2d0Iva0tUZTcwY2ZKd3lSSUJvdk1udDhSY0pwaC9DT0U4MnV5UzZGbXBwTExMMVZCUEdjUGZwUVBZSk5Yeld3aThpY3doS1E2Vy9RZTJoM29lYkJiMkZIcHdOSkRxbytUTWFDL3RkZmt2L0VsSkI3MmpSVEJETUE0R0ExVWREd0VCL3dRRUF3SUJCakFTQmdOVkhSTUJBZjhFQ0RBR0FRSC9BZ0VBTUIwR0ExVWREZ1FXQkJTWTdBSHZmN3RSLzlTVkhtK0tpSmhUQjRuT3Z6QUtCZ2dxaGtqT1BRUURBd05wQURCbUFqRUF3R0VHcmZHWlIxY2VuMVI4L0RUVk1JOTQzTHNzWm1KUnREcC9pN1NmR0htR1JQNmdSYnVqOXZPSzNiNjdaMFFRQWpFQXVUMkg2NzNMUUVhSFRjeVFTWnJrcDRtWDdXd2ttRitzVmJrWVk1bVhOK1JNSDEzS1VFSEhPcUFTYWVtWVdLL0UiCiAgICAgICAgICB9CiAgICAgICAgXQogICAgICB9LAogICAgICAidmFsaWRGb3IiOiB7CiAgICAgICAgInN0YXJ0IjogIjIwMjUtMDctMDRUMDA6MDA6MDBaIgogICAgICB9CiAgICB9CiAgXQp9Cg==","registry.npmjs.org%2Fkeys.json":"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K"}}}});var yW=g(jc=>{"use strict";var mW=jc&&jc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jc,"__esModule",{value:!0});jc.TUFClient=void 0;var ln=mW(require("fs")),Uh=mW(require("path")),s0e=dW(),n0e=mS(),o0e=pW(),DR="targets",xR=class{static{o(this,"TUFClient")}constructor(e){let t=new URL(e.mirrorURL),i=encodeURIComponent(t.host+t.pathname.replace(/\/$/,"")),s=Uh.default.join(e.cachePath,i);a0e(s),c0e({cachePath:s,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=l0e({mirrorURL:e.mirrorURL,cachePath:s,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,o0e.readTarget)(this.updater,e)}};jc.TUFClient=xR;function a0e(r){let e=Uh.default.join(r,DR);ln.default.existsSync(r)||ln.default.mkdirSync(r,{recursive:!0}),ln.default.existsSync(e)||ln.default.mkdirSync(e)}o(a0e,"initTufCache");function c0e({cachePath:r,mirrorURL:e,tufRootPath:t,forceInit:i}){let s=Uh.default.join(r,"root.json");if(!ln.default.existsSync(s)||i)if(t)ln.default.copyFileSync(t,s);else{let a=gW()[e];if(!a)throw new n0e.TUFError({code:"TUF_INIT_CACHE_ERROR",message:`No root.json found for mirror: ${e}`});ln.default.writeFileSync(s,Buffer.from(a["root.json"],"base64")),Object.entries(a.targets).forEach(([c,l])=>{ln.default.writeFileSync(Uh.default.join(r,DR,c),Buffer.from(l,"base64"))})}}o(c0e,"seedCache");function l0e(r){let e={fetchTimeout:r.timeout,fetchRetry:r.retry};return new s0e.Updater({metadataBaseUrl:r.mirrorURL,targetBaseUrl:`${r.mirrorURL}/targets`,metadataDir:r.cachePath,targetDir:Uh.default.join(r.cachePath,DR),forceCache:r.forceCache,config:e})}o(l0e,"initClient")});var mS=g(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.TUFError=as.DEFAULT_MIRROR_URL=void 0;as.getTrustedRoot=y0e;as.initTUF=S0e;var u0e=mh(),h0e=iH(),f0e=yW();as.DEFAULT_MIRROR_URL="https://tuf-repo-cdn.sigstore.dev";var d0e="sigstore-js",p0e={retries:2},g0e=5e3,m0e="trusted_root.json";async function y0e(r={}){let t=await SW(r).getTarget(m0e);return u0e.TrustedRoot.fromJSON(JSON.parse(t))}o(y0e,"getTrustedRoot");async function S0e(r={}){let e=SW(r);return e.refresh().then(()=>e)}o(S0e,"initTUF");function SW(r){return new f0e.TUFClient({cachePath:r.cachePath||(0,h0e.appDataPath)(d0e),rootPath:r.rootPath,mirrorURL:r.mirrorURL||as.DEFAULT_MIRROR_URL,retry:r.retry??p0e,timeout:r.timeout??g0e,forceCache:r.forceCache??!1,forceInit:r.forceInit??r.force??!1})}o(SW,"createClient");var w0e=NR();Object.defineProperty(as,"TUFError",{enumerable:!0,get:o(function(){return w0e.TUFError},"get")})});var wW=g(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});yS.DSSESignatureContent=void 0;var Vh=kt(),LR=class{static{o(this,"DSSESignatureContent")}constructor(e){this.env=e}compareDigest(e){return Vh.crypto.bufferEqual(e,Vh.crypto.digest("sha256",this.env.payload))}compareSignature(e){return Vh.crypto.bufferEqual(e,this.signature)}verifySignature(e){return Vh.crypto.verify(this.preAuthEncoding,e,this.signature)}get signature(){return this.env.signatures.length>0?this.env.signatures[0].sig:Buffer.from("")}get preAuthEncoding(){return Vh.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};yS.DSSESignatureContent=LR});var vW=g(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});SS.MessageSignatureContent=void 0;var MR=kt(),FR=class{static{o(this,"MessageSignatureContent")}constructor(e,t){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=t}compareSignature(e){return MR.crypto.bufferEqual(e,this.signature)}compareDigest(e){return MR.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return MR.crypto.verify(this.artifact,e,this.signature)}};SS.MessageSignatureContent=FR});var _W=g(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});wS.toSignedEntity=_0e;wS.signatureContent=EW;var BR=kt(),v0e=wW(),E0e=vW();function _0e(r,e){let{tlogEntries:t,timestampVerificationData:i}=r.verificationMaterial,s=[];for(let n of t)s.push({$case:"transparency-log",tlogEntry:n});for(let n of i?.rfc3161Timestamps??[])s.push({$case:"timestamp-authority",timestamp:BR.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:EW(r,e),key:b0e(r),tlogEntries:t,timestamps:s}}o(_0e,"toSignedEntity");function EW(r,e){switch(r.content.$case){case"dsseEnvelope":return new v0e.DSSESignatureContent(r.content.dsseEnvelope);case"messageSignature":return new E0e.MessageSignatureContent(r.content.messageSignature,e)}}o(EW,"signatureContent");function b0e(r){switch(r.verificationMaterial.content.$case){case"publicKey":return{$case:"public-key",hint:r.verificationMaterial.content.publicKey.hint};case"x509CertificateChain":return{$case:"certificate",certificate:BR.X509Certificate.parse(r.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case"certificate":return{$case:"certificate",certificate:BR.X509Certificate.parse(r.verificationMaterial.content.certificate.rawBytes)}}}o(b0e,"key")});var Ze=g($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.PolicyError=$c.VerificationError=void 0;var vS=class extends Error{static{o(this,"BaseError")}constructor({code:e,message:t,cause:i}){super(t),this.code=e,this.cause=i,this.name=this.constructor.name}},qR=class extends vS{static{o(this,"VerificationError")}};$c.VerificationError=qR;var jR=class extends vS{static{o(this,"PolicyError")}};$c.PolicyError=jR});var bW=g(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});ES.filterCertAuthorities=O0e;ES.filterTLogAuthorities=I0e;function O0e(r,e){return r.filter(t=>t.validFor.start<=e&&t.validFor.end>=e)}o(O0e,"filterCertAuthorities");function I0e(r,e){return r.filter(t=>e.logID&&!t.logID.equals(e.logID)?!1:t.validFor.start<=e.targetDate&&e.targetDate<=t.validFor.end)}o(I0e,"filterTLogAuthorities")});var To=g(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.filterTLogAuthorities=Io.filterCertAuthorities=void 0;Io.toTrustMaterial=R0e;var $R=kt(),zh=mh(),T0e=Ze(),UR=new Date(0),VR=new Date(864e13),TW=bW();Object.defineProperty(Io,"filterCertAuthorities",{enumerable:!0,get:o(function(){return TW.filterCertAuthorities},"get")});Object.defineProperty(Io,"filterTLogAuthorities",{enumerable:!0,get:o(function(){return TW.filterTLogAuthorities},"get")});function R0e(r,e){let t=typeof e=="function"?e:A0e(e);return{certificateAuthorities:r.certificateAuthorities.map(IW),timestampAuthorities:r.timestampAuthorities.map(IW),tlogs:r.tlogs.map(OW),ctlogs:r.ctlogs.map(OW),publicKey:t}}o(R0e,"toTrustMaterial");function OW(r){let e=r.publicKey.keyDetails,t=e===zh.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===zh.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===zh.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===zh.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===zh.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?"pkcs1":"spki";return{logID:r.logId.keyId,publicKey:$R.crypto.createPublicKey(r.publicKey.rawBytes,t),validFor:{start:r.publicKey.validFor?.start||UR,end:r.publicKey.validFor?.end||VR}}}o(OW,"createTLogAuthority");function IW(r){return{certChain:r.certChain.certificates.map(e=>$R.X509Certificate.parse(e.rawBytes)),validFor:{start:r.validFor?.start||UR,end:r.validFor?.end||VR}}}o(IW,"createCertAuthority");function A0e(r){return e=>{let t=(r||{})[e];if(!t)throw new T0e.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:$R.crypto.createPublicKey(t.rawBytes),validFor:o(i=>(t.validFor?.start||UR)<=i&&(t.validFor?.end||VR)>=i,"validFor")}}}o(A0e,"keyLocator")});var zR=g(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.CertificateChainVerifier=void 0;Gh.verifyCertificateChain=k0e;var un=Ze(),C0e=To();function k0e(r,e,t){let i=(0,C0e.filterCertAuthorities)(t,r),s;for(let n of i)try{return new _S({trustedCerts:n.certChain,untrustedCert:e,timestamp:r}).verify()}catch(a){s=a}throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"Failed to verify certificate chain",cause:s})}o(k0e,"verifyCertificateChain");var _S=class{static{o(this,"CertificateChainVerifier")}constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=P0e([...e.trustedCerts,e.untrustedCert]),this.timestamp=e.timestamp}verify(){let e=this.sort();if(this.checkPath(e),!e.every(i=>i.validForDate(this.timestamp)))throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate is not valid or expired at the specified date"});return e}sort(){let e=this.untrustedCert,t=this.buildPaths(e);if(t=t.filter(s=>s.some(n=>this.trustedCerts.includes(n))),t.length===0)throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"no trusted certificate path found"});let i=t.reduce((s,n)=>s.length<n.length?s:n);return[e,...i].slice(0,-1)}buildPaths(e){let t=[],i=this.findIssuer(e);if(i.length===0)throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"no valid certificate path found"});for(let s=0;s<i.length;s++){let n=i[s];if(n.equals(e)){t.push([e]);continue}let a=this.buildPaths(n);for(let c=0;c<a.length;c++)t.push([n,...a[c]])}return t}findIssuer(e){let t=[],i;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(i=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(s=>{if(i&&s.extSubjectKeyID){s.extSubjectKeyID.keyIdentifier.equals(i)&&t.push(s);return}s.subject.equals(e.issuer)&&t.push(s)}),t=t.filter(s=>{try{return e.verify(s)}catch{return!1}}),t)}checkPath(e){if(e.length<1)throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate chain must contain at least one certificate"});if(!e.slice(1).every(i=>i.isCA))throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"intermediate certificate is not a CA"});for(let i=e.length-2;i>=0;i--)if(!e[i].issuer.equals(e[i+1].subject))throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"incorrect certificate name chaining"});for(let i=0;i<e.length;i++){let s=e[i];if(s.extBasicConstraints?.isCA){let n=s.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<i-1)throw new un.VerificationError({code:"CERTIFICATE_ERROR",message:"path length constraint exceeded"})}}}};Gh.CertificateChainVerifier=_S;function P0e(r){for(let e=0;e<r.length;e++)for(let t=e+1;t<r.length;t++)r[e].equals(r[t])&&(r.splice(t,1),t--);return r}o(P0e,"dedupeCertificates")});var RW=g(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0});GR.verifySCTs=D0e;var bS=kt(),N0e=Ze(),x0e=To();function D0e(r,e,t){let i,s=r.clone();for(let l=0;l<s.extensions.length;l++){let u=s.extensions[l];if(u.subs[0].toOID()===bS.EXTENSION_OID_SCT){i=new bS.X509SCTExtension(u),s.extensions.splice(l,1);break}}if(!i)return[];if(i.signedCertificateTimestamps.length===0)return[];let n=new bS.ByteStream,a=bS.crypto.digest("sha256",e.publicKey);n.appendView(a);let c=s.tbsCertificate.toDER();return n.appendUint24(c.length),n.appendView(c),i.signedCertificateTimestamps.map(l=>{if(!(0,x0e.filterTLogAuthorities)(t,{logID:l.logID,targetDate:l.datetime}).some(f=>l.verify(n.buffer,f.publicKey)))throw new N0e.VerificationError({code:"CERTIFICATE_ERROR",message:"SCT verification failed"});return l.logID})}o(D0e,"verifySCTs")});var AW=g(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});OS.verifyPublicKey=$0e;OS.verifyCertificate=U0e;var L0e=kt(),M0e=Ze(),F0e=zR(),B0e=RW(),q0e="1.3.6.1.4.1.57264.1.1",j0e="1.3.6.1.4.1.57264.1.8";function $0e(r,e,t){let i=t.publicKey(r);return e.forEach(s=>{if(!i.validFor(s))throw new M0e.VerificationError({code:"PUBLIC_KEY_ERROR",message:`Public key is not valid for timestamp: ${s.toISOString()}`})}),{key:i.publicKey}}o($0e,"verifyPublicKey");function U0e(r,e,t){let i=[];return e.forEach(s=>{i=(0,F0e.verifyCertificateChain)(s,r,t.certificateAuthorities)}),{scts:(0,B0e.verifySCTs)(i[0],i[1],t.ctlogs),signer:V0e(i[0])}}o(U0e,"verifyCertificate");function V0e(r){let e,t=r.extension(j0e);t?e=t.valueObj.subs?.[0]?.value.toString("ascii"):e=r.extension(q0e)?.value.toString("ascii");let i={extensions:{issuer:e},subjectAlternativeName:r.subjectAltName};return{key:L0e.crypto.createPublicKey(r.publicKey),identity:i}}o(V0e,"getSigner")});var kW=g(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});IS.verifySubjectAlternativeName=z0e;IS.verifyExtensions=G0e;var CW=Ze();function z0e(r,e){if(e===void 0||!e.match(r))throw new CW.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`certificate identity error - expected ${r}, got ${e}`})}o(z0e,"verifySubjectAlternativeName");function G0e(r,e={}){let t;for(t in r)if(e[t]!==r[t])throw new CW.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`invalid certificate extension - expected ${t}=${r[t]}, got ${t}=${e[t]}`})}o(G0e,"verifyExtensions")});var PW=g(YR=>{"use strict";Object.defineProperty(YR,"__esModule",{value:!0});YR.verifyCheckpoint=J0e;var WR=kt(),Uc=Ze(),H0e=To(),HR=`
66
+
67
+ `,W0e=/\u2014 (\S+) (\S+)\n/g;function J0e(r,e){let t=(0,H0e.filterTLogAuthorities)(e,{targetDate:new Date(Number(r.integratedTime)*1e3)}),i=r.inclusionProof,s=JR.fromString(i.checkpoint.envelope),n=KR.fromString(s.note);if(!K0e(s,t))throw new Uc.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!WR.crypto.bufferEqual(n.logHash,i.rootHash))throw new Uc.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}o(J0e,"verifyCheckpoint");function K0e(r,e){let t=Buffer.from(r.note,"utf-8");return r.signatures.every(i=>{let s=e.find(n=>WR.crypto.bufferEqual(n.logID.subarray(0,4),i.keyHint));return s?WR.crypto.verify(t,s.publicKey,i.signature):!1})}o(K0e,"verifySignedNote");var JR=class r{static{o(this,"SignedNote")}constructor(e,t){this.note=e,this.signatures=t}static fromString(e){if(!e.includes(HR))throw new Uc.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let t=e.indexOf(HR),i=e.slice(0,t+1),n=e.slice(t+HR.length).matchAll(W0e),a=Array.from(n,c=>{let[,l,u]=c,h=Buffer.from(u,"base64");if(h.length<5)throw new Uc.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:l,keyHint:h.subarray(0,4),signature:h.subarray(4)}});if(a.length===0)throw new Uc.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new r(i,a)}},KR=class r{static{o(this,"LogCheckpoint")}constructor(e,t,i,s){this.origin=e,this.logSize=t,this.logHash=i,this.rest=s}static fromString(e){let t=e.trimEnd().split(`
68
+ `);if(t.length<3)throw new Uc.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let i=t[0],s=BigInt(t[1]),n=Buffer.from(t[2],"base64"),a=t.slice(3);return new r(i,s,n,a)}}});var NW=g(eA=>{"use strict";Object.defineProperty(eA,"__esModule",{value:!0});eA.verifyMerkleInclusion=X0e;var QR=kt(),ZR=Ze(),Y0e=Buffer.from([0]),Z0e=Buffer.from([1]);function X0e(r){let e=r.inclusionProof,t=BigInt(e.logIndex),i=BigInt(e.treeSize);if(t<0n||t>=i)throw new ZR.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${t}`});let{inner:s,border:n}=Q0e(t,i);if(e.hashes.length!==s+n)throw new ZR.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let a=e.hashes.slice(0,s),c=e.hashes.slice(s),l=nOe(r.canonicalizedBody),u=tOe(eOe(l,a,t),c);if(!QR.crypto.bufferEqual(u,e.rootHash))throw new ZR.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(X0e,"verifyMerkleInclusion");function Q0e(r,e){let t=rOe(r,e),i=iOe(r>>BigInt(t));return{inner:t,border:i}}o(Q0e,"decompInclProof");function eOe(r,e,t){return e.reduce((i,s,n)=>t>>BigInt(n)&BigInt(1)?XR(s,i):XR(i,s),r)}o(eOe,"chainInner");function tOe(r,e){return e.reduce((t,i)=>XR(i,t),r)}o(tOe,"chainBorderRight");function rOe(r,e){return sOe(r^e-BigInt(1))}o(rOe,"innerProofSize");function iOe(r){return r.toString(2).split("1").length-1}o(iOe,"onesCount");function sOe(r){return r===0n?0:r.toString(2).length}o(sOe,"bitLength");function XR(r,e){return QR.crypto.digest("sha256",Z0e,r,e)}o(XR,"hashChildren");function nOe(r){return QR.crypto.digest("sha256",Y0e,r)}o(nOe,"hashLeaf")});var DW=g(tA=>{"use strict";Object.defineProperty(tA,"__esModule",{value:!0});tA.verifyTLogSET=cOe;var xW=kt(),oOe=Ze(),aOe=To();function cOe(r,e){if(!(0,aOe.filterTLogAuthorities)(e,{logID:r.logId.keyId,targetDate:new Date(Number(r.integratedTime)*1e3)}).some(s=>{let n=lOe(r),a=Buffer.from(xW.json.canonicalize(n),"utf8"),c=r.inclusionPromise.signedEntryTimestamp;return xW.crypto.verify(a,s.publicKey,c)}))throw new oOe.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(cOe,"verifyTLogSET");function lOe(r){let{integratedTime:e,logIndex:t,logId:i,canonicalizedBody:s}=r;return{body:s.toString("base64"),integratedTime:Number(e),logIndex:Number(t),logID:i.keyId.toString("hex")}}o(lOe,"toVerificationPayload")});var MW=g(iA=>{"use strict";Object.defineProperty(iA,"__esModule",{value:!0});iA.verifyRFC3161Timestamp=fOe;var rA=kt(),LW=Ze(),uOe=zR(),hOe=To();function fOe(r,e,t){let i=r.signingTime;if(t=(0,hOe.filterCertAuthorities)(t,i),t=pOe(t,{serialNumber:r.signerSerialNumber,issuer:r.signerIssuer}),!t.some(n=>{try{return dOe(r,e,n),!0}catch{return!1}}))throw new LW.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}o(fOe,"verifyRFC3161Timestamp");function dOe(r,e,t){let[i,...s]=t.certChain,n=rA.crypto.createPublicKey(i.publicKey),a=r.signingTime;try{new uOe.CertificateChainVerifier({untrustedCert:i,trustedCerts:s,timestamp:a}).verify()}catch{throw new LW.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}r.verify(e,n)}o(dOe,"verifyTimestampForCA");function pOe(r,e){return r.filter(t=>t.certChain.length>0&&rA.crypto.bufferEqual(t.certChain[0].serialNumber,e.serialNumber)&&rA.crypto.bufferEqual(t.certChain[0].issuer,e.issuer))}o(pOe,"filterCAsBySerialAndIssuer")});var FW=g(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});TS.verifyTSATimestamp=vOe;TS.verifyTLogTimestamp=EOe;var gOe=Ze(),mOe=PW(),yOe=NW(),SOe=DW(),wOe=MW();function vOe(r,e,t){return(0,wOe.verifyRFC3161Timestamp)(r,e,t),{type:"timestamp-authority",logID:r.signerSerialNumber,timestamp:r.signingTime}}o(vOe,"verifyTSATimestamp");function EOe(r,e){let t=!1;if(_Oe(r)&&((0,SOe.verifyTLogSET)(r,e),t=!0),bOe(r)&&((0,yOe.verifyMerkleInclusion)(r),(0,mOe.verifyCheckpoint)(r,e),t=!0),!t)throw new gOe.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:r.logId.keyId,timestamp:new Date(Number(r.integratedTime)*1e3)}}o(EOe,"verifyTLogTimestamp");function _Oe(r){return r.inclusionPromise!==void 0}o(_Oe,"isTLogEntryWithInclusionPromise");function bOe(r){return r.inclusionProof!==void 0}o(bOe,"isTLogEntryWithInclusionProof")});var BW=g(sA=>{"use strict";Object.defineProperty(sA,"__esModule",{value:!0});sA.verifyDSSETLogBody=OOe;var RS=Ze();function OOe(r,e){switch(r.apiVersion){case"0.0.1":return IOe(r,e);default:throw new RS.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${r.apiVersion}`})}}o(OOe,"verifyDSSETLogBody");function IOe(r,e){if(r.spec.signatures?.length!==1)throw new RS.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=r.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(t,"base64")))throw new RS.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let i=r.spec.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(i,"hex")))throw new RS.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(IOe,"verifyDSSE001TLogBody")});var qW=g(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.verifyHashedRekordTLogBody=TOe;var nA=Ze();function TOe(r,e){switch(r.apiVersion){case"0.0.1":return ROe(r,e);default:throw new nA.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported hashedrekord version: ${r.apiVersion}`})}}o(TOe,"verifyHashedRekordTLogBody");function ROe(r,e){let t=r.spec.signature.content||"";if(!e.compareSignature(Buffer.from(t,"base64")))throw new nA.VerificationError({code:"TLOG_BODY_ERROR",message:"signature mismatch"});let i=r.spec.data.hash?.value||"";if(!e.compareDigest(Buffer.from(i,"hex")))throw new nA.VerificationError({code:"TLOG_BODY_ERROR",message:"digest mismatch"})}o(ROe,"verifyHashedrekord001TLogBody")});var jW=g(aA=>{"use strict";Object.defineProperty(aA,"__esModule",{value:!0});aA.verifyIntotoTLogBody=AOe;var AS=Ze();function AOe(r,e){switch(r.apiVersion){case"0.0.2":return COe(r,e);default:throw new AS.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported intoto version: ${r.apiVersion}`})}}o(AOe,"verifyIntotoTLogBody");function COe(r,e){if(r.spec.content.envelope.signatures?.length!==1)throw new AS.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=kOe(r.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(t,"base64")))throw new AS.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let i=r.spec.content.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(i,"hex")))throw new AS.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(COe,"verifyIntoto002TLogBody");function kOe(r){return Buffer.from(r,"base64").toString("utf-8")}o(kOe,"base64Decode")});var UW=g(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});cA.verifyTLogBody=DOe;var $W=Ze(),POe=BW(),NOe=qW(),xOe=jW();function DOe(r,e){let{kind:t,version:i}=r.kindVersion,s=JSON.parse(r.canonicalizedBody.toString("utf8"));if(t!==s.kind||i!==s.apiVersion)throw new $W.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/version mismatch - expected: ${t}/${i}, received: ${s.kind}/${s.apiVersion}`});switch(s.kind){case"dsse":return(0,POe.verifyDSSETLogBody)(s,e);case"intoto":return(0,xOe.verifyIntotoTLogBody)(s,e);case"hashedrekord":return(0,NOe.verifyHashedRekordTLogBody)(s,e);default:throw new $W.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported kind: ${t}`})}}o(DOe,"verifyTLogBody")});var WW=g(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});CS.Verifier=void 0;var LOe=require("util"),Vc=Ze(),VW=AW(),zW=kW(),GW=FW(),MOe=UW(),lA=class{static{o(this,"Verifier")}constructor(e,t={}){this.trustMaterial=e,this.options={ctlogThreshold:t.ctlogThreshold??1,tlogThreshold:t.tlogThreshold??1,tsaThreshold:t.tsaThreshold??0}}verify(e,t){let i=this.verifyTimestamps(e),s=this.verifySigningKey(e,i);return this.verifyTLogs(e),this.verifySignature(e,s),t&&this.verifyPolicy(t,s.identity||{}),s}verifyTimestamps(e){let t=0,i=0,s=e.timestamps.map(n=>{switch(n.$case){case"timestamp-authority":return i++,(0,GW.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case"transparency-log":return t++,(0,GW.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(HW(s))throw new Vc.VerificationError({code:"TIMESTAMP_ERROR",message:"duplicate timestamp"});if(t<this.options.tlogThreshold)throw new Vc.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${t}`});if(i<this.options.tsaThreshold)throw new Vc.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${i}`});return s.map(n=>n.timestamp)}verifySigningKey({key:e},t){switch(e.$case){case"public-key":return(0,VW.verifyPublicKey)(e.hint,t,this.trustMaterial);case"certificate":{let i=(0,VW.verifyCertificate)(e.certificate,t,this.trustMaterial);if(HW(i.scts))throw new Vc.VerificationError({code:"CERTIFICATE_ERROR",message:"duplicate SCT"});if(i.scts.length<this.options.ctlogThreshold)throw new Vc.VerificationError({code:"CERTIFICATE_ERROR",message:`expected ${this.options.ctlogThreshold} SCTs, got ${i.scts.length}`});return i.signer}}}verifyTLogs({signature:e,tlogEntries:t}){t.forEach(i=>(0,MOe.verifyTLogBody)(i,e))}verifySignature(e,t){if(!e.signature.verifySignature(t.key))throw new Vc.VerificationError({code:"SIGNATURE_ERROR",message:"signature verification failed"})}verifyPolicy(e,t){e.subjectAlternativeName&&(0,zW.verifySubjectAlternativeName)(e.subjectAlternativeName,t.subjectAlternativeName),e.extensions&&(0,zW.verifyExtensions)(e.extensions,t.extensions)}};CS.Verifier=lA;function HW(r){for(let e=0;e<r.length;e++)for(let t=e+1;t<r.length;t++)if((0,LOe.isDeepStrictEqual)(r[e],r[t]))return!0;return!1}o(HW,"containsDupes")});var kS=g(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.Verifier=yr.toTrustMaterial=yr.VerificationError=yr.PolicyError=yr.toSignedEntity=void 0;var FOe=_W();Object.defineProperty(yr,"toSignedEntity",{enumerable:!0,get:o(function(){return FOe.toSignedEntity},"get")});var JW=Ze();Object.defineProperty(yr,"PolicyError",{enumerable:!0,get:o(function(){return JW.PolicyError},"get")});Object.defineProperty(yr,"VerificationError",{enumerable:!0,get:o(function(){return JW.VerificationError},"get")});var BOe=To();Object.defineProperty(yr,"toTrustMaterial",{enumerable:!0,get:o(function(){return BOe.toTrustMaterial},"get")});var qOe=WW();Object.defineProperty(yr,"Verifier",{enumerable:!0,get:o(function(){return qOe.Verifier},"get")})});var KW=g(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.DEFAULT_TIMEOUT=yt.DEFAULT_RETRY=void 0;yt.createBundleBuilder=UOe;yt.createKeyFinder=VOe;yt.createVerificationPolicy=zOe;var jOe=kt(),zc=IT(),$Oe=kS();yt.DEFAULT_RETRY={retries:2};yt.DEFAULT_TIMEOUT=5e3;function UOe(r,e){let t={signer:GOe(e),witnesses:WOe(e)};switch(r){case"messageSignature":return new zc.MessageSignatureBundleBuilder(t);case"dsseEnvelope":return new zc.DSSEBundleBuilder({...t,certificateChain:e.legacyCompatibility})}}o(UOe,"createBundleBuilder");function VOe(r){return e=>{let t=r(e);if(!t)throw new $Oe.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:jOe.crypto.createPublicKey(t),validFor:o(()=>!0,"validFor")}}}o(VOe,"createKeyFinder");function zOe(r){let e={},t=r.certificateIdentityEmail||r.certificateIdentityURI;return t&&(e.subjectAlternativeName=t),r.certificateIssuer&&(e.extensions={issuer:r.certificateIssuer}),e}o(zOe,"createVerificationPolicy");function GOe(r){return new zc.FulcioSigner({fulcioBaseURL:r.fulcioURL,identityProvider:r.identityProvider||HOe(r),retry:r.retry??yt.DEFAULT_RETRY,timeout:r.timeout??yt.DEFAULT_TIMEOUT})}o(GOe,"initSigner");function HOe(r){let e=r.identityToken;return e?{getToken:o(()=>Promise.resolve(e),"getToken")}:new zc.CIContextProvider("sigstore")}o(HOe,"initIdentityProvider");function WOe(r){let e=[];return JOe(r)&&e.push(new zc.RekorWitness({rekorBaseURL:r.rekorURL,entryType:r.legacyCompatibility?"intoto":"dsse",fetchOnConflict:!1,retry:r.retry??yt.DEFAULT_RETRY,timeout:r.timeout??yt.DEFAULT_TIMEOUT})),KOe(r)&&e.push(new zc.TSAWitness({tsaBaseURL:r.tsaServerURL,retry:r.retry??yt.DEFAULT_RETRY,timeout:r.timeout??yt.DEFAULT_TIMEOUT})),e}o(WOe,"initWitnesses");function JOe(r){return r.tlogUpload!==!1}o(JOe,"isRekorEnabled");function KOe(r){return r.tsaServerURL!==void 0}o(KOe,"isTSAEnabled")});var XW=g(Sr=>{"use strict";var YOe=Sr&&Sr.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),ZOe=Sr&&Sr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),YW=Sr&&Sr.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s);return i},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),s=0;s<i.length;s++)i[s]!=="default"&&YOe(t,e,i[s]);return ZOe(t,e),t}})();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.sign=QOe;Sr.attest=eIe;Sr.verify=tIe;Sr.createVerifier=ZW;var hA=Sh(),XOe=YW(mS()),uA=kS(),Gc=YW(KW());async function QOe(r,e={}){let i=await Gc.createBundleBuilder("messageSignature",e).create({data:r});return(0,hA.bundleToJSON)(i)}o(QOe,"sign");async function eIe(r,e,t={}){let s=await Gc.createBundleBuilder("dsseEnvelope",t).create({data:r,type:e});return(0,hA.bundleToJSON)(s)}o(eIe,"attest");async function tIe(r,e,t){let i;return Buffer.isBuffer(e)?i=e:t=e,ZW(t).then(s=>s.verify(r,i))}o(tIe,"verify");async function ZW(r={}){let e=await XOe.getTrustedRoot({mirrorURL:r.tufMirrorURL,rootPath:r.tufRootPath,cachePath:r.tufCachePath,forceCache:r.tufForceCache,retry:r.retry??Gc.DEFAULT_RETRY,timeout:r.timeout??Gc.DEFAULT_TIMEOUT}),t=r.keySelector?Gc.createKeyFinder(r.keySelector):void 0,i=(0,uA.toTrustMaterial)(e,t),s={ctlogThreshold:r.ctLogThreshold,tlogThreshold:r.tlogThreshold},n=new uA.Verifier(i,s),a=Gc.createVerificationPolicy(r);return{verify:o((c,l)=>{let u=(0,hA.bundleFromJSON)(c),h=(0,uA.toSignedEntity)(u,l);n.verify(h,a)},"verify")}}o(ZW,"createVerifier")});var dA=g(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.verify=ve.sign=ve.createVerifier=ve.attest=ve.VerificationError=ve.PolicyError=ve.TUFError=ve.InternalError=ve.DEFAULT_REKOR_URL=ve.DEFAULT_FULCIO_URL=ve.ValidationError=void 0;var rIe=Sh();Object.defineProperty(ve,"ValidationError",{enumerable:!0,get:o(function(){return rIe.ValidationError},"get")});var fA=IT();Object.defineProperty(ve,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return fA.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(ve,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return fA.DEFAULT_REKOR_URL},"get")});Object.defineProperty(ve,"InternalError",{enumerable:!0,get:o(function(){return fA.InternalError},"get")});var iIe=mS();Object.defineProperty(ve,"TUFError",{enumerable:!0,get:o(function(){return iIe.TUFError},"get")});var QW=kS();Object.defineProperty(ve,"PolicyError",{enumerable:!0,get:o(function(){return QW.PolicyError},"get")});Object.defineProperty(ve,"VerificationError",{enumerable:!0,get:o(function(){return QW.VerificationError},"get")});var PS=XW();Object.defineProperty(ve,"attest",{enumerable:!0,get:o(function(){return PS.attest},"get")});Object.defineProperty(ve,"createVerifier",{enumerable:!0,get:o(function(){return PS.createVerifier},"get")});Object.defineProperty(ve,"sign",{enumerable:!0,get:o(function(){return PS.sign},"get")});Object.defineProperty(ve,"verify",{enumerable:!0,get:o(function(){return PS.verify},"get")})});var yA=g((e6e,s3)=>{var sIe=require("node:crypto"),e3=wt(),nIe=Zu(),pA=Ft(),oIe=ye(),aIe=dA(),gA=ho(),cIe=Zn(),lIe=gh(),t3=vI().version,r3=E0(),i3=Yn(),uIe="application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",hIe="application/json",fIe="2015-01-01T00:00:00.000Z",mA=class extends cIe{static{o(this,"RegistryFetcher")}#e;constructor(e,t){super(e,t),this.packumentCache=this.opts.packumentCache||null,this.registry=gA.pickRegistry(e,t),this.packumentUrl=`${r3(this.registry)}/${this.spec.escapedName}`,this.#e=`${this.fullMetadata?"full":"corgi"}:${this.packumentUrl}`;let i=new URL(this.registry),s=`//${i.host}${i.pathname}`;this.opts[`${s}:_keys`]&&(this.registryKeys=this.opts[`${s}:_keys`])}async resolve(){if(await this.manifest(),!this.resolved)throw Object.assign(new Error("Invalid package manifest: no `dist.tarball` field"),{package:this.spec.toString()});return this.resolved}#t(){return{"user-agent":this.opts.userAgent||`pacote/${t3} node/${process.version}`,...this.opts.headers||{},"pacote-version":t3,"pacote-req-type":"packument","pacote-pkg-id":`registry:${this.spec.name}`,accept:this.fullMetadata?hIe:uIe}}async packument(){if(this.packumentCache?.has(this.#e))return this.packumentCache.get(this.#e);try{let e=await gA(this.packumentUrl,{...this.opts,headers:this.#t(),spec:this.spec,integrity:null}),t=await e.json(),i=e.headers.get("content-length");return i&&(t._contentLength=Number(i)),this.packumentCache?.set(this.#e,t),t}catch(e){if(this.packumentCache?.delete(this.#e),e.code!=="E404"||this.fullMetadata)throw e;return this.fullMetadata=!0,this.packument()}}async manifest(){if(this.package)return this.package;this.opts.verifySignatures&&(this.fullMetadata=!0);let e=await this.packument(),t=e3.normalizeSteps.filter(a=>a!=="_attributes"),i=await new e3().fromContent(nIe(e,this.spec.fetchSpec,{...this.opts,defaultTag:this.defaultTag,before:this.before})).normalize({steps:t}).then(a=>a.content),s=e.time?.[i.version];s&&(i._time=s);let{dist:n}=i;if(n){this.resolved=i._resolved=n.tarball,i._from=this.from;let a=n.integrity?pA.parse(n.integrity):n.shasum?pA.fromHex(n.shasum,"sha1",{...this.opts}):null;if(a){if(this.integrity&&!this.integrity.match(a)){for(let c of Object.keys(this.integrity))if(a[c])throw Object.assign(new Error(`Integrity checksum failed when using ${c}: wanted ${this.integrity} but got ${a}.`),{code:"EINTEGRITY"})}this.integrity=a}}if(this.integrity){if(i._integrity=String(this.integrity),n.signatures)if(this.opts.verifySignatures){let a=`${i._id}:${i._integrity}`;for(let c of n.signatures){let l=this.registryKeys&&this.registryKeys.filter(p=>p.keyid===c.keyid)[0];if(!l)throw Object.assign(new Error(`${i._id} has a registry signature with keyid: ${c.keyid} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let u=Date.parse(i._time||fIe);if(!(!l.expires||u<Date.parse(l.expires)))throw Object.assign(new Error(`${i._id} has a registry signature with keyid: ${c.keyid} but the corresponding public key has expired ${l.expires}`),{code:"EEXPIREDSIGNATUREKEY"});let f=sIe.createVerify("SHA256");if(f.write(a),f.end(),!f.verify(l.pemkey,c.sig,"base64"))throw Object.assign(new Error(`${i._id} has an invalid registry signature with keyid: ${l.keyid} and signature: ${c.sig}`),{code:"EINTEGRITYSIGNATURE",keyid:l.keyid,signature:c.sig,resolved:i._resolved,integrity:i._integrity})}i._signatures=n.signatures}else i._signatures=n.signatures;if(n.attestations)if(this.opts.verifyAttestations){let a=new URL(n.attestations.url).pathname,c=r3(this.registry)+a,l=await gA(c,{...this.opts,integrity:null}),{attestations:u}=await l.json(),h=u.map(({predicateType:p,bundle:m})=>{let y=JSON.parse(Buffer.from(m.dsseEnvelope.payload,"base64").toString("utf8")),w=m.dsseEnvelope.signatures[0].keyid,S=m.dsseEnvelope.signatures[0].sig;return{predicateType:p,bundle:m,statement:y,keyid:w,signature:S}}),f=h.map(p=>p.keyid).filter(p=>!!p),d=(this.registryKeys||[]).filter(p=>f.includes(p.keyid));if(!d.length)throw Object.assign(new Error(`${i._id} has attestations but no corresponding public key(s) can be found`),{code:"EMISSINGSIGNATUREKEY"});for(let{predicateType:p,bundle:m,keyid:y,signature:w,statement:S}of h){let v=d.find(O=>O.keyid===y);if(y){if(!v)throw Object.assign(new Error(`${i._id} has attestations with keyid: ${y} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let O=new Date(Number(m.verificationMaterial.tlogEntries[0].integratedTime)*1e3);if(!(!v.expires||O<Date.parse(v.expires)))throw Object.assign(new Error(`${i._id} has attestations with keyid: ${y} but the corresponding public key has expired ${v.expires}`),{code:"EEXPIREDSIGNATUREKEY"})}let _={name:S.subject[0].name,sha512:S.subject[0].digest.sha512},E=this.spec.type==="version"?oIe.toPurl(this.spec):this.spec;if(_.name!==E)throw Object.assign(new Error(`${i._id} package name and version (PURL): ${E} doesn't match what was signed: ${_.name}`),{code:"EATTESTATIONSUBJECT"});let b=pA.parse(this.integrity).hexDigest();if(_.sha512!==b)throw Object.assign(new Error(`${i._id} package integrity (hex digest): ${b} doesn't match what was signed: ${_.sha512}`),{code:"EATTESTATIONSUBJECT"});try{let O={tufCachePath:this.tufCache,tufForceCache:!0,keySelector:v?()=>v.pemkey:void 0};await aIe.verify(m,O)}catch(O){throw Object.assign(new Error(`${i._id} failed to verify attestation: ${O.message}`),{code:"EATTESTATIONVERIFY",predicateType:p,keyid:y,signature:w,resolved:i._resolved,integrity:i._integrity})}}i._attestations=n.attestations}else i._attestations=n.attestations}return this.package=i,this.package}[i3.tarballFromResolved](){return new lIe(this.resolved,{...this.opts,resolved:this.resolved,pkgid:`registry:${this.spec.name}@${this.resolved}`})[i3.tarballFromResolved]()}get types(){return["tag","version","range"]}};s3.exports=mA});var Zn=g((r6e,u3)=>{var{basename:dIe,dirname:n3}=require("node:path"),{rm:pIe,mkdir:o3}=require("node:fs/promises"),c3=wt(),SA=Qr(),gIe=As(),mIe=Dp(),l3=ye(),yIe=Cn(),wA=Ft(),SIe=Gu(),{Minipass:wIe}=ee(),{log:hn}=se(),Hh=Yn(),a3=dj(),vIe=v0(),EIe=E0(),_Ie=o(r=>c3.prepare(r).then(e=>e.content),"packageJsonPrepare"),bIe=o(r=>c3.normalize(r).then(e=>e.content),"packageJsonNormalize"),NS=class{static{o(this,"FetcherBase")}constructor(e,t){if(!t||typeof t!="object")throw new TypeError("options object is required");this.spec=l3(e,t.where),this.allowGitIgnore=!!t.allowGitIgnore,this.from=this.spec.registry?`${this.spec.name}@${this.spec.rawSpec}`:this.spec.saveSpec,this.#r(),this.opts={...t},this.cache=t.cache||a3().cacache,this.tufCache=t.tufCache||a3().tufcache,this.resolved=t.resolved||null,this.defaultIntegrityAlgorithm=t.defaultIntegrityAlgorithm||"sha512",typeof t.integrity=="string"&&(this.opts.integrity=wA.parse(t.integrity)),this.package=null,this.type=this.constructor.name,this.fmode=t.fmode||438,this.dmode=t.dmode||511,this.umask=t.umask||0,this.preferOnline=!!t.preferOnline,this.preferOffline=!!t.preferOffline,this.offline=!!t.offline,this.before=t.before,this.fullMetadata=this.before?!0:!!t.fullMetadata,this.fullReadJson=!!t.fullReadJson,this[Hh.readPackageJson]=this.fullReadJson?_Ie:bIe,this.replaceRegistryHost=!t.replaceRegistryHost||t.replaceRegistryHost==="npmjs"?"registry.npmjs.org":t.replaceRegistryHost,this.defaultTag=t.defaultTag||"latest",this.registry=EIe(t.registry||"https://registry.npmjs.org"),this.npmBin=t.npmBin||"npm",this.npmInstallCmd=t.npmInstallCmd||["install","--force"],this.npmCliConfig=t.npmCliConfig||[`--cache=${n3(this.cache)}`,`--prefer-offline=${!!this.preferOffline}`,`--prefer-online=${!!this.preferOnline}`,`--offline=${!!this.offline}`,...this.before?[`--before=${this.before.toISOString()}`]:[],"--no-progress","--no-save","--no-audit","--include=dev","--include=peer","--include=optional","--no-package-lock-only","--no-dry-run"]}get integrity(){return this.opts.integrity||null}set integrity(e){if(!e)return;e=wA.parse(e);let t=this.opts.integrity;t?t.merge(e):this.opts.integrity=e}get notImplementedError(){return new Error("not implemented in this fetcher type: "+this.type)}resolve(){return this.resolved?Promise.resolve(this.resolved):Promise.reject(this.notImplementedError)}packument(){return Promise.reject(this.notImplementedError)}manifest(){return Promise.reject(this.notImplementedError)}[Hh.tarballFromResolved](){throw this.notImplementedError}tarball(){return this.tarballStream(e=>e.concat().then(t=>(t.integrity=this.integrity&&String(this.integrity),t.resolved=this.resolved,t.from=this.from,t)))}#e(){let e=Date.now(),t=SA.get.stream.byDigest(this.cache,this.integrity,this.opts),i=Date.now()-e;return hn.http("cache",`${this.spec} ${i}ms (cache hit)`),t}get[Hh.cacheFetches](){return!0}#t(e){if(!this.opts.cache||!this[Hh.cacheFetches]){if(e.hasIntegrityEmitter)return e.on("integrity",n=>this.integrity=n),e;let s=wA.integrityStream(this.opts);return s.on("integrity",n=>this.integrity=n),e.on("error",n=>s.emit("error",n)),e.pipe(s)}let t=new wIe;e.on("error",s=>t.emit("error",s)),e.pipe(t,{end:!1});let i=SA.put.stream(this.opts.cache,`pacote:tarball:${this.from}`,this.opts);return i.on("integrity",s=>this.integrity=s),i.on("error",s=>e.emit("error",s)),e.pipe(i),i.promise().catch(()=>{}).then(()=>t.end()),t}pickIntegrityAlgorithm(){return this.integrity?this.integrity.pickAlgorithm(this.opts):this.defaultIntegrityAlgorithm}isDataCorruptionError(e){return e.code==="EINTEGRITY"||e.code==="Z_DATA_ERROR"}get types(){return!1}#r(){if(this.types&&!this.types.includes(this.spec.type))throw new TypeError(`Wrong spec type (${this.spec.type}) for ${this.constructor.name}. Supported types: ${this.types.join(", ")}`)}isRetriableError(e){return this.isDataCorruptionError(e)||e.code==="ENOENT"||e.code==="EISDIR"}tarballStream(e){let t=!this.preferOnline&&this.integrity&&this.resolved?e(this.#e()).catch(s=>{if(this.isDataCorruptionError(s))return hn.warn("tarball",`cached data for ${this.spec} (${this.integrity}) seems to be corrupted. Refreshing cache.`),this.cleanupCached().then(()=>{throw s});throw s}):null,i=o(s=>{if(s){if(!this.isRetriableError(s))throw s;hn.silly("tarball",`no local data for ${this.spec}. Extracting by manifest.`)}return this.resolve().then(()=>yIe(n=>e(this.#t(this[Hh.tarballFromResolved]())).catch(a=>{if(this.isRetriableError(a))return hn.warn("tarball",`tarball data for ${this.spec} (${this.integrity}) seems to be corrupted. Trying again.`),this.cleanupCached().then(()=>n(a));throw a}),{retries:1,minTimeout:0,maxTimeout:0}))},"fromResolved");return t?t.catch(i):i()}cleanupCached(){return SA.rm.content(this.cache,this.integrity,this.opts)}#i(e){return mIe({path:e,depth:1}).then(t=>Promise.all(t.map(i=>pIe(i,{recursive:!0,force:!0}))))}async#s(e){return await this.#i(e),await o3(e,{recursive:!0})}async extract(e){return await this.#s(e),this.tarballStream(t=>this.#n(e,t))}#o(e){return this.tarballStream(t=>new Promise((i,s)=>{let n=new gIe.WriteStream(e);t.on("error",a=>n.emit("error",a)),n.on("error",a=>s(a)),n.on("close",()=>i({integrity:this.integrity&&String(this.integrity),resolved:this.resolved,from:this.from})),t.pipe(n)}))}async tarballFile(e){let t=n3(e);return await o3(t,{recursive:!0}),this.#o(e)}#n(e,t){let i=SIe.x(this.#a({cwd:e})),s=new Promise((n,a)=>{i.on("end",()=>{n({resolved:this.resolved,integrity:this.integrity&&String(this.integrity),from:this.from})}),i.on("error",c=>{hn.warn("tar",c.message),hn.silly("tar",c),a(c)}),t.on("error",c=>a(c))});return t.pipe(i),s}#c(e,t,i){let s=/Directory|GNUDumpDir/.test(i)?this.dmode:/File$/.test(i)?this.fmode:0,n=vIe(this.package,e)?73:0;return(t|s)&~this.umask|n|384}#a({cwd:e}){let t=new Set;return{cwd:e,noChmod:!0,noMtime:!0,filter:o((i,s)=>{if(/Link$/.test(s.type))return!1;if(s.mode=this.#c(s.path,s.mode,s.type),/File$/.test(s.type)){let n=dIe(s.path);if(n===".npmignore")t.add(s.path);else if(n===".gitignore"&&!this.allowGitIgnore){let a=s.path.replace(/\.gitignore$/,".npmignore");if(t.has(a))return!1;s.path=a}return!0}},"filter"),strip:1,onwarn:o((i,s,n)=>{hn.warn("tar",i,s),hn.silly("tar",i,s,n)},"onwarn"),umask:this.umask,preserveOwner:!1}}};u3.exports=NS;var OIe=bI(),IIe=yA(),TIe=Ya(),RIe=Jg(),AIe=gh();NS.get=(r,e={})=>{let t=l3(r,e.where);switch(t.type){case"git":return new OIe(t,e);case"remote":return new AIe(t,e);case"version":case"range":case"tag":case"alias":return new IIe(t.subSpec||t,e);case"file":return new TIe(t,e);case"directory":return new RIe(t,e);default:throw new TypeError("Unknown spec type: "+t.type)}}});var Hc=g((s6e,h3)=>{var{get:Ro}=Zn(),CIe=bI(),kIe=yA(),PIe=Ya(),NIe=Jg(),xIe=gh(),vA=o((r,e)=>Ro(r,e).tarball(),"tarball");vA.stream=(r,e,t)=>Ro(r,t).tarballStream(e);vA.file=(r,e,t)=>Ro(r,t).tarballFile(e);h3.exports={GitFetcher:CIe,RegistryFetcher:kIe,FileFetcher:PIe,DirFetcher:NIe,RemoteFetcher:xIe,resolve:o((r,e)=>Ro(r,e).resolve(),"resolve"),extract:o((r,e,t)=>Ro(r,t).extract(e),"extract"),manifest:o((r,e)=>Ro(r,e).manifest(),"manifest"),packument:o((r,e)=>Ro(r,e).packument(),"packument"),tarball:vA}});var d3=g((o6e,f3)=>{var DIe=o(({visit:r,filter:e=o(()=>!0,"filter"),getChildren:t,tree:i})=>{let s=[],n=new Map,a=o(()=>{for(;s.length;){let h=s.shift(),f=c(h);if(EA(f))return f.then(()=>a())}return n.get(i)},"next"),c=o(h=>{if(n.has(h))return n.get(h);n.set(h,null);let f=r?r(h):h;if(EA(f)){let d=f.then(p=>(n.set(h,p),l(h)));return n.set(h,d),d}else return n.set(h,f),l(h)},"visitNode"),l=o(h=>{let f=t(h,n.get(h));return EA(f)?f.then(u):u(f)},"kidNodes"),u=o(h=>{h=(h||[]).filter(e),s.push(...h)},"processKids");return s.push(i),a()},"breadth"),EA=o(r=>r&&typeof r.then=="function","isPromise");f3.exports=DIe});var g3=g((c6e,p3)=>{var LIe=o(({visit:r,filter:e,getChildren:t,tree:i})=>{let s=[],n=new Map,a=o(()=>{for(;s.length;){let h=s.pop(),f=c(h);if(_A(f))return f.then(()=>a())}return n.get(i)},"next"),c=o(h=>{if(n.has(h))return n.get(h);n.set(h,null);let f=r?r(h):h;if(_A(f)){let d=f.then(p=>(n.set(h,p),l(h)));return n.set(h,d),d}else return n.set(h,f),l(h)},"visitNode"),l=o(h=>{let f=t(h,n.get(h));return _A(f)?f.then(u):u(f)},"kidNodes"),u=o(h=>{h=(h||[]).filter(e),s.push(...h)},"processKids");return s.push(i),a()},"depth"),_A=o(r=>r&&typeof r.then=="function","isPromise");p3.exports=LIe});var S3=g((u6e,y3)=>{var MIe=g3(),m3=o(({visit:r,leave:e,filter:t=o(()=>!0,"filter"),seen:i=new Map,getChildren:s,tree:n})=>{if(!e)return MIe({visit:r,filter:t,getChildren:s,tree:n});if(i.has(n))return i.get(n);i.set(n,null);let a=o(()=>{let h=r?r(n):n;if(bA(h)){let f=h.then(d=>(i.set(n,d),c()));return i.set(n,f),f}else return i.set(n,h),c()},"visitNode"),c=o(()=>{let h=s(n,i.get(n));return bA(h)?h.then(l):l(h)},"kidNodes"),l=o(h=>{let f=(h||[]).filter(t).map(d=>m3({visit:r,leave:e,filter:t,seen:i,getChildren:s,tree:d}));return f.some(bA)?Promise.all(f).then(u):u(f)},"processKids"),u=o(h=>{let f=e(i.get(n),h);return i.set(n,f),f},"leaveNode");return a()},"depth"),bA=o(r=>r&&typeof r.then=="function","isPromise");y3.exports=m3});var cs=g((f6e,w3)=>{w3.exports={breadth:d3(),depth:S3()}});var Wh=g((d6e,E3)=>{var{basename:v3,dirname:FIe}=require("path"),BIe=o((r,e)=>r.charAt(0)==="@"?`${r}/${e}`:e,"getName");E3.exports=r=>r?BIe(v3(FIe(r)),v3(r)):!1});var OA=g((g6e,T3)=>{var _3=require("path"),qIe=Wh(),{minimatch:Jh}=Rr(),jIe=wt(),{glob:$Ie}=Md();function UIe(r){let e=[],t=[];for(let i of r){let s=i.match(/^!+/);if(s&&(i=i.slice(s[0].length)),i=i.replace(/^\.?\/+/,""),s&&s[0].length%2===1)t.push(i);else{for(let a=0;a<t.length;++a){let c=t[a];Jh(i,c)&&t.splice(a,1)}e.push(i)}}for(let i of t)for(let s of Jh.match(e,i))e.splice(e.indexOf(s),1);return{patterns:e,negatedPatterns:t}}o(UIe,"appendNegatedPatterns");function b3(r){let e=Array.isArray(r.packages)?r.packages:r;if(!Array.isArray(e))throw xS({message:"workspaces config expects an Array",code:"EWORKSPACESCONFIG"});return UIe(e)}o(b3,"getPatterns");function O3(r,e){return r.name||qIe(e)}o(O3,"getPackageName");function VIe(r){return r=r.replace(/\\/g,"/"),r.endsWith("/")?r:`${r}/`}o(VIe,"getGlobPattern");function xS({Type:r=TypeError,message:e,code:t}){return Object.assign(new r(e),{code:t})}o(xS,"getError");function zIe(r){return new Map(Array.from(r,e=>e.reverse()))}o(zIe,"reverseResultMap");async function I3(r={}){if(!r||!r.pkg)throw xS({message:"mapWorkspaces missing pkg info",code:"EMAPWORKSPACESPKG"});r.cwd||(r.cwd=process.cwd());let{workspaces:e=[]}=r.pkg,{patterns:t,negatedPatterns:i}=b3(e),s=new Map;if(!t.length&&!i.length)return s;let n=new Map,a=o(()=>({...r,ignore:[...r.ignore||[],"**/node_modules/**",...i]}),"getGlobOpts"),c=await $Ie(t.map(h=>VIe(h)),a());c=c.sort((h,f)=>h.localeCompare(f,"en"));let l=[];for(let h of t)l.push(...c.filter(f=>Jh(f,h,{partial:!0,windowsPathsNoEscape:!0})));for(let h of l){let f;try{f=await jIe.normalize(_3.join(r.cwd,h))}catch(m){if(m.code==="ENOENT"||m.code==="ENOTDIR")continue;throw m}let d=O3(f.content,f.path),p=n.get(d);p||(p=new Set,n.set(d,p)),p.add(f.path)}let u=["must not have multiple workspaces with the same name"];for(let[h,f]of n)f.size>1?GIe(u,h,f):s.set(h,f.values().next().value);if(u.length>1)throw xS({Type:Error,message:u.join(`
69
+ `),code:"EDUPLICATEWORKSPACE"});return s}o(I3,"mapWorkspaces");function GIe(r,e,t){r.push(`package '${e}' has conflicts in the following paths:`);for(let i of t)r.push(" "+i)}o(GIe,"addDuplicateErrorMessages");I3.virtual=function(r={}){if(!r||!r.lockfile)throw xS({message:"mapWorkspaces.virtual missing lockfile info",code:"EMAPWORKSPACESLOCKFILE"});r.cwd||(r.cwd=process.cwd());let{packages:e={}}=r.lockfile,{workspaces:t=[]}=e[""]||{},i=new Map,{patterns:s,negatedPatterns:n}=b3(t);if(!s.length&&!n.length)return i;n.push("**/node_modules/**");let a=Object.keys(e);for(let c of n)for(let l of Jh.match(a,c))a.splice(a.indexOf(l),1);for(let c of s)for(let l of Jh.match(a,c)){let u=_3.join(r.cwd,l),h=O3(e[l],u);i.set(u,h)}return zIe(i)};T3.exports=I3});var wr=g((y6e,A3)=>{var R3=typeof Intl=="object"&&!!Intl,HIe=R3&&Intl.Collator,IA=new Map,WIe=o((r,e)=>{let t=new HIe(r,e);return(i,s)=>t.compare(i,s)},"collatorCompare"),JIe=o((r,e)=>(t,i)=>t.localeCompare(i,r,e),"localeCompare"),KIe=["sensitivity","numeric","ignorePunctuation","caseFirst"],{hasOwnProperty:YIe}=Object.prototype;A3.exports=(r,e={})=>{if(!r||typeof r!="string")throw new TypeError("locale required");let t=KIe.reduce((n,a)=>(YIe.call(e,a)&&(n[a]=e[a]),n),{}),i=`${r}
70
+ ${JSON.stringify(t)}`;if(IA.has(i))return IA.get(i);let s=R3?WIe(r,t):JIe(r,t);return IA.set(i,s),s}});var LS=g((w6e,C3)=>{var{log:ZIe}=se(),XIe=wr()("en"),QIe=o(({pkg:r,add:e,saveBundle:t,saveType:i})=>{for(let{name:s,rawSpec:n}of e){let a=i;a||(a=eTe(r,s)),a==="prod"?(Ao(r,"devDependencies",s,"dependencies"),Ao(r,"peerDependencies",s,"dependencies")):a==="dev"?Ao(r,"dependencies",s,"devDependencies"):a==="optional"?Ao(r,"peerDependencies",s,"optionalDependencies"):(Ao(r,"dependencies",s,"peerDependencies"),Ao(r,"optionalDependencies",s,"peerDependencies"));let c=Kh.get(a);if(r[c]=r[c]||{},(n!=="*"||r[c][s]===void 0)&&(r[c][s]=n),a==="optional"&&(r.dependencies=r.dependencies||{},r.dependencies[s]=r.optionalDependencies[s]),a==="peer"||a==="peerOptional"){let l=r.peerDependenciesMeta||{};a==="peer"&&l[s]&&l[s].optional?l[s].optional=!1:a==="peerOptional"&&(l[s]=l[s]||{},l[s].optional=!0,r.peerDependenciesMeta=l),r.devDependencies&&r.devDependencies[s]!==void 0&&(r.devDependencies[s]=r.peerDependencies[s])}if(t&&a!=="peer"&&a!=="peerOptional"){let l=new Set(r.bundleDependencies||[]);l.add(s),r.bundleDependencies=[...l].sort(XIe)}}return r},"add"),Kh=new Map([["dev","devDependencies"],["optional","optionalDependencies"],["prod","dependencies"],["peerOptional","peerDependencies"],["peer","peerDependencies"]]),eTe=o((r,e)=>{for(let t of Kh.keys())if(DS(r,Kh.get(t),e))return t==="peerOptional"&&(!DS(r,"peerDependenciesMeta",e)||!r.peerDependenciesMeta[e].optional)?"peer":t;return"prod"},"inferSaveType"),DS=o((r,e,t)=>r[e]&&Object.prototype.hasOwnProperty.call(r[e],t),"hasSubKey"),Ao=o((r,e,t,i)=>{DS(r,e,t)&&(i&&ZIe.warn("idealTree",`Removing ${e}.${t} in favor of ${i}.${t}`),delete r[e][t],e==="peerDependencies"&&r.peerDependenciesMeta&&(delete r.peerDependenciesMeta[t],Object.keys(r.peerDependenciesMeta).length||delete r.peerDependenciesMeta),Object.keys(r[e]).length||delete r[e])},"deleteSubKey"),tTe=o((r,e)=>{for(let t of new Set(Kh.values()))for(let i of e)Ao(r,t,i);return r.bundleDependencies&&(r.bundleDependencies=r.bundleDependencies.filter(t=>!e.includes(t)),r.bundleDependencies.length||delete r.bundleDependencies),r},"rm");C3.exports={add:QIe,rm:tTe,saveTypeMap:Kh,hasSubKey:DS}});var D3=g((E6e,x3)=>{var{satisfies:k3,simplifyRange:rTe}=$e(),P3={loose:!0,includePrerelease:!0},TA=wr()("en"),iTe=ye(),N3=new Map([["info",0],[0,"info"],["low",1],[1,"low"],["moderate",2],[2,"moderate"],["high",3],[3,"high"],["critical",4],[4,"critical"],[null,-1],[-1,null]]),RA=class{static{o(this,"Vuln")}#e=null;#t=null;#r=!0;constructor({name:e,advisory:t}){this.name=e,this.via=new Set,this.advisories=new Set,this.severity=null,this.effects=new Set,this.topNodes=new Set,this.nodes=new Set,this.addAdvisory(t),this.packument=t.packument,this.versions=t.versions}get fixAvailable(){return this.#r}set fixAvailable(e){this.#r=e;for(let t of this.via)t.fixAvailable!==e&&(e===!1||t.fixAvailable===!0||typeof e=="object"&&(typeof t.fixAvailable!="object"||!t.fixAvailable.isSemVerMajor))&&(t.fixAvailable=e)}get isDirect(){for(let e of this.nodes.values())for(let t of e.edgesIn)if(t.from.isProjectRoot||t.from.isWorkspace)return!0;return!1}testSpec(e){let t=iTe(e);if(!t.registry)return!0;t.subSpec&&(e=t.subSpec.rawSpec);for(let i of this.versions)if(k3(i,e)&&!k3(i,this.range,P3))return!1;return!0}toJSON(){return{name:this.name,severity:this.severity,isDirect:this.isDirect,via:[...this.advisories].map(e=>e.type==="metavuln"?e.dependency:{...e,versions:void 0,vulnerableVersions:void 0,id:void 0}).sort((e,t)=>TA(String(e.source||e),String(t.source||t))),effects:[...this.effects].map(e=>e.name).sort(TA),range:this.simpleRange,nodes:[...this.nodes].map(e=>e.location).sort(TA),fixAvailable:this.#r}}addVia(e){this.via.add(e),e.effects.add(this),this.fixAvailable=this.fixAvailable}deleteVia(e){this.via.delete(e),e.effects.delete(this)}deleteAdvisory(e){this.advisories.delete(e),this.severity=null,this.#e=null,this.#t=null;for(let i of this.advisories)this.addAdvisory(i);let t=new Set([...this.advisories].map(i=>i.dependency));for(let i of this.via)t.has(i.name)||this.deleteVia(i)}addAdvisory(e){this.advisories.add(e);let t=N3.get(e.severity);this.#e=null,this.#t=null,t>N3.get(this.severity)&&(this.severity=e.severity)}get range(){return this.#e||(this.#e=[...this.advisories].map(e=>e.range).join(" || ")),this.#e}get simpleRange(){if(this.#t&&this.#t===this.#e)return this.#t;let e=[...this.advisories][0].versions,t=this.range;return this.#t=rTe(e,t,P3),this.#e=this.#t,this.#t}isVulnerable(e){if(this.nodes.has(e))return!0;let{version:t}=e.package;if(!t)return!1;for(let i of this.advisories)if(i.testVersion(t))return this.nodes.add(e),!0;return!1}};x3.exports=RA});var Co=g((b6e,L3)=>{L3.exports={cacheFetches:Symbol.for("pacote.Fetcher._cacheFetches"),readPackageJson:Symbol.for("package.Fetcher._readPackageJson"),tarballFromResolved:Symbol.for("pacote.Fetcher._tarballFromResolved")}});var F3=g((O6e,M3)=>{var{resolve:AA}=require("node:path"),{tmpdir:sTe,homedir:nTe}=require("node:os");M3.exports=(r=!1)=>{let e=sTe(),t=process.getuid?process.getuid():process.pid,i=nTe()||AA(e,"npm-"+t),s=r||process.platform,n=s==="win32"?"npm-cache":".npm",a=s==="win32"&&process.env.LOCALAPPDATA||i;return{cacache:AA(a,n,"_cacache"),tufcache:AA(a,n,"_tuf")}}});var CA=g((I6e,B3)=>{var oTe=o((r,e)=>typeof e=="string"?{[r]:e}:e,"binObj"),aTe=o((r,e)=>{let t=oTe(r.name,r.bin),i=e.replace(/^[^\\/]*\//,"");for(let s of Object.entries(t))if(s[1]===i)return!0;return!1},"hasBin");B3.exports=(r,e)=>r&&r.bin?aTe(r,e):!1});var kA=g((R6e,q3)=>{var cTe=o(r=>{let e=r;for(;e.endsWith("/");)e=e.slice(0,-1);return e},"removeTrailingSlashes");q3.exports=cTe});var Wc=g((C6e,j3)=>{var{resolve:lTe}=require("node:path"),{stat:uTe,chmod:hTe}=require("node:fs/promises"),fTe=Qr(),dTe=As(),pTe=ko(),PA=Co(),NA=class extends pTe{static{o(this,"FileFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec}get types(){return["file"]}manifest(){return this.package?Promise.resolve(this.package):fTe.tmp.withTmp(this.cache,this.opts,e=>this.extract(e).then(()=>this[PA.readPackageJson](e)).then(t=>this.package={...t,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from}))}#e(e,t){return e.bin?Promise.all(Object.keys(e.bin).map(async i=>{let s=lTe(t,e.bin[i]);try{let n=await uTe(s),a=n.mode|73;if(a===n.mode)return;await hTe(s,a)}catch{}})):Promise.resolve()}extract(e){return super.extract(e).then(t=>this.package?t:this[PA.readPackageJson](e).then(i=>this.#e(i,e)).then(()=>t))}[PA.tarballFromResolved](){return new dTe.ReadStream(this.resolved)}packument(){return this.manifest().then(e=>({name:e.name,"dist-tags":{[this.defaultTag]:e.version},versions:{[e.version]:{...e,dist:{tarball:`file:${this.resolved}`,integrity:this.integrity&&String(this.integrity)}}}}))}};j3.exports=NA});var U3=g((P6e,$3)=>{var gTe=CA(),mTe=o(r=>({cwd:r._resolved,prefix:"package/",portable:!0,gzip:{level:9},filter:o((e,t)=>(gTe(r,e)&&(t.mode|=73),!0),"filter"),mtime:new Date("1985-10-26T08:15:00.000Z")}),"tarCreateOptions");$3.exports=mTe});var MS=g((x6e,G3)=>{var{resolve:yTe}=require("node:path"),STe=L0(),wTe=Ka(),vTe=Gu(),{Minipass:ETe}=ee(),_Te=ko(),bTe=Wc(),V3=Co(),z3=U3(),xA=class extends _Te{static{o(this,"DirFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec,this.tree=t.tree||null,this.Arborist=t.Arborist||null}static tarCreateOptions(e){return z3(e)}get types(){return["directory"]}#e(){return this.manifest().then(e=>{if(!e.scripts||!e.scripts.prepare||this.opts.ignoreScripts)return;let t=this.opts.foregroundScripts?"inherit":"pipe";return wTe({scriptShell:this.opts.scriptShell||void 0,pkg:e,event:"prepare",path:this.resolved,stdio:t,env:{npm_package_resolved:this.resolved,npm_package_integrity:this.integrity,npm_package_json:yTe(this.resolved,"package.json")}})})}[V3.tarballFromResolved](){if(!this.tree&&!this.Arborist)throw new Error("DirFetcher requires either a tree or an Arborist constructor to pack");let e=new ETe;e.resolved=this.resolved,e.integrity=this.integrity;let{prefix:t,workspaces:i}=this.opts;return this.#e().then(async()=>{if(!this.tree){let s=new this.Arborist({path:this.resolved});this.tree=await s.loadActual()}return STe(this.tree,{path:this.resolved,prefix:t,workspaces:i})}).then(s=>vTe.c(z3(this.package),s).on("error",n=>e.emit("error",n)).pipe(e)).catch(s=>e.emit("error",s)),e}manifest(){return this.package?Promise.resolve(this.package):this[V3.readPackageJson](this.resolved).then(e=>this.package={...e,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from})}packument(){return bTe.prototype.packument.apply(this)}};G3.exports=xA});var DA=g((L6e,OTe)=>{OTe.exports={name:"pacote",version:"21.0.1",description:"JavaScript package downloader",author:"GitHub Inc.",bin:{pacote:"bin/index.js"},license:"ISC",main:"lib/index.js",scripts:{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:{timeout:300,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/arborist":"^9.0.2","@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","hosted-git-info":"^9.0.0","mutate-fs":"^2.1.1",nock:"^13.2.4","npm-registry-mock":"^1.3.2",rimraf:"^6.0.1",tap:"^16.0.1"},files:["bin/","lib/"],keywords:["packages","npm","git"],dependencies:{"@npmcli/git":"^6.0.0","@npmcli/installed-package-contents":"^3.0.0","@npmcli/package-json":"^7.0.0","@npmcli/promise-spawn":"^8.0.0","@npmcli/run-script":"^10.0.0",cacache:"^20.0.0","fs-minipass":"^3.0.0",minipass:"^7.0.2","npm-package-arg":"^13.0.0","npm-packlist":"^10.0.1","npm-pick-manifest":"^10.0.0","npm-registry-fetch":"^19.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",sigstore:"^4.0.0",ssri:"^12.0.0",tar:"^7.4.3"},engines:{node:"^20.17.0 || >=22.9.0"},repository:{type:"git",url:"git+https://github.com/npm/pacote.git"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.4",windowsCI:!1,publish:"true"}}});var Yh=g((M6e,K3)=>{var ITe=ho(),{Minipass:TTe}=ee(),RTe=ko(),H3=Wc(),W3=Co(),J3=DA().version,LA=class extends RTe{static{o(this,"RemoteFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec;let i=new URL(this.resolved);this.replaceRegistryHost!=="never"&&(this.replaceRegistryHost==="always"||this.replaceRegistryHost===i.host)&&(this.resolved=new URL(i.pathname,this.registry).href);let s=this.spec.name?`${this.spec.name}@`:"";this.pkgid=t.pkgid?t.pkgid:`remote:${s}${this.resolved}`}get[W3.cacheFetches](){return!1}[W3.tarballFromResolved](){let e=new TTe;e.hasIntegrityEmitter=!0;let t={...this.opts,headers:this.#e(),spec:this.spec,integrity:this.integrity,algorithms:[this.pickIntegrityAlgorithm()]};return ITe(this.resolved,t).then(i=>{i.body.on("error",s=>e.emit("error",s)),i.body.on("integrity",s=>{this.integrity=s,e.emit("integrity",s)}),i.body.pipe(e)}).catch(i=>e.emit("error",i)),e}#e(){return{"user-agent":this.opts.userAgent||`pacote/${J3} node/${process.version}`,...this.opts.headers||{},"pacote-version":J3,"pacote-req-type":"tarball","pacote-pkg-id":this.pkgid,...this.integrity?{"pacote-integrity":String(this.integrity)}:{},...this.opts.headers||{}}}get types(){return["remote"]}packument(){return H3.prototype.packument.apply(this)}manifest(){return H3.prototype.manifest.apply(this)}};K3.exports=LA});var Z3=g((B6e,Y3)=>{var ATe=o((r,e)=>{if(r.hosted){let t=r.hosted,i={noCommittish:!0};return`${t.https&&t.auth?t.https(i):t.shortcut(i)}#${e}`}else return r.rawSpec.replace(/#.*$/,"")+`#${e}`},"addGitSha");Y3.exports=ATe});var Q3=g((j6e,X3)=>{var CTe=Qo();X3.exports=(r,e,t,i,s)=>{let n=r.endsWith(".js"),a=n?process.execPath:r,c=(n?[r]:[]).concat(e);return CTe(a,c,{cwd:t,env:i},s)}});var FA=g(($6e,i5)=>{var kTe=Qr(),FS=NE(),PTe=ye(),NTe=ep(),{Minipass:xTe}=ee(),{log:e5}=se(),DTe=MS(),LTe=ko(),t5=Wc(),MTe=Yh(),BS=Co(),FTe=Z3(),BTe=Q3(),qTe=/^[a-f0-9]{40}$/,qS=o((r,e)=>r.sshurl&&!(r.https&&r.auth)&&r5(r.sshurl(e))||r.https&&r5(r.https(e)),"repoUrl"),r5=o(r=>r&&`git+${r}`.replace(/^(git\+)+/,"git+"),"addGitPlus"),MA=class extends LTe{static{o(this,"GitFetcher")}constructor(e,t){super(e,t),this.opts.integrity&&(delete this.opts.integrity,e5.warn(`skipping integrity check for git dependency ${this.spec.fetchSpec}`)),this.resolvedRef=null,this.spec.hosted&&(this.from=this.spec.hosted.shortcut({noCommittish:!1})),this.spec.gitCommittish&&qTe.test(this.spec.gitCommittish)?(this.resolvedSha=this.spec.gitCommittish,this.resolved=this.spec.hosted?qS(this.spec.hosted,{noCommittish:!1}):this.spec.rawSpec):this.resolvedSha="",this.Arborist=t.Arborist||null}static repoUrl(e,t){return qS(e,t)}get types(){return["git"]}resolve(){if(this.resolved)return super.resolve();let e=this.spec.hosted;return e?this.#e(e):this.#t(this.spec.fetchSpec)}#e(e){return this.#t(e.https&&e.https()).catch(t=>{if(t instanceof FS.errors.GitPathspecError)throw t;let i=e.sshurl&&e.sshurl();if(!i||e.auth)throw t;return this.#t(i)})}#t(e){if(!e)return Promise.reject(new Error(`No git url for ${this.spec}`));let t=this.spec.gitRange,i=this.spec.name;return FS.revs(e,this.opts).then(s=>t?NTe({versions:s.versions,"dist-tags":s["dist-tags"],name:i},t,this.opts):this.spec.gitCommittish?s.refs[this.spec.gitCommittish]||s.refs[s.shas[this.spec.gitCommittish]]:s.refs.HEAD).then(s=>!s||!s.sha?this.#s():(this.resolvedRef=s,this.resolvedSha=s.sha,this.#i(s.sha),this.resolved))}#r(e){this.resolved=this.spec.hosted?qS(PTe(e).hosted,{noCommittish:!1}):e}#i(e){this.#r(FTe(this.spec,e))}#s(){return this.#n(()=>this.resolved)}#o(e){return this[BS.readPackageJson](e).then(t=>{let i=t.scripts;if(!t.workspaces&&(!i||!(i.postinstall||i.build||i.preinstall||i.install||i.prepack||i.prepare)))return;let s=process.env._PACOTE_NO_PREPARE_?process.env._PACOTE_NO_PREPARE_.split(`
71
+ `):[];if(s.includes(this.resolved)){e5.info("prepare","skip prepare, already seen",this.resolved);return}return s.push(this.resolved),BTe(this.npmBin,[].concat(this.npmInstallCmd).concat(this.npmCliConfig),e,{...process.env,_PACOTE_NO_PREPARE_:s.join(`
72
+ `)},{message:"git dep preparation failed"})})}[BS.tarballFromResolved](){let e=new xTe;return e.resolved=this.resolved,e.from=this.from,this.#n(t=>this.#o(t).then(()=>new Promise((i,s)=>{if(!this.Arborist)throw new Error("GitFetcher requires an Arborist constructor to pack a tarball");let a=new DTe(`file:${t}`,{...this.opts,Arborist:this.Arborist,resolved:null,integrity:null})[BS.tarballFromResolved]();a.on("error",s),a.on("end",i),a.pipe(e)}))).catch(t=>e.emit("error",t)),e}#n(e,t=!0){let i={tmpPrefix:"git-clone"},s=this.resolvedSha||this.spec.gitCommittish,n=this.spec.hosted,a=this.resolved;return t=t&&n&&a===qS(n,{noCommittish:!1})&&n.tarball,kTe.tmp.withTmp(this.cache,i,async c=>{if(t){let u=this.spec.name?`${this.spec.name}@`:"";return new MTe(n.tarball({noCommittish:!1}),{...this.opts,allowGitIgnore:!0,pkgid:`git:${u}${this.resolved}`,resolved:this.resolved,integrity:null}).extract(c).then(()=>e(c),h=>{if(h.constructor.name.match(/^Http/))return this.#n(e,!1);throw h})}let l=await(n?this.#c(s,c):this.#a(this.spec.fetchSpec,s,c));return this.resolvedSha=l,this.resolved||await this.#i(l),e(c)})}#c(e,t){let i=this.spec.hosted;return this.#a(i.https({noCommittish:!0}),e,t).catch(s=>{if(s instanceof FS.errors.GitPathspecError)throw s;let n=i.sshurl&&i.sshurl({noCommittish:!0});if(!n||i.auth)throw s;return this.#a(n,e,t)})}#a(e,t,i){let{opts:s,spec:n}=this;return FS.clone(e,t,i,{...s,spec:n})}manifest(){return this.package?Promise.resolve(this.package):this.spec.hosted&&this.resolved?t5.prototype.manifest.apply(this):this.#n(e=>this[BS.readPackageJson](e).then(t=>this.package={...t,_resolved:this.resolved,_from:this.from}))}packument(){return t5.prototype.packument.apply(this)}};i5.exports=MA});var $A=g((V6e,c5)=>{var jTe=require("node:crypto"),s5=wt(),$Te=ep(),BA=Ft(),UTe=ye(),VTe=dA(),qA=ho(),zTe=ko(),GTe=Yh(),n5=DA().version,o5=kA(),a5=Co(),HTe="application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",WTe="application/json",JTe="2015-01-01T00:00:00.000Z",jA=class extends zTe{static{o(this,"RegistryFetcher")}#e;constructor(e,t){super(e,t),this.packumentCache=this.opts.packumentCache||null,this.registry=qA.pickRegistry(e,t),this.packumentUrl=`${o5(this.registry)}/${this.spec.escapedName}`,this.#e=`${this.fullMetadata?"full":"corgi"}:${this.packumentUrl}`;let i=new URL(this.registry),s=`//${i.host}${i.pathname}`;this.opts[`${s}:_keys`]&&(this.registryKeys=this.opts[`${s}:_keys`])}async resolve(){if(await this.manifest(),!this.resolved)throw Object.assign(new Error("Invalid package manifest: no `dist.tarball` field"),{package:this.spec.toString()});return this.resolved}#t(){return{"user-agent":this.opts.userAgent||`pacote/${n5} node/${process.version}`,...this.opts.headers||{},"pacote-version":n5,"pacote-req-type":"packument","pacote-pkg-id":`registry:${this.spec.name}`,accept:this.fullMetadata?WTe:HTe}}async packument(){if(this.packumentCache?.has(this.#e))return this.packumentCache.get(this.#e);try{let e=await qA(this.packumentUrl,{...this.opts,headers:this.#t(),spec:this.spec,integrity:null}),t=await e.json(),i=e.headers.get("content-length");return i&&(t._contentLength=Number(i)),this.packumentCache?.set(this.#e,t),t}catch(e){if(this.packumentCache?.delete(this.#e),e.code!=="E404"||this.fullMetadata)throw e;return this.fullMetadata=!0,this.packument()}}async manifest(){if(this.package)return this.package;this.opts.verifySignatures&&(this.fullMetadata=!0);let e=await this.packument(),t=s5.normalizeSteps.filter(a=>a!=="_attributes"),i=await new s5().fromContent($Te(e,this.spec.fetchSpec,{...this.opts,defaultTag:this.defaultTag,before:this.before})).normalize({steps:t}).then(a=>a.content),s=e.time?.[i.version];s&&(i._time=s);let{dist:n}=i;if(n){this.resolved=i._resolved=n.tarball,i._from=this.from;let a=n.integrity?BA.parse(n.integrity):n.shasum?BA.fromHex(n.shasum,"sha1",{...this.opts}):null;if(a){if(this.integrity&&!this.integrity.match(a)){for(let c of Object.keys(this.integrity))if(a[c])throw Object.assign(new Error(`Integrity checksum failed when using ${c}: wanted ${this.integrity} but got ${a}.`),{code:"EINTEGRITY"})}this.integrity=a}}if(this.integrity){if(i._integrity=String(this.integrity),n.signatures)if(this.opts.verifySignatures){let a=`${i._id}:${i._integrity}`;for(let c of n.signatures){let l=this.registryKeys&&this.registryKeys.filter(p=>p.keyid===c.keyid)[0];if(!l)throw Object.assign(new Error(`${i._id} has a registry signature with keyid: ${c.keyid} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let u=Date.parse(i._time||JTe);if(!(!l.expires||u<Date.parse(l.expires)))throw Object.assign(new Error(`${i._id} has a registry signature with keyid: ${c.keyid} but the corresponding public key has expired ${l.expires}`),{code:"EEXPIREDSIGNATUREKEY"});let f=jTe.createVerify("SHA256");if(f.write(a),f.end(),!f.verify(l.pemkey,c.sig,"base64"))throw Object.assign(new Error(`${i._id} has an invalid registry signature with keyid: ${l.keyid} and signature: ${c.sig}`),{code:"EINTEGRITYSIGNATURE",keyid:l.keyid,signature:c.sig,resolved:i._resolved,integrity:i._integrity})}i._signatures=n.signatures}else i._signatures=n.signatures;if(n.attestations)if(this.opts.verifyAttestations){let a=new URL(n.attestations.url).pathname,c=o5(this.registry)+a,l=await qA(c,{...this.opts,integrity:null}),{attestations:u}=await l.json(),h=u.map(({predicateType:p,bundle:m})=>{let y=JSON.parse(Buffer.from(m.dsseEnvelope.payload,"base64").toString("utf8")),w=m.dsseEnvelope.signatures[0].keyid,S=m.dsseEnvelope.signatures[0].sig;return{predicateType:p,bundle:m,statement:y,keyid:w,signature:S}}),f=h.map(p=>p.keyid).filter(p=>!!p),d=(this.registryKeys||[]).filter(p=>f.includes(p.keyid));if(!d.length)throw Object.assign(new Error(`${i._id} has attestations but no corresponding public key(s) can be found`),{code:"EMISSINGSIGNATUREKEY"});for(let{predicateType:p,bundle:m,keyid:y,signature:w,statement:S}of h){let v=d.find(O=>O.keyid===y);if(y){if(!v)throw Object.assign(new Error(`${i._id} has attestations with keyid: ${y} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let O=new Date(Number(m.verificationMaterial.tlogEntries[0].integratedTime)*1e3);if(!(!v.expires||O<Date.parse(v.expires)))throw Object.assign(new Error(`${i._id} has attestations with keyid: ${y} but the corresponding public key has expired ${v.expires}`),{code:"EEXPIREDSIGNATUREKEY"})}let _={name:S.subject[0].name,sha512:S.subject[0].digest.sha512},E=this.spec.type==="version"?UTe.toPurl(this.spec):this.spec;if(_.name!==E)throw Object.assign(new Error(`${i._id} package name and version (PURL): ${E} doesn't match what was signed: ${_.name}`),{code:"EATTESTATIONSUBJECT"});let b=BA.parse(this.integrity).hexDigest();if(_.sha512!==b)throw Object.assign(new Error(`${i._id} package integrity (hex digest): ${b} doesn't match what was signed: ${_.sha512}`),{code:"EATTESTATIONSUBJECT"});try{let O={tufCachePath:this.tufCache,tufForceCache:!0,keySelector:v?()=>v.pemkey:void 0};await VTe.verify(m,O)}catch(O){throw Object.assign(new Error(`${i._id} failed to verify attestation: ${O.message}`),{code:"EATTESTATIONVERIFY",predicateType:p,keyid:y,signature:w,resolved:i._resolved,integrity:i._integrity})}}i._attestations=n.attestations}else i._attestations=n.attestations}return this.package=i,this.package}[a5.tarballFromResolved](){return new GTe(this.resolved,{...this.opts,resolved:this.resolved,pkgid:`registry:${this.spec.name}@${this.resolved}`})[a5.tarballFromResolved]()}get types(){return["tag","version","range"]}};c5.exports=jA});var ko=g((G6e,p5)=>{var{basename:KTe,dirname:l5}=require("node:path"),{rm:YTe,mkdir:u5}=require("node:fs/promises"),f5=wt(),UA=Qr(),ZTe=As(),XTe=Dp(),d5=ye(),QTe=Cn(),VA=Ft(),eRe=Gu(),{Minipass:tRe}=ee(),{log:fn}=se(),Zh=Co(),h5=F3(),rRe=CA(),iRe=kA(),sRe=o(r=>f5.prepare(r).then(e=>e.content),"packageJsonPrepare"),nRe=o(r=>f5.normalize(r).then(e=>e.content),"packageJsonNormalize"),jS=class{static{o(this,"FetcherBase")}constructor(e,t){if(!t||typeof t!="object")throw new TypeError("options object is required");this.spec=d5(e,t.where),this.allowGitIgnore=!!t.allowGitIgnore,this.from=this.spec.registry?`${this.spec.name}@${this.spec.rawSpec}`:this.spec.saveSpec,this.#r(),this.opts={...t},this.cache=t.cache||h5().cacache,this.tufCache=t.tufCache||h5().tufcache,this.resolved=t.resolved||null,this.defaultIntegrityAlgorithm=t.defaultIntegrityAlgorithm||"sha512",typeof t.integrity=="string"&&(this.opts.integrity=VA.parse(t.integrity)),this.package=null,this.type=this.constructor.name,this.fmode=t.fmode||438,this.dmode=t.dmode||511,this.umask=t.umask||0,this.preferOnline=!!t.preferOnline,this.preferOffline=!!t.preferOffline,this.offline=!!t.offline,this.before=t.before,this.fullMetadata=this.before?!0:!!t.fullMetadata,this.fullReadJson=!!t.fullReadJson,this[Zh.readPackageJson]=this.fullReadJson?sRe:nRe,this.replaceRegistryHost=!t.replaceRegistryHost||t.replaceRegistryHost==="npmjs"?"registry.npmjs.org":t.replaceRegistryHost,this.defaultTag=t.defaultTag||"latest",this.registry=iRe(t.registry||"https://registry.npmjs.org"),this.npmBin=t.npmBin||"npm",this.npmInstallCmd=t.npmInstallCmd||["install","--force"],this.npmCliConfig=t.npmCliConfig||[`--cache=${l5(this.cache)}`,`--prefer-offline=${!!this.preferOffline}`,`--prefer-online=${!!this.preferOnline}`,`--offline=${!!this.offline}`,...this.before?[`--before=${this.before.toISOString()}`]:[],"--no-progress","--no-save","--no-audit","--include=dev","--include=peer","--include=optional","--no-package-lock-only","--no-dry-run"]}get integrity(){return this.opts.integrity||null}set integrity(e){if(!e)return;e=VA.parse(e);let t=this.opts.integrity;t?t.merge(e):this.opts.integrity=e}get notImplementedError(){return new Error("not implemented in this fetcher type: "+this.type)}resolve(){return this.resolved?Promise.resolve(this.resolved):Promise.reject(this.notImplementedError)}packument(){return Promise.reject(this.notImplementedError)}manifest(){return Promise.reject(this.notImplementedError)}[Zh.tarballFromResolved](){throw this.notImplementedError}tarball(){return this.tarballStream(e=>e.concat().then(t=>(t.integrity=this.integrity&&String(this.integrity),t.resolved=this.resolved,t.from=this.from,t)))}#e(){let e=Date.now(),t=UA.get.stream.byDigest(this.cache,this.integrity,this.opts),i=Date.now()-e;return fn.http("cache",`${this.spec} ${i}ms (cache hit)`),t}get[Zh.cacheFetches](){return!0}#t(e){if(!this.opts.cache||!this[Zh.cacheFetches]){if(e.hasIntegrityEmitter)return e.on("integrity",n=>this.integrity=n),e;let s=VA.integrityStream(this.opts);return s.on("integrity",n=>this.integrity=n),e.on("error",n=>s.emit("error",n)),e.pipe(s)}let t=new tRe;e.on("error",s=>t.emit("error",s)),e.pipe(t,{end:!1});let i=UA.put.stream(this.opts.cache,`pacote:tarball:${this.from}`,this.opts);return i.on("integrity",s=>this.integrity=s),i.on("error",s=>e.emit("error",s)),e.pipe(i),i.promise().catch(()=>{}).then(()=>t.end()),t}pickIntegrityAlgorithm(){return this.integrity?this.integrity.pickAlgorithm(this.opts):this.defaultIntegrityAlgorithm}isDataCorruptionError(e){return e.code==="EINTEGRITY"||e.code==="Z_DATA_ERROR"}get types(){return!1}#r(){if(this.types&&!this.types.includes(this.spec.type))throw new TypeError(`Wrong spec type (${this.spec.type}) for ${this.constructor.name}. Supported types: ${this.types.join(", ")}`)}isRetriableError(e){return this.isDataCorruptionError(e)||e.code==="ENOENT"||e.code==="EISDIR"}tarballStream(e){let t=!this.preferOnline&&this.integrity&&this.resolved?e(this.#e()).catch(s=>{if(this.isDataCorruptionError(s))return fn.warn("tarball",`cached data for ${this.spec} (${this.integrity}) seems to be corrupted. Refreshing cache.`),this.cleanupCached().then(()=>{throw s});throw s}):null,i=o(s=>{if(s){if(!this.isRetriableError(s))throw s;fn.silly("tarball",`no local data for ${this.spec}. Extracting by manifest.`)}return this.resolve().then(()=>QTe(n=>e(this.#t(this[Zh.tarballFromResolved]())).catch(a=>{if(this.isRetriableError(a))return fn.warn("tarball",`tarball data for ${this.spec} (${this.integrity}) seems to be corrupted. Trying again.`),this.cleanupCached().then(()=>n(a));throw a}),{retries:1,minTimeout:0,maxTimeout:0}))},"fromResolved");return t?t.catch(i):i()}cleanupCached(){return UA.rm.content(this.cache,this.integrity,this.opts)}#i(e){return XTe({path:e,depth:1}).then(t=>Promise.all(t.map(i=>YTe(i,{recursive:!0,force:!0}))))}async#s(e){return await this.#i(e),await u5(e,{recursive:!0})}async extract(e){return await this.#s(e),this.tarballStream(t=>this.#n(e,t))}#o(e){return this.tarballStream(t=>new Promise((i,s)=>{let n=new ZTe.WriteStream(e);t.on("error",a=>n.emit("error",a)),n.on("error",a=>s(a)),n.on("close",()=>i({integrity:this.integrity&&String(this.integrity),resolved:this.resolved,from:this.from})),t.pipe(n)}))}async tarballFile(e){let t=l5(e);return await u5(t,{recursive:!0}),this.#o(e)}#n(e,t){let i=eRe.x(this.#a({cwd:e})),s=new Promise((n,a)=>{i.on("end",()=>{n({resolved:this.resolved,integrity:this.integrity&&String(this.integrity),from:this.from})}),i.on("error",c=>{fn.warn("tar",c.message),fn.silly("tar",c),a(c)}),t.on("error",c=>a(c))});return t.pipe(i),s}#c(e,t,i){let s=/Directory|GNUDumpDir/.test(i)?this.dmode:/File$/.test(i)?this.fmode:0,n=rRe(this.package,e)?73:0;return(t|s)&~this.umask|n|384}#a({cwd:e}){let t=new Set;return{cwd:e,noChmod:!0,noMtime:!0,filter:o((i,s)=>{if(/Link$/.test(s.type))return!1;if(s.mode=this.#c(s.path,s.mode,s.type),/File$/.test(s.type)){let n=KTe(s.path);if(n===".npmignore")t.add(s.path);else if(n===".gitignore"&&!this.allowGitIgnore){let a=s.path.replace(/\.gitignore$/,".npmignore");if(t.has(a))return!1;s.path=a}return!0}},"filter"),strip:1,onwarn:o((i,s,n)=>{fn.warn("tar",i,s),fn.silly("tar",i,s,n)},"onwarn"),umask:this.umask,preserveOwner:!1}}};p5.exports=jS;var oRe=FA(),aRe=$A(),cRe=Wc(),lRe=MS(),uRe=Yh();jS.get=(r,e={})=>{let t=d5(r,e.where);switch(t.type){case"git":return new oRe(t,e);case"remote":return new uRe(t,e);case"version":case"range":case"tag":case"alias":return new aRe(t.subSpec||t,e);case"file":return new cRe(t,e);case"directory":return new lRe(t,e);default:throw new TypeError("Unknown spec type: "+t.type)}}});var m5=g((W6e,g5)=>{var{get:Po}=ko(),hRe=FA(),fRe=$A(),dRe=Wc(),pRe=MS(),gRe=Yh(),zA=o((r,e)=>Po(r,e).tarball(),"tarball");zA.stream=(r,e,t)=>Po(r,t).tarballStream(e);zA.file=(r,e,t)=>Po(r,t).tarballFile(e);g5.exports={GitFetcher:hRe,RegistryFetcher:fRe,FileFetcher:dRe,DirFetcher:pRe,RemoteFetcher:gRe,resolve:o((r,e)=>Po(r,e).resolve(),"resolve"),extract:o((r,e,t)=>Po(r,t).extract(e),"extract"),manifest:o((r,e)=>Po(r,e).manifest(),"manifest"),packument:o((r,e)=>Po(r,e).packument(),"packument"),tarball:zA}});var S5=g((K6e,y5)=>{var{createHash:mRe}=require("crypto");y5.exports=({name:r,source:e})=>mRe("sha512").update(JSON.stringify([r,e])).digest("base64")});var v5=g((Y6e,w5)=>{w5.exports=(r,e)=>{let{dependencies:t={},optionalDependencies:i={},peerDependencies:s={}}=r;return t&&typeof t[e]=="string"?t[e]:i&&typeof i[e]=="string"?i[e]:s&&typeof s[e]=="string"?s[e]:null}});var R5=g((Z6e,T5)=>{var yRe=S5(),vr=$e(),jr={includePrerelease:!0,loose:!0},SRe=v5(),Xh=Symbol("source"),Qh=Symbol("packument"),$S=Symbol("versionVulnMemo"),GA=Symbol("updated"),wRe=Symbol("options"),E5=Symbol("specVulnMemo"),_5=Symbol("testVersion"),b5=Symbol("testVersions"),O5=Symbol("calculateRange"),No=Symbol("markVulnerable"),I5=Symbol("testSpec"),HA=class{static{o(this,"Advisory")}constructor(e,t,i={}){this.source=t.id,this[Xh]=t,this[wRe]=i,this.name=e,t.name||(t.name=e),this.dependency=t.name,this.type==="advisory"?(this.title=t.title,this.url=t.url):(this.title=`Depends on vulnerable versions of ${t.name}`,this.url=null),this.severity=t.severity||"high",this.versions=[],this.vulnerableVersions=[],this.cwe=t.cwe,this.cvss=t.cvss,this.range=this.type==="advisory"?t.vulnerable_versions||"*":null,this.id=yRe(this),this[Qh]=null,this[$S]=new Map,this[E5]=new Map,this[GA]=!1}get updated(){return this[GA]}get type(){return this.dependency===this.name?"advisory":"metavuln"}get packument(){return this[Qh]}load(e,t){if(!e||typeof e!="object")throw new TypeError("invalid cached data, expected object");if(!t||typeof t!="object")throw new TypeError("invalid packument data, expected object");if(e.id&&e.id!==this.id)throw Object.assign(new Error("loading from incorrect cache entry"),{expected:this.id,actual:e.id});if(t.name!==this.name)throw Object.assign(new Error("loading from incorrect packument"),{expected:this.name,actual:t.name});if(this[Qh])throw new Error("advisory object already loaded");(!this.range||e.range&&e.range===this.range)&&Object.assign(this,e),this[Qh]=t;let i=Object.keys(t.versions||{}),s=new Set([...i,...this.versions]),n=[],a=[];for(let l of s)this.versions.includes(l)?i.includes(l)||a.push(l):(n.push(l),this.versions.push(l));this.versions=vr.sort(this.versions.filter(l=>!a.includes(l)),jr);let c=this.type==="advisory"?this.range&&this.range===e.range:!this[Xh].updated;return this.vulnerableVersions=c?vr.sort(this.vulnerableVersions.filter(l=>!a.includes(l)),jr):[],c&&!n.length&&!a.length?this:(this[GA]=!0,(!c||n.length)&&this[b5](c?n:this.versions),this.vulnerableVersions=vr.sort(this.vulnerableVersions,jr),this.type==="metavuln"&&this[O5](),this)}[O5](){let e=[];this.versions=vr.sort(this.versions,jr),this.vulnerableVersions=vr.sort(this.vulnerableVersions,jr);for(let i=0,s=0;i<this.versions.length;i++){let n=[this.versions[i]];for(;i<this.versions.length;){if(this.versions[i]!==this.vulnerableVersions[s]){if(/-/.test(this.versions[i])){i++;continue}break}n.length>1?n[1]=this.versions[i]:n.push(this.versions[i]),i++,s++}if(n.length>1){let a=this.versions[this.versions.length-1];e.push(n[1]===a?`>=${n[0]}`:n[0]===n[1]?n[0]:n.join(" - "))}}let t=e.join(" || ").trim();this.range=t?vr.simplifyRange(this.versions,t,jr):"<0.0.0-0"}testVersion(e,t=null){let i=String(e);if(this[$S].has(i))return this[$S].get(i);let s=this[_5](e,t);return s&&this[No](e),this[$S].set(i,!!s),s}[No](e){let t=String(e);this.vulnerableVersions.includes(t)||this.vulnerableVersions.push(t)}[_5](e,t){let i=String(e);if(this.vulnerableVersions.includes(i))return!0;if(this.type==="advisory")return vr.satisfies(e,this.range,jr);let s=this[Qh]?.versions?.[e]||{dependencies:{[this.dependency]:t}};if(t||(t=SRe(s,this.dependency)),t===null)return!1;if(!vr.validRange(t,jr))return!0;let n=s.bundleDependencies,a=n&&n.includes(this[Xh].name),c=this[Xh].range;return a?vr.intersects(t,c,jr):this[Xh].testSpec(t)}testSpec(e){let t=this[E5];if(t.has(e))return t.get(e);let i=this[I5](e);return t.set(e,i),i}[I5](e){for(let t of this.versions)if(vr.satisfies(t,e,jr)&&!this.testVersion(t))return!1;return!0}[b5](e){if(!e.length)return;let t=new Set;e=vr.sort(e.map(n=>vr.parse(n,jr)));let i=e[0].major+"."+e[0].minor,s=[];t.add(s);for(let n of e){let a=n.major+"."+n.minor;a!==i&&(i=a,s=[],t.add(s)),s.push(n)}for(let n of t){let a=0,c=this.testVersion(n[a]);for(;a<n.length&&/-/.test(String(n[a]));)a++;if(a===n.length)a=0;else if(c)for(let y=0;y<a;y++)this[No](n[y]);let l=n.length-1,u=this.testVersion(n[l]);for(;l>a&&/-/.test(String(n[l]));)l--;if(l===a)l=n.length-1;else if(u)for(let y=n.length-1;y>l;y--)this[No](n[y]);let h=a===0?c:this.testVersion(n[a]),f=l===n.length-1?u:this.testVersion(n[l]);if(h&&f){for(let y=a;y<l;y++)this[No](n[y]);continue}if(l<a+2)continue;let d=Math.floor(n.length/2),p=n.slice(0,d),m=n.slice(d);if(!/-/.test(String(p[0]))){let y=this.testVersion(p[p.length-1]);for(;/-/.test(String(p[p.length-1]));){let w=p.pop();y&&this[No](w)}}if(!/-/.test(String(m[m.length-1]))){let y=this.testVersion(m[0]);for(;/-/.test(String(m[0]));){let w=m.shift();y&&this[No](w)}}t.add(p),t.add(m)}}};T5.exports=HA});var L5=g((Q6e,D5)=>{var vRe=m5(),A5=Qr(),{time:ef}=se(),ERe=R5(),{homedir:_Re}=require("os"),C5=ml(),k5=Symbol("packument"),P5=Symbol("cachePut"),N5=Symbol("cacheGet"),Jc=Symbol("cacheData"),tf=Symbol("packuments"),rf=Symbol("cache"),dn=Symbol("options"),sf=Symbol("advisories"),x5=Symbol("calculate"),WA=class{static{o(this,"Calculator")}constructor(e={}){this[dn]={...e},this[rf]=this[dn].cache||_Re()+"/.npm/_cacache",this[dn].cache=this[rf],this[tf]=new Map,this[Jc]=new Map,this[sf]=new Map}get cache(){return this[rf]}get options(){return{...this[dn]}}async calculate(e,t){let i=`security-advisory:${e}:${t.id}`;if(this[sf].has(i))return this[sf].get(i);let s=this[x5](e,t);return this[sf].set(i,s),s}async[x5](e,t){let i=`security-advisory:${e}:${t.id}`,s=ef.start(`metavuln:calculate:${i}`),n=new ERe(e,t,this[dn]),[a,c]=await Promise.all([this[N5](n),this[k5](e)]),l=ef.start(`metavuln:load:${i}`);return n.load(a,c),l(),n.updated&&await this[P5](n),this[sf].set(i,n),s(),n}async[P5](e){let{name:t,id:i}=e,s=`security-advisory:${t}:${i}`,n=ef.start(`metavuln:cache:put:${s}`),a=JSON.stringify(e),c={...this[dn]};this[Jc].set(s,C5(a)),await A5.put(this[rf],s,a,c).catch(()=>{}),n()}async[N5](e){let{name:t,id:i}=e,s=`security-advisory:${t}:${i}`;if(this[Jc].has(s))return this[Jc].get(s);let n=ef.start(`metavuln:cache:get:${s}`),a=A5.get(this[rf],s,{...this[dn]}).catch(()=>({data:"{}"})).then(({data:c})=>(c=C5(c),n(),this[Jc].set(s,c),c));return this[Jc].set(s,a),a}async[k5](e){if(this[tf].has(e))return this[tf].get(e);let t=ef.start(`metavuln:packument:${e}`),i=vRe.packument(e,{...this[dn]}).catch(()=>({name:e,versions:{}})).then(s=>(t(),this[tf].set(e,s),s));return this[tf].set(e,i),i}};D5.exports=WA});var KA=g((tJe,F5)=>{var bRe=wr()("en"),ORe=ye(),IRe=Zu(),TRe=D3(),RRe=L5(),{log:US,time:M5}=se(),ARe=ho(),JA=class r extends Map{static{o(this,"AuditReport")}#e;error=null;topVulns=new Map;static load(e,t){return new r(e,t).run()}get auditReportVersion(){return 2}toJSON(){let e={auditReportVersion:this.auditReportVersion,vulnerabilities:{},metadata:{vulnerabilities:{info:0,low:0,moderate:0,high:0,critical:0,total:this.size},dependencies:{prod:0,dev:0,optional:0,peer:0,peerOptional:0,total:this.tree.inventory.size-1}}};for(let i of this.tree.inventory.values()){let{dependencies:s}=e.metadata,n=!0;for(let a of["dev","optional","peer","peerOptional"])i[a]&&(s[a]++,n=!1);n&&s.prod++}let t=[];for(let[i,s]of this.entries())t.push([i,s.toJSON()]),e.metadata.vulnerabilities[s.severity]++;return e.vulnerabilities=t.sort(([i],[s])=>bRe(i,s)).reduce((i,[s,n])=>(i[s]=n,i),{}),e}constructor(e,t={}){super(),this.#e=new Set(t.omit||[]),this.calculator=new RRe(t),this.options=t,this.tree=e,this.filterSet=t.filterSet}async run(){return this.report=await this.#i(),US.silly("audit report",this.report),this.report&&await this.#t(),this}isVulnerable(e){let t=this.get(e.packageName);return!!(t&&t.isVulnerable(e))}async#t(){let e=M5.start("auditReport:init"),t=[];for(let[n,a]of Object.entries(this.report))for(let c of a)t.push(this.calculator.calculate(n,c));let i=new Set(await Promise.all(t)),s=new Set;for(let n of i){let{name:a,range:c}=n,l=`${a}@${c}`,u=this.get(a)||new TRe({name:a,advisory:n});if(this.has(a)&&u.addAdvisory(n),super.set(a,u),!s.has(l)){let h=[];for(let f of this.tree.inventory.query("packageName",a))if(this.shouldAudit(f)&&n.testVersion(f.version)&&(n.type==="metavuln"&&u.addVia(this.get(n.dependency)),!u.nodes.has(f))){u.nodes.add(f);for(let{from:d,spec:p}of f.edgesIn)if(d.isTop&&!u.topNodes.has(d))u.fixAvailable=this.#r(u,p),u.fixAvailable!==!0&&(this.topVulns.set(u.name,u),u.topNodes.add(d));else{let m=this.calculator.calculate(d.packageName,n);h.push(m.then(y=>{y.testVersion(d.version,p)&&i.add(y)}))}}await Promise.all(h),s.add(l)}if(this.get(a).nodes.size===0){this.delete(a);continue}for(let h of u.advisories)[...u.nodes].some(d=>h.testVersion(d.version))||u.deleteAdvisory(h)}e()}#r(e,t){if(!e.testSpec(t))return!0;let i=ORe(t);if(!i.registry)return!1;i.subSpec&&(t=i.subSpec.rawSpec);try{let{_isSemVerMajor:s,version:n,name:a}=IRe(e.packument,t,{...this.options,before:null,avoid:e.range,avoidStrict:!0});return{name:a,version:n,isSemVerMajor:s}}catch{return!1}}set(){throw new Error("do not call AuditReport.set() directly")}async#i(){if(this.options.audit===!1||this.options.offline===!0||this.tree.inventory.size===1)return null;let e=M5.start("auditReport:getReport");try{let t=this.prepareBulkData();return US.silly("audit","bulk request",t),Object.keys(t).length?await(await ARe("/-/npm/v1/security/advisories/bulk",{...this.options,registry:this.options.auditRegistry||this.options.registry,method:"POST",gzip:!0,body:t})).json():null}catch(t){return US.verbose("audit error",t),US.silly("audit error",String(t.body)),this.error=t,null}finally{e()}}shouldAudit(e){return!e.version||e.isRoot||this.filterSet&&this.filterSet?.size!==0&&!this.filterSet?.has(e)?!1:this.#e.size===0?!0:!e.shouldOmit(this.#e)}prepareBulkData(){let e={};for(let t of this.tree.inventory.query("packageName")){let i=new Set;for(let s of this.tree.inventory.query("packageName",t))this.shouldAudit(s)&&i.add(s.version);i.size&&(e[t]=[...i])}return e}};F5.exports=JA});var Oi=g((iJe,B5)=>{var{relative:CRe}=require("node:path"),kRe=o((r,e)=>CRe(r,e).replace(/\\/g,"/"),"relpath");B5.exports=kRe});var j5=g((nJe,q5)=>{var{LRUCache:PRe}=Pi(),{getHeapStatistics:NRe}=require("node:v8"),{log:xRe}=se(),YA=class r extends PRe{static{o(this,"PackumentCache")}static#e=Math.floor(NRe().heap_size_limit);#t;#r=new Set;#i(...e){xRe.silly("packumentCache",...e)}constructor({heapFactor:e=.25,maxEntryFactor:t=.5,sizeKey:i="_contentLength"}={}){let s=Math.floor(r.#e*e),n=Math.floor(s*t);super({maxSize:s,maxEntrySize:n,sizeCalculation:o(a=>a[i]?a[i]<1e4?a[i]*2:a[i]<1e6?Math.floor(a[i]*1.5):n+1:n+1,"sizeCalculation"),dispose:o((a,c)=>{this.#r.add(c),this.#i(c,"dispose")},"dispose")}),this.#t=i,this.#i(`heap:${r.#e} maxSize:${s} maxEntrySize:${n}`)}set(e,t,...i){let s=this.#r.has(e);return s&&this.#r.delete(e),this.#i(e,"set",`size:${t[this.#t]} disposed:${s}`),super.set(e,t,...i)}has(e,...t){let i=super.has(e,...t);return this.#i(e,`cache-${i?"hit":"miss"}`),i}};q5.exports=YA});var z5=g((aJe,V5)=>{var DRe=require("events"),$5=Symbol("onProgress"),Kc=Symbol("bars"),ls=Symbol("listener"),U5=Symbol("normData"),ZA=class extends DRe{static{o(this,"Client")}constructor({normalize:e=!1,stopOnDone:t=!1}={}){super(),this.normalize=!!e,this.stopOnDone=!!t,this[Kc]=new Map,this[ls]=null}get size(){return this[Kc].size}get listening(){return!!this[ls]}addListener(...e){return this.on(...e)}on(e,...t){return e==="progress"&&!this[ls]&&this.start(),super.on(e,...t)}off(e,...t){return this.removeListener(e,...t)}removeListener(e,...t){let i=super.removeListener(e,...t);return e==="progress"&&this.listeners(e).length===0&&this.stop(),i}stop(){this[ls]&&(process.removeListener("progress",this[ls]),this[ls]=null)}start(){this[ls]||(this[ls]=(...e)=>this[$5](...e),process.on("progress",this[ls]))}[$5](e,t){t=this[U5](e,t),this[Kc].has(e)||this.emit("bar",e,t),this[Kc].set(e,t),this.emit("progress",e,t),t.done&&(this[Kc].delete(e),this.emit("barDone",e,t),this.size===0&&(this.stopOnDone&&this.stop(),this.emit("done")))}[U5](e,t){let i=t.value,s=t.total,n=i,a=s,c=t.done||n>=a;if(this.normalize){let l=this[Kc].get(e);if(a=100,c)n=100;else{let u=100*i/s;l&&(n=u>l.value?u:(100-l.value)/100+l.value)}}return{...t,key:e,name:t.name||e,value:n,total:a,actualValue:i,actualTotal:s,done:c}}};V5.exports=ZA});var H5=g((lJe,G5)=>{var LRe=require("events"),XA=class extends LRe{static{o(this,"Tracker")}constructor(e,t,i){if(super(),!e)throw new Error("proggy: Tracker needs a name");typeof t=="number"&&!i&&(i=t,t=null),i||(i=100),t||(t=e),this.done=!1,this.name=e,this.key=t,this.value=0,this.total=i}finish(e={}){this.update(this.total,this.total,e)}update(e,t,i){if(i||(t&&typeof t=="object"?i=t:i={}),typeof t!="number"&&(t=this.total),this.done){let n=`proggy: updating completed tracker: ${JSON.stringify(this.key)}`;throw new Error(n)}this.value=e,this.total=t;let s=this.value>=this.total;process.emit("progress",this.key,{...i,name:this.name,key:this.key,value:e,total:t,done:s}),s&&(this.done=!0,this.emit("done"))}};G5.exports=XA});var W5=g(xo=>{xo.Client=z5();xo.Tracker=H5();var QA=new Map;xo.createTracker=(r,e,t)=>{let i=new xo.Tracker(r,e,t);if(QA.has(i.key)){let s=`proggy: duplicate progress id ${JSON.stringify(i.key)}`;throw new Error(s)}return QA.set(i.key,i),i.on("done",()=>QA.delete(i.key)),i};xo.createClient=(r={})=>new xo.Client(r)});var K5=g((dJe,J5)=>{var MRe=W5();J5.exports=r=>class extends r{static{o(this,"Tracker")}#e=new Map;#t(t,i){let s=new MRe.Tracker(i??t);s.on("done",()=>this.#e.delete(t)),this.#e.set(t,s)}addTracker(t,i=null,s=null){t==null&&this.#r("Tracker can't be null or undefined"),s===null&&(s=i);let n=this.#e.has(t),a=this.#e.has(`${t}:${s}`);if(n&&i===null)this.#r(`Tracker "${t}" already exists`);else if(!n&&i===null)this.#t(t);else if(!n&&i!==null)this.#r(`Parent tracker "${t}" does not exist`);else if(!n||!a){let c=this.#e.get(t);c.update(c.value,c.total+1),this.#t(`${t}:${s}`,`${t}:${i}`)}}finishTracker(t,i=null,s=null){t==null&&this.#r("Tracker can't be null or undefined"),s===null&&(s=i);let n=this.#e.has(t),a=this.#e.has(`${t}:${s}`);if(n&&i===null){let c=this.#e.keys();for(let l of c)l.match(new RegExp(t+":"))&&this.finishTracker(t,l);this.#e.get(t).finish()}else if(!n&&i===null)this.#r(`Tracker "${t}" does not exist`);else if(!n||a){let c=this.#e.get(t);c.update(c.value+1),this.#e.get(`${t}:${s}`).finish()}}#r(t){throw new Error(t)}}});var VS=g(Ii=>{"use strict";var FRe=Ii&&Ii.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,s)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),BRe=Ii&&Ii.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),qRe=Ii&&Ii.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&FRe(e,r,t);return BRe(e,r),e};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.callLimit=void 0;var eC=qRe(require("node:os")),jRe="availableParallelism"in eC?Math.max(1,eC.availableParallelism()-1):Math.max(1,eC.cpus().length-1),$Re=o((r,{limit:e=jRe,rejectLate:t}={})=>new Promise((i,s)=>{let n=0,a=0,c=[],l=!1,u,h=o(m=>{l||(l=!0,u??=m,t||s(u))},"reject"),f=!1,d=o(()=>{f||n>0||(f=!0,i(c))},"resolve"),p=o(()=>{let m=a++;if(m>=r.length)return l?h():d();n++;let y=r[m];if(!y)throw new Error("walked off queue");c[m]=y().then(w=>(n--,c[m]=w,w),w=>{n--,h(w)}).then(w=>l&&n===0?s(u):(p(),w))},"run");for(let m=0;m<e;m++)p()}),"callLimit");Ii.callLimit=$Re});var tC=g((yJe,Z5)=>{var{lstat:URe,readlink:VRe}=require("node:fs/promises"),{resolve:nf,basename:zRe,dirname:GRe}=require("node:path"),zS=o((r,e,t,i)=>{if(i>2e3)throw Y5(r);if(r=nf(r),e.has(r))return Promise.resolve(e.get(r));let s=GRe(r),n=zRe(r);return n&&e.has(s)?WRe(s,n,e,t,i):n?zS(s,e,t,i+1).then(()=>zS(r,e,t,i+1)):(e.set(s,s),Promise.resolve(s))},"realpathCached"),HRe=o((r,e)=>{if(e.has(r))return Promise.resolve(e.get(r));let t=URe(r).then(i=>(e.set(r,i),i));return e.set(r,t),t},"lstatCached"),Y5=o(r=>Object.assign(new Error(`ELOOP: too many symbolic links encountered, stat '${r}'`),{errno:-62,syscall:"stat",code:"ELOOP",path:r}),"eloop"),WRe=o((r,e,t,i,s)=>{let n=t.get(r);if(typeof n>"u")throw new Error("in realpathChild without parent being in realpath cache");let a=nf(n,e);return HRe(a,i).then(c=>c.isSymbolicLink()?VRe(a).then(l=>{let u=nf(n,l);if(a===u)throw Y5(a);return zS(u,t,i,s+1)}).then(l=>(t.set(nf(r,e),l),l)):(t.set(nf(r,e),a),a))},"realpathChild");Z5.exports=zS});var pn=g((wJe,GS)=>{var JRe=process.env.ARBORIST_DEBUG!=="0"&&(process.env.ARBORIST_DEBUG==="1"||/\barborist\b/.test(process.env.NODE_DEBUG||"")||process.env.npm_package_name==="@npmcli/arborist"&&["test","snap"].includes(process.env.npm_lifecycle_event)||process.cwd()===require("node:path").resolve(__dirname,".."));GS.exports=JRe?r=>r():()=>{};var KRe=process.stderr.isTTY?r=>`\x1B[31m${r}\x1B[39m`:r=>r;GS.exports.log=(...r)=>GS.exports(()=>{let{format:e}=require("node:util"),t=`
73
+ ${process.pid} ${KRe(e(r.shift()))} `;r=(t+e(...r).trim().split(`
74
+ `).join(t)).trim()})});var Yc=g((vJe,rC)=>{var YRe=pn(),ZRe=o((r,e=!0)=>{let t=[["START TREE CHECK",r.path]];if(!r.root||!r.root.inventory)return r;let{inventory:i}=r.root,s=new Set,n=o((a,c=r,l="self")=>{if(t.push(["CHECK",a&&a.location,c&&c.location,l,"seen="+s.has(a),"promise="+!!(a&&a.then),"root="+!!(a&&a.isRoot)]),!a||s.has(a)||a.then)return;if(s.add(a),a.isRoot&&a!==r.root)throw Object.assign(new Error("double root"),{node:a.path,realpath:a.realpath,tree:r.path,root:r.root.path,via:c.path,viaType:l,log:t});if(a.root!==r.root)throw Object.assign(new Error("node from other root in tree"),{node:a.path,realpath:a.realpath,tree:r.path,root:r.root.path,via:c.path,viaType:l,otherRoot:a.root&&a.root.path,log:t});if(!a.isRoot&&a.inventory.size!==0)throw Object.assign(new Error("non-root has non-zero inventory"),{node:a.path,tree:r.path,root:r.root.path,via:c.path,viaType:l,inventory:[...a.inventory.values()].map(p=>[p.path,p.location]),log:t});if(!a.isRoot&&!i.has(a)&&!a.dummy)throw Object.assign(new Error("not in inventory"),{node:a.path,tree:r.path,root:r.root.path,via:c.path,viaType:l,log:t});let u=[...a.edgesOut.values()].filter(p=>p.dev);if(!a.isTop&&u.length)throw Object.assign(new Error("dev edges on non-top node"),{node:a.path,tree:r.path,root:r.root.path,via:c.path,viaType:l,devEdges:u.map(p=>[p.type,p.name,p.spec,p.error]),log:t});if(a.path===r.root.path&&a!==r.root&&!r.root.isLink)throw Object.assign(new Error("node with same path as root"),{node:a.path,tree:r.path,root:r.root.path,via:c.path,viaType:l,log:t});if(!a.isLink&&a.path!==a.realpath)throw Object.assign(new Error("non-link with mismatched path/realpath"),{node:a.path,tree:r.path,realpath:a.realpath,root:r.root.path,via:c.path,viaType:l,log:t});let{parent:h,fsParent:f,target:d}=a;n(h,a,"parent"),n(f,a,"fsParent"),n(d,a,"target"),t.push(["CHILDREN",a.location,...a.children.keys()]);for(let p of a.children.values())n(p,a,"children");for(let p of a.fsChildren)n(p,a,"fsChildren");for(let p of a.linksIn)n(p,a,"linksIn");for(let p of a.tops)n(p,a,"tops");t.push(["DONE",a.location])},"check");if(n(r),e){for(let a of i.values())if(!s.has(a)&&a!==r.root)throw Object.assign(new Error("unreachable in inventory"),{node:a.path,realpath:a.realpath,location:a.location,root:r.root.path,tree:r.path,log:t})}return r},"checkTree");rC.exports=r=>r;YRe(()=>rC.exports=ZRe)});var iC=g((_Je,X5)=>{var XRe=o(r=>{let e=new Set([r]);for(let i of e){for(let s of i.edgesOut.values())s.valid&&s.peer&&s.to&&e.add(s.to);for(let s of i.edgesIn)s.valid&&s.peer&&e.add(s.from)}let t=new Map;for(let i of e)for(let s of i.edgesIn)if(s.valid&&(!s.peer||s.from.isTop)){let n=new Set([i]);for(let a of n)for(let c of a.edgesOut.values())c.valid&&c.peer&&c.to&&n.add(c.to);n.has(r)&&t.set(s,n)}return t},"peerEntrySets");X5.exports=XRe});var sC=g((OJe,Q5)=>{var QRe=o((r,e)=>{for(let t of r.ancestry()){if(t.isProjectRoot||!t.resolveParent||t.globalTop)return t;let i=t.edgesOut.get(e);if(!i||!i.peer)return t}},"deepestNestingTarget");Q5.exports=QRe});var uC=g((TJe,t4)=>{var e4=wr()("en"),eAe=$e(),nC=pn(),tAe=iC(),oC=sC(),Er=Symbol("CONFLICT"),aC=Symbol("OK"),Do=Symbol("REPLACE"),cC=Symbol("KEEP"),lC=class r{static{o(this,"CanPlaceDep")}constructor(e){let{dep:t,target:i,edge:s,preferDedupe:n,parent:a=null,peerPath:c=[],explicitRequest:l=!1}=e;nC(()=>{if(!t)throw new Error("no dep provided to CanPlaceDep");if(!i)throw new Error("no target provided to CanPlaceDep");if(!s)throw new Error("no edge provided to CanPlaceDep");this._treeSnapshot=JSON.stringify([...i.root.inventory.entries()].map(([u,{packageName:h,version:f,resolved:d}])=>[u,h,f,d]).sort(([u],[h])=>e4(u,h)))}),this.canPlace=null,this.canPlaceSelf=null,this.dep=t,this.target=i,this.edge=s,this.explicitRequest=l,this.peerPath=c,this.preferDedupe=!!n||s.peer,this.parent=a,this.children=[],this.isSource=i===this.peerSetSource,this.name=s.name,this.current=i.children.get(this.name),this.targetEdge=i.edgesOut.get(this.name),this.conflicts=new Map,this.edgeOverride=!t.satisfies(s),this.canPlace=this.checkCanPlace(),this.canPlaceSelf||(this.canPlaceSelf=this.canPlace),nC(()=>{let u=JSON.stringify([...i.root.inventory.entries()].map(([h,{packageName:f,version:d,resolved:p}])=>[h,f,d,p]).sort(([h],[f])=>e4(h,f)));if(this._treeSnapshot!==u)throw Object.assign(new Error("tree changed in CanPlaceDep"),{expect:this._treeSnapshot,actual:u})})}checkCanPlace(){let{target:e,targetEdge:t,current:i,dep:s}=this;return s.errors.length?i?Do:aC:t&&t.peer&&!e.isTop||!i&&t&&!s.satisfies(t)&&t!==this.edge?Er:i?this.checkCanPlaceCurrent():this.checkCanPlaceNoCurrent()}checkCanPlaceCurrent(){let{preferDedupe:e,explicitRequest:t,current:i,target:s,edge:n,dep:a}=this;if(a.matches(i)&&(i.satisfies(n)||this.edgeOverride))return t?Do:cC;let{version:c}=i,{version:l}=a,u=c&&l&&eAe.gte(l,c);if(u&&a.canReplace(i)){let d=this.canPlacePeers(Do);if(d!==Er)return d}if(i.satisfies(n)&&(!t||e))return cC;if(e&&!u&&a.canReplace(i)){let d=this.canPlacePeers(Do);if(d!==Er)return d}let h=this.deepestNestingTarget;if(s!==h)return Er;if(!n.peer&&s===n.from)return this.canPlacePeers(Do);if(!this.parent&&!n.peer)return Er;let f=!0;for(let[d,p]of tAe(i)){if(d===this.edge||d===this.peerEntryEdge)continue;let m=d.to,y=a.parent.children.get(m.name);if(y&&y.canReplace(m,a.parent.children.keys()))continue;let w=!y;if(!y){let v=new Set([m]);e:for(let _ of v)for(let E of _.edgesOut.values()){if(!E.peer||!E.valid)continue;let b=a.parent.children.get(E.name);if(!b){E.to&&v.add(E.to);continue}if(!b.satisfies(E)){w=!1;break e}}}if(w)continue;let S=!0;for(let v of p){if(!S)break;let _=oC(d.from,v.name);(_===s||s.isDescendantOf(_))&&(S=!1,f=!1)}}return f?this.canPlacePeers(Do):Er}checkCanPlaceNoCurrent(){let{target:e,peerEntryEdge:t,dep:i,name:s}=this,n=e!==t.from&&e.resolve(s);if(n){for(let a of n.edgesIn.values())if(a.from.isDescendantOf(e)&&a.valid&&!i.satisfies(a))return Er}return this.canPlacePeers(aC)}get deepestNestingTarget(){let e=this.parent?this.parent.deepestNestingTarget:this.edge.from;return oC(e,this.name)}get conflictChildren(){return this.allChildren.filter(e=>e.canPlace===Er)}get allChildren(){let e=new Set(this.children);for(let t of e)for(let i of t.children)e.add(i);return[...e]}get top(){return this.parent?this.parent.top:this}canPlacePeers(e){if(this.canPlaceSelf=e,this._canPlacePeers)return this._canPlacePeers;let t=[...this.peerPath,this.dep],i=!1;for(let s of this.dep.edgesOut.values()){if(!s.peer||!s.to||t.includes(s.to))continue;let n=s.to,a=oC(this.target,n.name),c=new r({dep:n,target:a,parent:this,edge:s,peerPath:t,preferDedupe:!0});nC(()=>{if(this.children.some(l=>l.dep===c.dep))throw new Error("checking same dep repeatedly")}),this.children.push(c),c.canPlace===Er&&(i=!0)}return this._canPlacePeers=i?Er:e,this._canPlacePeers}get peerSetSource(){return this.parent?this.parent.peerSetSource:this.edge.from}get peerEntryEdge(){return this.top.edge}static get CONFLICT(){return Er}static get OK(){return aC}static get REPLACE(){return Do}static get KEEP(){return cC}get description(){let{canPlace:e}=this;return e&&e.description||e}};t4.exports=lC});var Zc=g((AJe,r4)=>{var rAe=process.env.__TESTING_BIN_LINKS_PLATFORM__||process.platform;r4.exports=rAe==="win32"});var fC=g((CJe,s4)=>{var{dirname:i4,basename:iAe}=require("path"),hC=new Map;s4.exports=r=>{if(hC.has(r))return hC.get(r);let e=i4(r),t=iAe(e)==="node_modules"?e:i4(e);return hC.set(r,t),t}});var dC=g((kJe,n4)=>{var{dirname:sAe}=require("path"),nAe=fC();n4.exports=r=>sAe(nAe(r))});var HS=g((PJe,a4)=>{var oAe=Zc(),o4=dC(),aAe=fC(),{dirname:cAe}=require("path");a4.exports=({top:r,path:e})=>r?oAe?o4(e):cAe(o4(e))+"/bin":aAe(e)+"/.bin"});var u4=g(WS=>{WS.replaceDollarWithPercentPair=l4;WS.convertToSetCommand=c4;WS.convertToSetCommands=uAe;function c4(r,e){var t="";return r=r||"",r=r.trim(),e=e||"",e=e.trim(),r&&e&&e.length>0&&(t="@SET "+r+"="+l4(e)+`\r
75
+ `),t}o(c4,"convertToSetCommand");function lAe(r){var e={};return r.map(function(t){var i=t.split("=");e[i[0]]=i[1]}),e}o(lAe,"extractVariableValuePairs");function uAe(r){var e=lAe(r.split(" ")),t="";return Object.keys(e).forEach(function(i){t+=c4(i,e[i])}),t}o(uAe,"convertToSetCommands");function l4(r){var e=/\$\{?([^$@#?\- \t{}:]+)\}?/g,t="",i=0;do{var s=e.exec(r);if(s){var n=r.substring(i,s.index)||"";t+=n+"%"+s[1]+"%",i=e.lastIndex}}while(e.lastIndex>0);return t+=r.slice(i),t}o(l4,"replaceDollarWithPercentPair")});var p4=g((DJe,d4)=>{var{chmod:pC,mkdir:hAe,readFile:fAe,stat:h4,unlink:dAe,writeFile:gC}=require("fs/promises"),{dirname:f4,relative:pAe}=require("path"),gAe=u4(),mAe=/^#!\s*(?:\/usr\/bin\/env\s+(?:-S\s+)?((?:[^ \t=]+=[^ \t=]+\s+)*))?([^ \t]+)(.*)$/,yAe=o((r,e)=>h4(r).then(()=>SC(r,e),()=>{}),"cmdShimIfExists"),mC=o(r=>dAe(r).catch(()=>{}),"rm"),SC=o((r,e)=>h4(r).then(()=>SAe(r,e)),"cmdShim"),SAe=o((r,e)=>Promise.all([mC(e),mC(e+".cmd"),mC(e+".ps1")]).then(()=>wAe(r,e)),"cmdShim_"),wAe=o((r,e)=>hAe(f4(e),{recursive:!0}).then(()=>fAe(r,"utf8")).then(t=>{let s=t.trim().split(/\r*\n/)[0].match(mAe);if(!s)return yC(r,e);let n=s[1]||"",a=s[2],c=s[3]||"";return yC(r,e,a,c,n)},()=>yC(r,e)),"writeShim"),yC=o((r,e,t,i,s)=>{let n=pAe(f4(e),r),a=n.split("/").join("\\"),c,l=t&&t.split("\\").join("/"),u,h=l&&`"${l}$exe"`,f;n=n.split("\\").join("/"),i=i||"",s=s||"",t?(c=`"%dp0%\\${t}.exe"`,u=`"$basedir/${t}"`,f=`"$basedir/${t}$exe"`,a=`"%dp0%\\${a}"`,n=`"$basedir/${n}"`):(t=`"%dp0%\\${a}"`,l=`"$basedir/${n}"`,h=l,i="",a="",n="");let d=`@ECHO off\r
76
+ GOTO start\r
77
+ :find_dp0\r
78
+ SET dp0=%~dp0\r
79
+ EXIT /b\r
80
+ :start\r
81
+ SETLOCAL\r
82
+ CALL :find_dp0\r
83
+ `,p;if(c){u=u.trim(),i=i.trim();let w=gAe.convertToSetCommands(s);p=d+w+`\r
84
+ IF EXIST ${c} (\r
85
+ SET "_prog=${c.replace(/(^")|("$)/g,"")}"\r
86
+ ) ELSE (\r
87
+ SET "_prog=${t.replace(/(^")|("$)/g,"")}"\r
88
+ SET PATHEXT=%PATHEXT:;.JS;=;%\r
89
+ )\r
90
+ \r
91
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" ${i} ${a} %*\r
92
+ `}else p=`${d}${t} ${i} ${a} %*\r
93
+ `;let m=`#!/bin/sh
94
+ `;m=m+`basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
95
+
96
+ case \`uname\` in
97
+ *CYGWIN*|*MINGW*|*MSYS*)
98
+ if command -v cygpath > /dev/null 2>&1; then
99
+ basedir=\`cygpath -w "$basedir"\`
100
+ fi
101
+ ;;
102
+ esac
103
+
104
+ `,u?m=m+`if [ -x ${u} ]; then
105
+ exec ${s}${u} ${i} ${n} "$@"
106
+ else
107
+ exec ${s}${l} ${i} ${n} "$@"
108
+ fi
109
+ `:m=m+`exec ${l} ${i} ${n} "$@"
110
+ `;let y=`#!/usr/bin/env pwsh
111
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
112
+
113
+ $exe=""
114
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
115
+ # Fix case when both the Windows and Linux builds of Node
116
+ # are installed in the same directory
117
+ $exe=".exe"
118
+ }
119
+ `;return u?y=y+`$ret=0
120
+ if (Test-Path ${f}) {
121
+ # Support pipeline input
122
+ if ($MyInvocation.ExpectingInput) {
123
+ $input | & ${f} ${i} ${n} $args
124
+ } else {
125
+ & ${f} ${i} ${n} $args
126
+ }
127
+ $ret=$LASTEXITCODE
128
+ } else {
129
+ # Support pipeline input
130
+ if ($MyInvocation.ExpectingInput) {
131
+ $input | & ${h} ${i} ${n} $args
132
+ } else {
133
+ & ${h} ${i} ${n} $args
134
+ }
135
+ $ret=$LASTEXITCODE
136
+ }
137
+ exit $ret
138
+ `:y=y+`# Support pipeline input
139
+ if ($MyInvocation.ExpectingInput) {
140
+ $input | & ${h} ${i} ${n} $args
141
+ } else {
142
+ & ${h} ${i} ${n} $args
143
+ }
144
+ exit $LASTEXITCODE
145
+ `,Promise.all([gC(e+".ps1",y,"utf8"),gC(e+".cmd",p,"utf8"),gC(e,m,"utf8")]).then(()=>vAe(e))},"writeShim_"),vAe=o(r=>Promise.all([pC(r,493),pC(r+".cmd",493),pC(r+".ps1",493)]),"chmodShim");d4.exports=SC;SC.ifExists=yAe});var EC=g((MJe,y4)=>{var g4=require("fs"),{promisify:EAe}=require("util"),{readFileSync:_Ae}=g4,bAe=EAe(g4.readFile),m4=o((r,e)=>/[.]cmd$/.test(r)?IAe(e):/[.]ps1$/.test(r)?OAe(e):TAe(e),"extractPath"),OAe=o(r=>{let e=r.match(/"[$]basedir[/]([^"]+?)"\s+[$]args/);return e&&e[1]},"extractPathFromPowershell"),IAe=o(r=>{let e=r.match(/"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/);return e&&e[1]},"extractPathFromCmd"),TAe=o(r=>{let e=r.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/);return e&&e[1]},"extractPathFromCygwin"),RAe=o((r,e)=>(e.message=r.message,e.code=r.code,e.path=r.path,e),"wrapError"),wC=o((r,e)=>(e||(e=new Error,Error.captureStackTrace(e,wC)),e.code="ENOTASHIM",e.message=`Can't read shim path from '${r}', it doesn't appear to be a cmd-shim`,e),"notaShim"),vC=o(r=>{let e=new Error;return Error.captureStackTrace(e,vC),bAe(r).then(t=>{let i=m4(r,t.toString());if(i)return i;throw wC(r,e)},t=>{throw RAe(t,e)})},"readCmdShim"),AAe=o(r=>{let e=_Ae(r),t=m4(r,e.toString());if(!t)throw wC(r);return t},"readCmdShimSync");vC.sync=AAe;y4.exports=vC});var S4=g(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.signals=void 0;Lo.signals=[];Lo.signals.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Lo.signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Lo.signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var w4=g(Ti=>{"use strict";var JS;Object.defineProperty(Ti,"__esModule",{value:!0});Ti.unload=Ti.load=Ti.onExit=Ti.signals=void 0;var KS=S4();Object.defineProperty(Ti,"signals",{enumerable:!0,get:o(function(){return KS.signals},"get")});var YS=o(r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function","processOk"),_C=Symbol.for("signal-exit emitter"),bC=globalThis,CAe=Object.defineProperty.bind(Object),OC=class{static{o(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(bC[_C])return bC[_C];CAe(bC,_C,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let i=this.listeners[e],s=i.indexOf(t);s!==-1&&(s===0&&i.length===1?i.length=0:i.splice(s,1))}emit(e,t,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let n of this.listeners[e])s=n(t,i)===!0||s;return e==="exit"&&(s=this.emit("afterExit",t,i)||s),s}},ZS=class{static{o(this,"SignalExitBase")}},kAe=o(r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),"signalExitWrap"),IC=class extends ZS{static{o(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},TC=class extends ZS{static{o(this,"SignalExit")}#e=RC.platform==="win32"?"SIGINT":"SIGHUP";#t=new OC;#r;#i;#s;#o={};#n=!1;constructor(e){super(),this.#r=e,this.#o={};for(let t of KS.signals)this.#o[t]=()=>{let i=this.#r.listeners(t),{count:s}=this.#t,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(s+=n.__signal_exit_emitter__.count),i.length===s){this.unload();let a=this.#t.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;a||e.kill(e.pid,c)}};this.#s=e.reallyExit,this.#i=e.emit}onExit(e,t){if(!YS(this.#r))return()=>{};this.#n===!1&&this.load();let i=t?.alwaysLast?"afterExit":"exit";return this.#t.on(i,e),()=>{this.#t.removeListener(i,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#n){this.#n=!0,this.#t.count+=1;for(let e of KS.signals)try{let t=this.#o[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#a(e,...t),this.#r.reallyExit=e=>this.#c(e)}}unload(){this.#n&&(this.#n=!1,KS.signals.forEach(e=>{let t=this.#o[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#i,this.#r.reallyExit=this.#s,this.#t.count-=1)}#c(e){return YS(this.#r)?(this.#r.exitCode=e||0,this.#t.emit("exit",this.#r.exitCode,null),this.#s.call(this.#r,this.#r.exitCode)):0}#a(e,...t){let i=this.#i;if(e==="exit"&&YS(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let s=i.call(this.#r,e,...t);return this.#t.emit("exit",this.#r.exitCode,null),s}else return i.call(this.#r,e,...t)}},RC=globalThis.process;JS=kAe(YS(RC)?new TC(RC):new IC),Ti.onExit=JS.onExit,Ti.load=JS.load,Ti.unload=JS.unload});var E4=g(($Je,of)=>{"use strict";of.exports=FAe;of.exports.sync=BAe;of.exports._getTmpname=AC;of.exports._cleanupOnExit=CC;var Ee=require("fs"),PAe=i_(),{onExit:v4}=w4(),NAe=require("path"),{promisify:_r}=require("util"),gn={},xAe=o((function(){try{return require("worker_threads").threadId}catch{return 0}}),"getId")(),DAe=0;function AC(r){return r+"."+PAe(__filename).hash(String(process.pid)).hash(String(xAe)).hash(String(++DAe)).result()}o(AC,"getTmpname");function CC(r){return()=>{try{Ee.unlinkSync(typeof r=="function"?r():r)}catch{}}}o(CC,"cleanupOnExit");function LAe(r){return new Promise(e=>{gn[r]||(gn[r]=[]),gn[r].push(e),gn[r].length===1&&e()})}o(LAe,"serializeActiveFile");function XS(r){return r.code==="ENOSYS"||(!process.getuid||process.getuid()!==0)&&(r.code==="EINVAL"||r.code==="EPERM")}o(XS,"isChownErrOk");async function MAe(r,e,t={}){typeof t=="string"&&(t={encoding:t});let i,s,n=v4(CC(()=>s)),a=NAe.resolve(r);try{await LAe(a);let c=await _r(Ee.realpath)(r).catch(()=>r);if(s=AC(c),!t.mode||!t.chown){let l=await _r(Ee.stat)(c).catch(()=>{});l&&(t.mode==null&&(t.mode=l.mode),t.chown==null&&process.getuid&&(t.chown={uid:l.uid,gid:l.gid}))}i=await _r(Ee.open)(s,"w",t.mode),t.tmpfileCreated&&await t.tmpfileCreated(s),ArrayBuffer.isView(e)?await _r(Ee.write)(i,e,0,e.length,0):e!=null&&await _r(Ee.write)(i,String(e),0,String(t.encoding||"utf8")),t.fsync!==!1&&await _r(Ee.fsync)(i),await _r(Ee.close)(i),i=null,t.chown&&await _r(Ee.chown)(s,t.chown.uid,t.chown.gid).catch(l=>{if(!XS(l))throw l}),t.mode&&await _r(Ee.chmod)(s,t.mode).catch(l=>{if(!XS(l))throw l}),await _r(Ee.rename)(s,c)}finally{i&&await _r(Ee.close)(i).catch(()=>{}),n(),await _r(Ee.unlink)(s).catch(()=>{}),gn[a].shift(),gn[a].length>0?gn[a][0]():delete gn[a]}}o(MAe,"writeFileAsync");async function FAe(r,e,t,i){t instanceof Function&&(i=t,t={});let s=MAe(r,e,t);if(i)try{let n=await s;return i(n)}catch(n){return i(n)}return s}o(FAe,"writeFile");function BAe(r,e,t){typeof t=="string"?t={encoding:t}:t||(t={});try{r=Ee.realpathSync(r)}catch{}let i=AC(r);if(!t.mode||!t.chown)try{let l=Ee.statSync(r);t=Object.assign({},t),t.mode||(t.mode=l.mode),!t.chown&&process.getuid&&(t.chown={uid:l.uid,gid:l.gid})}catch{}let s,n=CC(i),a=v4(n),c=!0;try{if(s=Ee.openSync(i,"w",t.mode||438),t.tmpfileCreated&&t.tmpfileCreated(i),ArrayBuffer.isView(e)?Ee.writeSync(s,e,0,e.length,0):e!=null&&Ee.writeSync(s,String(e),0,String(t.encoding||"utf8")),t.fsync!==!1&&Ee.fsyncSync(s),Ee.closeSync(s),s=null,t.chown)try{Ee.chownSync(i,t.chown.uid,t.chown.gid)}catch(l){if(!XS(l))throw l}if(t.mode)try{Ee.chmodSync(i,t.mode)}catch(l){if(!XS(l))throw l}Ee.renameSync(i,r),c=!1}finally{if(s)try{Ee.closeSync(s)}catch{}a(),c&&n()}}o(BAe,"writeFileSync")});var kC=g((VJe,_4)=>{var{chmod:qAe,open:jAe,readFile:$Ae}=require("fs/promises"),UAe=511&~process.umask(),VAe=E4(),zAe=o(r=>r[0]===35&&r[1]===33&&/^#![^\n]+\r\n/.test(r.toString()),"isWindowsHashBang"),GAe=o(r=>{let e=o(()=>!1,"FALSE");return jAe(r,"r").then(t=>{let i=Buffer.alloc(2048);return t.read(i,0,2048,0).then(()=>{let s=zAe(i);return t.close().then(()=>s,()=>s)},()=>t.close().then(e,e))},e)},"isWindowsHashbangFile"),HAe=o(r=>$Ae(r,"utf8").then(e=>VAe(r,e.replace(/^(#![^\n]+)\r\n/,`$1
146
+ `))),"dos2Unix"),WAe=o((r,e=UAe)=>qAe(r,e).then(()=>GAe(r)).then(t=>t?HAe(r):null),"fixBin");_4.exports=WAe});var PC=g((GJe,T4)=>{var{resolve:b4,dirname:JAe}=require("path"),{lstat:KAe}=require("fs/promises"),YAe=o(r=>{if(r.code!=="ENOENT")throw r},"throwNonEnoent"),ZAe=p4(),XAe=EC(),QAe=kC(),QS=new Set,I4=o(({to:r,from:e})=>Promise.reject(Object.assign(new Error("EEXIST: file already exists"),{path:r,dest:e,code:"EEXIST"})),"failEEXIST"),eCe=o(({er:r,from:e,to:t})=>r.code==="ENOENT"?null:r.code==="ENOTASHIM"?I4({from:e,to:t}):Promise.reject(r),"handleReadCmdShimError"),O4=Symbol("skip - missing or already installed"),tCe=o(({path:r,to:e,from:t,absFrom:i,force:s})=>{let n=[e,e+".cmd",e+".ps1"];for(let a of n){if(QS.has(a))return!0;QS.add(a)}return Promise.all([...n,i].map(a=>KAe(a).catch(YAe))).then(a=>{let[,,,c]=a;return c?s?!1:Promise.all(n.map((l,u)=>[l,a[u]]).map(([l,u])=>u?XAe(l).then(h=>(h=b4(JAe(e),h),h.indexOf(b4(r))!==0?I4({from:t,to:e,path:r}):!1),h=>eCe({er:h,from:t,to:e})):!1)):O4}).then(a=>a!==O4&&rCe(i,e))},"shimBin"),rCe=o((r,e)=>ZAe(r,e).then(()=>QAe(r)),"doShim"),iCe=o(()=>{for(let r of QS)QS.delete(r)},"resetSeen");T4.exports=Object.assign(tCe,{resetSeen:iCe})});var tw=g((WJe,P4)=>{var{resolve:sCe,dirname:R4}=require("path"),{lstat:A4,mkdir:nCe,readlink:oCe,rm:NC,symlink:C4}=require("fs/promises"),{log:aCe}=se(),k4=o(r=>{if(r.code!=="ENOENT"){if(r.code==="EACCES"){aCe.warn("error adding file",r.message);return}throw r}},"throwSignificant"),xC={recursive:!0,force:!0},ew=new Set,DC=Symbol("skip - missing or already installed"),LC=Symbol("clobber - ours or in forceful mode"),cCe=o(async({path:r,to:e,from:t,absFrom:i,force:s})=>ew.has(e)?!1:(ew.add(e),Promise.all([A4(i).catch(k4),A4(e).catch(k4)]).then(([n,a])=>n?a?a.isSymbolicLink()?oCe(e).then(c=>c===t?DC:(c=sCe(R4(e),c),c.indexOf(r)===0||s?NC(e,xC).then(()=>LC):!1)):s&&NC(e,xC).then(()=>LC):nCe(R4(e),{recursive:!0}):DC).then(n=>n===DC?!1:C4(t,e,"file").catch(a=>{if(n===LC||s)return NC(e,xC).then(()=>C4(t,e,"file"));throw a}).then(()=>!0))),"linkGently"),lCe=o(()=>{for(let r of ew)ew.delete(r)},"resetSeen");P4.exports=Object.assign(cCe,{resetSeen:lCe})});var x4=g((KJe,N4)=>{var uCe=tw(),hCe=kC(),fCe=o(({path:r,to:e,from:t,absFrom:i,force:s})=>uCe({path:r,to:e,from:t,absFrom:i,force:s}).then(n=>n&&hCe(i)),"linkBin");N4.exports=fCe});var M4=g((ZJe,L4)=>{var dCe=Zc(),pCe=HS(),{dirname:gCe,resolve:D4,relative:mCe}=require("path"),yCe=dCe?PC():x4(),SCe=Pn(),wCe=o(({path:r,pkg:e,top:t,force:i})=>{if(e=SCe(e),!e.bin)return Promise.resolve([]);let s=[],n=pCe({path:r,top:t});for(let[a,c]of Object.entries(e.bin)){let l=D4(n,a),u=D4(r,c),h=mCe(gCe(l),u);s.push(yCe({path:r,from:h,to:l,absFrom:u,force:i}))}return Promise.all(s)},"linkBins");L4.exports=wCe});var MC=g((QJe,F4)=>{var vCe=Zc(),ECe=dC(),{dirname:_Ce}=require("path");F4.exports=({top:r,path:e})=>!r||vCe?null:_Ce(ECe(e))+"/share/man"});var j4=g((eKe,q4)=>{var{dirname:bCe,relative:OCe,join:ICe,resolve:B4,basename:TCe}=require("path"),RCe=tw(),ACe=MC(),CCe=o(async({path:r,pkg:e,top:t,force:i})=>{let s=ACe({path:r,top:t});if(!s||!Array.isArray(e?.man)||!e.man.length)return[];let n=[];for(let a of new Set(e.man)){if(!a||typeof a!="string")continue;a=ICe("/",a).replace(/\\|:/g,"/").slice(1);let c=a.match(/\.([0-9]+)(\.gz)?$/);if(!c)throw Object.assign(new Error(`invalid man entry name
147
+ Man files must end with a number, and optionally a .gz suffix if they are compressed.`),{code:"EBADMAN",path:r,pkgid:e._id,man:a});let l=c[1],u=TCe(a),h=B4(r,a);if(h.indexOf(r)!==0)throw Object.assign(new Error("invalid man entry"),{code:"EBADMAN",path:r,pkgid:e._id,man:a});let f=B4(s,"man"+l,u),d=OCe(bCe(f),h);n.push(RCe({from:d,to:f,path:r,absFrom:h,force:i}))}return Promise.all(n)},"linkMans");q4.exports=CCe});var V4=g((rKe,U4)=>{var kCe=Zc(),PCe=HS(),{resolve:rw,dirname:$4}=require("path"),NCe=EC(),{readlink:xCe}=require("fs/promises"),DCe=o(async({bin:r,path:e,top:t,global:i,force:s})=>{if(s||!i||!t)return;let n=rw(PCe({path:e,top:t}),r);return e=rw(e),kCe?BCe({target:n,path:e}):MCe({target:n,path:e})},"checkBin"),LCe=o(async({er:r,target:e})=>r.code==="ENOENT"?null:iw({target:e}),"handleReadLinkError"),MCe=o(async({target:r,path:e})=>{let t=await xCe(r).catch(s=>LCe({er:s,target:r}));if(!t)return;if(rw($4(r),t).toLowerCase().indexOf(e.toLowerCase())!==0)return iw({target:r})},"checkLink"),FCe=o(({er:r,target:e})=>r.code==="ENOENT"?null:iw({target:e}),"handleReadCmdShimError"),iw=o(({target:r})=>Promise.reject(Object.assign(new Error("EEXIST: file already exists"),{path:r,code:"EEXIST"})),"failEEXIST"),BCe=o(async({target:r,path:e})=>{let t=[r,r+".cmd",r+".ps1"];await Promise.all(t.map(async i=>{let s=await NCe(i).catch(a=>FCe({er:a,target:i}));if(!s)return;if(rw($4(i),s.replace(/\\/g,"/")).toLowerCase().indexOf(e.toLowerCase())!==0)return iw({target:i})}))},"checkShim");U4.exports=DCe});var G4=g((sKe,z4)=>{var qCe=V4(),jCe=Pn(),$Ce=o(async({pkg:r,path:e,top:t,global:i,force:s})=>{s||!i||!t||(r=jCe(r),r.bin&&await Promise.all(Object.keys(r.bin).map(n=>qCe({bin:n,path:e,top:t,global:i,force:s}))))},"checkBins");z4.exports=$Ce});var K4=g((oKe,J4)=>{var UCe=HS(),VCe=MC(),{resolve:H4,basename:W4,extname:zCe}=require("path"),GCe=Zc();J4.exports=({path:r,pkg:e,global:t,top:i})=>{if(i&&!t)return[];let s=[],n=UCe({path:r,top:i});if(e.bin)for(let l of Object.keys(e.bin)){let u=H4(n,l);s.push(u),GCe&&(s.push(u+".cmd"),s.push(u+".ps1"))}let a=VCe({path:r,top:i}),c=[];if(a&&e.man&&Array.isArray(e.man)&&e.man.length)for(let l of e.man){if(!/.\.[0-9]+(\.gz)?$/.test(l))return s;let u=zCe(W4(l,".gz")).slice(1),h=W4(l);c.push(H4(a,"man"+u,h))}return c.length?[...s,...c]:s}});var FC=g((aKe,Y4)=>{var HCe=M4(),WCe=j4(),JCe=o(r=>{let{path:e,pkg:t,force:i,global:s,top:n}=r;return n&&!s?Promise.resolve():Promise.all([HCe({path:e,pkg:t,top:n,force:i||!n}),WCe({path:e,pkg:t,top:n,force:i})])},"binLinks"),KCe=PC(),YCe=tw(),ZCe=o(()=>{KCe.resetSeen(),YCe.resetSeen()},"resetSeen"),XCe=G4(),QCe=K4();Y4.exports=Object.assign(JCe,{checkBins:XCe,resetSeen:ZCe,getPaths:QCe})});var nw=g(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});sw.walkUp=void 0;var Z4=require("path"),eke=o(function*(r){for(r=(0,Z4.resolve)(r);r;){yield r;let e=(0,Z4.dirname)(r);if(e===r)break;r=e}},"walkUp");sw.walkUp=eke});var Q4=g((fKe,X4)=>{X4.exports=class extends Map{static{o(this,"CIMap")}#e=new Map;constructor(e=[]){super();for(let[t,i]of e)this.set(t,i)}#t(e){return typeof e!="string"?e:e.normalize("NFKD").toLowerCase()}get(e){let t=this.#t(e);return this.#e.has(t)?super.get(this.#e.get(t)):void 0}set(e,t){let i=this.#t(e);return this.#e.has(i)&&super.delete(this.#e.get(i)),this.#e.set(i,e),super.set(e,t)}delete(e){let t=this.#t(e);if(this.#e.has(t)){let i=this.#e.get(t);return this.#e.delete(t),super.delete(i)}}has(e){let t=this.#t(e);return this.#e.has(t)&&super.has(this.#e.get(t))}}});var BC=g((pKe,e6)=>{var{dirname:tke}=require("node:path"),rke=ye(),ike=o((r,e)=>{if(e&&e.overrides&&e.overrides.name===e.name&&e.overrides.value)return r.sourceReference?r.sourceReference.root.realpath:r.root.realpath;if(r.resolved){let t=rke(r.resolved);if(t?.type==="file")return tke(t.fetchSpec)}return r.realpath},"fromPath");e6.exports=ike});var i6=g((mKe,r6)=>{var t6=$e(),qC=ye(),{relative:ske}=require("node:path"),nke=BC(),jC=o((r,e,t)=>{if(typeof e=="string")try{e=qC.resolve(r.name,e||"*",nke(t,t.edgesOut.get(r.name)))}catch(s){return s.dependency=r.name,s.requested=e,t.errors.push(s),!1}if(!e){let s=new Error("Invalid dependency specifier");return s.dependency=r.name,s.requested=e,t.errors.push(s),!1}switch(e.type){case"range":if(e.fetchSpec==="*")return!0;case"version":return t6.satisfies(r.version,e.fetchSpec,!0);case"directory":return oke(r,e,t);case"file":return ake(r,e,t);case"alias":return jC(r,e.subSpec,t);case"tag":return r.resolved&&qC(r.resolved).type==="remote";case"remote":return r.resolved===e.fetchSpec;case"git":{let s=qC(r.resolved||""),n=s.hosted,a=e.hosted,l={noCommittish:!/^[a-fA-F0-9]{40}$/.test(e.gitCommittish||"")};if(n){if(a?.ssh(l)!==n.ssh(l))return!1}else if(s.fetchSpec!==e.fetchSpec)return!1;return e.gitRange?t6.satisfies(r.package.version,e.gitRange,{loose:!0}):!0}default:break}let i=new Error("Unsupported dependency type");return i.dependency=r.name,i.requested=e,t.errors.push(i),!1},"depValid"),oke=o((r,e,t)=>{let i=!!r.isLink;return t.installLinks&&!r.isWorkspace?!i:i&&ske(r.realpath,e.fetchSpec)===""},"linkValid"),ake=o((r,e)=>r.isLink?!1:r.resolved?r.resolved.replace(/\\/g,"/")===`file:${e.fetchSpec.replace(/\\/g,"/")}`:r.package._requested?r.package._requested.saveSpec===e.saveSpec:!1,"tarballValid");r6.exports=(r,e,t,i)=>jC(r,e,i)||(typeof t=="string"?jC(r,t,i):!1)});var UC=g((SKe,n6)=>{var s6=ye(),Xc=$e(),{log:cke}=se(),$C=class r{static{o(this,"OverrideSet")}constructor({overrides:e,key:t,parent:i}){if(this.parent=i,this.children=new Map,typeof e=="string"&&(e={".":e}),e["."]===""&&(e["."]="*"),i){let s=s6(t);if(!s.name)throw new Error(`Override without name: ${t}`);this.name=s.name,s.name="",this.key=t,this.keySpec=s.toString(),this.value=e["."]||this.keySpec}for(let[s,n]of Object.entries(e)){if(s===".")continue;let a=new r({parent:this,key:s,overrides:n});this.children.set(a.key,a)}}childrenAreEqual(e){if(this.children.size!==e.children.size)return!1;for(let[t]of this.children)if(!e.children.has(t)||this.children.get(t).value!==e.children.get(t).value||!this.children.get(t).childrenAreEqual(e.children.get(t)))return!1;return!0}isEqual(e){return this===e?!0:!e||this.key!==e.key||this.value!==e.value||!this.childrenAreEqual(e)?!1:this.parent?this.parent.isEqual(e.parent):!e.parent}getEdgeRule(e){for(let t of this.ruleset.values()){if(t.name!==e.name)continue;if(t.keySpec==="*")return t;let i=s6(`${e.name}@${e.rawSpec||e.spec}`);if(i.type==="alias"&&(i=i.subSpec),i.type==="git"){if(i.gitRange&&Xc.intersects(i.gitRange,t.keySpec))return t;continue}if(i.type==="range"||i.type==="version"){if(Xc.intersects(i.fetchSpec,t.keySpec))return t;continue}return t}return this}getNodeRule(e){for(let t of this.ruleset.values())if(t.name===e.name&&(Xc.satisfies(e.version,t.keySpec)||Xc.satisfies(e.version,t.value)))return t;return this}getMatchingRule(e){for(let t of this.ruleset.values())if(t.name===e.name&&(Xc.satisfies(e.version,t.keySpec)||Xc.satisfies(e.version,t.value)))return t;return null}*ancestry(){for(let e=this;e;e=e.parent)yield e}get isRoot(){return!this.parent}get ruleset(){let e=new Map;for(let t of this.ancestry()){for(let i of t.children.values())e.has(i.key)||e.set(i.key,i);!t.isRoot&&!e.has(t.key)&&e.set(t.key,t)}return e}static findSpecificOverrideSet(e,t){for(let i=t;i;i=i.parent)if(i.isEqual(e))return t;for(let i=e;i;i=i.parent)if(i.isEqual(t))return e;cke.silly("Conflicting override sets",e,t)}static doOverrideSetsConflict(e,t){return this.findSpecificOverrideSet(e,t)===void 0}};n6.exports=$C});var GC=g((vKe,o6)=>{var lke=require("node:util"),uke=ye(),af=i6(),hke=UC(),VC=class{static{o(this,"ArboristEdge")}constructor(e){this.name=e.name,this.spec=e.spec,this.type=e.type;let t=e.from?.location,i=e.to?.location,s=e.overrides?.value;t!=null&&(this.from=t),i&&(this.to=i),e.error&&(this.error=e.error),e.peerConflicted&&(this.peerConflicted=!0),s&&(this.overridden=s)}},zC=class r{static{o(this,"Edge")}#e;#t;#r;#i;#s;#o;#n;#c;static types=Object.freeze(["prod","dev","optional","peer","peerOptional","workspace"]);static errors=Object.freeze(["DETACHED","MISSING","PEER LOCAL","INVALID"]);constructor(e){let{type:t,name:i,spec:s,accept:n,from:a,overrides:c}=e;if(typeof s!="string")throw new TypeError("must provide string spec");if(!r.types.includes(t))throw new TypeError(`invalid type: ${t}
148
+ (valid types are: ${r.types.join(", ")})`);if(t==="workspace"&&uke(s).type!=="directory")throw new TypeError("workspace edges must be a symlink");if(typeof i!="string")throw new TypeError("must provide dependency name");if(!a)throw new TypeError('must provide "from" node');if(n!==void 0){if(typeof n!="string")throw new TypeError("accept field must be a string if provided");this.#e=n||"*"}c!==void 0&&(this.overrides=c),this.#s=i,this.#c=t,this.#o=s,this.#r=null,this.#i=a,a.edgesOut.get(this.#s)?.detach(),a.addEdgeOut(this),this.reload(!0),this.peerConflicted=!1}satisfiedBy(e){return e.name!==this.#s||!this.#i?!1:e.hasShrinkwrap||e.inShrinkwrap||e.inBundle?af(e,this.rawSpec,this.#e,this.#i):this.overrides?.keySpec?af(e,this.spec,this.#e,this.#i)?!0:af(e,this.rawSpec,this.#e,this.#i)?!af(e,this.overrides.keySpec,this.#e,this.#i):!1:af(e,this.spec,this.#e,this.#i)}explain(e=[]){if(!this.#r){let t={type:this.#c,name:this.#s,spec:this.spec};this.rawSpec!==this.spec&&(t.rawSpec=this.rawSpec,t.overridden=!0),this.bundled&&(t.bundled=this.bundled),this.error&&(t.error=this.error),this.#i&&(t.from=this.#i.explain(null,e)),this.#r=t}return this.#r}get bundled(){return!!this.#i?.package?.bundleDependencies?.includes(this.#s)}get workspace(){return this.#c==="workspace"}get prod(){return this.#c==="prod"}get dev(){return this.#c==="dev"}get optional(){return this.#c==="optional"||this.#c==="peerOptional"}get peer(){return this.#c==="peer"||this.#c==="peerOptional"}get type(){return this.#c}get name(){return this.#s}get rawSpec(){return this.#o}get spec(){if(this.overrides?.value&&this.overrides.value!=="*"&&this.overrides.name===this.#s){if(this.overrides.value.startsWith("$")){let e=this.overrides.value.slice(1),t=this.#i?.sourceReference?this.#i?.sourceReference.root.package:this.#i?.root?.package,i=this.#a(e,t);if(i||(t=this.#i?.package,i=this.#a(e,t)),i)return i;throw new Error(`Unable to resolve reference ${this.overrides.value}`)}return this.overrides.value}return this.#o}#a(e,t){if(t.devDependencies?.[e])return t.devDependencies[e];if(t.optionalDependencies?.[e])return t.optionalDependencies[e];if(t.dependencies?.[e])return t.dependencies[e];if(t.peerDependencies?.[e])return t.peerDependencies[e]}get accept(){return this.#e}get valid(){return!this.error}get missing(){return this.error==="MISSING"}get invalid(){return this.error==="INVALID"}get peerLocal(){return this.error==="PEER LOCAL"}get error(){return this.#t||(this.#n?this.peer&&this.#i===this.#n.parent&&!this.#i?.isTop?this.#t="PEER LOCAL":this.satisfiedBy(this.#n)?this.overrides&&this.#n.edgesOut.size&&hke.doOverrideSetsConflict(this.overrides,this.#n.overrides)?this.#t="INVALID":this.#t="OK":this.#t="INVALID":this.optional?this.#t=null:this.#t="MISSING"),this.#t==="OK"?null:this.#t}reload(e=!1){this.#r=null;let t=!1,i,s;this.#i?.overrides?(i=this.#i.overrides.getEdgeRule(this),i&&!i.isEqual(this.overrides)&&(t=!0,s=this.overrides,this.overrides=i)):delete this.overrides;let n=this.#i?.resolve(this.#s);n!==this.#n?(this.#n&&this.#n.deleteEdgeIn(this),this.#n=n,this.#t=null,this.#n&&this.#n.addEdgeIn(this)):e?this.#t=null:t&&this.#n&&(this.#n.updateOverridesEdgeInRemoved(s),this.#n.updateOverridesEdgeInAdded(i))}detach(){this.#r=null,this.#n&&this.#n.deleteEdgeIn(this),this.#i?.edgesOut.delete(this.#s),this.#n=null,this.#t="DETACHED",this.#i=null}get from(){return this.#i}get to(){return this.#n}toJSON(){return new VC(this)}[lke.inspect.custom](){return this.toJSON()}};o6.exports=zC});var l6=g((_Ke,c6)=>{var{hasOwnProperty:fke}=Object.prototype,dke=pn(),a6=["name","license","funding","realpath","packageName"],HC=class extends Map{static{o(this,"Inventory")}#e;constructor(){super(),this.#e=new Map;for(let e of a6)this.#e.set(e,new Map)}get primaryKey(){return"location"}get indexes(){return[...a6]}*filter(e){for(let t of this.values())e(t)&&(yield t)}add(e){let t=super.get("");if(t&&e.root!==t&&e.root!==t.root){dke(()=>{throw Object.assign(new Error("adding external node to inventory"),{root:t.path,node:e.path,nodeRoot:e.root.path})});return}let i=super.get(e.location);if(i){if(i===e)return;this.delete(i)}super.set(e.location,e);for(let[s,n]of this.#e.entries()){let a;fke.call(e,s)?a=e[s]:s==="license"&&e.package?e.package.license?a=e.package.license:e.package.licence?a=e.package.licence:Array.isArray(e.package.licenses)?a=e.package.licenses[0]:Array.isArray(e.package.licences)&&(a=e.package.licences[0]):e[s]?a=e[s]:a=e.package?.[s],a&&typeof a=="object"&&(s==="license"?a=a.type:s==="funding"&&(a=a.url)),n.has(a)||n.set(a,new Set),n.get(a).add(e)}}delete(e){if(this.has(e)){super.delete(e.location);for(let[t,i]of this.#e.entries()){let s;e[t]!==void 0?s=e[t]:s=e.package?.[t];let n=i.get(s);n&&(n.delete(e),n.size===0&&i.delete(e[t]))}}}query(e,t){let i=this.#e.get(e);return arguments.length===2?i.has(t)?i.get(t):new Set:i.keys()}has(e){return super.get(e.location)===e}set(){throw new Error("direct set() not supported, use inventory.add(node)")}};c6.exports=HC});var cf=g((OKe,u6)=>{var pke=ye(),gke=Oi(),mke=o((r,e,t,i=!1)=>{if(!r)return null;try{let s={noCommittish:!1},{fetchSpec:n,saveSpec:a,type:c,hosted:l,rawSpec:u,raw:h}=pke(r,e);return c==="file"||c==="directory"?i&&t?`file:${gke(t,n)}`:`file:${n}`:l?`git+${l.auth?l.https(s):l.sshurl(s)}`:c==="git"?a:u==="*"?h:u}catch{return r}},"consistentResolve");u6.exports=mke});var ow=g((TKe,h6)=>{var yke=o((r,e)=>{let t=new Set(r);for(let s of t)for(let n of s.edgesOut.values())n.to&&e(n)&&t.add(n.to);let i=!0;for(;i===!0&&t.size>0;){i=!1;for(let s of t)for(let n of s.edgesIn)if(!t.has(n.from)&&e(n)){i=!0,t.delete(s);break}}return t},"gatherDepSet");h6.exports=yke});var g6=g((AKe,p6)=>{var aw=wr()("en"),d6=require("node:util"),Ske=Oi(),lf=class{static{o(this,"ArboristNode")}constructor(e,t){this.name=e.name,e.packageName&&e.packageName!==this.name&&(this.packageName=e.packageName),e.version&&(this.version=e.version),this.location=e.location,this.path=e.path,e.realpath!==this.path&&(this.realpath=e.realpath),e.resolved!==null&&(this.resolved=e.resolved),e.extraneous&&(this.extraneous=!0),e.dev&&(this.dev=!0),e.optional&&(this.optional=!0),e.devOptional&&!e.dev&&!e.optional&&(this.devOptional=!0),e.peer&&(this.peer=!0),e.inBundle&&(this.bundled=!0),e.inDepBundle&&(this.bundler=e.getBundler().location),e.isProjectRoot&&(this.isProjectRoot=!0),e.isWorkspace&&(this.isWorkspace=!0);let i=e.package&&e.package.bundleDependencies;i&&i.length&&(this.bundleDependencies=i),e.inShrinkwrap?this.inShrinkwrap=!0:e.hasShrinkwrap&&(this.hasShrinkwrap=!0),e.error&&(this.error=f6(e.error)),e.errors&&e.errors.length&&(this.errors=e.errors.map(f6)),e.overrides&&(this.overrides=new Map([...e.overrides.ruleset.values()].map(s=>[s.key,s.value]))),e.edgesOut.size&&(this.edgesOut=new Map([...e.edgesOut.entries()].sort(([s],[n])=>aw(s,n)).map(([s,n])=>[s,new KC(n)]))),e.edgesIn.size&&(this.edgesIn=new Set([...e.edgesIn].sort((s,n)=>aw(s.from.location,n.from.location)).map(s=>new YC(s)))),e.workspaces&&e.workspaces.size&&(this.workspaces=new Map([...e.workspaces.entries()].map(([s,n])=>[s,Ske(e.root.realpath,n)]))),e.fsChildren.size&&(this.fsChildren=new Set([...e.fsChildren].sort(({path:s},{path:n})=>aw(s,n)).map(s=>uf(s,t)))),e.children.size&&(this.children=new Map([...e.children.entries()].sort(([s],[n])=>aw(s,n)).map(([s,n])=>[s,uf(n,t)])))}},WC=class extends lf{static{o(this,"ArboristVirtualNode")}constructor(e,t){super(e,t),this.sourceReference=uf(e.sourceReference,t)}},JC=class extends lf{static{o(this,"ArboristLink")}constructor(e,t){super(e,t),this.target=uf(e.target,t)}},f6=o(({code:r,path:e})=>({code:r,...e?{path:e}:{}}),"treeError"),cw=class{static{o(this,"Edge")}constructor(e){this.type=e.type,this.name=e.name,this.spec=e.rawSpec||"*",e.rawSpec!==e.spec&&(this.override=e.spec),e.error&&(this.error=e.error),e.peerConflicted&&(this.peerConflicted=e.peerConflicted)}},KC=class extends cw{static{o(this,"EdgeOut")}constructor(e){super(e),this.to=e.to&&e.to.location}[d6.inspect.custom](){return`{ ${this.type} ${this.name}@${this.spec}${this.override?` overridden:${this.override}`:""}${this.to?" -> "+this.to:""}${this.error?" "+this.error:""}${this.peerConflicted?" peerConflicted":""} }`}},YC=class extends cw{static{o(this,"EdgeIn")}constructor(e){super(e),this.from=e.from&&e.from.location}[d6.inspect.custom](){return`{ ${this.from||'""'} ${this.type} ${this.name}@${this.spec}${this.error?" "+this.error:""}${this.peerConflicted?" peerConflicted":""} }`}},uf=o((r,e=[])=>{if(!r)return r;let t=r.isLink?JC:r.sourceReference?WC:lf;if(e.includes(r)){let i=Object.create(t.prototype);return Object.assign(i,{location:r.location})}return e.push(r),new t(r,e)},"printableTree");p6.exports=uf});var ZC=g((lw,m6)=>{"use strict";lw.__esModule=!0;lw.default=Eke;function wke(r){for(var e=r.toLowerCase(),t="",i=!1,s=0;s<6&&e[s]!==void 0;s++){var n=e.charCodeAt(s),a=n>=97&&n<=102||n>=48&&n<=57;if(i=n===32,!a)break;t+=e[s]}if(t.length!==0){var c=parseInt(t,16),l=c>=55296&&c<=57343;return l||c===0||c>1114111?["�",t.length+(i?1:0)]:[String.fromCodePoint(c),t.length+(i?1:0)]}}o(wke,"gobbleHex");var vke=/\\/;function Eke(r){var e=vke.test(r);if(!e)return r;for(var t="",i=0;i<r.length;i++){if(r[i]==="\\"){var s=wke(r.slice(i+1,i+7));if(s!==void 0){t+=s[0],i+=s[1];continue}if(r[i+1]==="\\"){t+="\\",i++;continue}r.length===i+1&&(t+=r[i]);continue}t+=r[i]}return t}o(Eke,"unesc");m6.exports=lw.default});var S6=g((uw,y6)=>{"use strict";uw.__esModule=!0;uw.default=_ke;function _ke(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];for(;t.length>0;){var s=t.shift();if(!r[s])return;r=r[s]}return r}o(_ke,"getProp");y6.exports=uw.default});var v6=g((hw,w6)=>{"use strict";hw.__esModule=!0;hw.default=bke;function bke(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];for(;t.length>0;){var s=t.shift();r[s]||(r[s]={}),r=r[s]}}o(bke,"ensureObject");w6.exports=hw.default});var _6=g((fw,E6)=>{"use strict";fw.__esModule=!0;fw.default=Oke;function Oke(r){for(var e="",t=r.indexOf("/*"),i=0;t>=0;){e=e+r.slice(i,t);var s=r.indexOf("*/",t+2);if(s<0)return e;i=s+2,t=r.indexOf("/*",i)}return e=e+r.slice(i),e}o(Oke,"stripComments");E6.exports=fw.default});var hf=g(Ri=>{"use strict";Ri.__esModule=!0;Ri.unesc=Ri.stripComments=Ri.getProp=Ri.ensureObject=void 0;var Ike=dw(ZC());Ri.unesc=Ike.default;var Tke=dw(S6());Ri.getProp=Tke.default;var Rke=dw(v6());Ri.ensureObject=Rke.default;var Ake=dw(_6());Ri.stripComments=Ake.default;function dw(r){return r&&r.__esModule?r:{default:r}}o(dw,"_interopRequireDefault")});var us=g((ff,I6)=>{"use strict";ff.__esModule=!0;ff.default=void 0;var b6=hf();function O6(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(O6,"_defineProperties");function Cke(r,e,t){return e&&O6(r.prototype,e),t&&O6(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(Cke,"_createClass");var kke=o(function r(e,t){if(typeof e!="object"||e===null)return e;var i=new e.constructor;for(var s in e)if(e.hasOwnProperty(s)){var n=e[s],a=typeof n;s==="parent"&&a==="object"?t&&(i[s]=t):n instanceof Array?i[s]=n.map(function(c){return r(c,i)}):i[s]=r(n,i)}return i},"cloneNode"),Pke=(function(){function r(t){t===void 0&&(t={}),Object.assign(this,t),this.spaces=this.spaces||{},this.spaces.before=this.spaces.before||"",this.spaces.after=this.spaces.after||""}o(r,"Node");var e=r.prototype;return e.remove=o(function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},"remove"),e.replaceWith=o(function(){if(this.parent){for(var i in arguments)this.parent.insertBefore(this,arguments[i]);this.remove()}return this},"replaceWith"),e.next=o(function(){return this.parent.at(this.parent.index(this)+1)},"next"),e.prev=o(function(){return this.parent.at(this.parent.index(this)-1)},"prev"),e.clone=o(function(i){i===void 0&&(i={});var s=kke(this);for(var n in i)s[n]=i[n];return s},"clone"),e.appendToPropertyAndEscape=o(function(i,s,n){this.raws||(this.raws={});var a=this[i],c=this.raws[i];this[i]=a+s,c||n!==s?this.raws[i]=(c||a)+n:delete this.raws[i]},"appendToPropertyAndEscape"),e.setPropertyAndEscape=o(function(i,s,n){this.raws||(this.raws={}),this[i]=s,this.raws[i]=n},"setPropertyAndEscape"),e.setPropertyWithoutEscape=o(function(i,s){this[i]=s,this.raws&&delete this.raws[i]},"setPropertyWithoutEscape"),e.isAtPosition=o(function(i,s){if(this.source&&this.source.start&&this.source.end)return!(this.source.start.line>i||this.source.end.line<i||this.source.start.line===i&&this.source.start.column>s||this.source.end.line===i&&this.source.end.column<s)},"isAtPosition"),e.stringifyProperty=o(function(i){return this.raws&&this.raws[i]||this[i]},"stringifyProperty"),e.valueToString=o(function(){return String(this.stringifyProperty("value"))},"valueToString"),e.toString=o(function(){return[this.rawSpaceBefore,this.valueToString(),this.rawSpaceAfter].join("")},"toString"),Cke(r,[{key:"rawSpaceBefore",get:o(function(){var i=this.raws&&this.raws.spaces&&this.raws.spaces.before;return i===void 0&&(i=this.spaces&&this.spaces.before),i||""},"get"),set:o(function(i){(0,b6.ensureObject)(this,"raws","spaces"),this.raws.spaces.before=i},"set")},{key:"rawSpaceAfter",get:o(function(){var i=this.raws&&this.raws.spaces&&this.raws.spaces.after;return i===void 0&&(i=this.spaces.after),i||""},"get"),set:o(function(i){(0,b6.ensureObject)(this,"raws","spaces"),this.raws.spaces.after=i},"set")}]),r})();ff.default=Pke;I6.exports=ff.default});var Xe=g(de=>{"use strict";de.__esModule=!0;de.UNIVERSAL=de.TAG=de.STRING=de.SELECTOR=de.ROOT=de.PSEUDO=de.NESTING=de.ID=de.COMMENT=de.COMBINATOR=de.CLASS=de.ATTRIBUTE=void 0;var Nke="tag";de.TAG=Nke;var xke="string";de.STRING=xke;var Dke="selector";de.SELECTOR=Dke;var Lke="root";de.ROOT=Lke;var Mke="pseudo";de.PSEUDO=Mke;var Fke="nesting";de.NESTING=Fke;var Bke="id";de.ID=Bke;var qke="comment";de.COMMENT=qke;var jke="combinator";de.COMBINATOR=jke;var $ke="class";de.CLASS=$ke;var Uke="attribute";de.ATTRIBUTE=Uke;var Vke="universal";de.UNIVERSAL=Vke});var pw=g((df,C6)=>{"use strict";df.__esModule=!0;df.default=void 0;var zke=Hke(us()),hs=Gke(Xe());function A6(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(A6=o(function(s){return s?t:e},"_getRequireWildcardCache"))(r)}o(A6,"_getRequireWildcardCache");function Gke(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=A6(e);if(t&&t.has(r))return t.get(r);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(n!=="default"&&Object.prototype.hasOwnProperty.call(r,n)){var a=s?Object.getOwnPropertyDescriptor(r,n):null;a&&(a.get||a.set)?Object.defineProperty(i,n,a):i[n]=r[n]}return i.default=r,t&&t.set(r,i),i}o(Gke,"_interopRequireWildcard");function Hke(r){return r&&r.__esModule?r:{default:r}}o(Hke,"_interopRequireDefault");function Wke(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=Jke(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var i=0;return function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
149
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}o(Wke,"_createForOfIteratorHelperLoose");function Jke(r,e){if(r){if(typeof r=="string")return T6(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return T6(r,e)}}o(Jke,"_unsupportedIterableToArray");function T6(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}o(T6,"_arrayLikeToArray");function R6(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(R6,"_defineProperties");function Kke(r,e,t){return e&&R6(r.prototype,e),t&&R6(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(Kke,"_createClass");function Yke(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,XC(r,e)}o(Yke,"_inheritsLoose");function XC(r,e){return XC=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),XC(r,e)}o(XC,"_setPrototypeOf");var Zke=(function(r){Yke(e,r);function e(i){var s;return s=r.call(this,i)||this,s.nodes||(s.nodes=[]),s}o(e,"Container");var t=e.prototype;return t.append=o(function(s){return s.parent=this,this.nodes.push(s),this},"append"),t.prepend=o(function(s){s.parent=this,this.nodes.unshift(s);for(var n in this.indexes)this.indexes[n]++;return this},"prepend"),t.at=o(function(s){return this.nodes[s]},"at"),t.index=o(function(s){return typeof s=="number"?s:this.nodes.indexOf(s)},"index"),t.removeChild=o(function(s){s=this.index(s),this.at(s).parent=void 0,this.nodes.splice(s,1);var n;for(var a in this.indexes)n=this.indexes[a],n>=s&&(this.indexes[a]=n-1);return this},"removeChild"),t.removeAll=o(function(){for(var s=Wke(this.nodes),n;!(n=s()).done;){var a=n.value;a.parent=void 0}return this.nodes=[],this},"removeAll"),t.empty=o(function(){return this.removeAll()},"empty"),t.insertAfter=o(function(s,n){var a;n.parent=this;for(var c=this.index(s),l=[],u=2;u<arguments.length;u++)l.push(arguments[u]);(a=this.nodes).splice.apply(a,[c+1,0,n].concat(l)),n.parent=this;var h;for(var f in this.indexes)h=this.indexes[f],c<h&&(this.indexes[f]=h+arguments.length-1);return this},"insertAfter"),t.insertBefore=o(function(s,n){var a;n.parent=this;for(var c=this.index(s),l=[],u=2;u<arguments.length;u++)l.push(arguments[u]);(a=this.nodes).splice.apply(a,[c,0,n].concat(l)),n.parent=this;var h;for(var f in this.indexes)h=this.indexes[f],h>=c&&(this.indexes[f]=h+arguments.length-1);return this},"insertBefore"),t._findChildAtPosition=o(function(s,n){var a=void 0;return this.each(function(c){if(c.atPosition){var l=c.atPosition(s,n);if(l)return a=l,!1}else if(c.isAtPosition(s,n))return a=c,!1}),a},"_findChildAtPosition"),t.atPosition=o(function(s,n){if(this.isAtPosition(s,n))return this._findChildAtPosition(s,n)||this},"atPosition"),t._inferEndPosition=o(function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},"_inferEndPosition"),t.each=o(function(s){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var n=this.lastEach;if(this.indexes[n]=0,!!this.length){for(var a,c;this.indexes[n]<this.length&&(a=this.indexes[n],c=s(this.at(a),a),c!==!1);)this.indexes[n]+=1;if(delete this.indexes[n],c===!1)return!1}},"each"),t.walk=o(function(s){return this.each(function(n,a){var c=s(n,a);if(c!==!1&&n.length&&(c=n.walk(s)),c===!1)return!1})},"walk"),t.walkAttributes=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.ATTRIBUTE)return s.call(n,a)})},"walkAttributes"),t.walkClasses=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.CLASS)return s.call(n,a)})},"walkClasses"),t.walkCombinators=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.COMBINATOR)return s.call(n,a)})},"walkCombinators"),t.walkComments=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.COMMENT)return s.call(n,a)})},"walkComments"),t.walkIds=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.ID)return s.call(n,a)})},"walkIds"),t.walkNesting=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.NESTING)return s.call(n,a)})},"walkNesting"),t.walkPseudos=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.PSEUDO)return s.call(n,a)})},"walkPseudos"),t.walkTags=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.TAG)return s.call(n,a)})},"walkTags"),t.walkUniversals=o(function(s){var n=this;return this.walk(function(a){if(a.type===hs.UNIVERSAL)return s.call(n,a)})},"walkUniversals"),t.split=o(function(s){var n=this,a=[];return this.reduce(function(c,l,u){var h=s.call(n,l);return a.push(l),h?(c.push(a),a=[]):u===n.length-1&&c.push(a),c},[])},"split"),t.map=o(function(s){return this.nodes.map(s)},"map"),t.reduce=o(function(s,n){return this.nodes.reduce(s,n)},"reduce"),t.every=o(function(s){return this.nodes.every(s)},"every"),t.some=o(function(s){return this.nodes.some(s)},"some"),t.filter=o(function(s){return this.nodes.filter(s)},"filter"),t.sort=o(function(s){return this.nodes.sort(s)},"sort"),t.toString=o(function(){return this.map(String).join("")},"toString"),Kke(e,[{key:"first",get:o(function(){return this.at(0)},"get")},{key:"last",get:o(function(){return this.at(this.length-1)},"get")},{key:"length",get:o(function(){return this.nodes.length},"get")}]),e})(zke.default);df.default=Zke;C6.exports=df.default});var ek=g((pf,P6)=>{"use strict";pf.__esModule=!0;pf.default=void 0;var Xke=ePe(pw()),Qke=Xe();function ePe(r){return r&&r.__esModule?r:{default:r}}o(ePe,"_interopRequireDefault");function k6(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(k6,"_defineProperties");function tPe(r,e,t){return e&&k6(r.prototype,e),t&&k6(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(tPe,"_createClass");function rPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,QC(r,e)}o(rPe,"_inheritsLoose");function QC(r,e){return QC=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),QC(r,e)}o(QC,"_setPrototypeOf");var iPe=(function(r){rPe(e,r);function e(i){var s;return s=r.call(this,i)||this,s.type=Qke.ROOT,s}o(e,"Root");var t=e.prototype;return t.toString=o(function(){var s=this.reduce(function(n,a){return n.push(String(a)),n},[]).join(",");return this.trailingComma?s+",":s},"toString"),t.error=o(function(s,n){return this._error?this._error(s,n):new Error(s)},"error"),tPe(e,[{key:"errorGenerator",set:o(function(s){this._error=s},"set")}]),e})(Xke.default);pf.default=iPe;P6.exports=pf.default});var rk=g((gf,N6)=>{"use strict";gf.__esModule=!0;gf.default=void 0;var sPe=oPe(pw()),nPe=Xe();function oPe(r){return r&&r.__esModule?r:{default:r}}o(oPe,"_interopRequireDefault");function aPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,tk(r,e)}o(aPe,"_inheritsLoose");function tk(r,e){return tk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),tk(r,e)}o(tk,"_setPrototypeOf");var cPe=(function(r){aPe(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=nPe.SELECTOR,i}return o(e,"Selector"),e})(sPe.default);gf.default=cPe;N6.exports=gf.default});var gw=g(($Ke,x6)=>{"use strict";var lPe={},uPe=lPe.hasOwnProperty,hPe=o(function(e,t){if(!e)return t;var i={};for(var s in t)i[s]=uPe.call(e,s)?e[s]:t[s];return i},"merge"),fPe=/[ -,\.\/:-@\[-\^`\{-~]/,dPe=/[ -,\.\/:-@\[\]\^`\{-~]/,pPe=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,ik=o(function r(e,t){t=hPe(t,r.options),t.quotes!="single"&&t.quotes!="double"&&(t.quotes="single");for(var i=t.quotes=="double"?'"':"'",s=t.isIdentifier,n=e.charAt(0),a="",c=0,l=e.length;c<l;){var u=e.charAt(c++),h=u.charCodeAt(),f=void 0;if(h<32||h>126){if(h>=55296&&h<=56319&&c<l){var d=e.charCodeAt(c++);(d&64512)==56320?h=((h&1023)<<10)+(d&1023)+65536:c--}f="\\"+h.toString(16).toUpperCase()+" "}else t.escapeEverything?fPe.test(u)?f="\\"+u:f="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(u)?f="\\"+h.toString(16).toUpperCase()+" ":u=="\\"||!s&&(u=='"'&&i==u||u=="'"&&i==u)||s&&dPe.test(u)?f="\\"+u:f=u;a+=f}return s&&(/^-[-\d]/.test(a)?a="\\-"+a.slice(1):/\d/.test(n)&&(a="\\3"+n+" "+a.slice(1))),a=a.replace(pPe,function(p,m,y){return m&&m.length%2?p:(m||"")+y}),!s&&t.wrap?i+a+i:a},"cssesc");ik.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};ik.version="3.0.0";x6.exports=ik});var nk=g((mf,M6)=>{"use strict";mf.__esModule=!0;mf.default=void 0;var gPe=L6(gw()),mPe=hf(),yPe=L6(us()),SPe=Xe();function L6(r){return r&&r.__esModule?r:{default:r}}o(L6,"_interopRequireDefault");function D6(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(D6,"_defineProperties");function wPe(r,e,t){return e&&D6(r.prototype,e),t&&D6(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(wPe,"_createClass");function vPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,sk(r,e)}o(vPe,"_inheritsLoose");function sk(r,e){return sk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),sk(r,e)}o(sk,"_setPrototypeOf");var EPe=(function(r){vPe(e,r);function e(i){var s;return s=r.call(this,i)||this,s.type=SPe.CLASS,s._constructed=!0,s}o(e,"ClassName");var t=e.prototype;return t.valueToString=o(function(){return"."+r.prototype.valueToString.call(this)},"valueToString"),wPe(e,[{key:"value",get:o(function(){return this._value},"get"),set:o(function(s){if(this._constructed){var n=(0,gPe.default)(s,{isIdentifier:!0});n!==s?((0,mPe.ensureObject)(this,"raws"),this.raws.value=n):this.raws&&delete this.raws.value}this._value=s},"set")}]),e})(yPe.default);mf.default=EPe;M6.exports=mf.default});var ak=g((yf,F6)=>{"use strict";yf.__esModule=!0;yf.default=void 0;var _Pe=OPe(us()),bPe=Xe();function OPe(r){return r&&r.__esModule?r:{default:r}}o(OPe,"_interopRequireDefault");function IPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ok(r,e)}o(IPe,"_inheritsLoose");function ok(r,e){return ok=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),ok(r,e)}o(ok,"_setPrototypeOf");var TPe=(function(r){IPe(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=bPe.COMMENT,i}return o(e,"Comment"),e})(_Pe.default);yf.default=TPe;F6.exports=yf.default});var lk=g((Sf,B6)=>{"use strict";Sf.__esModule=!0;Sf.default=void 0;var RPe=CPe(us()),APe=Xe();function CPe(r){return r&&r.__esModule?r:{default:r}}o(CPe,"_interopRequireDefault");function kPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ck(r,e)}o(kPe,"_inheritsLoose");function ck(r,e){return ck=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),ck(r,e)}o(ck,"_setPrototypeOf");var PPe=(function(r){kPe(e,r);function e(i){var s;return s=r.call(this,i)||this,s.type=APe.ID,s}o(e,"ID");var t=e.prototype;return t.valueToString=o(function(){return"#"+r.prototype.valueToString.call(this)},"valueToString"),e})(RPe.default);Sf.default=PPe;B6.exports=Sf.default});var mw=g((wf,$6)=>{"use strict";wf.__esModule=!0;wf.default=void 0;var NPe=j6(gw()),xPe=hf(),DPe=j6(us());function j6(r){return r&&r.__esModule?r:{default:r}}o(j6,"_interopRequireDefault");function q6(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(q6,"_defineProperties");function LPe(r,e,t){return e&&q6(r.prototype,e),t&&q6(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(LPe,"_createClass");function MPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,uk(r,e)}o(MPe,"_inheritsLoose");function uk(r,e){return uk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),uk(r,e)}o(uk,"_setPrototypeOf");var FPe=(function(r){MPe(e,r);function e(){return r.apply(this,arguments)||this}o(e,"Namespace");var t=e.prototype;return t.qualifiedName=o(function(s){return this.namespace?this.namespaceString+"|"+s:s},"qualifiedName"),t.valueToString=o(function(){return this.qualifiedName(r.prototype.valueToString.call(this))},"valueToString"),LPe(e,[{key:"namespace",get:o(function(){return this._namespace},"get"),set:o(function(s){if(s===!0||s==="*"||s==="&"){this._namespace=s,this.raws&&delete this.raws.namespace;return}var n=(0,NPe.default)(s,{isIdentifier:!0});this._namespace=s,n!==s?((0,xPe.ensureObject)(this,"raws"),this.raws.namespace=n):this.raws&&delete this.raws.namespace},"set")},{key:"ns",get:o(function(){return this._namespace},"get"),set:o(function(s){this.namespace=s},"set")},{key:"namespaceString",get:o(function(){if(this.namespace){var s=this.stringifyProperty("namespace");return s===!0?"":s}else return""},"get")}]),e})(DPe.default);wf.default=FPe;$6.exports=wf.default});var fk=g((vf,U6)=>{"use strict";vf.__esModule=!0;vf.default=void 0;var BPe=jPe(mw()),qPe=Xe();function jPe(r){return r&&r.__esModule?r:{default:r}}o(jPe,"_interopRequireDefault");function $Pe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,hk(r,e)}o($Pe,"_inheritsLoose");function hk(r,e){return hk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),hk(r,e)}o(hk,"_setPrototypeOf");var UPe=(function(r){$Pe(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=qPe.TAG,i}return o(e,"Tag"),e})(BPe.default);vf.default=UPe;U6.exports=vf.default});var pk=g((Ef,V6)=>{"use strict";Ef.__esModule=!0;Ef.default=void 0;var VPe=GPe(us()),zPe=Xe();function GPe(r){return r&&r.__esModule?r:{default:r}}o(GPe,"_interopRequireDefault");function HPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,dk(r,e)}o(HPe,"_inheritsLoose");function dk(r,e){return dk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),dk(r,e)}o(dk,"_setPrototypeOf");var WPe=(function(r){HPe(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=zPe.STRING,i}return o(e,"String"),e})(VPe.default);Ef.default=WPe;V6.exports=Ef.default});var mk=g((_f,z6)=>{"use strict";_f.__esModule=!0;_f.default=void 0;var JPe=YPe(pw()),KPe=Xe();function YPe(r){return r&&r.__esModule?r:{default:r}}o(YPe,"_interopRequireDefault");function ZPe(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,gk(r,e)}o(ZPe,"_inheritsLoose");function gk(r,e){return gk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),gk(r,e)}o(gk,"_setPrototypeOf");var XPe=(function(r){ZPe(e,r);function e(i){var s;return s=r.call(this,i)||this,s.type=KPe.PSEUDO,s}o(e,"Pseudo");var t=e.prototype;return t.toString=o(function(){var s=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),s,this.rawSpaceAfter].join("")},"toString"),e})(JPe.default);_f.default=XPe;z6.exports=_f.default});var H6=g((YKe,G6)=>{G6.exports=require("util").deprecate});var _k=g(If=>{"use strict";If.__esModule=!0;If.default=void 0;If.unescapeValue=Ek;var bf=vk(gw()),QPe=vk(ZC()),e1e=vk(mw()),t1e=Xe(),yk;function vk(r){return r&&r.__esModule?r:{default:r}}o(vk,"_interopRequireDefault");function W6(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(W6,"_defineProperties");function r1e(r,e,t){return e&&W6(r.prototype,e),t&&W6(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(r1e,"_createClass");function i1e(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,wk(r,e)}o(i1e,"_inheritsLoose");function wk(r,e){return wk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),wk(r,e)}o(wk,"_setPrototypeOf");var Of=H6(),s1e=/^('|")([^]*)\1$/,n1e=Of(function(){},"Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."),o1e=Of(function(){},"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."),a1e=Of(function(){},"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");function Ek(r){var e=!1,t=null,i=r,s=i.match(s1e);return s&&(t=s[1],i=s[2]),i=(0,QPe.default)(i),i!==r&&(e=!0),{deprecatedUsage:e,unescaped:i,quoteMark:t}}o(Ek,"unescapeValue");function c1e(r){if(r.quoteMark!==void 0||r.value===void 0)return r;a1e();var e=Ek(r.value),t=e.quoteMark,i=e.unescaped;return r.raws||(r.raws={}),r.raws.value===void 0&&(r.raws.value=r.value),r.value=i,r.quoteMark=t,r}o(c1e,"handleDeprecatedContructorOpts");var yw=(function(r){i1e(e,r);function e(i){var s;return i===void 0&&(i={}),s=r.call(this,c1e(i))||this,s.type=t1e.ATTRIBUTE,s.raws=s.raws||{},Object.defineProperty(s.raws,"unquoted",{get:Of(function(){return s.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:Of(function(){return s.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")}),s._constructed=!0,s}o(e,"Attribute");var t=e.prototype;return t.getQuotedValue=o(function(s){s===void 0&&(s={});var n=this._determineQuoteMark(s),a=Sk[n],c=(0,bf.default)(this._value,a);return c},"getQuotedValue"),t._determineQuoteMark=o(function(s){return s.smart?this.smartQuoteMark(s):this.preferredQuoteMark(s)},"_determineQuoteMark"),t.setValue=o(function(s,n){n===void 0&&(n={}),this._value=s,this._quoteMark=this._determineQuoteMark(n),this._syncRawValue()},"setValue"),t.smartQuoteMark=o(function(s){var n=this.value,a=n.replace(/[^']/g,"").length,c=n.replace(/[^"]/g,"").length;if(a+c===0){var l=(0,bf.default)(n,{isIdentifier:!0});if(l===n)return e.NO_QUOTE;var u=this.preferredQuoteMark(s);if(u===e.NO_QUOTE){var h=this.quoteMark||s.quoteMark||e.DOUBLE_QUOTE,f=Sk[h],d=(0,bf.default)(n,f);if(d.length<l.length)return h}return u}else return c===a?this.preferredQuoteMark(s):c<a?e.DOUBLE_QUOTE:e.SINGLE_QUOTE},"smartQuoteMark"),t.preferredQuoteMark=o(function(s){var n=s.preferCurrentQuoteMark?this.quoteMark:s.quoteMark;return n===void 0&&(n=s.preferCurrentQuoteMark?s.quoteMark:this.quoteMark),n===void 0&&(n=e.DOUBLE_QUOTE),n},"preferredQuoteMark"),t._syncRawValue=o(function(){var s=(0,bf.default)(this._value,Sk[this.quoteMark]);s===this._value?this.raws&&delete this.raws.value:this.raws.value=s},"_syncRawValue"),t._handleEscapes=o(function(s,n){if(this._constructed){var a=(0,bf.default)(n,{isIdentifier:!0});a!==n?this.raws[s]=a:delete this.raws[s]}},"_handleEscapes"),t._spacesFor=o(function(s){var n={before:"",after:""},a=this.spaces[s]||{},c=this.raws.spaces&&this.raws.spaces[s]||{};return Object.assign(n,a,c)},"_spacesFor"),t._stringFor=o(function(s,n,a){n===void 0&&(n=s),a===void 0&&(a=J6);var c=this._spacesFor(n);return a(this.stringifyProperty(s),c)},"_stringFor"),t.offsetOf=o(function(s){var n=1,a=this._spacesFor("attribute");if(n+=a.before.length,s==="namespace"||s==="ns")return this.namespace?n:-1;if(s==="attributeNS"||(n+=this.namespaceString.length,this.namespace&&(n+=1),s==="attribute"))return n;n+=this.stringifyProperty("attribute").length,n+=a.after.length;var c=this._spacesFor("operator");n+=c.before.length;var l=this.stringifyProperty("operator");if(s==="operator")return l?n:-1;n+=l.length,n+=c.after.length;var u=this._spacesFor("value");n+=u.before.length;var h=this.stringifyProperty("value");if(s==="value")return h?n:-1;n+=h.length,n+=u.after.length;var f=this._spacesFor("insensitive");return n+=f.before.length,s==="insensitive"&&this.insensitive?n:-1},"offsetOf"),t.toString=o(function(){var s=this,n=[this.rawSpaceBefore,"["];return n.push(this._stringFor("qualifiedAttribute","attribute")),this.operator&&(this.value||this.value==="")&&(n.push(this._stringFor("operator")),n.push(this._stringFor("value")),n.push(this._stringFor("insensitiveFlag","insensitive",function(a,c){return a.length>0&&!s.quoted&&c.before.length===0&&!(s.spaces.value&&s.spaces.value.after)&&(c.before=" "),J6(a,c)}))),n.push("]"),n.push(this.rawSpaceAfter),n.join("")},"toString"),r1e(e,[{key:"quoted",get:o(function(){var s=this.quoteMark;return s==="'"||s==='"'},"get"),set:o(function(s){o1e()},"set")},{key:"quoteMark",get:o(function(){return this._quoteMark},"get"),set:o(function(s){if(!this._constructed){this._quoteMark=s;return}this._quoteMark!==s&&(this._quoteMark=s,this._syncRawValue())},"set")},{key:"qualifiedAttribute",get:o(function(){return this.qualifiedName(this.raws.attribute||this.attribute)},"get")},{key:"insensitiveFlag",get:o(function(){return this.insensitive?"i":""},"get")},{key:"value",get:o(function(){return this._value},"get"),set:o(function(s){if(this._constructed){var n=Ek(s),a=n.deprecatedUsage,c=n.unescaped,l=n.quoteMark;if(a&&n1e(),c===this._value&&l===this._quoteMark)return;this._value=c,this._quoteMark=l,this._syncRawValue()}else this._value=s},"set")},{key:"insensitive",get:o(function(){return this._insensitive},"get"),set:o(function(s){s||(this._insensitive=!1,this.raws&&(this.raws.insensitiveFlag==="I"||this.raws.insensitiveFlag==="i")&&(this.raws.insensitiveFlag=void 0)),this._insensitive=s},"set")},{key:"attribute",get:o(function(){return this._attribute},"get"),set:o(function(s){this._handleEscapes("attribute",s),this._attribute=s},"set")}]),e})(e1e.default);If.default=yw;yw.NO_QUOTE=null;yw.SINGLE_QUOTE="'";yw.DOUBLE_QUOTE='"';var Sk=(yk={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}},yk[null]={isIdentifier:!0},yk);function J6(r,e){return""+e.before+r+e.after}o(J6,"defaultAttrConcat")});var Ok=g((Tf,K6)=>{"use strict";Tf.__esModule=!0;Tf.default=void 0;var l1e=h1e(mw()),u1e=Xe();function h1e(r){return r&&r.__esModule?r:{default:r}}o(h1e,"_interopRequireDefault");function f1e(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,bk(r,e)}o(f1e,"_inheritsLoose");function bk(r,e){return bk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),bk(r,e)}o(bk,"_setPrototypeOf");var d1e=(function(r){f1e(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=u1e.UNIVERSAL,i.value="*",i}return o(e,"Universal"),e})(l1e.default);Tf.default=d1e;K6.exports=Tf.default});var Tk=g((Rf,Y6)=>{"use strict";Rf.__esModule=!0;Rf.default=void 0;var p1e=m1e(us()),g1e=Xe();function m1e(r){return r&&r.__esModule?r:{default:r}}o(m1e,"_interopRequireDefault");function y1e(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,Ik(r,e)}o(y1e,"_inheritsLoose");function Ik(r,e){return Ik=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),Ik(r,e)}o(Ik,"_setPrototypeOf");var S1e=(function(r){y1e(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=g1e.COMBINATOR,i}return o(e,"Combinator"),e})(p1e.default);Rf.default=S1e;Y6.exports=Rf.default});var Ak=g((Af,Z6)=>{"use strict";Af.__esModule=!0;Af.default=void 0;var w1e=E1e(us()),v1e=Xe();function E1e(r){return r&&r.__esModule?r:{default:r}}o(E1e,"_interopRequireDefault");function _1e(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,Rk(r,e)}o(_1e,"_inheritsLoose");function Rk(r,e){return Rk=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),Rk(r,e)}o(Rk,"_setPrototypeOf");var b1e=(function(r){_1e(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=v1e.NESTING,i.value="&",i}return o(e,"Nesting"),e})(w1e.default);Af.default=b1e;Z6.exports=Af.default});var Q6=g((Sw,X6)=>{"use strict";Sw.__esModule=!0;Sw.default=O1e;function O1e(r){return r.sort(function(e,t){return e-t})}o(O1e,"sortAscending");X6.exports=Sw.default});var Ck=g(x=>{"use strict";x.__esModule=!0;x.word=x.tilde=x.tab=x.str=x.space=x.slash=x.singleQuote=x.semicolon=x.plus=x.pipe=x.openSquare=x.openParenthesis=x.newline=x.greaterThan=x.feed=x.equals=x.doubleQuote=x.dollar=x.cr=x.comment=x.comma=x.combinator=x.colon=x.closeSquare=x.closeParenthesis=x.caret=x.bang=x.backslash=x.at=x.asterisk=x.ampersand=void 0;var I1e=38;x.ampersand=I1e;var T1e=42;x.asterisk=T1e;var R1e=64;x.at=R1e;var A1e=44;x.comma=A1e;var C1e=58;x.colon=C1e;var k1e=59;x.semicolon=k1e;var P1e=40;x.openParenthesis=P1e;var N1e=41;x.closeParenthesis=N1e;var x1e=91;x.openSquare=x1e;var D1e=93;x.closeSquare=D1e;var L1e=36;x.dollar=L1e;var M1e=126;x.tilde=M1e;var F1e=94;x.caret=F1e;var B1e=43;x.plus=B1e;var q1e=61;x.equals=q1e;var j1e=124;x.pipe=j1e;var $1e=62;x.greaterThan=$1e;var U1e=32;x.space=U1e;var eJ=39;x.singleQuote=eJ;var V1e=34;x.doubleQuote=V1e;var z1e=47;x.slash=z1e;var G1e=33;x.bang=G1e;var H1e=92;x.backslash=H1e;var W1e=13;x.cr=W1e;var J1e=12;x.feed=J1e;var K1e=10;x.newline=K1e;var Y1e=9;x.tab=Y1e;var Z1e=eJ;x.str=Z1e;var X1e=-1;x.comment=X1e;var Q1e=-2;x.word=Q1e;var eNe=-3;x.combinator=eNe});var iJ=g(Cf=>{"use strict";Cf.__esModule=!0;Cf.FIELDS=void 0;Cf.default=aNe;var C=tNe(Ck()),Qc,le;function rJ(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(rJ=o(function(s){return s?t:e},"_getRequireWildcardCache"))(r)}o(rJ,"_getRequireWildcardCache");function tNe(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=rJ(e);if(t&&t.has(r))return t.get(r);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(n!=="default"&&Object.prototype.hasOwnProperty.call(r,n)){var a=s?Object.getOwnPropertyDescriptor(r,n):null;a&&(a.get||a.set)?Object.defineProperty(i,n,a):i[n]=r[n]}return i.default=r,t&&t.set(r,i),i}o(tNe,"_interopRequireWildcard");var rNe=(Qc={},Qc[C.tab]=!0,Qc[C.newline]=!0,Qc[C.cr]=!0,Qc[C.feed]=!0,Qc),iNe=(le={},le[C.space]=!0,le[C.tab]=!0,le[C.newline]=!0,le[C.cr]=!0,le[C.feed]=!0,le[C.ampersand]=!0,le[C.asterisk]=!0,le[C.bang]=!0,le[C.comma]=!0,le[C.colon]=!0,le[C.semicolon]=!0,le[C.openParenthesis]=!0,le[C.closeParenthesis]=!0,le[C.openSquare]=!0,le[C.closeSquare]=!0,le[C.singleQuote]=!0,le[C.doubleQuote]=!0,le[C.plus]=!0,le[C.pipe]=!0,le[C.tilde]=!0,le[C.greaterThan]=!0,le[C.equals]=!0,le[C.dollar]=!0,le[C.caret]=!0,le[C.slash]=!0,le),kk={},tJ="0123456789abcdefABCDEF";for(ww=0;ww<tJ.length;ww++)kk[tJ.charCodeAt(ww)]=!0;var ww;function sNe(r,e){var t=e,i;do{if(i=r.charCodeAt(t),iNe[i])return t-1;i===C.backslash?t=nNe(r,t)+1:t++}while(t<r.length);return t-1}o(sNe,"consumeWord");function nNe(r,e){var t=e,i=r.charCodeAt(t+1);if(!rNe[i])if(kk[i]){var s=0;do t++,s++,i=r.charCodeAt(t+1);while(kk[i]&&s<6);s<6&&i===C.space&&t++}else t++;return t}o(nNe,"consumeEscape");var oNe={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6};Cf.FIELDS=oNe;function aNe(r){var e=[],t=r.css.valueOf(),i=t,s=i.length,n=-1,a=1,c=0,l=0,u,h,f,d,p,m,y,w,S,v,_,E,b;function O(T,I){if(r.safe)t+=I,S=t.length-1;else throw r.error("Unclosed "+T,a,c-n,c)}for(o(O,"unclosed");c<s;){switch(u=t.charCodeAt(c),u===C.newline&&(n=c,a+=1),u){case C.space:case C.tab:case C.newline:case C.cr:case C.feed:S=c;do S+=1,u=t.charCodeAt(S),u===C.newline&&(n=S,a+=1);while(u===C.space||u===C.newline||u===C.tab||u===C.cr||u===C.feed);b=C.space,d=a,f=S-n-1,l=S;break;case C.plus:case C.greaterThan:case C.tilde:case C.pipe:S=c;do S+=1,u=t.charCodeAt(S);while(u===C.plus||u===C.greaterThan||u===C.tilde||u===C.pipe);b=C.combinator,d=a,f=c-n,l=S;break;case C.asterisk:case C.ampersand:case C.bang:case C.comma:case C.equals:case C.dollar:case C.caret:case C.openSquare:case C.closeSquare:case C.colon:case C.semicolon:case C.openParenthesis:case C.closeParenthesis:S=c,b=u,d=a,f=c-n,l=S+1;break;case C.singleQuote:case C.doubleQuote:E=u===C.singleQuote?"'":'"',S=c;do for(p=!1,S=t.indexOf(E,S+1),S===-1&&O("quote",E),m=S;t.charCodeAt(m-1)===C.backslash;)m-=1,p=!p;while(p);b=C.str,d=a,f=c-n,l=S+1;break;default:u===C.slash&&t.charCodeAt(c+1)===C.asterisk?(S=t.indexOf("*/",c+2)+1,S===0&&O("comment","*/"),h=t.slice(c,S+1),w=h.split(`
150
+ `),y=w.length-1,y>0?(v=a+y,_=S-w[y].length):(v=a,_=n),b=C.comment,a=v,d=v,f=S-_):u===C.slash?(S=c,b=u,d=a,f=c-n,l=S+1):(S=sNe(t,c),b=C.word,d=a,f=S-n),l=S+1;break}e.push([b,a,c-n,d,f,c,l]),_&&(n=_,_=null),c=l}return e}o(aNe,"tokenize")});var hJ=g((kf,uJ)=>{"use strict";kf.__esModule=!0;kf.default=void 0;var cNe=br(ek()),Pk=br(rk()),lNe=br(nk()),sJ=br(ak()),uNe=br(lk()),hNe=br(fk()),Nk=br(pk()),fNe=br(mk()),nJ=vw(_k()),dNe=br(Ok()),xk=br(Tk()),pNe=br(Ak()),gNe=br(Q6()),R=vw(iJ()),k=vw(Ck()),mNe=vw(Xe()),_e=hf(),Mo,Dk;function lJ(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(lJ=o(function(s){return s?t:e},"_getRequireWildcardCache"))(r)}o(lJ,"_getRequireWildcardCache");function vw(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=lJ(e);if(t&&t.has(r))return t.get(r);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(n!=="default"&&Object.prototype.hasOwnProperty.call(r,n)){var a=s?Object.getOwnPropertyDescriptor(r,n):null;a&&(a.get||a.set)?Object.defineProperty(i,n,a):i[n]=r[n]}return i.default=r,t&&t.set(r,i),i}o(vw,"_interopRequireWildcard");function br(r){return r&&r.__esModule?r:{default:r}}o(br,"_interopRequireDefault");function oJ(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}o(oJ,"_defineProperties");function yNe(r,e,t){return e&&oJ(r.prototype,e),t&&oJ(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(yNe,"_createClass");var Fk=(Mo={},Mo[k.space]=!0,Mo[k.cr]=!0,Mo[k.feed]=!0,Mo[k.newline]=!0,Mo[k.tab]=!0,Mo),SNe=Object.assign({},Fk,(Dk={},Dk[k.comment]=!0,Dk));function aJ(r){return{line:r[R.FIELDS.START_LINE],column:r[R.FIELDS.START_COL]}}o(aJ,"tokenStart");function cJ(r){return{line:r[R.FIELDS.END_LINE],column:r[R.FIELDS.END_COL]}}o(cJ,"tokenEnd");function Fo(r,e,t,i){return{start:{line:r,column:e},end:{line:t,column:i}}}o(Fo,"getSource");function el(r){return Fo(r[R.FIELDS.START_LINE],r[R.FIELDS.START_COL],r[R.FIELDS.END_LINE],r[R.FIELDS.END_COL])}o(el,"getTokenSource");function Lk(r,e){if(r)return Fo(r[R.FIELDS.START_LINE],r[R.FIELDS.START_COL],e[R.FIELDS.END_LINE],e[R.FIELDS.END_COL])}o(Lk,"getTokenSourceSpan");function tl(r,e){var t=r[e];if(typeof t=="string")return t.indexOf("\\")!==-1&&((0,_e.ensureObject)(r,"raws"),r[e]=(0,_e.unesc)(t),r.raws[e]===void 0&&(r.raws[e]=t)),r}o(tl,"unescapeProp");function Mk(r,e){for(var t=-1,i=[];(t=r.indexOf(e,t+1))!==-1;)i.push(t);return i}o(Mk,"indexesOf");function wNe(){var r=Array.prototype.concat.apply([],arguments);return r.filter(function(e,t){return t===r.indexOf(e)})}o(wNe,"uniqs");var vNe=(function(){function r(t,i){i===void 0&&(i={}),this.rule=t,this.options=Object.assign({lossy:!1,safe:!1},i),this.position=0,this.css=typeof this.rule=="string"?this.rule:this.rule.selector,this.tokens=(0,R.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var s=Lk(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new cNe.default({source:s}),this.root.errorGenerator=this._errorGenerator();var n=new Pk.default({source:{start:{line:1,column:1}},sourceIndex:0});this.root.append(n),this.current=n,this.loop()}o(r,"Parser");var e=r.prototype;return e._errorGenerator=o(function(){var i=this;return function(s,n){return typeof i.rule=="string"?new Error(s):i.rule.error(s,n)}},"_errorGenerator"),e.attribute=o(function(){var i=[],s=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[R.FIELDS.TYPE]!==k.closeSquare;)i.push(this.currToken),this.position++;if(this.currToken[R.FIELDS.TYPE]!==k.closeSquare)return this.expected("closing square bracket",this.currToken[R.FIELDS.START_POS]);var n=i.length,a={source:Fo(s[1],s[2],this.currToken[3],this.currToken[4]),sourceIndex:s[R.FIELDS.START_POS]};if(n===1&&!~[k.word].indexOf(i[0][R.FIELDS.TYPE]))return this.expected("attribute",i[0][R.FIELDS.START_POS]);for(var c=0,l="",u="",h=null,f=!1;c<n;){var d=i[c],p=this.content(d),m=i[c+1];switch(d[R.FIELDS.TYPE]){case k.space:if(f=!0,this.options.lossy)break;if(h){(0,_e.ensureObject)(a,"spaces",h);var y=a.spaces[h].after||"";a.spaces[h].after=y+p;var w=(0,_e.getProp)(a,"raws","spaces",h,"after")||null;w&&(a.raws.spaces[h].after=w+p)}else l=l+p,u=u+p;break;case k.asterisk:if(m[R.FIELDS.TYPE]===k.equals)a.operator=p,h="operator";else if((!a.namespace||h==="namespace"&&!f)&&m){l&&((0,_e.ensureObject)(a,"spaces","attribute"),a.spaces.attribute.before=l,l=""),u&&((0,_e.ensureObject)(a,"raws","spaces","attribute"),a.raws.spaces.attribute.before=l,u=""),a.namespace=(a.namespace||"")+p;var S=(0,_e.getProp)(a,"raws","namespace")||null;S&&(a.raws.namespace+=p),h="namespace"}f=!1;break;case k.dollar:if(h==="value"){var v=(0,_e.getProp)(a,"raws","value");a.value+="$",v&&(a.raws.value=v+"$");break}case k.caret:m[R.FIELDS.TYPE]===k.equals&&(a.operator=p,h="operator"),f=!1;break;case k.combinator:if(p==="~"&&m[R.FIELDS.TYPE]===k.equals&&(a.operator=p,h="operator"),p!=="|"){f=!1;break}m[R.FIELDS.TYPE]===k.equals?(a.operator=p,h="operator"):!a.namespace&&!a.attribute&&(a.namespace=!0),f=!1;break;case k.word:if(m&&this.content(m)==="|"&&i[c+2]&&i[c+2][R.FIELDS.TYPE]!==k.equals&&!a.operator&&!a.namespace)a.namespace=p,h="namespace";else if(!a.attribute||h==="attribute"&&!f){l&&((0,_e.ensureObject)(a,"spaces","attribute"),a.spaces.attribute.before=l,l=""),u&&((0,_e.ensureObject)(a,"raws","spaces","attribute"),a.raws.spaces.attribute.before=u,u=""),a.attribute=(a.attribute||"")+p;var _=(0,_e.getProp)(a,"raws","attribute")||null;_&&(a.raws.attribute+=p),h="attribute"}else if(!a.value&&a.value!==""||h==="value"&&!(f||a.quoteMark)){var E=(0,_e.unesc)(p),b=(0,_e.getProp)(a,"raws","value")||"",O=a.value||"";a.value=O+E,a.quoteMark=null,(E!==p||b)&&((0,_e.ensureObject)(a,"raws"),a.raws.value=(b||O)+p),h="value"}else{var T=p==="i"||p==="I";(a.value||a.value==="")&&(a.quoteMark||f)?(a.insensitive=T,(!T||p==="I")&&((0,_e.ensureObject)(a,"raws"),a.raws.insensitiveFlag=p),h="insensitive",l&&((0,_e.ensureObject)(a,"spaces","insensitive"),a.spaces.insensitive.before=l,l=""),u&&((0,_e.ensureObject)(a,"raws","spaces","insensitive"),a.raws.spaces.insensitive.before=u,u="")):(a.value||a.value==="")&&(h="value",a.value+=p,a.raws.value&&(a.raws.value+=p))}f=!1;break;case k.str:if(!a.attribute||!a.operator)return this.error("Expected an attribute followed by an operator preceding the string.",{index:d[R.FIELDS.START_POS]});var I=(0,nJ.unescapeValue)(p),L=I.unescaped,F=I.quoteMark;a.value=L,a.quoteMark=F,h="value",(0,_e.ensureObject)(a,"raws"),a.raws.value=p,f=!1;break;case k.equals:if(!a.attribute)return this.expected("attribute",d[R.FIELDS.START_POS],p);if(a.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:d[R.FIELDS.START_POS]});a.operator=a.operator?a.operator+p:p,h="operator",f=!1;break;case k.comment:if(h)if(f||m&&m[R.FIELDS.TYPE]===k.space||h==="insensitive"){var X=(0,_e.getProp)(a,"spaces",h,"after")||"",Ce=(0,_e.getProp)(a,"raws","spaces",h,"after")||X;(0,_e.ensureObject)(a,"raws","spaces",h),a.raws.spaces[h].after=Ce+p}else{var Wt=a[h]||"",Ie=(0,_e.getProp)(a,"raws",h)||Wt;(0,_e.ensureObject)(a,"raws"),a.raws[h]=Ie+p}else u=u+p;break;default:return this.error('Unexpected "'+p+'" found.',{index:d[R.FIELDS.START_POS]})}c++}tl(a,"attribute"),tl(a,"namespace"),this.newNode(new nJ.default(a)),this.position++},"attribute"),e.parseWhitespaceEquivalentTokens=o(function(i){i<0&&(i=this.tokens.length);var s=this.position,n=[],a="",c=void 0;do if(Fk[this.currToken[R.FIELDS.TYPE]])this.options.lossy||(a+=this.content());else if(this.currToken[R.FIELDS.TYPE]===k.comment){var l={};a&&(l.before=a,a=""),c=new sJ.default({value:this.content(),source:el(this.currToken),sourceIndex:this.currToken[R.FIELDS.START_POS],spaces:l}),n.push(c)}while(++this.position<i);if(a){if(c)c.spaces.after=a;else if(!this.options.lossy){var u=this.tokens[s],h=this.tokens[this.position-1];n.push(new Nk.default({value:"",source:Fo(u[R.FIELDS.START_LINE],u[R.FIELDS.START_COL],h[R.FIELDS.END_LINE],h[R.FIELDS.END_COL]),sourceIndex:u[R.FIELDS.START_POS],spaces:{before:a,after:""}}))}}return n},"parseWhitespaceEquivalentTokens"),e.convertWhitespaceNodesToSpace=o(function(i,s){var n=this;s===void 0&&(s=!1);var a="",c="";i.forEach(function(u){var h=n.lossySpace(u.spaces.before,s),f=n.lossySpace(u.rawSpaceBefore,s);a+=h+n.lossySpace(u.spaces.after,s&&h.length===0),c+=h+u.value+n.lossySpace(u.rawSpaceAfter,s&&f.length===0)}),c===a&&(c=void 0);var l={space:a,rawSpace:c};return l},"convertWhitespaceNodesToSpace"),e.isNamedCombinator=o(function(i){return i===void 0&&(i=this.position),this.tokens[i+0]&&this.tokens[i+0][R.FIELDS.TYPE]===k.slash&&this.tokens[i+1]&&this.tokens[i+1][R.FIELDS.TYPE]===k.word&&this.tokens[i+2]&&this.tokens[i+2][R.FIELDS.TYPE]===k.slash},"isNamedCombinator"),e.namedCombinator=o(function(){if(this.isNamedCombinator()){var i=this.content(this.tokens[this.position+1]),s=(0,_e.unesc)(i).toLowerCase(),n={};s!==i&&(n.value="/"+i+"/");var a=new xk.default({value:"/"+s+"/",source:Fo(this.currToken[R.FIELDS.START_LINE],this.currToken[R.FIELDS.START_COL],this.tokens[this.position+2][R.FIELDS.END_LINE],this.tokens[this.position+2][R.FIELDS.END_COL]),sourceIndex:this.currToken[R.FIELDS.START_POS],raws:n});return this.position=this.position+3,a}else this.unexpected()},"namedCombinator"),e.combinator=o(function(){var i=this;if(this.content()==="|")return this.namespace();var s=this.locateNextMeaningfulToken(this.position);if(s<0||this.tokens[s][R.FIELDS.TYPE]===k.comma||this.tokens[s][R.FIELDS.TYPE]===k.closeParenthesis){var n=this.parseWhitespaceEquivalentTokens(s);if(n.length>0){var a=this.current.last;if(a){var c=this.convertWhitespaceNodesToSpace(n),l=c.space,u=c.rawSpace;u!==void 0&&(a.rawSpaceAfter+=u),a.spaces.after+=l}else n.forEach(function(b){return i.newNode(b)})}return}var h=this.currToken,f=void 0;s>this.position&&(f=this.parseWhitespaceEquivalentTokens(s));var d;if(this.isNamedCombinator()?d=this.namedCombinator():this.currToken[R.FIELDS.TYPE]===k.combinator?(d=new xk.default({value:this.content(),source:el(this.currToken),sourceIndex:this.currToken[R.FIELDS.START_POS]}),this.position++):Fk[this.currToken[R.FIELDS.TYPE]]||f||this.unexpected(),d){if(f){var p=this.convertWhitespaceNodesToSpace(f),m=p.space,y=p.rawSpace;d.spaces.before=m,d.rawSpaceBefore=y}}else{var w=this.convertWhitespaceNodesToSpace(f,!0),S=w.space,v=w.rawSpace;v||(v=S);var _={},E={spaces:{}};S.endsWith(" ")&&v.endsWith(" ")?(_.before=S.slice(0,S.length-1),E.spaces.before=v.slice(0,v.length-1)):S.startsWith(" ")&&v.startsWith(" ")?(_.after=S.slice(1),E.spaces.after=v.slice(1)):E.value=v,d=new xk.default({value:" ",source:Lk(h,this.tokens[this.position-1]),sourceIndex:h[R.FIELDS.START_POS],spaces:_,raws:E})}return this.currToken&&this.currToken[R.FIELDS.TYPE]===k.space&&(d.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(d)},"combinator"),e.comma=o(function(){if(this.position===this.tokens.length-1){this.root.trailingComma=!0,this.position++;return}this.current._inferEndPosition();var i=new Pk.default({source:{start:aJ(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][R.FIELDS.START_POS]});this.current.parent.append(i),this.current=i,this.position++},"comma"),e.comment=o(function(){var i=this.currToken;this.newNode(new sJ.default({value:this.content(),source:el(i),sourceIndex:i[R.FIELDS.START_POS]})),this.position++},"comment"),e.error=o(function(i,s){throw this.root.error(i,s)},"error"),e.missingBackslash=o(function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[R.FIELDS.START_POS]})},"missingBackslash"),e.missingParenthesis=o(function(){return this.expected("opening parenthesis",this.currToken[R.FIELDS.START_POS])},"missingParenthesis"),e.missingSquareBracket=o(function(){return this.expected("opening square bracket",this.currToken[R.FIELDS.START_POS])},"missingSquareBracket"),e.unexpected=o(function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[R.FIELDS.START_POS])},"unexpected"),e.unexpectedPipe=o(function(){return this.error("Unexpected '|'.",this.currToken[R.FIELDS.START_POS])},"unexpectedPipe"),e.namespace=o(function(){var i=this.prevToken&&this.content(this.prevToken)||!0;if(this.nextToken[R.FIELDS.TYPE]===k.word)return this.position++,this.word(i);if(this.nextToken[R.FIELDS.TYPE]===k.asterisk)return this.position++,this.universal(i);this.unexpectedPipe()},"namespace"),e.nesting=o(function(){if(this.nextToken){var i=this.content(this.nextToken);if(i==="|"){this.position++;return}}var s=this.currToken;this.newNode(new pNe.default({value:this.content(),source:el(s),sourceIndex:s[R.FIELDS.START_POS]})),this.position++},"nesting"),e.parentheses=o(function(){var i=this.current.last,s=1;if(this.position++,i&&i.type===mNe.PSEUDO){var n=new Pk.default({source:{start:aJ(this.tokens[this.position])},sourceIndex:this.tokens[this.position][R.FIELDS.START_POS]}),a=this.current;for(i.append(n),this.current=n;this.position<this.tokens.length&&s;)this.currToken[R.FIELDS.TYPE]===k.openParenthesis&&s++,this.currToken[R.FIELDS.TYPE]===k.closeParenthesis&&s--,s?this.parse():(this.current.source.end=cJ(this.currToken),this.current.parent.source.end=cJ(this.currToken),this.position++);this.current=a}else{for(var c=this.currToken,l="(",u;this.position<this.tokens.length&&s;)this.currToken[R.FIELDS.TYPE]===k.openParenthesis&&s++,this.currToken[R.FIELDS.TYPE]===k.closeParenthesis&&s--,u=this.currToken,l+=this.parseParenthesisToken(this.currToken),this.position++;i?i.appendToPropertyAndEscape("value",l,l):this.newNode(new Nk.default({value:l,source:Fo(c[R.FIELDS.START_LINE],c[R.FIELDS.START_COL],u[R.FIELDS.END_LINE],u[R.FIELDS.END_COL]),sourceIndex:c[R.FIELDS.START_POS]}))}if(s)return this.expected("closing parenthesis",this.currToken[R.FIELDS.START_POS])},"parentheses"),e.pseudo=o(function(){for(var i=this,s="",n=this.currToken;this.currToken&&this.currToken[R.FIELDS.TYPE]===k.colon;)s+=this.content(),this.position++;if(!this.currToken)return this.expected(["pseudo-class","pseudo-element"],this.position-1);if(this.currToken[R.FIELDS.TYPE]===k.word)this.splitWord(!1,function(a,c){s+=a,i.newNode(new fNe.default({value:s,source:Lk(n,i.currToken),sourceIndex:n[R.FIELDS.START_POS]})),c>1&&i.nextToken&&i.nextToken[R.FIELDS.TYPE]===k.openParenthesis&&i.error("Misplaced parenthesis.",{index:i.nextToken[R.FIELDS.START_POS]})});else return this.expected(["pseudo-class","pseudo-element"],this.currToken[R.FIELDS.START_POS])},"pseudo"),e.space=o(function(){var i=this.content();this.position===0||this.prevToken[R.FIELDS.TYPE]===k.comma||this.prevToken[R.FIELDS.TYPE]===k.openParenthesis||this.current.nodes.every(function(s){return s.type==="comment"})?(this.spaces=this.optionalSpace(i),this.position++):this.position===this.tokens.length-1||this.nextToken[R.FIELDS.TYPE]===k.comma||this.nextToken[R.FIELDS.TYPE]===k.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(i),this.position++):this.combinator()},"space"),e.string=o(function(){var i=this.currToken;this.newNode(new Nk.default({value:this.content(),source:el(i),sourceIndex:i[R.FIELDS.START_POS]})),this.position++},"string"),e.universal=o(function(i){var s=this.nextToken;if(s&&this.content(s)==="|")return this.position++,this.namespace();var n=this.currToken;this.newNode(new dNe.default({value:this.content(),source:el(n),sourceIndex:n[R.FIELDS.START_POS]}),i),this.position++},"universal"),e.splitWord=o(function(i,s){for(var n=this,a=this.nextToken,c=this.content();a&&~[k.dollar,k.caret,k.equals,k.word].indexOf(a[R.FIELDS.TYPE]);){this.position++;var l=this.content();if(c+=l,l.lastIndexOf("\\")===l.length-1){var u=this.nextToken;u&&u[R.FIELDS.TYPE]===k.space&&(c+=this.requiredSpace(this.content(u)),this.position++)}a=this.nextToken}var h=Mk(c,".").filter(function(m){var y=c[m-1]==="\\",w=/^\d+\.\d+%$/.test(c);return!y&&!w}),f=Mk(c,"#").filter(function(m){return c[m-1]!=="\\"}),d=Mk(c,"#{");d.length&&(f=f.filter(function(m){return!~d.indexOf(m)}));var p=(0,gNe.default)(wNe([0].concat(h,f)));p.forEach(function(m,y){var w=p[y+1]||c.length,S=c.slice(m,w);if(y===0&&s)return s.call(n,S,p.length);var v,_=n.currToken,E=_[R.FIELDS.START_POS]+p[y],b=Fo(_[1],_[2]+m,_[3],_[2]+(w-1));if(~h.indexOf(m)){var O={value:S.slice(1),source:b,sourceIndex:E};v=new lNe.default(tl(O,"value"))}else if(~f.indexOf(m)){var T={value:S.slice(1),source:b,sourceIndex:E};v=new uNe.default(tl(T,"value"))}else{var I={value:S,source:b,sourceIndex:E};tl(I,"value"),v=new hNe.default(I)}n.newNode(v,i),i=null}),this.position++},"splitWord"),e.word=o(function(i){var s=this.nextToken;return s&&this.content(s)==="|"?(this.position++,this.namespace()):this.splitWord(i)},"word"),e.loop=o(function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},"loop"),e.parse=o(function(i){switch(this.currToken[R.FIELDS.TYPE]){case k.space:this.space();break;case k.comment:this.comment();break;case k.openParenthesis:this.parentheses();break;case k.closeParenthesis:i&&this.missingParenthesis();break;case k.openSquare:this.attribute();break;case k.dollar:case k.caret:case k.equals:case k.word:this.word();break;case k.colon:this.pseudo();break;case k.comma:this.comma();break;case k.asterisk:this.universal();break;case k.ampersand:this.nesting();break;case k.slash:case k.combinator:this.combinator();break;case k.str:this.string();break;case k.closeSquare:this.missingSquareBracket();case k.semicolon:this.missingBackslash();default:this.unexpected()}},"parse"),e.expected=o(function(i,s,n){if(Array.isArray(i)){var a=i.pop();i=i.join(", ")+" or "+a}var c=/^[aeiou]/.test(i[0])?"an":"a";return n?this.error("Expected "+c+" "+i+', found "'+n+'" instead.',{index:s}):this.error("Expected "+c+" "+i+".",{index:s})},"expected"),e.requiredSpace=o(function(i){return this.options.lossy?" ":i},"requiredSpace"),e.optionalSpace=o(function(i){return this.options.lossy?"":i},"optionalSpace"),e.lossySpace=o(function(i,s){return this.options.lossy?s?" ":"":i},"lossySpace"),e.parseParenthesisToken=o(function(i){var s=this.content(i);return i[R.FIELDS.TYPE]===k.space?this.requiredSpace(s):s},"parseParenthesisToken"),e.newNode=o(function(i,s){return s&&(/^ +$/.test(s)&&(this.options.lossy||(this.spaces=(this.spaces||"")+s),s=!0),i.namespace=s,tl(i,"namespace")),this.spaces&&(i.spaces.before=this.spaces,this.spaces=""),this.current.append(i)},"newNode"),e.content=o(function(i){return i===void 0&&(i=this.currToken),this.css.slice(i[R.FIELDS.START_POS],i[R.FIELDS.END_POS])},"content"),e.locateNextMeaningfulToken=o(function(i){i===void 0&&(i=this.position+1);for(var s=i;s<this.tokens.length;)if(SNe[this.tokens[s][R.FIELDS.TYPE]]){s++;continue}else return s;return-1},"locateNextMeaningfulToken"),yNe(r,[{key:"currToken",get:o(function(){return this.tokens[this.position]},"get")},{key:"nextToken",get:o(function(){return this.tokens[this.position+1]},"get")},{key:"prevToken",get:o(function(){return this.tokens[this.position-1]},"get")}]),r})();kf.default=vNe;uJ.exports=kf.default});var dJ=g((Pf,fJ)=>{"use strict";Pf.__esModule=!0;Pf.default=void 0;var ENe=_Ne(hJ());function _Ne(r){return r&&r.__esModule?r:{default:r}}o(_Ne,"_interopRequireDefault");var bNe=(function(){function r(t,i){this.func=t||o(function(){},"noop"),this.funcRes=null,this.options=i}o(r,"Processor");var e=r.prototype;return e._shouldUpdateSelector=o(function(i,s){s===void 0&&(s={});var n=Object.assign({},this.options,s);return n.updateSelector===!1?!1:typeof i!="string"},"_shouldUpdateSelector"),e._isLossy=o(function(i){i===void 0&&(i={});var s=Object.assign({},this.options,i);return s.lossless===!1},"_isLossy"),e._root=o(function(i,s){s===void 0&&(s={});var n=new ENe.default(i,this._parseOptions(s));return n.root},"_root"),e._parseOptions=o(function(i){return{lossy:this._isLossy(i)}},"_parseOptions"),e._run=o(function(i,s){var n=this;return s===void 0&&(s={}),new Promise(function(a,c){try{var l=n._root(i,s);Promise.resolve(n.func(l)).then(function(u){var h=void 0;return n._shouldUpdateSelector(i,s)&&(h=l.toString(),i.selector=h),{transform:u,root:l,string:h}}).then(a,c)}catch(u){c(u);return}})},"_run"),e._runSync=o(function(i,s){s===void 0&&(s={});var n=this._root(i,s),a=this.func(n);if(a&&typeof a.then=="function")throw new Error("Selector processor returned a promise to a synchronous call.");var c=void 0;return s.updateSelector&&typeof i!="string"&&(c=n.toString(),i.selector=c),{transform:a,root:n,string:c}},"_runSync"),e.ast=o(function(i,s){return this._run(i,s).then(function(n){return n.root})},"ast"),e.astSync=o(function(i,s){return this._runSync(i,s).root},"astSync"),e.transform=o(function(i,s){return this._run(i,s).then(function(n){return n.transform})},"transform"),e.transformSync=o(function(i,s){return this._runSync(i,s).transform},"transformSync"),e.process=o(function(i,s){return this._run(i,s).then(function(n){return n.string||n.root.toString()})},"process"),e.processSync=o(function(i,s){var n=this._runSync(i,s);return n.string||n.root.toString()},"processSync"),r})();Pf.default=bNe;fJ.exports=Pf.default});var pJ=g(pe=>{"use strict";pe.__esModule=!0;pe.universal=pe.tag=pe.string=pe.selector=pe.root=pe.pseudo=pe.nesting=pe.id=pe.comment=pe.combinator=pe.className=pe.attribute=void 0;var ONe=Or(_k()),INe=Or(nk()),TNe=Or(Tk()),RNe=Or(ak()),ANe=Or(lk()),CNe=Or(Ak()),kNe=Or(mk()),PNe=Or(ek()),NNe=Or(rk()),xNe=Or(pk()),DNe=Or(fk()),LNe=Or(Ok());function Or(r){return r&&r.__esModule?r:{default:r}}o(Or,"_interopRequireDefault");var MNe=o(function(e){return new ONe.default(e)},"attribute");pe.attribute=MNe;var FNe=o(function(e){return new INe.default(e)},"className");pe.className=FNe;var BNe=o(function(e){return new TNe.default(e)},"combinator");pe.combinator=BNe;var qNe=o(function(e){return new RNe.default(e)},"comment");pe.comment=qNe;var jNe=o(function(e){return new ANe.default(e)},"id");pe.id=jNe;var $Ne=o(function(e){return new CNe.default(e)},"nesting");pe.nesting=$Ne;var UNe=o(function(e){return new kNe.default(e)},"pseudo");pe.pseudo=UNe;var VNe=o(function(e){return new PNe.default(e)},"root");pe.root=VNe;var zNe=o(function(e){return new NNe.default(e)},"selector");pe.selector=zNe;var GNe=o(function(e){return new xNe.default(e)},"string");pe.string=GNe;var HNe=o(function(e){return new DNe.default(e)},"tag");pe.tag=HNe;var WNe=o(function(e){return new LNe.default(e)},"universal");pe.universal=WNe});var SJ=g(Z=>{"use strict";Z.__esModule=!0;Z.isComment=Z.isCombinator=Z.isClassName=Z.isAttribute=void 0;Z.isContainer=nxe;Z.isIdentifier=void 0;Z.isNamespace=oxe;Z.isNesting=void 0;Z.isNode=Bk;Z.isPseudo=void 0;Z.isPseudoClass=sxe;Z.isPseudoElement=yJ;Z.isUniversal=Z.isTag=Z.isString=Z.isSelector=Z.isRoot=void 0;var be=Xe(),Nt,JNe=(Nt={},Nt[be.ATTRIBUTE]=!0,Nt[be.CLASS]=!0,Nt[be.COMBINATOR]=!0,Nt[be.COMMENT]=!0,Nt[be.ID]=!0,Nt[be.NESTING]=!0,Nt[be.PSEUDO]=!0,Nt[be.ROOT]=!0,Nt[be.SELECTOR]=!0,Nt[be.STRING]=!0,Nt[be.TAG]=!0,Nt[be.UNIVERSAL]=!0,Nt);function Bk(r){return typeof r=="object"&&JNe[r.type]}o(Bk,"isNode");function Ir(r,e){return Bk(e)&&e.type===r}o(Ir,"isNodeType");var gJ=Ir.bind(null,be.ATTRIBUTE);Z.isAttribute=gJ;var KNe=Ir.bind(null,be.CLASS);Z.isClassName=KNe;var YNe=Ir.bind(null,be.COMBINATOR);Z.isCombinator=YNe;var ZNe=Ir.bind(null,be.COMMENT);Z.isComment=ZNe;var XNe=Ir.bind(null,be.ID);Z.isIdentifier=XNe;var QNe=Ir.bind(null,be.NESTING);Z.isNesting=QNe;var qk=Ir.bind(null,be.PSEUDO);Z.isPseudo=qk;var exe=Ir.bind(null,be.ROOT);Z.isRoot=exe;var txe=Ir.bind(null,be.SELECTOR);Z.isSelector=txe;var rxe=Ir.bind(null,be.STRING);Z.isString=rxe;var mJ=Ir.bind(null,be.TAG);Z.isTag=mJ;var ixe=Ir.bind(null,be.UNIVERSAL);Z.isUniversal=ixe;function yJ(r){return qk(r)&&r.value&&(r.value.startsWith("::")||r.value.toLowerCase()===":before"||r.value.toLowerCase()===":after"||r.value.toLowerCase()===":first-letter"||r.value.toLowerCase()===":first-line")}o(yJ,"isPseudoElement");function sxe(r){return qk(r)&&!yJ(r)}o(sxe,"isPseudoClass");function nxe(r){return!!(Bk(r)&&r.walk)}o(nxe,"isContainer");function oxe(r){return gJ(r)||mJ(r)}o(oxe,"isNamespace")});var wJ=g($r=>{"use strict";$r.__esModule=!0;var jk=Xe();Object.keys(jk).forEach(function(r){r==="default"||r==="__esModule"||r in $r&&$r[r]===jk[r]||($r[r]=jk[r])});var $k=pJ();Object.keys($k).forEach(function(r){r==="default"||r==="__esModule"||r in $r&&$r[r]===$k[r]||($r[r]=$k[r])});var Uk=SJ();Object.keys(Uk).forEach(function(r){r==="default"||r==="__esModule"||r in $r&&$r[r]===Uk[r]||($r[r]=Uk[r])})});var _J=g((Nf,EJ)=>{"use strict";Nf.__esModule=!0;Nf.default=void 0;var axe=uxe(dJ()),cxe=lxe(wJ());function vJ(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(vJ=o(function(s){return s?t:e},"_getRequireWildcardCache"))(r)}o(vJ,"_getRequireWildcardCache");function lxe(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=vJ(e);if(t&&t.has(r))return t.get(r);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(n!=="default"&&Object.prototype.hasOwnProperty.call(r,n)){var a=s?Object.getOwnPropertyDescriptor(r,n):null;a&&(a.get||a.set)?Object.defineProperty(i,n,a):i[n]=r[n]}return i.default=r,t&&t.set(r,i),i}o(lxe,"_interopRequireWildcard");function uxe(r){return r&&r.__esModule?r:{default:r}}o(uxe,"_interopRequireDefault");var Vk=o(function(e){return new axe.default(e)},"parser");Object.assign(Vk,cxe);delete Vk.__esModule;var hxe=Vk;Nf.default=hxe;EJ.exports=Nf.default});var AJ=g((pYe,RJ)=>{"use strict";var bJ=_J(),OJ=Symbol("arrayDelimiter"),fxe=o(r=>r.replace(/\//g,"\\/"),"escapeSlashes"),IJ=o(r=>r.replace(/\\\//g,"/"),"unescapeSlashes"),zk=o(r=>{let e=[],t={};for(let n of r.nodes){let[a]=n.nodes;a.type==="tag"&&e.push(a.value)}let i=r.nodes.pop(),[s]=i.nodes;if(s.value===":attr"){let n=zk(s);e.push(OJ,...n.lookupProperties),t.qualifiedAttribute=n.attributeMatcher.qualifiedAttribute,t.operator=n.attributeMatcher.operator,t.value=n.attributeMatcher.value,t.attribute=n.attributeMatcher.attribute,n.attributeMatcher.insensitive&&(t.insensitive=!0)}else{if(s.type!=="attribute")throw Object.assign(new Error("`:attr` pseudo-class expects an attribute matcher as the last value"),{code:"EQUERYATTR"});t.qualifiedAttribute=IJ(s.qualifiedAttribute),t.operator=s.operator,t.value=s.value,t.attribute=t.qualifiedAttribute,s.insensitive&&(t.insensitive=!0)}return r.lookupProperties=e,r.attributeMatcher=t,r.nodes.length=0,r},"fixupAttr"),dxe=o(r=>{let e=bJ.root();r.nestedNode=e,e.nodes=[...r.nodes],r.nodes.length=0;for(let t of e.nodes)t.parent=e;TJ(e)},"fixupNestedPseudo"),pxe=o(r=>{if(r.nodes.length===3){let e=r.nodes.pop().nodes[0];if(e.type==="tag")r.semverFunc=e.value;else if(e.type==="string")r.semverFunc=e.value.slice(1,-1);else throw Object.assign(new Error("`:semver` pseudo-class expects a function name as last value"),{code:"ESEMVERFUNC"})}if(r.nodes.length===1){let e=r.nodes.pop();r.semverValue=e.nodes.reduce((t,i)=>`${t}${String(i)}`,"")}else if(r.nodes.length===2){for(let e=0;e<r.nodes.length;++e){let t=r.nodes[e].nodes[0].type;if(t==="tag"||t==="combinator"){let i=r.nodes.splice(e,1)[0];r.semverValue=i.nodes.reduce((s,n)=>`${s}${String(n)}`,""),r.semverPosition=e;break}}if(typeof r.semverValue>"u")throw Object.assign(new Error("`:semver` pseudo-class expects a static value in the first or second position"),{code:"ESEMVERVALUE"})}r.nodes.length===1?zk(r):(r.attributeMatcher={insensitive:!1,attribute:"version",qualifiedAttribute:"version"},r.lookupProperties=[]),r.nodes.length=0},"fixupSemverSpecs"),gxe=o(r=>{let[e]=r.nodes[0].nodes,{value:t}=e||{};r.typeValue=t,r.nodes.length=0},"fixupTypes"),mxe=o(r=>{r.pathValue=IJ(String(r.nodes[0])),r.nodes.length=0},"fixupPaths"),yxe=o(r=>{r.nodes.length&&(r.outdatedKind=String(r.nodes[0]),r.nodes.length=0)},"fixupOutdated"),Sxe=o(r=>{let e=[];if(r.nodes.length){for(let t of r.nodes){let i={};for(let s of t.nodes){if(s.type!=="attribute")throw Object.assign(new Error(':vuln pseudo-class only accepts attribute matchers or "cwe" tag'),{code:"EQUERYATTR"});if(!["severity","cwe"].includes(s._attribute))throw Object.assign(new Error(':vuln pseudo-class only matches "severity" and "cwe" attributes'),{code:"EQUERYATTR"});if(s.operator||(s.operator="=",s.value="*"),s.operator!=="=")throw Object.assign(new Error(':vuln pseudo-class attribute selector only accepts "=" operator',s),{code:"EQUERYATTR"});i[s._attribute]||(i[s._attribute]=[]),i[s._attribute].push(s._value)}e.push(i)}r.vulns=e,r.nodes.length=0}},"fixupVuln"),TJ=o(r=>{r.walk(e=>{switch(e.value){case":attr":return zk(e);case":is":case":has":case":not":return dxe(e);case":path":return mxe(e);case":semver":return pxe(e);case":type":return gxe(e);case":outdated":return yxe(e);case":vuln":return Sxe(e)}})},"transformAst"),wxe=o(r=>r?bJ(TJ).astSync(fxe(r),{lossless:!1}):[],"queryParser");RJ.exports={parser:wxe,arrayDelimiter:OJ}});var DJ=g((mYe,xJ)=>{"use strict";var{resolve:vxe}=require("node:path"),{parser:Exe,arrayDelimiter:CJ}=AJ(),_xe=wr()("en"),{log:PJ}=se(),{minimatch:bxe}=Rr(),Oxe=ye(),Ixe=Hc(),lt=$e(),Txe=ho(),Wk=class{static{o(this,"Results")}#e;#t;#r;#i=new Map;#s;#o;#n=new Map;#c;constructor(e){this.#e=e.rootAstNode.nodes[0],this.#r=e.inventory,this.#t=e.initialItems,this.#s=e.vulnCache,this.#c=e.targetNode,this.currentResults=this.#t,this.flatOptions=e.flatOptions||{},this.currentAstNode=e.rootAstNode}get currentResults(){return this.#n.get(this.#e)}set currentResults(e){this.#n.set(this.#e,e)}get initialItems(){return this.currentAstNode.parent.nodes[0]===this.currentAstNode&&this.currentAstNode.parent.parent.type==="root"?this.#t:this.currentAstNode.prev().type==="combinator"?this.#r:this.currentResults}processPendingCombinator(e){if(this.#o){let t=this.#o(this.currentResults,e);this.#o=null,this.currentResults=t}else this.currentResults=e}collect(e){return new Set(e.nodes.flatMap(t=>this.#n.get(t)))}attributeType(){let e=this.initialItems.filter(t=>Gk(this.currentAstNode,t.package));this.processPendingCombinator(e)}classType(){let e=Axe[String(this.currentAstNode)];if(!e)throw Object.assign(new Error(`\`${String(this.currentAstNode)}\` is not a supported dependency type.`),{code:"EQUERYNODEPTYPE"});let t=e(this.initialItems);this.processPendingCombinator(t)}combinatorType(){this.#o=Cxe[String(this.currentAstNode)]}idType(){let e=this.currentAstNode.value,t=this.initialItems.filter(i=>e===i.name||e===i.package.name);this.processPendingCombinator(t)}async pseudoType(){let e=`${this.currentAstNode.value.slice(1)}Pseudo`;if(!this[e])throw Object.assign(new Error(`\`${this.currentAstNode.value}\` is not a supported pseudo selector.`),{code:"EQUERYNOPSEUDO"});let t=await this[e]();this.processPendingCombinator(t)}selectorType(){this.#e=this.currentAstNode,this.currentResults||(this.currentResults=[])}universalType(){this.processPendingCombinator(this.initialItems)}attrPseudo(){let{lookupProperties:e,attributeMatcher:t}=this.currentAstNode;return this.initialItems.filter(i=>{let s=[i.package];for(let n of e){if(n===CJ){s=s.flat();continue}if(s=s.flatMap(c=>c[n]||[]),s.every(c=>!c))return!1}return s.some(n=>Gk(t,n))})}emptyPseudo(){return this.initialItems.filter(e=>e.edgesOut.size===0)}extraneousPseudo(){return this.initialItems.filter(e=>e.extraneous)}async hasPseudo(){let e=[];for(let t of this.initialItems)(await _w({flatOptions:this.flatOptions,initialItems:[t],inventory:this.#r,rootAstNode:this.currentAstNode.nestedNode,targetNode:t,vulnCache:this.#s})).size>0&&e.push(t);return e}invalidPseudo(){let e=[];for(let t of this.initialItems)for(let i of t.edgesIn)if(i.invalid){e.push(t);break}return e}async isPseudo(){return[...await _w({flatOptions:this.flatOptions,initialItems:this.initialItems,inventory:this.#r,rootAstNode:this.currentAstNode.nestedNode,targetNode:this.currentAstNode,vulnCache:this.#s})]}linkPseudo(){return this.initialItems.filter(e=>e.isLink||e.isTop&&!e.isRoot)}missingPseudo(){return this.#r.reduce((e,t)=>{for(let i of t.edgesOut.values())if(i.missing){let s={name:i.name,version:i.spec},n=new this.#c.constructor({pkg:s});n.queryContext={missing:!0},n.edgesIn=new Set([i]),e.push(n)}return e},[])}async notPseudo(){let e=await _w({flatOptions:this.flatOptions,initialItems:this.initialItems,inventory:this.#r,rootAstNode:this.currentAstNode.nestedNode,targetNode:this.currentAstNode,vulnCache:this.#s}),t=new Set(e);return this.initialItems.filter(i=>!t.has(i))}overriddenPseudo(){return this.initialItems.filter(e=>e.overridden)}pathPseudo(){return this.initialItems.filter(e=>this.currentAstNode.pathValue?bxe(e.realpath.replace(/\\+/g,"/"),vxe(e.root.realpath,this.currentAstNode.pathValue).replace(/\\+/g,"/")):!0)}privatePseudo(){return this.initialItems.filter(e=>e.package.private)}rootPseudo(){return this.initialItems.filter(e=>e===this.#c.root)}scopePseudo(){return this.initialItems.filter(e=>e===this.#c)}semverPseudo(){let{attributeMatcher:e,lookupProperties:t,semverFunc:i="infer",semverValue:s}=this.currentAstNode,{qualifiedAttribute:n}=e;if(!s)return PJ.warn("query","usage of :semver() with no parameters is deprecated"),this.initialItems;if(!lt.valid(s)&&!lt.validRange(s))throw Object.assign(new Error(`\`${s}\` is not a valid semver version or range`),{code:"EQUERYINVALIDSEMVER"});let a=!!lt.valid(s),c=o((l,u)=>{if(e.operator&&!Gk(e,u))return!1;let h=u[n];if(!lt.valid(h)&&!lt.validRange(h)||typeof h!="string")return!1;let f=!!lt.valid(h),d=i;if(d==="infer"&&(a&&f?d="eq":!a&&!f?d="intersects":d="satisfies"),["eq","neq","gt","gte","lt","lte"].includes(d))return!a||!f?!1:lt[d](h,s);if(["gtr","ltr","satisfies"].includes(d))return!a&&!f?!1:a?lt[d](s,h):lt[d](h,s);if(["intersects","subset"].includes(d))return lt[d](h,s);throw Object.assign(new Error(`\`semver.${d}\` is not a supported operator.`),{code:"EQUERYINVALIDOPERATOR"})},"nodeMatches");return this.initialItems.filter(l=>{if(!t.length)return c(l,l.package);let u=[l.package];for(let h of t){if(h===CJ){u=u.flat();continue}return u=u.flatMap(d=>d[h]||[]),u.every(d=>!d)?!1:u.some(d=>c(l,d))}})}typePseudo(){return this.currentAstNode.typeValue?this.initialItems.flatMap(e=>{let t=[];for(let i of e.edgesIn)Oxe(`${i.name}@${i.spec}`).type===this.currentAstNode.typeValue&&t.push(i.to);return t}):this.initialItems}dedupedPseudo(){return this.initialItems.filter(e=>e.target.edgesIn.size>1)}async vulnPseudo(){if(!this.initialItems.length)return this.initialItems;if(!this.#s){let i={};this.initialItems.map(n=>{n.isProjectRoot||n.package.private||(i[n.name]||(i[n.name]=[]),i[n.name].includes(n.version)||i[n.name].push(n.version))});let s=await Txe("/-/npm/v1/security/advisories/bulk",{...this.flatOptions,registry:this.flatOptions.auditRegistry||this.flatOptions.registry,method:"POST",gzip:!0,body:i});this.#s=await s.json()}let e=this.#s,{vulns:t}=this.currentAstNode;return this.initialItems.filter(i=>{let s=e[i.name]?.filter(n=>{if(!lt.intersects(n.vulnerable_versions,i.version))return!1;if(!t)return!0;for(let a of t)if(!(a.severity&&!a.severity.includes("*")&&!a.severity.includes(n.severity))){if(a?.cwe){if(a.cwe.includes("*")){if(!n.cwe.length)continue}else if(!a.cwe.every(c=>n.cwe.includes(`CWE-${c}`)))continue}return!0}});return s?.length?(i.queryContext={advisories:s},!0):!1})}async outdatedPseudo(){let{outdatedKind:e="any"}=this.currentAstNode;return(await Promise.all(this.initialItems.map(async i=>{if(i.isProjectRoot||i.package.private)return!1;this.#i.has(i.name)||this.#i.set(i.name,kxe(i.name,this.flatOptions));let s=await this.#i.get(i.name);i.queryContext.versions=s;let n=s.filter(a=>lt.gt(a,i.version));if(!n.length)return!1;if(e==="any")return i;if(["major","minor","patch"].includes(e))return n.filter(c=>lt.diff(i.version,c)===e).length?i:!1;if(e==="in-range"){let a=[];for(let c of i.edgesIn){let l=n.filter(u=>lt.satisfies(u,c.spec));l.length&&a.push({from:c.from.location,versions:l})}return a.length?(i.queryContext.outdated={...i.queryContext.outdated,inRange:a},i):!1}if(e==="out-of-range"){let a=[];for(let c of i.edgesIn){let l=n.filter(u=>!lt.satisfies(u,c.spec));l.length&&a.push({from:c.from.location,versions:l})}return a.length?(i.queryContext.outdated={...i.queryContext.outdated,outOfRange:a},i):!1}return!1}))).filter(Boolean)}},Rxe={"="({attr:r,value:e}){return r===e},"~="({attr:r,value:e}){return(r.match(/\w+/g)||[]).includes(e)},"*="({attr:r,value:e}){return r.includes(e)},"|="({attr:r,value:e}){return r.startsWith(`${e}-`)},"^="({attr:r,value:e}){return r.startsWith(e)},"$="({attr:r,value:e}){return r.endsWith(e)}},kJ=o(({attr:r,value:e,insensitive:t,operator:i})=>(typeof r=="number"&&(r=String(r)),typeof r!="string"?!1:(t&&(r=r.toLowerCase()),Rxe[i]({attr:r,insensitive:t,value:e}))),"attributeOperator"),Gk=o((r,e)=>{let t=!!r.insensitive,i=r.operator||"",s=r.qualifiedAttribute,n=r.value||"";if(i==="")return!!e[s];if(t&&(n=n.toLowerCase()),Array.isArray(e[s]))return e[s].find((a,c)=>{let l=e[s][c]||"";return kJ({attr:l,value:n,insensitive:t,operator:i})});{let a=e[s]||"";return kJ({attr:a,value:n,insensitive:t,operator:i})}},"attributeMatch"),NJ=o((r,e,t=new Set)=>{for(let i of r.edgesIn)if(!t.has(i)&&(t.add(i),i.type===e||i.from[e]||NJ(i.from,e,t)))return!0;return!1},"edgeIsType"),Hk=o((r,e)=>{let t=[];for(let i of r)(i[e]||NJ(i,e))&&t.push(i);return t},"filterByType"),Axe={".prod"(r){let e=[];for(let t of r)t.dev||e.push(t);return e},".dev"(r){return Hk(r,"dev")},".optional"(r){return Hk(r,"optional")},".peer"(r){return Hk(r,"peer")},".workspace"(r){return r.filter(e=>e.isWorkspace)},".bundled"(r){return r.filter(e=>e.inBundle)}},Jk=o((r,e)=>{for(let t of e){if(t.isLink&&(t=t.target),r.isTop&&r.resolveParent===t)return!0;for(let i of r.edgesIn)if(i&&i.from===t)return!0}return!1},"hasParent"),Ew=o((r,e,t=new Set)=>{if(Jk(r,e)||r.isTop&&r.resolveParent&&Ew(r.resolveParent,e))return!0;for(let i of r.edgesIn)if(!t.has(i)&&(t.add(i),i&&i.from&&Ew(i.from,e,t)))return!0;for(let i of r.linksIn)if(Ew(i,e,t))return!0;return!1},"hasAscendant"),Cxe={">"(r,e){return e.filter(t=>Jk(t,r))}," "(r,e){return e.filter(t=>Ew(t,r))},"~"(r,e){let t=new Set;for(let i of r)for(let s of i.edgesIn)t.add(s.from);return e.filter(i=>!r.includes(i)&&Jk(i,[...t]))}},kxe=o(async(r,e)=>{let t;try{t=await Ixe.packument(r,{...e,fullMetadata:!1})}catch(s){return PJ.warn("query",`could not retrieve packument for ${r}: ${s.message}`),[]}let i=Object.keys(t.versions).sort(lt.compare);return t.time&&e.before&&(i=i.filter(s=>t.time[s]?Date.parse(t.time[s])<=e.before:!1)),i},"getPackageVersions"),_w=o(async r=>{let e=r.rootAstNode;if(!e.nodes)return new Set;let t=new Wk(r),i=new Set;e.walk(s=>{i.add(s)});for(let s of i){t.currentAstNode=s;let n=`${t.currentAstNode.type}Type`;if(typeof t[n]!="function")throw Object.assign(new Error(`\`${t.currentAstNode.type}\` is not a supported selector.`),{code:"EQUERYNOSELECTOR"});await t[n]()}return t.collect(e)},"retrieveNodesFromParsedAst"),Pxe=o(async(r,e,t)=>{let i=[...r.root.inventory.values()];return[...await _w({initialItems:i,inventory:i,flatOptions:t,rootAstNode:Exe(e),targetNode:r})].sort((n,a)=>_xe(n.location,a.location))},"querySelectorAll");xJ.exports=Pxe});var sl=g((SYe,qJ)=>{var Nxe=wt(),xxe=Wh(),LJ=ye(),MJ=$e(),Dxe=require("node:util"),{getPaths:Lxe}=FC(),{log:Mxe}=se(),{resolve:mn,relative:FJ,dirname:Bo,basename:bw}=require("node:path"),{walkUp:Fxe}=nw(),BJ=Q4(),Ow=GC(),Bxe=l6(),Kk=UC(),qxe=cf(),yn=pn(),jxe=ow(),$xe=g6(),Uxe=DJ(),Yk=Oi(),Zk=Yc(),rl=Symbol("_package"),Ur=Symbol("_parent"),xf=Symbol.for("_target"),Gt=Symbol("_fsParent"),Sn=Symbol("_reloadNamedEdges"),Iw=Symbol.for("Arborist.Node._loadDeps"),il=Symbol.for("_refreshLocation"),Df=Symbol.for("_changePath"),qo=Symbol.for("_delistFromMeta"),Xk=Symbol("_explain"),Tw=Symbol("_explanation"),Qk=class r{static{o(this,"Node")}#e;#t;#r;#i;constructor(e){let{root:t,path:i,realpath:s,parent:n,error:a,meta:c,fsParent:l,resolved:u,integrity:h,name:f,children:d,fsChildren:p,installLinks:m=!1,legacyPeerDeps:y=!1,linksIn:w,isInStore:S=!1,hasShrinkwrap:v,overrides:_,loadOverrides:E=!1,extraneous:b=!0,dev:O=!0,optional:T=!0,devOptional:I=!0,peer:L=!0,global:F=!1,dummy:X=!1,sourceReference:Ce=null,inert:Wt=!1}=e;if(this.queryContext={},this.#e=F,this.#i=null,this.errors=a?[a]:[],this.isInStore=S,this.sourceReference=Ce,Ce)this[rl]=Ce.package;else{let Ie=new Nxe,ki={};e.pkg&&typeof e.pkg=="object"&&(ki=e.pkg),Ie.fromContent(ki),Ie.syncNormalize(),this[rl]=Ie.content}if(this.name=f||xxe(i||this.package.name||s)||this.package.name||null,this.path=i?mn(i):null,!this.name&&(!this.path||this.path!==Bo(this.path)))throw new TypeError("could not detect node name from path or package");if(this.realpath=this.isLink?mn(s):this.path,this.resolved=u||null,!this.resolved){let Ie=qxe(this.package._resolved);Ie&&!(/^file:/.test(Ie)&&this.package._where)&&(this.resolved=Ie)}if(this.integrity=h||this.package._integrity||null,this.hasShrinkwrap=v||this.package._hasShrinkwrap||!1,this.installLinks=m,this.legacyPeerDeps=y,this.children=new BJ,this.fsChildren=new Set,this.inventory=new Bxe,this.tops=new Set,this.linksIn=new Set(w||[]),X?(this.dummy=!0,this.dev=!1,this.optional=!1,this.devOptional=!1,this.peer=!1,this.extraneous=!1):(this.dev=O,this.optional=T,this.devOptional=I,this.peer=L,this.extraneous=b,this.dummy=!1),this.inert=Wt,this.edgesIn=new Set,this.edgesOut=new BJ,_)this.overrides=_;else if(E){let Ie=this.package.overrides||{};Object.keys(Ie).length>0&&(this.overrides=new Kk({overrides:this.package.overrides}))}if(this.meta=c,this[Ur]=null,this.parent=n||null,this[Gt]=null,this.fsParent=l||null,!n&&!l&&(this.root=t||null),d)for(let Ie of d)new r({...Ie,parent:this});if(p)for(let Ie of p)new r({...Ie,fsParent:this});this[Iw]()}get meta(){return this.#t}set meta(e){this.#t=e,e&&e.add(this)}get global(){return this.#r===this?this.#e:this.#r.global}get globalTop(){return this.global&&this.parent&&this.parent.isProjectRoot}get workspaces(){return this.#i}set workspaces(e){if(this.#i)for(let t of this.#i.keys())e.has(t)||this.edgesOut.get(t).detach();this.#i=e,this.#s(),this[Iw]()}get binPaths(){return this.parent?Lxe({pkg:this.package,path:this.path,global:this.global,top:this.globalTop}):[]}get hasInstallScript(){let{hasInstallScript:e,scripts:t}=this.package,{install:i,preinstall:s,postinstall:n}=t||{};return!!(e||i||s||n)}get version(){return this.package.version||""}get packageName(){return this.package.name||null}get pkgid(){let{name:e="",version:t=""}=this.package,{isProjectRoot:i}=this,s=i?e||this.name:this.name,n=!i&&e&&s!==e?`npm:${e}@`:"";return`${s}@${n}${t}`}get overridden(){if(!this.overrides||!this.overrides.value||this.overrides.name!==this.name)return!1;for(let e of this.edgesIn)if(e.overrides&&e.overrides.name===this.name&&e.overrides.value===this.version&&!e.overrides.isEqual(e.from.overrides))return!0;return!1}get package(){return this[rl]}set package(e){for(let t of this.edgesOut.values())t.detach();this[Tw]=null,(!e||typeof e!="object")&&(yn(()=>{throw new Error("setting Node.package to non-object")}),e={}),this[rl]=e,this.#s(),this[Iw](),this.edgesIn.forEach(t=>t.reload(!0))}explain(e=null,t=[]){return this[Tw]?this[Tw]:this[Tw]=this[Xk](e,t)}[Xk](e,t){if(this.isProjectRoot&&!this.sourceReference)return{location:this.path};let i={name:this.isProjectRoot||this.isTop?this.packageName:this.name,version:this.package.version};if((this.errors.length||!this.packageName||!this.package.version)&&(i.errors=this.errors.length?this.errors:[new Error("invalid package: lacks name and/or version")],i.package=this.package),this.root.sourceReference){let{name:s,version:n}=this.root.package;i.whileInstalling={name:s,version:n,path:this.root.sourceReference.path}}if(this.sourceReference)return this.sourceReference.explain(e,t);if(t.includes(this))return i;if(i.location=this.location,i.isWorkspace=this.isWorkspace,t=t.concat(this),i.dependents=[],e)i.dependents.push(e.explain(t));else{let s=[];for(let n of this.edgesIn)!n.valid&&!n.from.isProjectRoot||s.push(n);for(let n of s)i.dependents.push(n.explain(t))}return this.linksIn.size&&(i.linksIn=[...this.linksIn].map(s=>s[Xk](e,t))),i}isDescendantOf(e){for(let t=this;t;t=t.resolveParent)if(t===e)return!0;return!1}shouldOmit(e){if(!e.size)return!1;let{top:t}=this;return!t.isProjectRoot&&!t.isWorkspace?!1:this.peer&&e.has("peer")||this.dev&&e.has("dev")||this.optional&&e.has("optional")||this.devOptional&&e.has("optional")&&e.has("dev")}getBundler(e=[]){if(e.includes(this))return null;e.push(this);let t=this[Ur];if(!t)return null;let i=t.getBundler(e);if(i)return i;let s=t.package,n=s&&s.bundleDependencies;if(Array.isArray(n)&&n.includes(this.name))return t;for(let a of this.edgesIn){let c=a.from.getBundler(e);if(c&&c===t)return c}return null}get inBundle(){return!!this.getBundler()}get inDepBundle(){let e=this.getBundler();return!!e&&e!==this.root}get isWorkspace(){if(this.isProjectRoot)return!1;let{root:e}=this,{type:t,to:i}=e.edgesOut.get(this.packageName)||{};return t==="workspace"&&i&&(i.target===this||i===this)}get isRoot(){return this===this.root}get isProjectRoot(){return this===this.root||this===this.root.target}get isRegistryDependency(){if(this.edgesIn.size===0)return!1;for(let e of this.edgesIn)if(!LJ(e.spec).registry)return!1;return!0}*ancestry(){for(let e=this;e;e=e.resolveParent)yield e}set root(e){for(;e&&e.root!==e;)e=e.root;if(e=e||this,this[qo](),!this.path||!e.realpath||!e.path){this.#r=e;return}this.#r=this;for(let s of this.linksIn)s[xf]=null,this.linksIn.delete(s);let{target:t}=this;if(this.isLink&&(t&&(t.linksIn.delete(this),t.root===this&&t[qo]()),this[xf]=null),this.parent&&this.parent.root!==e&&(this.parent.children.delete(this.name),this[Ur]=null),this.fsParent&&this.fsParent.root!==e&&(this.fsParent.fsChildren.delete(this),this[Gt]=null),e===this)this[il]();else{let s=Yk(e.realpath,this.path),n=e.inventory.get(s);n&&(n.root=null),this.#r=e,this[il]();for(let c of Fxe(Bo(this.path))){if(c===this.path)continue;let l=Yk(e.realpath,c),u=e.inventory.get(l);if(u){if(u.isLink){yn(()=>{throw Object.assign(new Error("assigning parentage to link"),{path:this.path,parent:u.path,parentReal:u.realpath})});continue}let h=`${l}${l?"/":""}node_modules/${this.name}`;if(this.location===h){let d=u.children.get(this.name);d&&d!==this&&(d.root=null),this.parent&&(this.parent.children.delete(this.name),this.parent[Sn](this.name)),u.children.set(this.name,this),this[Ur]=u,this.isLink||u[Sn](this.name)}else this.fsParent&&this.fsParent.fsChildren.delete(this),u.fsChildren.add(this),this[Gt]=u;break}}this.parent?e.tops.delete(this):e.tops.add(this);let a=`${this.location}${this.location?"/":""}node_modules/`;for(let c of e.tops){let l=c.location===a+c.name,u=Bo(c.path).startsWith(this.path)&&c!==this&&!c.parent&&(!c.fsParent||c.fsParent===this||Bo(this.path).startsWith(c.fsParent.path));!l&&!u||(this.isLink?c.root=null:(c.fsParent&&c.fsParent.fsChildren.delete(c),c[Gt]=null,l?(this.children.set(c.name,c),c[Ur]=this,e.tops.delete(c)):(this.fsChildren.add(c),c[Gt]=this)))}for(let c of e.inventory.query("realpath",this.realpath))if(c!==this)if(yn(()=>{if(c.root!==e)throw new Error("inventory contains node from other root")}),this.isLink){let l=c.target;this[xf]=l,this[rl]=l.package,l.linksIn.add(this),this.parent&&this.parent[Sn](this.name);break}else c.isLink?(c[xf]=this,c[rl]=this.package,this.linksIn.add(c),c.parent&&c.parent[Sn](c.name)):yn(()=>{throw Object.assign(new Error("duplicate node in root setter"),{path:this.path,realpath:this.realpath,root:e.realpath})})}for(let s of this.edgesIn)s.from.root!==e&&s.reload();for(let s of this.edgesOut.values())(!s.to||s.to.root!==e)&&s.reload();let i=new Set([...this.fsChildren,...this.children.values(),...this.inventory.values()].filter(s=>s!==this));for(let s of i)if(s.root!==e){s[qo](),s[Ur]=null,this.children.delete(s.name),s[Gt]=null,this.fsChildren.delete(s);for(let n of s.linksIn)n[xf]=null,s.linksIn.delete(n)}for(let s of i)s.root!==e&&(s.root=e);this.isLink&&t&&!this.target&&e!==this&&(t.root=e),Zk(this),this!==e&&Zk(e)}get root(){return this.#r||this}#s(){if(this.#i)for(let[e,t]of this.#i.entries())new Ow({from:this,name:e,spec:`file:${t}`,type:"workspace"})}[Iw](){let e=this.package.peerDependencies,t=this.package.acceptDependencies||{};if(e&&typeof e=="object"&&!this.legacyPeerDeps){let d=this.package.peerDependenciesMeta||{},p={},m={};for(let[y,w]of Object.entries(e))d[y]?.optional?m[y]=w:p[y]=w;this.#o(p,"peer",t),this.#o(m,"peerOptional",t)}this.#o(this.package.dependencies,"prod",t),this.#o(this.package.optionalDependencies,"optional",t);let{globalTop:i,isTop:s,path:n,sourceReference:a}=this,{globalTop:c,isTop:l,path:u}=a||{};s&&!i&&n&&(!a||l&&!c&&u)&&this.#o(this.package.devDependencies,"dev",t)}#o(e,t,i){for(let[s,n]of Object.entries(e||{})){let a=this.edgesOut.get(s);(!a||a.type!=="workspace")&&new Ow({from:this,name:s,spec:n,accept:i[s],type:t})}}get fsParent(){return this[Gt]}set fsParent(e){if(!e){this[Gt]&&(this.root=null);return}if(yn(()=>{if(e===this)throw new Error("setting node to its own fsParent");if(e.realpath===this.realpath)throw new Error("setting fsParent to same path");if(!this[Gt]&&this.realpath.indexOf(e.realpath)!==0)throw Object.assign(new Error("setting fsParent improperly"),{path:this.path,realpath:this.realpath,fsParent:{path:e.path,realpath:e.realpath}})}),e.isLink&&(e=e.target),this===e||e.realpath===this.realpath||this[Gt]===e)return;let t=this[Gt],i=t?mn(e.path,FJ(t.path,this.path)):this.path,s=mn(e.path,"node_modules",this.name);if(i===s){this.parent=e;return}let n=i!==this.path,a=this.parent,c=this.name;this.parent&&(this.parent.children.delete(this.name),this[Ur]=null),this.fsParent&&(this.fsParent.fsChildren.delete(this),this[Gt]=null),n&&this[Df](i),a&&a[Sn](c),this.root=e.root}canReplaceWith(e,t){if(e.name!==this.name||e.packageName!==this.packageName)return!1;if(this.edgesOut.size){if(e.overrides){if(!e.overrides.isEqual(this.overrides))return!1}else if(this.overrides)return!1}t=new Set(t);let i=jxe([this],s=>s.to!==this&&s.valid);for(let s of this.edgesIn)if(!(!this.isTop&&s.from.parent===this.parent&&s.peer&&t.has(s.from.name))&&!i.has(s.from)&&!s.satisfiedBy(e))return!1;return!0}canReplace(e,t){return e.canReplaceWith(this,t)}canDedupe(e=!1,t=!1){if(this.inDepBundle||this.inShrinkwrap||!this.resolveParent||!this.resolveParent.resolveParent)return!1;if(this.edgesIn.size===0)return!0;let i=this.resolveParent.resolveParent.resolve(this.name);return i?i.matches(this)?!0:i.canReplace(this)?!!(e||MJ.eq(i.version,this.version)||!this.overridden&&MJ.gt(i.version,this.version)||t):!1:!1}satisfies(e){if(e instanceof Ow)return this.name===e.name&&e.satisfiedBy(this);let t=LJ(e),{name:i=this.name,rawSpec:s}=t;return this.name===i&&this.satisfies(new Ow({from:new r({path:this.root.realpath}),type:"prod",name:i,spec:s}))}matches(e){return e===this?!0:e.name!==this.name?!1:this.isLink?e.isLink&&this.target.matches(e.target):this.isProjectRoot&&e.isProjectRoot?this.path===e.path:this.integrity&&e.integrity?this.integrity===e.integrity:this.resolved&&e.resolved?this.resolved===e.resolved:this.packageName&&e.packageName&&this.packageName===e.packageName&&this.version&&e.version&&this.version===e.version}replaceWith(e){e.replace(this)}replace(e){if(this[qo](),e.parent?.children.get(this.name)===e?this.path=mn(e.parent.path,"node_modules",this.name):(this.path=e.path,this.name=e.name),this.isLink||(this.realpath=this.path),this[il](),!this.isLink){for(let t of e.children.values())t.parent=this;e.isLink&&e.target&&(e.target.root=null)}e.isRoot||(this.root=e.root),Zk(this)}get inShrinkwrap(){return this.parent&&(this.parent.hasShrinkwrap||this.parent.inShrinkwrap)}get parent(){return this[Ur]}set parent(e){if(!e){this[Ur]&&(this.root=null);return}if(e.isLink&&(e=e.target),this===e)return;let t=this[Ur];if(t===e)return;let i=mn(e.path,"node_modules",this.name),s=i!==this.path;t&&(t.children.delete(this.name),this[Ur]=null),this.fsParent&&(this.fsParent.fsChildren.delete(this),this[Gt]=null),s&&this[Df](i),this.root=e.root}[qo](){let e=this.root;!e.realpath||!this.path||(e.inventory.delete(this),e.tops.delete(this),e.meta&&e.meta.delete(this.path),yn(()=>{if([...e.inventory.values()].includes(this))throw new Error("failed to delist")}))}[Df](e){this[qo]();let t=this.path;this.path=e;let i=/(?:^|\/|\\)node_modules[\\/](@[^/\\]+[\\/][^\\/]+|[^\\/]+)$/,s=e.match(i);if(s&&this.name!==s[1]&&(this.name=s[1].replace(/\\/g,"/")),!this.isLink){this.realpath=e;for(let n of this.linksIn)n[qo](),n.realpath=e,n[il]()}for(let n of this.fsChildren)n[Df](mn(e,FJ(t,n.path)));for(let[n,a]of this.children.entries())a[Df](mn(e,"node_modules",n));this[il]()}[il](){let e=this.root,t=Yk(e.realpath,this.path);this.location=t,e.inventory.add(this),e.meta&&e.meta.add(this)}assertRootOverrides(){if(!(!this.isProjectRoot||!this.overrides)){for(let e of this.edgesOut.values())if(e.spec!==e.rawSpec&&!e.spec.startsWith("$"))throw Object.assign(new Error(`Override for ${e.name}@${e.rawSpec} conflicts with direct dependency`),{code:"EOVERRIDE"})}}addEdgeOut(e){this.overrides&&(e.overrides=this.overrides.getEdgeRule(e)),this.edgesOut.set(e.name,e)}recalculateOutEdgesOverrides(){for(let e of this.edgesOut.values())e.reload(!0),e.to&&e.to.updateOverridesEdgeInAdded(e.overrides)}updateOverridesEdgeInRemoved(e){if(!this.overrides||!this.overrides.isEqual(e))return!1;let t;for(let i of this.edgesIn)t&&i.overrides?t=Kk.findSpecificOverrideSet(i.overrides,t):t=i.overrides;return this.overrides.isEqual(t)?!1:(this.overrides=t,this.overrides&&this.recalculateOutEdgesOverrides(),!0)}updateOverridesEdgeInAdded(e){if(!e)return!1;if(!this.overrides)return this.overrides=e,this.recalculateOutEdgesOverrides(),!0;if(this.overrides.isEqual(e))return!1;let t=Kk.findSpecificOverrideSet(this.overrides,e);if(t)return this.overrides.isEqual(t)?!1:(this.overrides=t,this.recalculateOutEdgesOverrides(),!0);Mxe.silly("Conflicting override sets",this.name)}deleteEdgeIn(e){this.edgesIn.delete(e),e.overrides&&this.updateOverridesEdgeInRemoved(e.overrides)}addEdgeIn(e){(!this.overrides||!this.overrides.isEqual(e.overrides))&&this.updateOverridesEdgeInAdded(e.overrides),this.edgesIn.add(e),this.root.meta&&this.root.meta.addEdge(e)}[Sn](e,t=this.location){let i=this.edgesOut.get(e),s=i&&i.to&&i.to.location===`${t}/node_modules/${i.name}`,n=i&&this.resolve(e)===i.to;i&&(s||!n)&&i.reload(!0);for(let c of this.children.values())c[Sn](e,t);for(let c of this.fsChildren)c[Sn](e,t)}get isLink(){return!1}get target(){return this}set target(e){yn(()=>{throw Object.assign(new Error("cannot set target on non-Link Nodes"),{path:this.path})})}get depth(){return this.isTop?0:this.parent.depth+1}get isTop(){return!this.parent||this.globalTop}get top(){return this.isTop?this:this.parent.top}get isFsTop(){return!this.fsParent}get fsTop(){return this.isFsTop?this:this.fsParent.fsTop}get resolveParent(){return this.parent||this.fsParent}resolve(e){yn(()=>{if(typeof e!="string"||!e)throw new Error("non-string passed to Node.resolve")});let t=this.children.get(e);if(t)return t;let i=this.resolveParent;return i?i.resolve(e):null}inNodeModules(){let e=this.realpath,t=this.name,i=t.charAt(0)==="@",s=Bo(e),n=i?Bo(s):s,a=Bo(n);return(i?`${bw(s)}/${bw(e)}`:bw(e))===t&&bw(n)==="node_modules"?a:!1}querySelectorAll(e,t){return Uxe(this,e,t)}toJSON(){return $xe(this)}[Dxe.inspect.custom](){return this.toJSON()}};qJ.exports=Qk});var nl=g((vYe,VJ)=>{var Vxe=Oi(),jJ=sl(),zxe=Symbol.for("Arborist.Node._loadDeps"),Lf=Symbol.for("_target"),{dirname:Gxe}=require("node:path"),$J=Symbol.for("_delistFromMeta"),UJ=Symbol.for("_refreshLocation"),eP=class extends jJ{static{o(this,"Link")}constructor(e){let{root:t,realpath:i,target:s,parent:n,fsParent:a,isStoreLink:c}=e;if(!i&&!(s&&s.path))throw new TypeError("must provide realpath for Link node");super({...e,realpath:i||s.path,root:t||(n?n.root:a?a.root:s?s.root:null)}),this.isStoreLink=c||!1,s?this.target=s:this.realpath===this.root.path?this.target=this.root:this.target=new jJ({...e,path:i,parent:null,fsParent:null,root:this.root})}get version(){return this.target?this.target.version:this.package.version||""}get target(){return this[Lf]}set target(e){let t=this[Lf];if(e!==t){if(!e){t&&t.linksIn&&t.linksIn.delete(this),this.path?(this[$J](),this[Lf]=null,this.package={},this[UJ]()):this[Lf]=null;return}if(!this.path){e.path?this.realpath=e.path:e.path=e.realpath=this.realpath,e.root=this.root,this[Lf]=e,e.linksIn.add(this),this.package=e.package;return}this[$J](),this.package=e.package,this.realpath=e.path,this[UJ](),e.root=this.root}}get resolved(){return this.path&&this.realpath?`file:${Vxe(Gxe(this.path),this.realpath)}`:null}set resolved(e){}[zxe](){}get children(){return new Map}set children(e){}get isLink(){return!0}};VJ.exports=eP});var KJ=g((_Ye,JJ)=>{var Hxe=wr()("en"),{log:zJ}=se(),{redact:Wxe}=om(),GJ=sC(),WJ=uC(),{KEEP:Jxe,CONFLICT:Rw}=WJ,Kxe=pn(),Yxe=nl(),Mf=ow(),HJ=iC(),tP=class r{static{o(this,"PlaceDep")}constructor(e){if(this.auditReport=e.auditReport,this.dep=e.dep,this.edge=e.edge,this.explicitRequest=e.explicitRequest,this.force=e.force,this.installLinks=e.installLinks,this.installStrategy=e.installStrategy,this.legacyPeerDeps=e.legacyPeerDeps,this.parent=e.parent||null,this.preferDedupe=e.preferDedupe,this.strictPeerDeps=e.strictPeerDeps,this.updateNames=e.updateNames,this.canPlace=null,this.canPlaceSelf=null,this.checks=new Map,this.children=[],this.needEvaluation=new Set,this.peerConflict=null,this.placed=null,this.target=null,this.current=this.edge.to,this.name=this.edge.name,this.top=this.parent?.top||this,this.edge.to&&!this.edge.error&&!this.explicitRequest&&!this.updateNames.includes(this.edge.name)&&!this.auditReport?.isVulnerable(this.edge.to))return;let t=this.getStartNode();for(let a of t.ancestry()){let c=a.edgesOut.get(this.edge.name);if(!a.isTop&&c&&c.peer)continue;let l=new WJ({dep:this.dep,edge:this.edge,parent:this.parent&&this.parent.canPlace,target:a,preferDedupe:this.preferDedupe,explicitRequest:this.explicitRequest});if(this.checks.set(a,l),l.canPlaceSelf!==Rw&&(this.canPlaceSelf=l),l.canPlace!==Rw)this.canPlace=l;else break;if(this.dep.errors.length||this.installStrategy==="nested")break;if(this.installStrategy==="shallow"){let u=a.resolveParent;if(u&&u.isProjectRoot)break}}if(!this.canPlace){if(!this.force&&(this.isMine||this.strictPeerDeps))return this.failPeerConflict();if(!this.canPlaceSelf){this.warnPeerConflict();return}this.canPlace=this.canPlaceSelf}if(!this.canPlace){Kxe(()=>{throw new Error("canPlace not set, but trying to place in tree")});return}let{target:i}=this.canPlace;if(zJ.silly("placeDep",i.location||"ROOT",`${this.dep.name}@${this.dep.version}`,this.canPlace.description,`for: ${this.edge.from.package._id||this.edge.from.location}`,`want: ${Wxe(this.edge.spec||"*")}`),(this.canPlace.canPlace===Rw?this.canPlace.canPlaceSelf:this.canPlace.canPlace)===Jxe){this.edge.peer&&!this.edge.valid&&this.warnPeerConflict(),this.pruneDedupable(i);return}for(let a=i;a;a=a.resolveParent)if(a.matches(this.dep)&&!a.isTop){this.placed=new Yxe({parent:i,target:a});return}let n=this.dep.parent;this.placed=new this.dep.constructor({name:this.dep.name,pkg:this.dep.package,resolved:this.dep.resolved,integrity:this.dep.integrity,installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,error:this.dep.errors[0],...this.dep.overrides?{overrides:this.dep.overrides}:{},...this.dep.isLink?{target:this.dep.target,realpath:this.dep.realpath}:{}}),this.oldDep=i.children.get(this.name),this.oldDep?this.replaceOldDep():this.placed.parent=i,this.edge.peer&&!this.placed.satisfies(this.edge)&&this.warnPeerConflict(),this.edge.valid&&this.edge.to&&this.edge.to!==this.placed&&this.pruneDedupable(this.edge.to,!1);for(let a of i.root.inventory.query("name",this.name))if(a.isDescendantOf(i)&&!a.isTop&&(this.pruneDedupable(a,!1),a.root===i.root))for(let c of a.children.values())this.pruneDedupable(c,!1);for(let a of this.placed.edgesOut.values()){if(a.valid||!a.peer||a.peerConflicted)continue;let c=n.children.get(a.name);c&&c.satisfies(a)&&this.children.push(new r({auditReport:this.auditReport,explicitRequest:this.explicitRequest,force:this.force,installLinks:this.installLinks,installStrategy:this.installStrategy,legacyPeerDeps:this.legacyPeerDeps,preferDedupe:this.preferDedupe,strictPeerDeps:this.strictPeerDeps,updateNames:this.updateName,parent:this,dep:c,node:this.placed,edge:a}))}}replaceOldDep(){let e=this.oldDep.parent,t=[];for(let[s,n]of this.oldDep.edgesOut.entries())!this.placed.edgesOut.has(s)&&n.to&&t.push(...Mf([n.to],a=>a.to!==n.to));let i=[];for(let s of this.oldDep.edgesIn)if(!(this.placed.satisfies(s)||!s.peer||s.from.parent!==e||s.peerConflicted))for(let n of HJ(s.from).keys()){let a=n.to;GJ(a)!==e&&!(n.from.isProjectRoot||n.from.isWorkspace)?i.push(...Mf([a],l=>l.to!==a&&!l.peerConflicted)):this.warnPeerConflict(s,this.dep)}this.placed.replace(this.oldDep),this.pruneForReplacement(this.placed,t);for(let s of i){for(let n of s.edgesIn)this.needEvaluation.add(n.from);s.root=null}}pruneForReplacement(e,t){let i=new Set([...e.edgesOut.values()].filter(n=>n.to&&!n.valid).map(n=>n.to));for(let n of t){let a=Mf([n],c=>c.to!==n&&c.valid);for(let c of a)i.add(c)}let s=Mf(i,n=>n.from!==e&&n.to!==e&&n.valid);for(let n of s)n.root=null}pruneDedupable(e,t=!0){if(e.canDedupe(this.preferDedupe,this.explicitRequest)){let i=Mf([e],s=>s.to!==e&&s.valid);for(let s of i)s.root=null;return}if(t){let i=o((a,c)=>Hxe(a.location,c.location),"nodeSort"),s=[...e.children.values()].sort(i);for(let a of s)this.pruneDedupable(a);let n=[...e.fsChildren].sort(i);for(let a of n){let c=[...a.children.values()].sort(i);for(let l of c)this.pruneDedupable(l)}}}get isMine(){let{edge:e}=this.top,{from:t}=e;if(t.isWorkspace||t.isProjectRoot)return!0;if(!e.peer)return!1;let i=!1;for(let s of t.edgesIn){if(s.peer){i=!0;continue}if(s.from.isWorkspace||s.from.isProjectRoot)return!0}if(i){for(let s of HJ(t).keys())if(s.from.isWorkspace||s.from.isProjectRoot)return!0}return!1}warnPeerConflict(e,t){e=e||this.edge,t=t||this.dep,e.peerConflicted=!0;let i=this.explainPeerConflict(e,t);zJ.warn("ERESOLVE","overriding peer dependency",i)}failPeerConflict(e,t){e=e||this.top.edge,t=t||this.top.dep;let i=this.explainPeerConflict(e,t);throw Object.assign(new Error("could not resolve"),i)}explainPeerConflict(e,t){let{from:i}=e,s=i.resolve(e.name),n={code:"ERESOLVE",edge:e.explain(),dep:t.explain(e),force:this.force,isMine:this.isMine,strictPeerDeps:this.strictPeerDeps};if(this.parent)n.current=s&&s.explain(e),n.peerConflict=this.current&&this.current.explain(this.edge);else if(n.current=s&&s.explain(),this.canPlaceSelf&&this.canPlaceSelf.canPlaceSelf!==Rw){let a=this.canPlaceSelf;for(let c of a.conflictChildren)if(c.current){n.peerConflict={current:c.current.explain(),peer:c.dep.explain(c.edge)};break}}else n.peerConflict={current:this.current&&this.current.explain(),peer:this.dep.explain(this.edge)};return n}getStartNode(){let e=this.parent?.getStartNode()||this.edge.from;return GJ(e,this.name)}get allChildren(){let e=new Set(this.children);for(let t of e)for(let i of t.children)e.add(i);return[...e]}};JJ.exports=tP});var Bf=g((OYe,XJ)=>{var{depth:YJ}=cs(),Zxe=o((r,e=!0)=>(e&&(r.dev=!1,r.optional=!1,r.devOptional=!1,r.peer=!1),YJ({tree:r,visit:o(i=>ZJ(i),"visit"),filter:o(i=>i,"filter"),getChildren:o((i,s)=>[...s.edgesOut.values()].map(n=>n.to),"getChildren")})),"calcDepFlags"),ZJ=o(r=>(r.extraneous=!1,Ff(r,"extraneous"),Ff(r,"dev"),Ff(r,"peer"),Ff(r,"devOptional"),Ff(r,"optional"),r.isLink?r.target==null?r:(r.target.dev=r.dev,r.target.optional=r.optional,r.target.devOptional=r.devOptional,r.target.peer=r.peer,ZJ(r.target)):(r.edgesOut.forEach(({peer:e,optional:t,dev:i,to:s})=>{if(!s)return;s.extraneous=!1,e?s.peer=!0:s.peer&&!Xxe(s)&&Aw(s,"peer");let n=!r.devOptional&&!r.dev&&!r.optional&&!i&&!t,a=n||!r.dev&&!i,c=n||!r.optional&&!t;n&&Aw(s,"devOptional"),a&&Aw(s,"dev"),c&&Aw(s,"optional")}),r)),"calcDepFlagsStep"),Xxe=o(r=>{let e=r.isLink&&r.target?r.target:r;for(let t of e.edgesIn)if(t.type==="peer")return!0;return!1},"hasIncomingPeerEdge"),Ff=o((r,e)=>{if(!r[e])for(let t=r;t&&(t===r||t[e]);t=t.resolveParent)t[e]=!1},"resetParents"),Aw=o((r,e)=>{r[e]&&(r[e]=!1,YJ({tree:r,visit:o(t=>{t.extraneous=t[e]=!1,t.isLink&&t.target&&(t.target.extraneous=t.target[e]=!1)},"visit"),getChildren:o(t=>{let i=[],s=t.isLink&&t.target?t.target:t;for(let n of s.edgesOut.values())n.to?.[e]&&(e==="peer"?n.type==="peer"&&i.push(n.to):(n.type==="prod"||n.type==="peer")&&i.push(n.to));return i},"getChildren")}))},"unsetFlag");XJ.exports=Zxe});var eK=g((TYe,QJ)=>{var ol=wr()("en"),Qxe=cf(),{dirname:eDe}=require("node:path"),{breadth:tDe}=cs(),Cw={name:1,version:2,uid:3,resolved:4,integrity:5,registry:6,dependencies:7},rDe=o((r,e)=>!Cw[r]&&!Cw[e]?ol(r,e):(Cw[r]||100)>(Cw[e]||100)?1:-1,"priorityThenLocaleCompare"),rP=o(r=>typeof r=="boolean"||typeof r=="number"||r.startsWith("true")||r.startsWith("false")||/[:\s\n\\",[\]]/g.test(r)||!/^[a-zA-Z]/g.test(r)?JSON.stringify(r):r,"quoteIfNeeded"),iDe=o(r=>Object.keys(r).sort(ol).map(e=>` ${rP(e)} ${rP(r[e])}`).join(`
151
+ `),"sortKV"),sDe=o((r,e)=>r.integrity&&e.integrity?r.integrity===e.integrity:r.resolved&&e.resolved?r.resolved===e.resolved:r.version&&e.version?r.version===e.version:!0,"match"),nDe=`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
152
+ # yarn lockfile v1
153
+
154
+
155
+ `,oDe=Symbol("null"),iP=class r{static{o(this,"YarnLock")}static parse(e){return new r().parse(e)}static fromTree(e){return new r().fromTree(e)}constructor(){this.entries=null,this.endCurrent()}endCurrent(){this.current=null,this.subkey=oDe}parse(e){let t=/^[^\s].*:$/,i=/^ {2}[^\s]+:$/,s=/^ {4}[^\s]+ .+$/,n=/^ {2}[^\s]+ .+$/;this.entries=new Map,this.current=null;let a=/([^\r\n]*)\r?\n/gm,c,l=0;for(/\n$/.test(e)||(e+=`
156
+ `);c=a.exec(e);){let u=c[1];if(l++,u.charAt(0)!=="#"){if(u===""){this.endCurrent();continue}if(t.test(u)){this.endCurrent();let h=this.splitQuoted(u.slice(0,-1),/, */);this.current=new qf(h),h.forEach(f=>this.entries.set(f,this.current));continue}if(i.test(u)){this.subkey=u.slice(2,-1),this.current[this.subkey]={};continue}if(s.test(u)&&this.current&&this.current[this.subkey]){let h=this.splitQuoted(u.trimLeft()," ");if(h.length===2){this.current[this.subkey][h[0]]=h[1];continue}}if(n.test(u)&&this.current){let h=this.splitQuoted(u.trimLeft()," ");if(h.length===2){h[0]==="resolved"&&(h[1]=h[1].replace(/#.*/,"")),this.current[h[0]]=h[1];continue}}throw Object.assign(new Error("invalid or corrupted yarn.lock file"),{position:c.index,content:c[0],line:l})}}return this.endCurrent(),this}splitQuoted(e,t){let i=e.split(t),s=[],n=0;for(let a=0;a<i.length;a++){let c=i[a];if(/^".*"$/.test(c))s[n++]=c.trim().slice(1,-1);else if(/^"/.test(c)){let l=c.trimLeft().slice(1);for(;++a<i.length;){let u=i[a];if(/[^\\](\\\\)*"$/.test(u)){l+=u.trimRight().slice(0,-1);break}else l+=u}s[n++]=l}else s[n++]=c.trim()}return s}toString(){return nDe+[...new Set([...this.entries.values()])].map(e=>e.toString()).sort((e,t)=>ol(e.replace(/"/g,""),t.replace(/"/g,""))).join(`
157
+
158
+ `)+`
159
+ `}fromTree(e){return this.entries=new Map,tDe({tree:e,visit:o(t=>this.addEntryFromNode(t),"visit"),getChildren:o(t=>[...t.children.values(),...t.fsChildren].sort((i,s)=>i.depth-s.depth||ol(i.name,s.name)),"getChildren")}),this}addEntryFromNode(e){let t=[...e.edgesIn].map(a=>`${e.name}@${a.spec}`).sort(ol),i=this.entryDataFromNode(e),s=null,n=[];for(let a of t){let c=this.entries.get(a);if(!c){s?s.addSpec(a):n.push(a);continue}if(sDe(c,i)){if(!s){s=c;for(let u of n)s.addSpec(u),this.entries.set(u,s);n.length=0;continue}s.addSpec(a),this.entries.set(a,s)}}if(s)Object.assign(s,i);else{let a=Object.assign(new qf(n),i);for(let c of n)this.entries.set(c,a)}}entryDataFromNode(e){let t={};return e.package.dependencies&&(t.dependencies=e.package.dependencies),e.package.optionalDependencies&&(t.optionalDependencies=e.package.optionalDependencies),e.version&&(t.version=e.version),e.resolved&&(t.resolved=Qxe(e.resolved,e.isLink?eDe(e.path):e.path,e.root.path,!0)),e.integrity&&(t.integrity=e.integrity),t}static get Entry(){return qf}},qf=class{static{o(this,"YarnLockEntry")}#e;constructor(e){this.#e=new Set(e),this.resolved=null,this.version=null,this.integrity=null,this.dependencies=null,this.optionalDependencies=null}toString(){return([...this.#e].sort(ol).map(rP).join(", ")+`:
160
+ `+Object.getOwnPropertyNames(this).filter(e=>this[e]!==null).sort(rDe).map(e=>typeof this[e]!="object"?` ${e} ${e==="integrity"?this[e]:JSON.stringify(this[e])}
161
+ `:Object.keys(this[e]).length===0?"":` ${e}:
162
+ `+iDe(this[e])+`
163
+ `).join("")).trim()}addSpec(e){this.#e.add(e)}};QJ.exports=iP});var rK=g((AYe,tK)=>{var jf=ye(),aDe=o((r,e,t)=>{try{if(e.version){let i=jf.resolve(r,e.version,t);if(e.integrity||i.type==="git")return i}if(e.from){let i=jf.resolve(r,e.from,t);if(i.registry&&e.version)return jf.resolve(r,e.version,t);if(!e.resolved)return i}if(e.resolved)return jf.resolve(r,e.resolved,t)}catch{}try{return jf.resolve(r,e.version,t)}catch{return{}}},"specFromLock");tK.exports=aDe});var nK=g((kYe,sK)=>{var cDe=$e(),{basename:lDe}=require("node:path"),{URL:uDe}=require("node:url");sK.exports=(r,e)=>{let t=lDe(e);if(!t.endsWith(".tgz"))return null;if(e.startsWith("http:/")||e.startsWith("https:/")){let c=new uDe(e).pathname.slice(1).split("/-/");if(c.length>1&&c.pop()===t){let h=c.pop().split(/\/|%2f/i),f=h.pop(),d=h.pop();return iK(t,d,f)}}let i=r.split(/\/|%2f/i),s=i.pop(),n=i.pop();return iK(t,n,s)};var iK=o((r,e,t)=>{if(!r.startsWith(t+"-"))return null;let i=cDe.parse(r.substring(t.length+1,r.length-4));return i?{name:e&&e.charAt(0)==="@"?`${e}/${t}`:t,version:i.version}:null},"versionFromBaseScopeName")});var aK=g((NYe,oK)=>{oK.exports={diff:hDe,jsonPatchPathConverter:fDe};function hDe(r,e,t){if(!r||typeof r!="object"||!e||typeof e!="object")throw new Error("both arguments must be objects or arrays");t||(t=o(function(c){return c},"pathConverter"));function i({obj1:c,obj2:l,basePath:u,basePathForRemoves:h,diffs:f}){var d=Object.keys(c),p=d.length,m=Object.keys(l),y=m.length,w,S=c.length-l.length;if(pDe(c,l)){for(var v=0;v<p;v++){var _=Array.isArray(c)?Number(d[v]):d[v];_ in l||(w=h.concat(_),f.remove.push({op:"remove",path:t(w)}))}for(var v=0;v<y;v++){var _=Array.isArray(l)?Number(m[v]):m[v];n({key:_,obj1:c,obj2:l,path:u.concat(_),pathForRemoves:u.concat(_),diffs:f})}}else{for(var v=0;v<S;v++)w=h.concat(v),f.remove.push({op:"remove",path:t(w)});for(var E=c.slice(S),v=0;v<y;v++)n({key:v,obj1:E,obj2:l,path:u.concat(v),pathForRemoves:u.concat(v+S),diffs:f})}}o(i,"getDiff");var s={remove:[],replace:[],add:[]};return i({obj1:r,obj2:e,basePath:[],basePathForRemoves:[],diffs:s}),s.remove.reverse().concat(s.replace).concat(s.add);function n({key:c,obj1:l,obj2:u,path:h,pathForRemoves:f,diffs:d}){var p=l[c],m=u[c];if(!(c in l)&&c in u){var y=m;d.add.push({op:"add",path:t(h),value:y})}else p!==m&&(Object(p)!==p||Object(m)!==m||dDe(p,m)||!Object.keys(p).length&&!Object.keys(m).length&&String(p)!=String(m)?a(h,d,m):i({obj1:l[c],obj2:u[c],basePath:h,basePathForRemoves:f,diffs:d}))}o(n,"pushReplaces");function a(c,l,u){l.replace.push({op:"replace",path:t(c),value:u})}o(a,"pushReplace")}o(hDe,"diff");function fDe(r){return[""].concat(r).join("/")}o(fDe,"jsonPatchPathConverter");function dDe(r,e){return Object.prototype.toString.call(r)!=Object.prototype.toString.call(e)}o(dDe,"differentTypes");function pDe(r,e){var t=r.length-e.length;if(Array.isArray(r)&&Array.isArray(e)&&t>0){for(var i=0,s=0,n=0;n<e.length&&String(r[n])===String(e[n]);n++)i++;for(var a=e.length;a>0&&String(r[a+t])===String(e[a]);a--)s++;return i>=s}return!0}o(pDe,"trimFromRight")});var fK=g((DYe,hK)=>{hK.exports={diffApply:mDe,jsonPatchPathConverter:yDe};var cK="remove",lK="replace",gDe="add",$f="move";function mDe(r,e,t){if(!r||typeof r!="object")throw new Error("base object must be an object or an array");if(!Array.isArray(e))throw new Error("diff must be an array");for(var i=e.length,s=0;s<i;s++){var n=e[s],a=r,c=n.op,l=uK(t,n.path),u=n.from&&uK(t,n.from),h,f,d,p,m;if(u){if(h=l,l=u,f=h.slice(),d=f.pop(),kw(d),d==null)return!1;for(var y;(y=f.shift())!=null;)kw(y),y in p||(p[y]={}),p=p[y]}var w=l.slice(),S=w.pop();if(kw(S),S==null)return!1;for(var v;(v=w.shift())!=null;)kw(v),v in a||(a[v]={}),a=a[v];if(c===cK||c===lK||c===$f){var _=c===$f?n.from:n.path;if(!a.hasOwnProperty(S))throw new Error(["expected to find property",_,"in object",r].join(" "))}(c===cK||c===$f)&&(c===$f&&(m=a[S]),Array.isArray(a)?a.splice(S,1):delete a[S]),(c===lK||c===gDe)&&(a[S]=n.value),c===$f&&(a[d]=m)}return a}o(mDe,"diffApply");function uK(r,e){if(r){if(e=r(e),!Array.isArray(e))throw new Error(["pathConverter must return an array, returned:",e].join(" "))}else if(!Array.isArray(e))throw new Error(["diff path",e,"must be an array, consider supplying a path converter"].join(" "));return e}o(uK,"transformPath");function yDe(r){return r.split("/").slice(1)}o(yDe,"jsonPatchPathConverter");function kw(r){if(r=="__proto__"||r=="constructor"||r=="prototype")throw new Error("setting of prototype values not supported")}o(kw,"prototypeCheck")});var EK=g((MYe,vK)=>{var Pw=ml(),{diff:SDe}=aK(),{diffApply:wDe}=fK(),vDe=Object.getOwnPropertyNames(Object.prototype),EDe=o(r=>(r=r.toString(),r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),_De=/\|{7,}/g,gK=/<{7,}/g,mK=/={7,}/g,yK=/>{7,}/g,SK=o(r=>r.match(gK)&&r.match(mK)&&r.match(yK),"isDiff"),bDe=o((r,e,t)=>{if(t=t||"ours",t!=="theirs"&&t!=="ours")throw new TypeError('prefer param must be "ours" or "theirs" if set');if(r=EDe(r),!SK(r))return Pw(r);let i=r.split(/[\n\r]+/g).reduce((c,l)=>(l.match(_De)?c.state="parent":l.match(gK)?c.state="ours":l.match(mK)?c.state="theirs":l.match(yK)?c.state="top":((c.state==="top"||c.state==="ours")&&(c.ours+=l),(c.state==="top"||c.state==="theirs")&&(c.theirs+=l),(c.state==="top"||c.state==="parent")&&(c.parent+=l)),c),{state:"top",ours:"",theirs:"",parent:""}),s=Pw(i.parent,e),n=Pw(i.ours,e),a=Pw(i.theirs,e);return t==="ours"?pK(s,n,a):pK(s,a,n)},"parseConflictJSON"),dK=o(r=>r&&typeof r=="object","isObj"),wK=o((r,e,t,i)=>{let s=t[i];if(dK(r[s])&&dK(e[s])&&Array.isArray(r[s])===Array.isArray(e[s]))return wK(r[s],e[s],t,i+1);r[s]=e[s]},"copyPath"),pK=o((r,e,t)=>{let i=SDe(r,e);for(let s=0;s<i.length;s++)if(!vDe.find(n=>i[s].path.includes(n)))try{wDe(t,[i[s]])}catch{wK(t,e,i[s].path,0)}return t},"resolve");vK.exports=Object.assign(bDe,{isDiff:SK})});var bK=g((BYe,_K)=>{var Nw=o(r=>!!r&&!Array.isArray(r)&&typeof r=="object","isObj"),ODe=o((r,e,t)=>t.includes(r)&&!t.includes(e)?-1:t.includes(e)&&!t.includes(r)?1:t.includes(r)&&t.includes(e)?t.indexOf(r)-t.indexOf(e):r.localeCompare(e,"en"),"compare"),IDe=o((r,e)=>(t,i)=>{let s=Array.isArray(r)?r:[];if(typeof r=="function"&&(i=r(t,i)),!Nw(i))return i;if(e.has(i))return e.get(i);let n=Object.entries(i).sort(([a,c],[l,u])=>Nw(c)===Nw(u)?ODe(a,l,s):Nw(c)?1:-1).reduce((a,[c,l])=>(a[c]=l,a),{});return e.set(i,n),n},"sort");_K.exports=(r,e,t=2)=>JSON.stringify(r,IDe(e,new Map),t)+(t?`
164
+ `:"")});var IK=g((jYe,OK)=>{function TDe(r,e){let{omitLockfileRegistryResolved:t=!1}=e;if(!t)return r}o(TDe,"overrideResolves");OK.exports={overrideResolves:TDe}});var cl=g((UYe,PK)=>{var RDe=wr()("en"),xw=3,sP=o((r,e)=>r&&e&&r!==e,"mismatch"),{log:nP}=se(),ADe=eK(),{readFile:CDe,readdir:kDe,readlink:PDe,rm:NDe,stat:Lw,writeFile:TK}=require("node:fs/promises"),{resolve:Ht,basename:aP,relative:xDe}=require("node:path"),DDe=rK(),oP=nK(),Uf=ye(),LDe=wt(),MDe=EK(),FDe=Wh(),BDe=bK(),RK=["name","version","lockfileVersion","resolved","integrity","requires","packages","dependencies"],Dw=/^https?:\/\/registry\.yarnpkg\.com\//,qDe=/^https?:\/\/registry\.npmjs\.org\//,jDe=o(r=>{try{return Uf(r)}catch{return{}}},"specFromResolved"),Tr=Oi(),al=cf(),{overrideResolves:AK}=IK(),CK=["version","dependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","bundleDependencies","acceptDependencies","funding","engines","os","cpu","_integrity","license","_hasShrinkwrap","hasInstallScript","bin","deprecated","workspaces"],$De=["integrity","inBundle","hasShrinkwrap","hasInstallScript"],kK=o((r,e)=>{let t=r[e];if(t){if(e==="license"&&typeof t=="object"&&t.type)return t.type;if(typeof t!="object"||Object.keys(t).length)return t}return null},"metaFieldFromPkg"),cP=o(async(r,e,t,i,s)=>{let n=aP(i),a=i!==r&&n==="node_modules",c=i!==r&&n.startsWith("@"),u=i===r||a||c?i:Ht(i,"node_modules"),h=Tr(r,i);s.add(h);let f;if(i===r)f=[{name:"node_modules",isDirectory:o(()=>!0,"isDirectory")}];else{let{mtime:d}=await Lw(i);if(d>t)throw new Error(`out of date, updated: ${h}`);if(!c&&!a&&!e.packages[h])throw new Error(`missing from lockfile: ${h}`);f=await kDe(u,{withFileTypes:!0}).catch(()=>[])}if(await Promise.all(f.map(async d=>{let p=Ht(u,d.name);if(d.isDirectory()&&!d.name.startsWith("."))await cP(r,e,t,p,s);else if(d.isSymbolicLink()){let m=Ht(u,await PDe(p)),y=await Lw(m).catch(()=>null);s.add(Tr(r,p)),y?.isDirectory()&&!s.has(Tr(r,m))&&await cP(r,e,t,m,s)}})),i===r){for(let d in e.packages)if(!s.has(d))throw new Error(`missing from node_modules: ${d}`)}},"assertNoNewer"),lP=class r{static{o(this,"Shrinkwrap")}static get defaultLockfileVersion(){return xw}static load(e){return new r(e).load()}static get keyOrder(){return RK}static async reset(e){let t=new r(e);t.reset();let[i,s]=await t.resetFiles;return t.hiddenLockfile?t.filename=Ht(t.path,"node_modules/.package-lock.json"):t.shrinkwrapOnly||i?t.filename=Ht(t.path,"npm-shrinkwrap.json"):t.filename=Ht(t.path,"package-lock.json"),t.loadedFromDisk=!!(i||s),t.type=aP(t.filename),t}static metaFromNode(e,t,i={}){if(e.isLink)return{resolved:Tr(t,e.realpath),link:!0};let s={};for(let c of CK){let l=kK(e.package,c);l&&(s[c.replace(/^_/,"")]=l)}let n=e.packageName;n&&(e===e.root||n!==e.name||FDe(e.realpath)!==n)&&(s.name=n),e.isTop&&e.package.devDependencies&&(s.devDependencies=e.package.devDependencies);for(let c of $De)e[c]&&(s[c]=e[c]);let a=al(e.resolved,e.path,t,!0);return a&&(e.isRegistryDependency?s.resolved=AK(a,i):s.resolved=a),e.extraneous?s.extraneous=!0:(e.peer&&(s.peer=!0),e.dev&&(s.dev=!0),e.optional&&(s.optional=!0),e.devOptional&&!e.dev&&!e.optional&&(s.devOptional=!0)),s}#e=new Map;constructor(e={}){let{path:t,indent:i=2,newline:s=`
165
+ `,shrinkwrapOnly:n=!1,hiddenLockfile:a=!1,lockfileVersion:c,resolveOptions:l={}}=e;a?this.lockfileVersion=3:c?this.lockfileVersion=parseInt(c,10):this.lockfileVersion=null,this.tree=null,this.path=Ht(t||"."),this.filename=null,this.data=null,this.indent=i,this.newline=s,this.loadedFromDisk=!1,this.type=null,this.yarnLock=null,this.hiddenLockfile=a,this.loadingError=null,this.resolveOptions=l,this.shrinkwrapOnly=n}checkYarnLock(e,t={}){e=Uf(e);let{yarnLock:i,loadedFromDisk:s}=this,a=i&&!s&&i.entries.get(e.raw);if(a&&a.version){let{resolved:c,version:l,integrity:u}=a,h=e.registry&&Dw.test(c),d=e.registry&&!h&&qDe.test(c)||h,p=d&&oP(e.name,c)||{},m=c;if(p.name===e.name&&p.version===l?m=l:d&&p.name&&p.version&&(m=`npm:${p.name}@${p.version}`),m)return t.resolved=c.replace(Dw,"https://registry.npmjs.org/"),t.integrity=u,Uf(`${e.name}@${m}`)}return e}reset(){this.tree=null,this.#e=new Map;let e=this.lockfileVersion||xw;this.originalLockfileVersion=e,this.data={lockfileVersion:e,requires:!0,packages:{},dependencies:{}}}get#t(){return this.shrinkwrapOnly?[`${this.path}/npm-shrinkwrap.json`]:this.hiddenLockfile?[`${this.path}/node_modules/.package-lock.json`]:[`${this.path}/npm-shrinkwrap.json`,`${this.path}/package-lock.json`,`${this.path}/yarn.lock`]}get loadFiles(){return Promise.all(this.#t.map(e=>e&&CDe(e,"utf8").then(t=>t,t=>{if(t.code==="ENOENT")return"";throw t})))}get resetFiles(){return Promise.all(this.#t.slice(0,2).map(e=>e&&Lw(e).then(t=>t.isFile(),t=>{if(t.code==="ENOENT")return null;throw t})))}inferFormattingOptions(e){let{[Symbol.for("indent")]:t,[Symbol.for("newline")]:i}=e;t!==void 0&&(this.indent=t),i!==void 0&&(this.newline=i)}async load(){let e;try{let[i,s,n]=await this.loadFiles;if(e=i||s||"{}",this.hiddenLockfile?this.filename=Ht(this.path,"node_modules/.package-lock.json"):this.shrinkwrapOnly||i?this.filename=Ht(this.path,"npm-shrinkwrap.json"):this.filename=Ht(this.path,"package-lock.json"),this.type=aP(this.filename),this.loadedFromDisk=!!(i||s),n){this.yarnLock=new ADe;try{this.yarnLock.parse(n)}catch{}}if(e=MDe(e),this.inferFormattingOptions(e),this.hiddenLockfile&&e.packages){let a=+(await Lw(this.filename)).mtime+10;await cP(this.path,e,a,this.path,new Set)}}catch(i){if(typeof this.filename=="string"){let s=Tr(this.path,this.filename);nP.verbose("shrinkwrap",`failed to load ${s}`,i.message)}else nP.verbose("shrinkwrap",`failed to load ${this.path}`,i.message);this.loadingError=i,this.loadedFromDisk=!1,this.ancientLockfile=!1,e={}}let t=xw;if(this.lockfileVersion?t=this.lockfileVersion:e.lockfileVersion&&e.lockfileVersion!==1&&(t=e.lockfileVersion),this.data={...e,lockfileVersion:t,requires:!0,packages:e.packages||{},dependencies:e.dependencies||{}},this.originalLockfileVersion=e.lockfileVersion,this.lockfileVersion||(this.lockfileVersion=this.data.lockfileVersion=t),this.ancientLockfile=this.loadedFromDisk&&!(e.lockfileVersion>=2)&&!e.requires,e.dependencies&&!e.packages){let i;try{i=await LDe.normalize(this.path),i=i.content}catch{i={}}this.#r("",null,this.data),this.#i(i)}return this}#r(e,t,i){let s=this.#c(e,t,i);if(s.link&&(e=s.resolved),i.dependencies)for(let n in i.dependencies){let a=e+(e?"/":"")+"node_modules/"+n;this.#r(a,n,i.dependencies[n])}}#i(e){let t=this.data.packages[""];for(let i of CK){let s=kK(e,i);s&&(t[i.replace(/^_/,"")]=s)}for(let i in this.data.packages){let s=this.data.packages[i];if(!(!s.requires||!i)){for(let n in s.requires){let a=this.#s(i,n),c="dependencies";a?.optional&&!s.optional?c="optionalDependencies":a?.dev&&!s.dev&&(c="devDependencies"),s[c]||(s[c]={}),s[c][n]=s.requires[n]}delete s.requires}}}#s(e,t){for(let i=e;;i=i.replace(/(^|\/)[^/]*$/,"")){let s=`${i}${i?"/":""}node_modules/${t}`;if(this.data.packages[s])return this.data.packages[s];if(!i)break}return null}#o(e,t,i=0){return e?(t[i]===""&&i++,i>=t.length?e:e.dependencies?this.#o(e.dependencies[t[i]],t,i+1):null):null}#n(e){return Tr(this.path,Ht(this.path,e))}delete(e){if(!this.data)throw new Error("run load() before getting or setting data");let t=this.#n(e);this.#e.delete(t),delete this.data.packages[t];let i=t.split(/(?:^|\/)node_modules\//),s=i.pop(),n=this.#o(this.data,i);n&&n.dependencies&&delete n.dependencies[s]}get(e){if(!this.data)throw new Error("run load() before getting or setting data");let t=this.#n(e);if(this.#e.has(t)&&this.#a(t),this.data.packages[t])return this.data.packages[t];let i=t.split(/(?:^|\/)node_modules\//),s=i[i.length-1],n=this.#o(this.data,i);return this.#c(t,s,n)}#c(e,t,i){if(!i)return{};let s=DDe(t,i,this.path);if(s.type==="directory"){let a=Tr(this.path,s.fetchSpec);return this.data.packages[e]={link:!0,resolved:a},this.data.packages[a]||this.#c(a,t,{...i,version:null}),this.data.packages[e]}let n={};if(i.requires&&typeof i.requires=="object"&&(n.requires=i.requires),i.optional&&(n.optional=!0),i.dev&&(n.dev=!0),e===""&&(n.name=i.name),i.integrity&&(n.integrity=i.integrity),i.version&&!i.integrity){if(s.type==="git")return n.resolved=al(s,this.path,this.path),this.data.packages[e]=n;s.registry&&(n.version=i.version)}if((i.resolved||s.type&&!s.registry)&&(s.registry?n.resolved=i.resolved:s.type==="file"?n.resolved=al(s,this.path,this.path,!0):s.fetchSpec&&(n.resolved=s.fetchSpec)),!n.version)if(s.type==="file"||s.type==="remote"){let a=oP(s.name,s.fetchSpec)||oP(s.name,n.resolved);a&&(n.version=a.version,a.name!==t&&(n.name=a.name))}else s.type==="alias"?(n.name=s.subSpec.name,n.version=s.subSpec.fetchSpec):s.type==="version"&&(n.version=s.fetchSpec);return i.bundled&&(n.inBundle=!0),this.data.packages[e]=n}add(e){if(!this.data)throw new Error("run load() before getting or setting data");let t=Tr(this.path,e.path);if(e.path===this.path&&(this.tree=e),e.resolved===null||e.integrity===null){let{resolved:i,integrity:s,hasShrinkwrap:n,version:a}=this.get(e.path),c=null;i&&(/^file:/.test(i)?c=`file:${Ht(this.path,i.slice(5))}`:c=i);let l=!i||!e.resolved||e.resolved===c,u=!s||!e.integrity||e.integrity===s,h=!a||!e.version||a===e.version;if((i||s||a)&&l&&u&&h)e.resolved=e.resolved||c||null,e.integrity=e.integrity||s||null,e.hasShrinkwrap=e.hasShrinkwrap||n||!1;else{let{resolved:d,integrity:p,hasShrinkwrap:m}=r.metaFromNode(e,this.path,this.resolveOptions);e.resolved=e.resolved||d||null,e.integrity=e.integrity||p||null,e.hasShrinkwrap=e.hasShrinkwrap||m||!1}}this.#e.set(t,e)}addEdge(e){if(!this.yarnLock||!e.valid)return;let{to:t}=e;if(t.resolved!==null&&t.integrity!==null||!this.yarnLock.entries||!this.yarnLock.entries.size)return;let i=null;t.resolved&&(/file:/.test(t.resolved)?i=al(t.resolved,t.path,this.path,!0):i=t.resolved);let s=Uf(`${t.name}@${e.spec}`),n=this.yarnLock.entries.get(`${t.name}@${e.spec}`);!n||sP(t.version,n.version)||sP(t.integrity,n.integrity)||sP(i,n.resolved)||(n.resolved&&Dw.test(n.resolved)&&s.registry&&(n.resolved=n.resolved.replace(Dw,"https://registry.npmjs.org/")),t.integrity=t.integrity||n.integrity||null,t.resolved=t.resolved||al(n.resolved,this.path,t.path)||null,this.#e.set(Tr(this.path,t.path),t))}#a(e){let t=this.#e.get(e);this.#e.delete(e),this.data.packages[e]=r.metaFromNode(t,this.path,this.resolveOptions)}commit(){if(this.tree){this.yarnLock&&this.yarnLock.fromTree(this.tree);let e=r.metaFromNode(this.tree.target,this.path,this.resolveOptions);this.data.packages={},Object.keys(e).length&&(this.data.packages[""]=e);for(let t of this.tree.root.inventory.values()){if(t===this.tree||t.isRoot||t.location==="")continue;let i=Tr(this.path,t.path);this.data.packages[i]=r.metaFromNode(t,this.path,this.resolveOptions)}}else if(this.#e.size>0)for(let e of this.#e.keys())this.#a(e);if(this.lockfileVersion||(this.lockfileVersion=xw),this.data.lockfileVersion=this.lockfileVersion,this.hiddenLockfile?(delete this.data.packages[""],delete this.data.dependencies):this.tree&&this.lockfileVersion<=3&&this.#h(this.tree,this.data),this.lockfileVersion>=3){let{dependencies:e,...t}=this.data;return t}else if(this.lockfileVersion<2){let{packages:e,...t}=this.data;return t}else return{...this.data}}#h(e,t,i=[]){e===this.tree&&(t.name=e.packageName||e.name,e.version&&(t.version=e.version));let s=[...e.edgesIn].filter(h=>h.valid).sort((h,f)=>{let d=h.from.location.split("node_modules"),p=f.from.location.split("node_modules");return d.length>p.length?1:p.length>d.length?-1:RDe(d[d.length-1],p[p.length-1])})[0],n=al(e.resolved,this.path,this.path,!0),a=jDe(n),c=a;s&&(c=Uf.resolve(e.name,s.spec,s.from.realpath)),e.isLink?t.version=`file:${Tr(this.path,e.realpath)}`:c&&(c.type==="file"||c.type==="remote")?t.version=c.saveSpec:c&&c.type==="git"||a.type==="git"?(t.version=e.resolved,c.raw&&(t.from=c.raw)):!e.isRoot&&e.package&&e.packageName&&e.packageName!==e.name?t.version=`npm:${e.packageName}@${e.version}`:e.package&&e.version&&(t.version=e.version),e.inDepBundle&&(t.bundled=!0),e.resolved&&!e.isLink&&a.type!=="git"&&a.type!=="file"&&a.type!=="directory"&&c.type!=="directory"&&c.type!=="git"&&c.type!=="file"&&c.type!=="remote"&&(t.resolved=AK(e.resolved,this.resolveOptions)),e.integrity&&(t.integrity=e.integrity),e.extraneous?t.extraneous=!0:e.isLink||(e.peer&&(t.peer=!0),e.devOptional&&!e.dev&&!e.optional&&(t.devOptional=!0),e.dev&&(t.dev=!0),e.optional&&(t.optional=!0));let l=e.target;if(l.edgesOut.size>0)if(e!==this.tree){let h=[...l.edgesOut.entries()];t.requires=h.reduce((f,[d,p])=>{let{spec:m,peer:y}=p;if(y)return f;if(m.startsWith("file:")){let w=Ht(e.realpath,m.slice(5));f[d]=`file:${Tr(e.realpath,w)}`}else f[d]=m;return f},{})}else t.requires=!0;let{children:u}=e.target;if(!u.size)delete t.dependencies;else{let h=[...i,e.realpath],f={},d=!1;for(let[p,m]of u.entries())i.includes(m.realpath)||(f[p]=this.#h(m,{},h),d=!0);d&&(t.dependencies=f)}return t}toJSON(){if(!this.data)throw new Error("run load() before getting or setting data");return this.commit()}toString(e={}){let t=this.toJSON(),{format:i=!0}=e,s=this.indent||2,n=i===!0?s:i||0,a=i?this.newline||`
166
+ `:"";return BDe(t,RK,n).replace(/\n/g,a)}save(e={}){if(!this.data)throw new Error("run load() before saving data");let t=this.toString(e);return!this.hiddenLockfile&&this.originalLockfileVersion!==void 0&&this.originalLockfileVersion!==this.lockfileVersion&&nP.warn("shrinkwrap",`Converting lock file (${xDe(process.cwd(),this.filename)}) from v${this.originalLockfileVersion} -> v${this.lockfileVersion}`),Promise.all([TK(this.filename,t).catch(i=>{if(this.hiddenLockfile)return NDe(this.filename,{recursive:!0,force:!0});throw i}),this.yarnLock&&this.yarnLock.entries.size&&TK(this.path+"/yarn.lock",this.yarnLock.toString())])}};PK.exports=lP});var uP=g((zYe,NK)=>{var UDe=ow(),VDe=o(r=>{if(!r.optional)return new Set;let e=new Set([r]);for(let t of e)for(let i of t.edgesIn)i.optional||e.add(i.from);return UDe(e,t=>!e.has(t.to))},"optionalSet");NK.exports=VDe});var DK=g((HYe,xK)=>{xK.exports=r=>{for(let e of r.inventory.values())e.extraneous=!0,e.dev=!0,e.devOptional=!0,e.peer=!0,e.optional=!0}});var XK=g((JYe,ZK)=>{var fP=wr()("en"),LK=wt(),Ai=ye(),Mw=Hc(),zDe=Qr(),{callLimit:MK}=VS(),FK=tC(),{resolve:ll,dirname:BK,sep:GDe}=require("node:path"),HDe=Yc(),{readdirScoped:WDe}=Dn(),{lstat:JDe,readlink:KDe}=require("node:fs/promises"),{depth:qK}=cs(),{log:Ci,time:wn}=se(),{redact:YDe}=om(),ZDe=$e(),{OK:XDe,REPLACE:QDe,CONFLICT:eLe}=uC(),tLe=KJ(),jK=pn(),rLe=BC(),$K=Bf(),dP=cl(),{defaultLockfileVersion:hP}=dP,ul=sl(),UK=nl(),VK=LS(),zK=uP(),{checkEngine:GK,checkPlatform:HK}=Zd(),WK=Oi(),iLe=DK(),hl=Symbol.for("updateAll"),sLe=Symbol.for("flagsSuspect"),nLe=Symbol.for("setWorkspaces"),fs=Symbol.for("updateNames"),Fw=Symbol.for("resolvedAdd"),JK=Symbol.for("usePackageLock"),KK=Symbol.for("realpathCache"),YK=Symbol.for("statCache"),oLe=Symbol.for("addNodeToTrashList"),pP=class{static{o(this,"DepsQueue")}#e=[];#t=!0;get length(){return this.#e.length}push(e){this.#e.includes(e)||(this.#t=!1,this.#e.push(e))}pop(){return this.#t||(this.#e.sort((e,t)=>e.depth-t.depth||fP(e.path,t.path)),this.#t=!0),this.#e.shift()}};ZK.exports=r=>class extends r{static{o(this,"IdealTreeBuilder")}#e;#t=null;#r=new pP;#i=new Set;#s=new Set;#o;#n;#c=new Set;#a=new Set;#h=new Map;#l=!1;#f=new WeakMap;#u=!1;#p;#g;#w=new Map;constructor(t){super(t);let i=t.registry||"https://registry.npmjs.org";t.registry=this.registry=i.replace(/\/+$/,"")+"/";let{follow:s=!1,installStrategy:n="hoisted",idealTree:a=null,installLinks:c=!1,legacyPeerDeps:l=!1,packageLock:u=!0,strictPeerDeps:h=!1,workspaces:f,global:d}=t;if(this.#g=!!h,this.idealTree=a,this.installLinks=c,this.legacyPeerDeps=l,this[JK]=u,this.#n=d?"shallow":n,this.#o=!!s,f?.length&&d)throw new Error("Cannot operate on workspaces in global mode");this[hl]=!1,this[fs]=[],this[Fw]=[]}get explicitRequests(){return new Set(this.#s)}async buildIdealTree(t={}){if(this.idealTree)return this.idealTree;t={...this.options,...t},(!t.add||t.add.length===0)&&(t.add=null),(!t.rm||t.rm.length===0)&&(t.rm=null);let i=wn.start("idealTree");if(!t.add&&!t.rm&&!t.update&&this.options.global)throw new Error("global requires add, rm, or update option");this.#A(t),this.addTracker("idealTree");try{await this.#E(),await this.#T(),await this.#O(t),await this.#k(),await this.#y(),await this.#F(),await this.#m()}finally{i(),this.finishTracker("idealTree")}return HDe(this.idealTree)}async#m(){let{engineStrict:t,npmVersion:i,nodeVersion:s,omit:n=[],cpu:a,os:c,libc:l}=this.options,u=new Set(n);for(let h of this.idealTree.inventory.values()){if(!h.optional&&!h.shouldOmit(u)){try{h.isRoot&&h.package.devEngines||GK(h.package,i,s,this.options.force)}catch(f){if(t)throw f;Ci.warn(f.code,f.message,{package:f.pkgid,required:f.required,current:f.current})}HK(h.package,this.options.force)}if(h.optional&&!h.inert)try{GK(h.package,i,s,!1),HK(h.package,!1,{cpu:a,os:c,libc:l})}catch{let d=zK(h);for(let p of d)p.inert=!0}}}#A(t){let i=t.update===!0?{all:!0}:Array.isArray(t.update)?{names:t.update}:t.update||{};(i.all||!Array.isArray(i.names))&&(i.names=[]),this.#e=!!t.complete,this.#u=!!t.preferDedupe;for(let s of i.names){let n=Ai(s),a=new TypeError(`Update arguments must only contain package names, eg:
167
+ npm update ${n.name}`);if(a.code="EUPDATEARGS",n.raw!==n.name)throw a}this[fs]=i.names,this[hl]=i.all,this.#p=t.prune!==!1,this.#l=!!(t.add||t.rm||i.all||i.names.length)}async#E(){let t=wn.start("idealTree:init"),i;if(this.options.global)i=await this.#_();else try{let{content:s}=await LK.normalize(this.path);i=await this.#b(s)}catch(s){if(s.code==="EJSONPARSE")throw s;i=await this.#b({})}return this[nLe](i).then(s=>this.options.global?s:!this[JK]||this[hl]?dP.reset({path:this.path,lockfileVersion:this.options.lockfileVersion,resolveOptions:this.options}).then(n=>Object.assign(s,{meta:n})):this.loadVirtual({root:s}).then(n=>(this.#V(n),n))).then(async s=>((!this[hl]&&!this.options.global&&!s.meta.loadedFromDisk||this.options.global&&this[fs].length)&&(await new this.constructor(this.options).loadActual({root:s}),s.target.children.size&&(s.meta.loadedFromDisk=!0,s.meta.originalLockfileVersion=s.meta.lockfileVersion=this.options.lockfileVersion||hP)),s.meta.inferFormattingOptions(s.package),s)).then(s=>(qK({tree:s,getChildren:o(n=>{let a=[];for(let c of n.edgesOut.values())a.push(c.to);return a},"getChildren"),filter:o(n=>n,"filter"),visit:o(n=>{for(let a of n.edgesOut.values())if(!a.to||!a.valid){this.#r.push(n);break}},"visit")}),this.idealTree=s,this.virtualTree=null,t(),s))}async#_(){let t=await this.#b({dependencies:{}}),i=new dP({path:this.path,lockfileVersion:this.options.lockfileVersion,resolveOptions:this.options});return i.reset(),t.meta=i,t}async#b(t){let i=await FK(this.path,this[KK],this[YK]),s=i===this.path?ul:UK,n=new s({path:this.path,realpath:i,pkg:t,extraneous:!1,dev:!1,devOptional:!1,peer:!1,optional:!1,global:this.options.global,installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,loadOverrides:!0});return n.isLink&&(n.target=new ul({path:i,realpath:i,pkg:t,extraneous:!1,dev:!1,devOptional:!1,peer:!1,optional:!1,global:this.options.global,installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,root:n})),n}async#O(t){let i=wn.start("idealTree:userRequests"),s=this.idealTree.target;if(!this.options.workspaces.length)await this.#v(s,t);else{let n=this.workspaceNodes(s,this.options.workspaces);this.options.includeWorkspaceRoot&&n.push(s);let a=n.map(c=>this.#v(c,t));await Promise.all(a)}i()}async#v(t,i){!this.options.global&&this[fs].length&&this.#B();let s=[];if(this.options.global&&(this[hl]||this[fs].length)){let c=ll(this.path,"node_modules"),l=await WDe(c).catch(()=>[]);for(let u of l){let h=u.replace(/\\/g,"/"),f=this[fs].includes(h);if(this[hl]||f){f&&s.push(h);let d=ll(c,h),p=await JDe(d).catch(()=>null);if(p&&p.isSymbolicLink()){let m=await KDe(d),y=ll(BK(d),m);t.package.dependencies[h]=`file:${y}`}else t.package.dependencies[h]="*"}}}this.auditReport&&this.auditReport.size>0&&await this.#I(i);let{add:n,rm:a}=i;if(a&&a.length){VK.rm(t.package,a);for(let c of a)this.#s.add({from:t,name:c,action:"DELETE"})}n&&n.length&&await this.#C(t,i),(n&&n.length||a&&a.length||this.options.global)&&(t.package=t.package);for(let c of this[Fw])c.tree===t&&this.#s.add(t.edgesOut.get(c.name));for(let c of s)this.#s.add(t.edgesOut.get(c));this.#r.push(t)}async#C(t,{add:i,saveType:s=null,saveBundle:n=!1}){let a=t.target.path;await Promise.all(i.map(async c=>{let l=Ai(c),u=l.rawSpec&&l.type==="tag";if(!l.name||u){let f=await Mw.manifest(l,{...this.options});u&&(l=Ai(`${f.name}@${f.version}`)),l.name=f.name}let{name:h}=l;if(l.type==="file")l=Ai(`file:${WK(a,l.fetchSpec)}`,a),l.name=h;else if(l.type==="directory")try{let f=await FK(l.fetchSpec,this[KK],this[YK]);l=Ai(`file:${WK(a,f)}`,a),l.name=h}catch{}l.tree=t,this[Fw].push(l)})),VK.add({pkg:t.package,add:this[Fw],saveBundle:n,saveType:s})}async#I(t){for(let i of this.auditReport.values())for(let s of i.nodes){let n=s.getBundler();if(n){Ci.warn(`audit fix ${s.name}@${s.version}`,`${s.location}
168
+ is a bundled dependency of
169
+ ${n.name}@${n.version} at ${n.location}
170
+ It cannot be fixed automatically.
171
+ Check for updates to the ${n.name} package.`);continue}for(let a of s.edgesIn)this.addTracker("idealTree",a.from.name,a.from.location),this.#r.push(a.from)}if(this.options.force&&this.auditReport&&this.auditReport.topVulns.size){t.add=t.add||[],t.rm=t.rm||[];let i=new Set;for(let[s,n]of this.auditReport.topVulns.entries()){let{simpleRange:a,topNodes:c,fixAvailable:l}=n;for(let u of c){if(!u.isProjectRoot&&!u.isWorkspace){Ci.warn("audit",`Manual fix required in linked project at ./${u.location} for ${s}@${a}.
172
+ 'cd ./${u.location}' and run 'npm audit' for details.`);continue}if(!l){Ci.warn("audit",`No fix available for ${s}@${a}`);continue}let{isSemVerMajor:h,version:f,name:d}=l,p=h?"a SemVer major change":"outside your stated dependency range";Ci.warn("audit",`Updating ${d} to ${f}, which is ${p}.`),await this.#C(u,{add:[`${d}@${f}`]}),i.add(u)}}for(let s of i)s.package=s.package}}#d(t){if(!this.auditReport)return null;let i=this.auditReport.get(t);return i?i.range:null}#B(){for(let t of this.idealTree.inventory.values())if(this[fs].includes(t.name)&&!t.isTop&&!t.inDepBundle&&!t.inShrinkwrap)for(let i of t.edgesIn)this.addTracker("idealTree",i.from.name,i.from.location),this.#r.push(i.from)}async#T(){let{meta:t,inventory:i}=this.idealTree,s=t.ancientLockfile,n=t.loadedFromDisk&&!(t.originalLockfileVersion>=2);if(i.size===0||!s&&!n)return;let a=wn.start("idealTree:inflate"),c=s?"ancient lockfile":"old lockfile";(s||!this.options.lockfileVersion||this.options.lockfileVersion>=hP)&&Ci.warn(c,`
173
+ The ${t.type} file was created with an old version of npm,
174
+ so supplemental metadata must be fetched from the registry.
175
+
176
+ This is a one-time fix-up, please be patient...
177
+ `),this.addTracker("idealTree:inflate");let l=[];for(let u of i.values())u.isProjectRoot||u.location.startsWith("node_modules")&&l.push(async()=>{Ci.silly("inflate",u.location);let{resolved:h,version:f,path:d,name:p,location:m,integrity:y}=u,S=h&&(!f||h.startsWith("file:"))?h:f,v=Ai.resolve(p,S,BK(d)),_=`idealTree:inflate:${m}`;this.addTracker(_);try{let E=await Mw.manifest(v,{...this.options,resolved:h,integrity:y,fullMetadata:!1});u.package={...E,_id:`${E.name}@${E.version}`}}catch(E){let b=`Could not fetch metadata for ${p}@${S}`;Ci.warn(c,b,E)}this.finishTracker(_)});await MK(l),$K(this.idealTree),!this.options.lockfileVersion&&!t.hiddenLockfile&&(t.originalLockfileVersion=hP),this.finishTracker("idealTree:inflate"),a()}#k(){let t=wn.start("idealTree:buildDeps"),i=this.idealTree.target;return i.assertRootOverrides(),this.#r.push(i),Ci.silly("idealTree","buildDeps"),this.addTracker("idealTree",i.name,""),this.#L().then(t)}async#L(){if(this.#t){let{location:f,name:d}=this.#t;wn.end(`idealTree:${f||"#root"}`),this.finishTracker("idealTree",d,f),this.#t=null}if(!this.#r.length)return this.#$();let t=this.#r.pop(),i=t.package.bundleDependencies,s=i&&Array.isArray(i)&&i.length,{hasShrinkwrap:n}=t;if(this.#i.has(t)||t.root!==this.idealTree||n&&!this.#e)return this.#L();if(this.#i.add(t),this.#t=t,wn.start(`idealTree:${t.location||"#root"}`),this.#e&&t!==this.idealTree&&t.resolved&&(s||n)&&!t.inert){let f=this.constructor,d={...this.options};await zDe.tmp.withTmp(this.cache,d,async p=>{await Mw.extract(t.resolved,p,{...d,Arborist:f,resolved:t.resolved,integrity:t.integrity}),n&&await new f({...this.options,path:p}).loadVirtual({root:t}),s&&await new f({...this.options,path:p}).loadActual({root:t,ignoreMissing:!0})})}let c=[],l=this.#f.get(t)||t;for(let f of this.#P(t)){if(f.peerConflicted)continue;let d=f.peer?l:t,p=this.#q(d,!0),m=p&&p.edgesOut.get(f.name),y=m&&m.valid&&m.to,w=new Set([f.from]),S=f.peer?p:null,v=y&&y.satisfies(f)?y:await this.#R(f,S,null,w);jK(()=>{if(!v)throw new Error("no dep??")}),c.push({edge:f,dep:v})}let u=c.sort((f,d)=>fP(f.edge.name,d.edge.name)),h=[];for(let{edge:f,dep:d}of u){let p=new tLe({edge:f,dep:d,auditReport:this.auditReport,explicitRequest:this.#s.has(f),force:this.options.force,installLinks:this.installLinks,installStrategy:this.#n,legacyPeerDeps:this.legacyPeerDeps,preferDedupe:this.#u,strictPeerDeps:this.#g,updateNames:this[fs]});qK({tree:p,getChildren:o(m=>m.children,"getChildren"),visit:o(m=>{let{placed:y,edge:w,canPlace:S}=m;if(y){if(y.errors.length&&this.#a.add(y),this.#l=!0,S.canPlaceSelf===XDe)for(let v of y.edgesIn){if(v===w)continue;let{from:_,valid:E,peerConflicted:b}=v;!b&&!E&&!this.#i.has(_)&&(this.addTracker("idealTree",_.name,_.location),this.#r.push(v.from))}else if(S.canPlaceSelf===QDe)for(let v of y.edgesIn){if(v===w)continue;let{valid:_,peerConflicted:E}=v;!_&&!E&&(this.#i.delete(v.from),this.#r.push(v.from))}if(S.canPlaceSelf===eLe){jK(()=>{let v=new Error("placed with canPlaceSelf=CONFLICT");throw Object.assign(v,{placeDep:m})});return}this.#r.push(y);for(let v of m.needEvaluation)this.#i.delete(v),this.#r.push(v);for(let v of this.#P(y))h.push(()=>this.#N(Ai.resolve(v.name,v.spec,rLe(y,v))).catch(()=>null))}},"visit")})}for(let{to:f}of t.edgesOut.values())f&&f.isLink&&f.target&&this.#c.add(f);return await MK(h),this.#L()}async#R(t,i,s,n){let a=i||this.#q(t.from),c=Ai.resolve(t.name,t.spec,t.from.path),l=await this.#M(t.name,c,a,t),u=s&&Ai.resolve(t.name,s.spec,s.from.path),h=s&&!s.valid?await this.#M(t.name,u,a,s):null,f=h&&t.valid?h:l;f.parent=a,(n.has(t.from)&&t.type!=="peerOptional"||s&&n.has(s.from)&&s.type!=="peerOptional")&&n.add(f);let d=a.sourceReference;return this.#f.set(f,d),this.options.global&&t.from.isProjectRoot?f:this.#D(f,n)}#q(t,i=!1){if(i&&this.#w.has(t))return this.#w.get(t);let s=new ul({path:t.realpath,sourceReference:t,installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,overrides:t.overrides});for(let n of t.children.values())n.isLink&&new ul({path:n.realpath,sourceReference:n.target,root:s});return this.#w.set(t,s),s}#P(t){let i=t.isProjectRoot||t.isWorkspace?null:t.package.bundleDependencies,s=new Set(i||[]),n=[];for(let a of t.edgesOut.values())if(!s.has(a.name)&&!(a.to&&this.#a.has(a.to))&&!(a.to&&a.to.inShrinkwrap)){if(!a.to){(a.type!=="peerOptional"||this.#s.has(a))&&n.push(a);continue}if(!a.valid){n.push(a);continue}if(!a.to.isWorkspace){if(this[fs].includes(a.name)){n.push(a);continue}if(this.auditReport&&this.auditReport.isVulnerable(a.to)){n.push(a);continue}if(this.#s.has(a)){n.push(a);continue}}}return n}async#N(t){let i={...this.options,avoid:this.#d(t.name),fullMetadata:!0};if(t=this.idealTree.meta.checkYarnLock(t,i),this.#h.has(t.raw))return this.#h.get(t.raw);{Ci.silly("fetch manifest",t.raw.replace(t.rawSpec,YDe(t.rawSpec)));let s=await Mw.manifest(t,i);return this.#h.set(t.raw,s),s}}#M(t,i,s,n){let{installLinks:a,legacyPeerDeps:c}=this,l=this.idealTree.workspaces&&this.idealTree.workspaces.has(i.name),u=!1;if(n?.rawSpec.startsWith("file:../")||n?.rawSpec.startsWith("file:./")){let p=ll(s.realpath,n.rawSpec.slice(5)),m=ll(this.idealTree.realpath);u=p.startsWith(m+GDe)||p===m}let h=s&&!s.isLink&&s.resolved?.startsWith("file:"),f=i.type==="directory"&&h&&a,d=(l||u||!a)&&!f;if(i.type==="directory"&&d)return this.#x(t,i,s,n);if(l){let p=this.idealTree.edgesOut.get(i.name).to;if(p&&p.isWorkspace&&p.satisfies(n))return p}if(f&&n){let p=s.resolved.slice(5),m=n.rawSpec.slice(5),y=ll(p,m);i=Ai.resolve(t,`file:${y}`)}return this.#N(i).then(p=>new ul({name:t,pkg:p,parent:s,installLinks:a,legacyPeerDeps:c}),p=>{p.requiredBy=n.from.location||".";let m=new ul({name:t,parent:s,error:p,installLinks:a,legacyPeerDeps:c});return this.#a.add(m),m})}async#x(t,i,s){let n=i.fetchSpec,{installLinks:a,legacyPeerDeps:c}=this,{content:l}=await LK.normalize(n).catch(()=>({content:{}})),u=new UK({name:t,parent:s,realpath:n,pkg:l,installLinks:a,legacyPeerDeps:c});return this.#c.add(u),u}async#D(t,i){let s=[...t.edgesOut.values()].filter(n=>n.peer&&!(n.valid&&n.to)).sort(({name:n},{name:a})=>fP(n,a));for(let n of s){if(!t.parent)break;if(n.valid&&n.to)continue;let a=t.parent.edgesOut.get(n.name),{isProjectRoot:c,isWorkspace:l}=t.parent.sourceReference,u=c||l,h=this.options.force||!u&&!this.#g;if(!n.to)if(a){let p=await this.#R(a,t.parent,n,i);if(n.valid)continue;if(h||!i.has(p)){n.peerConflicted=!0;continue}this.#S(n,a)}else{await this.#R(n,t.parent,null,i);continue}let f=n.to;if((await this.#R(n,null,null,i)).canReplace(f)){await this.#R(n,t.parent,null,i);continue}h||!i.has(n.from)||this.#S(n,a)}return t}#S(t,i){let s=this.#j(t,i);throw Object.assign(new Error("unable to resolve dependency tree"),s)}#j(t,i){return{code:"ERESOLVE",current:t.from.resolve(t.name).explain(),currentEdge:i?i.explain():null,edge:t.explain(),strictPeerDeps:this.#g,force:this.options.force}}#$(){for(let t of this.#c){if(this.#c.delete(t),t.root!==this.idealTree)continue;let i=this.idealTree.target;if(!t.target.isDescendantOf(i)&&!this.#o)continue;let n=(t.target.parent||t.target.fsParent)&&!this.#i.has(t.target);(this.#o&&!t.target.parent&&!t.target.fsParent||n)&&(this.addTracker("idealTree",t.target.name,t.target.location),this.#r.push(t.target))}if(this.#r.length)return this.#L()}#y(){let t=wn.start("idealTree:fixDepFlags"),i=this.idealTree.meta.loadedFromDisk,s=this[sLe],n=this.#l;i&&n&&iLe(this.idealTree),!i||n?$K(this.idealTree):(this.idealTree.extraneous=!1,this.idealTree.dev=!1,this.idealTree.optional=!1,this.idealTree.devOptional=!1,this.idealTree.peer=!1);let a=i&&(n||s);this.#p&&a&&this.#U(),t()}#V(t){let i=t.root.package.overrides||{};for(let s of t.root.inventory.values())if(s.isWorkspace)for(let n of Object.keys(i)){let a=s.edgesOut.get(n),c=t.root.children.get(n);if(!a||!c)continue;let l=c.package.version;ZDe.satisfies(l,a.spec)||(a.detach(),s.children.delete(n))}}#U(){for(let t of this.idealTree.inventory.values())(t.extraneous||t.peer&&t.optional)&&(t.parent=null)}#F(){for(let t of this.#a){if(!t.optional)throw t.errors[0];let i=zK(t);for(let s of i)s.inert=!0}}async prune(t={}){if(t={...this.options,...t},await this.buildIdealTree(t),this.#U(),!this.options.workspacesEnabled){let i=this.excludeWorkspacesDependencySet(this.idealTree);for(let s of this.idealTree.inventory.values())s.parent!==null&&!s.isProjectRoot&&!i.has(s)&&!s.inert&&this[oLe](s)}return this.reify(t)}}});var rY=g((YYe,tY)=>{var{parse:QK,sep:gP,normalize:eY}=require("path");function*aLe(r,e){let[t,i]=r.length>e.length?[r,e]:[e,r];for(let s of i)if(s===t.shift())yield s;else break}o(aLe,"commonArrayMembers");var cLe=o((r,e)=>r===e?r:QK(r).root!==QK(e).root?null:[...aLe(eY(r).split(gP),eY(e).split(gP))].join(gP),"commonAncestorPath");tY.exports=(...r)=>r.reduce(cLe)});var hY=g((QYe,uY)=>{var{dirname:iY,join:lLe,normalize:sY,relative:uLe,resolve:nY}=require("node:path"),hLe=wt(),{readdirScoped:oY}=Dn(),{walkUp:aY}=nw(),fLe=rY(),dLe=Yc(),cY=cl(),pLe=Bf(),mP=sl(),gLe=nl(),yP=tC(),mLe=Symbol.for("_changePath"),lY=Symbol.for("setWorkspaces"),Bw=Symbol.for("realpathCache"),qw=Symbol.for("statCache");uY.exports=r=>class extends r{static{o(this,"ActualLoader")}#e;#t=new Set;#r;#i=new Map;#s;#o=new Set;#n;constructor(t){super(t),this.actualTree=t.actualTree;let i=process.cwd();this[Bw]=new Map([[i,i]]),this[qw]=new Map}async loadActual(t={}){return this.actualTree?this.actualTree:(this.#r||(t={...this.options,...t},this.#r=this.#c(t).then(i=>{if(!t.root)for(let s of i.inventory.values())s.extraneous=!0;return pLe(i,!t.root),this.actualTree=dLe(i),this.actualTree})),this.#r)}async#c(t){let{global:i,filter:s=o(()=>!0,"filter"),root:n=null,transplantFilter:a=o(()=>!0,"transplantFilter"),ignoreMissing:c=!1,forceActual:l=!1}=t;if(this.#s=s,this.#n=a,i){let u=await yP(this.path,this[Bw],this[qw]),h={path:this.path,realpath:u,pkg:{},global:i,loadOverrides:!0};this.path===u?this.#e=this.#l(h):this.#e=await this.#f(h)}else{if(this.#e=await this.#h({path:this.path,real:await yP(this.path,this[Bw],this[qw]),loadOverrides:!0}),this.#e.assertRootOverrides(),!l){let h=await cY.load({path:this.#e.path,hiddenLockfile:!0,resolveOptions:this.options});if(h.loadedFromDisk)return this.#e.meta=h,await new this.constructor({...this.options}).loadVirtual({root:this.#e}),await this[lY](this.#e),this.#a(n),this.#e}let u=await cY.load({path:this.#e.path,lockfileVersion:this.options.lockfileVersion,resolveOptions:this.options});this.#e.meta=u}if(await this.#u(this.#e),await this[lY](this.#e),this.#e.workspaces&&this.#e.workspaces.size){let u=[];for(let h of this.#e.workspaces.values())if(!this.#i.has(h)){let f=this.#h({path:h,root:this.#e,useRootOverrides:!0}).then(d=>this.#u(d));u.push(f)}await Promise.all(u)}c||await this.#g();for(let u of this.#o){let h=this.#i.get(u);if(h&&!h.parent&&!h.fsParent){for(let f of aY(iY(u)))if(this.#i.has(f)){h.fsParent=this.#i.get(f);break}}}if(this.#a(n),i){let u=this.#e,h=u.isLink?u.target:u,{dependencies:f={}}=h.package;for(let[d,p]of h.children.entries()){let m=p.isLink?`file:${p.realpath}`:"*";f[d]=f[d]||m}h.package={...h.package,dependencies:f}}return this.#e}#a(t){if(!(!t||t===this.#e)){this.#e[mLe](t.path);for(let i of this.#e.children.values())this.#n(i)||(i.root=null);t.replace(this.#e);for(let i of this.#e.fsChildren)i.root=this.#n(i)?t:null;this.#e=t}}async#h({path:t,parent:i,real:s,root:n,loadOverrides:a,useRootOverrides:c}){if(!s)try{s=await yP(t,this[Bw],this[qw])}catch(h){return new mP({error:h,path:t,realpath:t,parent:i,root:n,loadOverrides:a})}let l=this.#i.get(t),u;if(l&&!l.dummy)return l.parent=i,l;{let h={installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,path:t,realpath:s,parent:i,root:n,loadOverrides:a};try{let{content:f}=await hLe.normalize(s);h.pkg=f,c&&n.overrides&&(h.overrides=n.overrides.getNodeRule({name:f.name,version:f.version}))}catch(f){f.code==="EJSONPARSE"&&(f.path=lLe(s,"package.json")),h.error=f}sY(t)===s?u=this.#l(h):u=await this.#f(h)}return this.#i.set(t,u),u}#l(t){let{parent:i,realpath:s}=t;return i||this.#o.add(s),new mP(t)}async#f(t){let{realpath:i}=t;this.#o.add(i);let s=this.#i.get(i),n=new gLe({...t,target:s});return s||(this.#i.set(i,n.target),await this.#u(n.target)),n}async#u(t){let i=this.#t;if(!t.isLink&&!i.has(t.target.realpath))return i.add(t.target.realpath),await this.#p(t.target),Promise.all([...t.target.children.entries()].filter(([,s])=>!i.has(s.realpath)).map(([,s])=>this.#u(s)))}async#p(t){let i=nY(t.realpath,"node_modules");try{let s=await oY(i).then(n=>n.map(a=>a.replace(/\\/g,"/")));return Promise.all(s.filter(n=>!/^(@[^/]+\/)?\./.test(n)).filter(n=>this.#s(t,n)).map(n=>this.#h({parent:t,path:nY(i,n)})))}catch{}}async#g(){let t=new Map,i=this.#e;for(let s of i.inventory.values()){let n=fLe(s.realpath,this.path),a=[];for(let[c,l]of s.edgesOut.entries())if(!(!l.missing&&!(l.to&&(l.to.dummy||l.to.parent!==s))))for(let h of aY(iY(s.realpath))){if(n&&/^\.\.(?:[\\/]|$)/.test(uLe(n,h)))break;let f;if(t.has(h)?f=t.get(h):(f=await oY(h+"/node_modules").catch(()=>[]).then(p=>p.map(m=>m.replace(/\\/g,"/"))),t.set(h,f)),!f.includes(c))continue;let d;if(this.#i.has(h)?d=this.#i.get(h):(d=new mP({path:h,root:s.root,dummy:!0}),this.#i.set(h,d)),d.dummy){let p=sY(`${h}/node_modules/${c}`),m=this.#i.get(p);(!m||m.dummy)&&a.push(this.#h({path:p,root:s.root,parent:d}).then(y=>this.#u(y)))}break}await Promise.all(a)}}}});var gY=g((rZe,pY)=>{var{resolve:jw}=require("node:path"),yLe=OA(),fY=wt(),SLe=Wh(),wLe=cf(),vLe=cl(),ELe=sl(),_Le=nl(),bLe=Oi(),OLe=Bf(),dY=Yc(),Vf=Symbol.for("flagsSuspect"),ILe=Symbol.for("setWorkspaces");pY.exports=r=>class extends r{static{o(this,"VirtualLoader")}#e;constructor(t){super(t),this.virtualTree=t.virtualTree,this[Vf]=!1}async loadVirtual(t={}){if(this.virtualTree)return this.virtualTree;if(t={...this.options,...t},t.root&&t.root.meta)return await this.#t(t.root.meta,t.root),dY(this.virtualTree);let i=await vLe.load({path:this.path,lockfileVersion:this.options.lockfileVersion,resolveOptions:this.options});if(!i.loadedFromDisk&&!t.root){let a=new Error("loadVirtual requires existing shrinkwrap file");throw Object.assign(a,{code:"ENOLOCK"})}let s=await fY.normalize(this.path).then(a=>a.content).catch(()=>i.data.packages[""]||{}),{root:n=await this[ILe](this.#n("",s,!0))}=t;return this.#e=t.root,await this.#t(i,n),n.assertRootOverrides(),dY(this.virtualTree)}async#t(t,i){this.#e?this[Vf]=!0:(i.extraneous=!1,i.dev=!1,i.optional=!1,i.devOptional=!1,i.peer=!1),this.#r(t,i),i.meta=t,this.virtualTree=i;let{links:s,nodes:n}=this.#i(t,i);if(await this.#s(s,n),t.originalLockfileVersion>=2||this.#o(n),this[Vf]){for(let a of n.values())a.isRoot||a===this.#e||(a.extraneous=!0,a.dev=!0,a.optional=!0,a.devOptional=!0,a.peer=!0);OLe(this.virtualTree,!this.#e)}return i}#r(t,i){if(!t.loadedFromDisk||t.ancientLockfile)return;let s=t.get(""),n=s.dependencies||{},a=s.devDependencies||{},c=s.optionalDependencies||{},l=s.peerDependencies||{},u={};if(s.peerDependenciesMeta)for(let[m,y]of Object.entries(s.peerDependenciesMeta))y.optional&&l[m]!==void 0&&(u[m]=l[m],delete l[m]);for(let m of Object.keys(c))delete n[m];let h={},f=yLe.virtual({cwd:this.path,lockfile:t.data});for(let[m,y]of f.entries())h[m]=`file:${y}`;let d=new Set(i.edgesOut.keys()),p={dev:a,optional:c,peer:l,peerOptional:u,prod:n,workspace:h};for(let m in p){let y=p[m];for(let w in y){let S=i.edgesOut.get(w);if(!S||S.type!==m||S.spec!==y[w])return this[Vf]=!0;d.delete(w)}}if(d.size)return this[Vf]=!0}#i(t,i){let s=new Map,n=new Map([["",i]]);for(let[a,c]of Object.entries(t.data.packages))a&&(c.link?s.set(a,c):n.set(a,this.#n(a,c)));return{links:s,nodes:n}}async#s(t,i){for(let[s,n]of t.entries()){let a=jw(this.path,n.resolved),c=bLe(this.path,a),l=i.get(c);if(!l){let h=new Error(`Missing target in lock file: "${c}" is referenced by "${s}" but does not exist.
178
+ To fix:
179
+ 1. rm package-lock.json
180
+ 2. npm install`);throw h.code="EMISSINGTARGET",h}let u=this.#c(s,c,l,n);i.set(s,u),i.set(c,u.target),u.target.parent||await fY.normalize(u.realpath).then(h=>u.target.package=h.content).catch(()=>null)}}#o(t){for(let[i,s]of t){if(!i||s.isLink&&!s.target.location)continue;let{name:n,parent:a,package:{inBundle:c}}=s;if(!a)continue;let{package:l}=a,{inBundle:u}=l;c&&!u&&a.edgesOut.has(s.name)&&(l.bundleDependencies?l.bundleDependencies.push(n):l.bundleDependencies=[n])}}#n(t,i,s){let n=this.virtualTree?this.virtualTree.realpath:this.path,a=jw(n,t);i.name||(i.name=SLe(a));let c=i.dev,l=i.optional,u=c||l||i.devOptional,h=i.peer,f=new ELe({installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,root:this.virtualTree,path:a,realpath:a,integrity:i.integrity,resolved:wLe(i.resolved,this.path,a),pkg:i,hasShrinkwrap:i.hasShrinkwrap,dev:c,optional:l,devOptional:u,peer:h,loadOverrides:s});return f.extraneous=!!i.extraneous,f.devOptional=!!(i.devOptional||i.dev||i.optional),f.peer=!!i.peer,f.optional=!!i.optional,f.dev=!!i.dev,f}#c(t,i,s){let n=jw(this.path,t),a=new _Le({installLinks:this.installLinks,legacyPeerDeps:this.legacyPeerDeps,path:n,realpath:jw(this.path,i),target:s,pkg:s&&s.package});return a.extraneous=s.extraneous,a.devOptional=s.devOptional,a.peer=s.peer,a.optional=s.optional,a.dev=s.dev,a}}});var SP=g((sZe,mY)=>{var TLe=Promise.allSettled?r=>Promise.allSettled(r):r=>{let e=[];for(let t=0;t<r.length;t++)e[t]=Promise.resolve(r[t]).then(i=>({status:"fulfilled",value:i}),i=>({status:"rejected",reason:i}));return Promise.all(e)};mY.exports=r=>TLe(r).then(e=>{let t=null,i=new Array(e.length);return e.forEach((s,n)=>{if(s.status==="rejected")throw s.reason;i[n]=s.value}),i})});var OY=g((oZe,bY)=>{var RLe=wt(),yY=FC(),ALe=wr()("en"),SY=SP(),CLe=Ka(),{callLimit:kLe}=VS(),{depth:PLe}=cs(),{isNodeGypPackage:NLe,defaultGypInstallScript:xLe}=B0(),{log:wP,time:jo}=se(),{resolve:DLe}=require("node:path"),$w=o(r=>r?"1":"","boolEnv"),wY=o((r,e)=>r.depth-e.depth||ALe(r.path,e.path),"sortNodes"),vY=Symbol.for("checkBins"),EY=Symbol.for("handleOptionalFailure"),_Y=Symbol.for("trashList");bY.exports=r=>class extends r{static{o(this,"Builder")}#e;#t=null;#r;constructor(t){super(t),this.scriptsRun=new Set,this.#o()}async rebuild({nodes:t,handleOptionalFailure:i=!1}={}){if(this.options.ignoreScripts&&!this.options.binLinks)return;this.#e=i,t||(t=await this.#i());let s=jo.start("build"),{depNodes:n,linkNodes:a}=this.#s(t);await this.#n(n,{}),a.size&&(this.#o(),await this.#n(a,{type:"links"})),s()}async#i(){let t,i=await this.loadActual(),s;return this.options.workspacesEnabled?this.options.workspaces.length?(s=this.workspaceDependencySet(i,this.options.workspaces,this.options.includeWorkspaceRoot),t=i.inventory.filter(n=>s.has(n))):t=i.inventory.values():(s=this.excludeWorkspacesDependencySet(i),t=i.inventory.filter(n=>s.has(n)||n.isProjectRoot)),t}#s(t){let i=new Set,s=new Set,n=new Set;for(let a of t)a.isStoreLink?n.add(a):a.isLink?s.add(a):i.add(a);for(let a of n)i.add(a);if(!this.options.global)for(let a of s)i.delete(a.target);return{depNodes:i,linkNodes:s}}#o(){this.#r={preinstall:[],install:[],postinstall:[],prepare:[],bin:[]}}async#n(t,{type:i="deps"}){let s=jo.start(`build:${i}`);await this.#c(t),this.options.ignoreScripts||await this.#h("preinstall"),i==="links"&&(this.options.ignoreScripts||await this.#h("prepare")),this.options.binLinks&&await this.#l(),this.options.ignoreScripts||(await this.#h("install"),await this.#h("postinstall")),s()}async#c(t){let i=jo.start("build:queue"),s=new Set,n=[];for(let c of t)if(n.push(this.#a(c,s)),this.options.rebuildBundle!==!1){let l=c.package.bundleDependencies;l&&l.length&&PLe({tree:c,leave:o(u=>n.push(this.#a(u,s)),"leave"),getChildren:o(u=>[...u.children.values()],"getChildren"),filter:o(u=>u.inBundle,"filter")})}await SY(n);let a=[...s].sort(wY);for(let c of a){let{package:{bin:l,scripts:u={}}}=c.target,{preinstall:h,install:f,postinstall:d,prepare:p}=u,m={bin:l,preinstall:h,install:f,postinstall:d,prepare:p};for(let[y,w]of Object.entries(m))w&&this.#r[y].push(c)}i()}async[vY](t){if(!t.globalTop||this.options.force)return;let{path:i,package:s}=t;await yY.checkBins({pkg:s,path:i,top:!0,global:!0})}async#a(t,i,s=!1){if(i.has(t))return;if(this.#t===null){let{root:{meta:w}}=t;this.#t=w&&w.loadedFromDisk&&!(w.originalLockfileVersion>=2)}let{package:n,hasInstallScript:a}=t.target,{gypfile:c,bin:l,scripts:u={}}=n,{preinstall:h,install:f,postinstall:d,prepare:p}=u;if(!s&&!(h||f||d||p)&&(a||this.#t)){i.add(t);let{content:w}=await RLe.normalize(t.path).catch(()=>({content:{}}));i.delete(t);let{scripts:S={}}=w;return t.package.scripts=S,this.#a(t,i,!0)}let y=c!==!1&&!f&&!h&&await NLe(t.path);(l||h||f||d||p||y)&&(l&&await this[vY](t),y&&(u.install=xLe,t.package.scripts=u),i.add(t))}async#h(t){let i=this.#r[t];if(!i.length)return;let s=jo.start(`build:run:${t}`),n=this.options.foregroundScripts?"inherit":"pipe",a=this.options.foregroundScripts?1:void 0;await kLe(i.map(c=>async()=>{let{path:l,integrity:u,resolved:h,optional:f,peer:d,dev:p,devOptional:m,package:y,location:w,isStoreLink:S}=c.target;if(this[_Y].has(l)||S)return;let v=jo.start(`build:run:${t}:${w}`);wP.info("run",y._id,t,w,y.scripts[t]);let _={npm_package_resolved:h,npm_package_integrity:u,npm_package_json:DLe(l,"package.json"),npm_package_optional:$w(f),npm_package_dev:$w(p),npm_package_peer:$w(d),npm_package_dev_optional:$w(m&&!p&&!f)},E={event:t,path:l,pkg:y,stdio:n,env:_,scriptShell:this.options.scriptShell},b=CLe(E).catch(O=>{let{code:T,signal:I}=O;throw wP.info("run",y._id,t,{code:T,signal:I}),O}).then(({args:O,code:T,signal:I,stdout:L,stderr:F})=>{this.scriptsRun.add({pkg:y,path:l,event:t,cmd:O&&O[O.length-1],env:_,code:T,signal:I,stdout:L,stderr:F}),wP.info("run",y._id,t,{code:T,signal:I})});await(this.#e?this[EY](c,b):b),v()}),{limit:a}),s()}async#l(){let t=this.#r.bin;if(!t.length)return;let i=jo.start("build:link"),s=[];for(let n of t.sort(wY))s.push(this.#f(n));await SY(s),i()}async#f(t){if(this[_Y].has(t.path))return;let i=jo.start(`build:link:${t.location}`),s=yY({pkg:t.package,path:t.path,top:!!(t.isTop||t.globalTop),force:this.options.force,global:!!t.globalTop});await(this.#e?this[EY](t,s):s),i()}}});var CY=g((cZe,AY)=>{var{depth:IY}=cs(),{existsSync:LLe}=require("node:fs"),MLe=Ft(),Uw=class r{static{o(this,"Diff")}constructor({actual:e,ideal:t,filterSet:i,shrinkwrapInflated:s,omit:n}){this.omit=n,this.filterSet=i,this.shrinkwrapInflated=s,this.children=[],this.actual=e,this.ideal=t,this.ideal&&(this.resolved=this.ideal.resolved,this.integrity=this.ideal.integrity),this.action=TY(this),this.parent=null,this.leaves=[],this.unchanged=[],this.removed=[]}static calculate({actual:e,ideal:t,filterNodes:i=[],shrinkwrapInflated:s=new Set,omit:n=new Set}){let a=new Set,c=new Set;for(let l of i){let{root:u}=l;if(u!==t&&u!==e)throw new Error("invalid filterNode: outside idealTree/actualTree");let h=u.target,f=[...h.edgesOut.values()].filter(d=>d.to&&(d.to===l||d.to.target===l))[0];a.add(u),a.add(h),a.add(t),a.add(e),f&&f.to&&(a.add(f.to),a.add(f.to.target)),a.add(l),IY({tree:l,visit:o(d=>a.add(d),"visit"),getChildren:o(d=>{d=d.target;let p=d.location,m=t.inventory.get(p),y=m?[...m.edgesOut.values()].filter(v=>v.to).map(v=>v.to):[],w=e.inventory.get(p),S=w?[...w.edgesOut.values()].filter(v=>v.to).map(v=>v.to):[];if(w)for(let v of w.children.values())v.extraneous&&c.add(v);return y.concat(S)},"getChildren")})}for(let l of c)a.add(l);return IY({tree:new r({actual:e,ideal:t,filterSet:a,shrinkwrapInflated:s,omit:n}),getChildren:RY,leave:BLe})}},TY=o(({actual:r,ideal:e})=>{if(!e)return"REMOVE";if(!r)return e.inDepBundle?null:"ADD";if(e.isRoot&&r.isRoot)return null;if(e.version!==r.version)return"CHANGE";let t=e.binPaths.every(c=>LLe(c)),i=!e.integrity&&!r.integrity,s=!e.resolved&&!r.resolved,n=e.resolved&&e.resolved===r.resolved;return i&&t&&(n||s)?null:!e.integrity||!r.integrity||!MLe.parse(e.integrity).match(r.integrity)||!t?"CHANGE":null},"getAction"),vP=o(r=>{if(!r)return new Map;if(r.isRoot&&r.isLink)return vP(r.target);let e=new Map;for(let t of[r,...r.fsChildren])for(let i of t.children.values())e.set(i.path,i);return e},"allChildren"),RY=o(r=>{let e=[],{actual:t,ideal:i,unchanged:s,removed:n,filterSet:a,shrinkwrapInflated:c,omit:l}=r,u=vP(t),h=vP(i);if(i&&i.hasShrinkwrap&&!c.has(i))return r.leaves.push(r),e;let f=new Set([...u.keys(),...h.keys()]);for(let d of f){let p=u.get(d),m=h.get(d);FLe({actual:p,ideal:m,children:e,unchanged:s,removed:n,filterSet:a,shrinkwrapInflated:c,omit:l})}return r.leaves&&!e.length&&r.leaves.push(r),e},"getChildren"),FLe=o(({actual:r,ideal:e,children:t,unchanged:i,removed:s,filterSet:n,shrinkwrapInflated:a,omit:c})=>{if(n.size&&!(n.has(e)||n.has(r))||(e?.shouldOmit?.(c)&&(e.inert=!0),e?.inert&&(e=void 0),!r&&!e))return;let l=TY({actual:r,ideal:e});if(l||!a.has(e)&&e.hasShrinkwrap)l==="REMOVE"&&s.push(r),t.push(new Uw({actual:r,ideal:e,filterSet:n,shrinkwrapInflated:a,omit:c}));else{i.push(e);let u=e.package.bundleDependencies;if(r&&u&&u.length){let h=[];for(let f of r.children.values())f.inBundle&&h.push(f);for(let f of h)f.parent=e}t.push(...RY({actual:r,ideal:e,unchanged:i,removed:s,filterSet:n,shrinkwrapInflated:a,omit:c}))}},"diffNode"),BLe=o((r,e)=>(e.forEach(t=>{t.parent=r,r.leaves.push(...t.leaves),r.unchanged.push(...t.unchanged),r.removed.push(...t.removed)}),r.children=e,r),"leave");AY.exports=Uw});var PY=g((uZe,Vw)=>{var kY=global.__ARBORIST_FAKE_PLATFORM__||process.platform;Vw.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];kY!=="win32"&&Vw.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");kY==="linux"&&Vw.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var xY=g((hZe,EP)=>{var NY=PY();EP.exports=Object.assign(r=>qLe(r),{process});var qLe=o(r=>{let{process:e}=EP.exports,t={loaded:!1},i=o(()=>{if(t.loaded){for(let c of NY)try{e.removeListener(c,t[c])}catch{}e.removeListener("beforeExit",s),t.loaded=!1}},"unload"),s=o(()=>{i(),e.kill(e.pid,n),setTimeout(()=>{},500)},"onBeforeExit"),n=null,a=o((c,l)=>()=>{n=c,i(),e.listeners(c).length<1&&e.once("beforeExit",s),l({signal:c})},"listener");for(let c of NY){t[c]=a(c,r);let l=e.getMaxListeners();try{let{length:u}=e.listeners(c);u>=l&&e.setMaxListeners(u+1),e.on(c,t[c])}catch{}}return t.loaded=!0,i},"setup")});var LY=g((dZe,DY)=>{var jLe=require("node:crypto"),{dirname:$Le,basename:ULe,resolve:VLe}=require("node:path"),zLe=o(r=>jLe.createHash("sha1").update(r).digest("base64").replace(/[^a-zA-Z0-9]+/g,"").slice(0,8),"pathSafeHash"),GLe=o(r=>{let e=$Le(r),t=ULe(r),i=zLe(r);return VLe(e,`.${t}-${i}`)},"retirePath");DY.exports=GLe});var tZ=g((mZe,eZ)=>{var MY=wt(),HLe=wl(),WLe=ye(),JLe=Dp(),KLe=Hc(),xt=SP(),YLe=Ka(),{callLimit:ZLe}=VS(),{depth:_P}=cs(),{dirname:bP,resolve:$o,relative:fl,join:XLe}=require("node:path"),{log:Vr,time:Ke}=se(),{lstat:OP,mkdir:dl,rm:zf,symlink:QLe}=require("node:fs/promises"),{moveFile:FY}=Dn(),{subset:BY,intersects:qY}=$e(),{walkUp:eMe}=nw(),tMe=KA(),rMe=CY(),iMe=Bf(),IP=pn(),sMe=xY(),nMe=uP(),jY=Oi(),$Y=LY(),oMe=Yc(),{defaultLockfileVersion:aMe}=cl(),{saveTypeMap:cMe,hasSubKey:pl}=LS(),UY=Symbol.for("retireShallowNodes"),zw=Symbol.for("loadBundlesAndUpdateTrees"),TP=Symbol("submitQuickAudit"),VY=Symbol.for("unpackNewModules"),zY=Symbol.for("build"),vn=Symbol.for("trashList"),GY=Symbol.for("handleOptionalFailure"),HY=Symbol.for("loadTrees"),lMe=Symbol.for("checkBins"),Gw=Symbol.for("diffTrees"),RP=Symbol.for("createSparseTree"),AP=Symbol.for("loadShrinkwrapsAndUpdateTrees"),Gf=Symbol.for("reifyNode"),WY=Symbol.for("updateAll"),CP=Symbol.for("updateNames"),kP=Symbol.for("moveContents"),JY=Symbol.for("moveBackRetiredUnchanged"),KY=Symbol.for("removeTrash"),gl=Symbol.for("renamePath"),PP=Symbol.for("rollbackRetireShallowNodes"),NP=Symbol.for("rollbackCreateSparseTree"),YY=Symbol.for("rollbackMoveBackRetiredUnchanged"),ZY=Symbol.for("saveIdealTree"),XY=Symbol.for("reifyPackages"),QY=Symbol.for("resolvedAdd"),uMe=Symbol.for("usePackageLock"),Hf=Symbol.for("addNodeToTrashList"),hMe=Symbol.for("createIsolatedTree");eZ.exports=r=>class extends r{static{o(this,"Reifier")}#e=new Set;#t=new Set;#r;#i=new Set;#s;#o={};#n={};#c;#a=new Set;#h=new Set;#l=new Set;constructor(t){super(t),this[vn]=new Set}async reify(t={}){let i=(t.installStrategy||this.options.installStrategy)==="linked";if(this.options.packageLockOnly&&this.options.global){let a=new Error("cannot generate lockfile for global packages");throw a.code="ESHRINKWRAPGLOBAL",a}this.#s=new Set(t.omit),this.addTracker("reify");let s=Ke.start("reify");!this.options.packageLockOnly&&!this.options.dryRun&&(await dl($o(this.path),{recursive:!0}),await this.#f($o(this.path,"node_modules"))),await this[HY](t);let n=this.idealTree;i&&(Vr.warn("reify",'The "linked" install strategy is EXPERIMENTAL and may contain bugs.'),this.idealTree=await this[hMe]()),await this[Gw](),await this[XY](),i&&(this.idealTree=n),await this[ZY](t);for(let a of this.idealTree.inventory.values())a.inert&&(a.parent=null);for(let a of this[vn]){let c=jY(this.idealTree.realpath,a),l=this.idealTree.inventory.get(c);l&&l.root===this.idealTree&&(l.parent=null)}if(this.diff&&this.diff.filterSet.size){let a=new Set,{filterSet:c}=this.diff,l=new Set;for(let[u,h]of this.idealTree.inventory.entries()){if(l.add(u),c.has(h))continue;let f=this.actualTree.inventory.get(u);if(!f)h.root=null;else{if([...f.linksIn].some(m=>c.has(m))){l.add(f.location);continue}let{realpath:d,isLink:p}=f;if(p&&h.isLink&&h.realpath===d)continue;a.add(f)}}for(let[u,h]of this.actualTree.inventory.entries())l.has(u)||(l.add(u),!c.has(h)&&a.add(h));for(let u of a)u.root=this.idealTree;for(let u of this.idealTree.tops)u.linksIn.size===0&&(u.root=null);iMe(this.idealTree)}if(this.idealTree.meta.filename=this.idealTree.realpath+"/node_modules/.package-lock.json",this.idealTree.meta.hiddenLockfile=!0,this.idealTree.meta.lockfileVersion=aMe,this.actualTree=this.idealTree,this.idealTree=null,!this.options.global){await this.actualTree.meta.save();let a=!!this.options.ignoreScripts;if(!this.options.dryRun&&!a&&this.diff&&this.diff.children.length){let{path:c,package:l}=this.actualTree.target,u=this.options.foregroundScripts?"inherit":"pipe",{scripts:h={}}=l;for(let f of["predependencies","dependencies","postdependencies"])Object.prototype.hasOwnProperty.call(h,f)&&(Vr.info("run",l._id,f,h[f]),await Ke.start(`reify:run:${f}`,()=>YLe({event:f,path:c,pkg:l,stdio:u,scriptShell:this.options.scriptShell})))}}return this.auditReport=await this.auditReport,this.finishTracker("reify"),s(),oMe(this.actualTree)}async[XY](){if(this.options.dryRun)return;if(this.options.packageLockOnly)return this[TP]();let t=null,i=sMe(({signal:n})=>(i(),t=Object.assign(new Error("process terminated"),{signal:n}),!1)),s=[[PP,[UY]],[NP,[RP,AP,zw,TP,VY]],[YY,[JY,zY]]];for(let[n,a]of s)for(let c of a)try{if(await this[c](),t)throw t}catch(l){throw await this[n](l),l}if(await this[KY](),t)throw t;i()}[HY](t){let i=Ke.start("reify:loadTrees"),s={...t,complete:this.options.packageLockOnly||this.options.dryRun};if(this.options.packageLockOnly)return this.buildIdealTree(s).then(i);let n=this.options.global?{ignoreMissing:!0,global:!0,filter:o((a,c)=>!!(this.explicitRequests.size===0||!a.isProjectRoot||this.idealTree.edgesOut.has(c)||[...this.explicitRequests].some(u=>u.name===c)),"filter")}:{ignoreMissing:!0};return this.options.global?this.buildIdealTree(s).then(()=>this.loadActual(n)).then(i):Promise.all([this.loadActual(n),this.buildIdealTree(s)]).then(i)}[Gw](){if(this.options.packageLockOnly)return;let t=Ke.start("reify:diffTrees"),i=this.options.workspacesEnabled,s=!i||this.options.includeWorkspaceRoot&&this.options.workspaces.length>0,n=[];if(this.options.global&&this.explicitRequests.size){let a=this.idealTree.target,c=this.actualTree.target;for(let{name:l}of this.explicitRequests){let u=a.children.get(l);u&&n.push(u);let h=c.children.get(l);h&&n.push(h)}}else{if(i)for(let a of this.options.workspaces){let c=this.idealTree.children.get(a);c&&n.push(c);let l=this.actualTree.children.get(a);l&&n.push(l)}if(s)for(let a of[this.idealTree,this.actualTree])for(let{type:c,to:l}of a.edgesOut.values())c!=="workspace"&&l&&n.push(l)}this.diff=rMe.calculate({omit:this.#s,shrinkwrapInflated:this.#a,filterNodes:n,actual:this.actualTree,ideal:this.idealTree}),t()}[Hf](t,i=!1){let s=[t.path,...t.binPaths],n=this.#o;Vr.silly("reify","mark",i?"retired":"deleted",s);for(let a of s)if(i){let c=$Y(a);n[a]=c,this[vn].add(c)}else this[vn].add(a)}[UY](){let t=Ke.start("reify:retireShallow"),i=this.#o={};for(let n of this.diff.children)(n.action==="CHANGE"||n.action==="REMOVE")&&this[Hf](n.actual,!0);Vr.silly("reify","moves",i);let s=Object.entries(i).map(([n,a])=>this[gl](n,a));return xt(s).then(t)}[gl](t,i,s=!1){return FY(t,i).catch(n=>{if(n.code==="ENOENT")return s?null:dl(bP(i),{recursive:!0}).then(()=>this[gl](t,i,!0));if(n.code==="EEXIST")return zf(i,{recursive:!0,force:!0}).then(()=>FY(t,i));throw n})}[PP](t){let i=Ke.start("reify:rollback:retireShallow"),s=this.#o,n=Object.entries(s).map(([a,c])=>this[gl](c,a));return xt(n).catch(()=>{}).then(i).then(()=>{throw t})}[RP](){let t=Ke.start("reify:createSparse"),i=this.diff.leaves.filter(n=>(n.action==="ADD"||n.action==="CHANGE")&&!this.#h.has(n.ideal.path)&&!n.ideal.isLink).map(n=>n.ideal),s=new Set;return xt(i.map(async n=>{for(let c of eMe(n.path)){if(c===n.top.path)break;if(s.has(c))continue;s.add(c);let l=await OP(c).catch(()=>null);if(l&&!l.isDirectory()){let u=$Y(c);this.#o[c]=u,this[vn].add(u),await this[gl](c,u)}}this.#h.add(n.path);let a=await dl(n.path,{recursive:!0});a&&this.#l.add(a)})).then(t)}[NP](t){let i=Ke.start("reify:rollback:createSparse"),s=this.#l,n=[],c=[...s,...Object.keys(this.#o)].map(l=>zf(l,{recursive:!0,force:!0}).catch(u=>n.push([l,u])));return xt(c).then(()=>{n.length&&Vr.warn("cleanup","Failed to remove some directories",n)}).then(i).then(()=>this[PP](t))}[AP](){let t=this.#a,i=this.diff.leaves.filter(a=>(a.action==="CHANGE"||a.action==="ADD"||!a.action)&&a.ideal.hasShrinkwrap&&!t.has(a.ideal)&&!this[vn].has(a.ideal.path));if(!i.length)return;let s=Ke.start("reify:loadShrinkwraps"),n=this.constructor;return xt(i.map(a=>{let c=a.ideal;return t.add(c),a.action?this[Gf](c):c})).then(a=>xt(a.map(c=>new n({...this.options,path:c.path}).loadVirtual({root:c})))).then(()=>this[Gw]()).then(()=>this[RP]()).then(()=>this[AP]()).then(s)}[Gf](t){let i=Ke.start(`reifyNode:${t.location}`);this.addTracker("reify",t.name,t.location);let s=Promise.resolve().then(async()=>{await this[lMe](t),await this.#u(t);let{_id:n,deprecated:a}=t.package;a&&Vr.warn("deprecated",`${n}: ${a}`)});return this[GY](t,s).then(()=>(this.finishTracker("reify",t.name,t.location),i(),t))}async#f(t){if(this.options.force||this.#i.has(t))return;let i=await OP(t).catch(()=>null);if(!i||i.isDirectory()){this.#i.add(t);return}Vr.warn("reify","Removing non-directory",t),await zf(t,{recursive:!0,force:!0})}async#u(t){let i=$o(t.parent.path,"node_modules");if(await this.#f(i),!t.isLink){let c=null;if(t.resolved){let l=this.#g(t.resolved);l&&(c=`${t.name}@${l}`)}else t.package.name&&t.version&&(c=`${t.package.name}@${t.version}`);if(!c){Vr.warn("reify",`invalid or damaged lockfile detected
181
+ please re-try this operation once it completes
182
+ so that the damage can be corrected, or perform
183
+ a fresh install with no lockfile if the problem persists.`),Vr.verbose("reify","unrecognized node in tree",t.path),t.parent=null,t.fsParent=null,this[Hf](t);return}if(await IP(async()=>{let l=await OP(t.path).catch(()=>null);if(l&&!l.isDirectory())throw IP.log("unpacking into a non-directory",t),Object.assign(new Error("ENOTDIR: not a directory"),{code:"ENOTDIR",path:t.path})}),await KLe.extract(c,t.path,{...this.options,resolved:t.resolved,integrity:t.integrity}),t.isInStore){let{content:l}=await MY.normalize(t.path);t.package.scripts=l.scripts}return}await zf(t.path,{recursive:!0,force:!0});let s=bP(t.path),n=t.realpath,a;return t.resolved?.startsWith("file:")?a=this.#p(t,s,n,i):a=fl(s,n),await dl(s,{recursive:!0}),QLe(a,t.path,"junction")}[GY](t,i){return(t.optional?i.catch(()=>{let s=nMe(t);for(let n of s)Vr.verbose("reify","failed optional dependency",n.path),n.inert=!0,this[Hf](n)}):i).then(()=>t)}#p(t,i,s){let n=[...t.edgesIn].some(l=>l.from.isRoot&&l.overrides);if(!n&&t.root){let l=t.root.target;n=!!(l&&l.package.overrides&&l.package.overrides[t.name])}if(!n)return fl(i,s);let a=t.root?.target?.package?.overrides?.[t.name];if(typeof a=="string"&&a.startsWith("file:")){let l=a.replace(/^file:/,""),u=t.root.target.path;return fl(i,$o(u,l))}let c=t.resolved.replace(/^file:/,"");return XLe(c)}#g(t){try{let i=HLe.parseUrl(t);if(this.options.replaceRegistryHost===i.hostname||this.options.replaceRegistryHost==="always"){let s=new URL(this.registry);i.hostname=s.hostname,i.port=s.port,i.protocol=s.protocol;let n=s.pathname.replace(/\/$/,"");return n&&n!=="/"&&!i.pathname.startsWith(n)&&(i.pathname=n+i.pathname),i.toString()}return t}catch{return}}[zw](t=0,i){let s;if(i?s=i.get("maxBundleDepth"):(i=new Map,s=-1,_P({tree:this.diff,visit:o(a=>{let c=a.ideal;if(!c||c.isProjectRoot)return;let{bundleDependencies:l}=c.package;l&&l.length&&(s=Math.max(s,c.depth),i.has(c.depth)?i.get(c.depth).push(c):i.set(c.depth,[c]))},"visit"),getChildren:o(a=>a.children,"getChildren")}),i.set("maxBundleDepth",s)),t===0&&Ke.start("reify:loadBundles"),t>s){s!==-1&&(this.#w(i),this[Gw]()),Ke.end("reify:loadBundles");return}let n=(i.get(t)||[]).filter(a=>a.root===this.idealTree&&a.target!==a.root&&!this[vn].has(a.path));return n.length?ZLe(n.map(a=>()=>(this.#t.add(a),this[Gf](a))),{rejectLate:!0}).then(a=>xt(a.map(async c=>{let l=new this.constructor({...this.options,path:c.path}),u=new Set(c.children.keys());await l.loadActual({root:c,transplantFilter:o(h=>h.package._id?(u.delete(h.name),!0):!1,"transplantFilter")});for(let h of u)this.#e.add(c.children.get(h))}))).then(()=>this[zw](t+1,i)):this[zw](t+1,i)}#w(t){let i=new Set;for(let n of t.values())if(Array.isArray(n))for(let a of n)for(let c of a.children.keys()){let l=a.parent.resolve(c);l&&(i.add(l),l.extraneous=!0)}for(let n of i)for(let a of n.edgesOut.values())a.to&&(i.add(a.to),a.to.extraneous=!0);let s;do{s=!1;for(let n of i)for(let a of n.edgesIn)if(!i.has(a.from)){n.extraneous=!1,i.delete(n),s=!0;break}}while(s);for(let n of i)this[Hf](n),n.root=null}async[TP](){if(this.options.audit===!1){this.auditReport=null;return}let t=Ke.start("reify:audit"),i={...this.options},s=this.idealTree;this.options.workspaces.length&&(i.filterSet=this.workspaceDependencySet(s,this.options.workspaces,this.options.includeWorkspaceRoot)),this.auditReport=tMe.load(s,i).then(n=>(t(),n))}[VY](){let t=Ke.start("reify:unpack"),i=[];return _P({tree:this.diff,visit:o(s=>{if(s.action!=="CHANGE"&&s.action!=="ADD")return;let n=s.ideal,a=this.#t.has(n),c=this.#a.has(n),l=this.#e.has(n);n&&!n.isRoot&&!a&&!c&&(l||!n.inDepBundle)&&i.push(this[Gf](n))},"visit"),getChildren:o(s=>s.children,"getChildren")}),xt(i).then(t)}[JY](){let t=Ke.start("reify:unretire"),i=this.#o;return this.#n={},xt(this.diff.children.map(s=>{if(s.action!=="CHANGE"&&s.action!=="REMOVE")return;let{path:n}=s.actual,a=i[n];return IP(()=>{if(!a){let c=new Error("trying to un-retire but not retired");throw Object.assign(c,{realFolder:n,retireFolder:a,actual:s.actual,ideal:s.ideal,action:s.action})}}),this.#n[a]=[],xt(s.unchanged.map(c=>{if(c.isLink)return dl(bP(c.path),{recursive:!0,force:!0}).then(()=>this[Gf](c));if(c.inDepBundle&&!this.#e.has(c))return;this.#n[a].push(c);let l=fl(n,c.path),u=$o(a,l),h=c.package.bundleDependencies,f=h&&h.length?c.path+"/node_modules":c.path;return dl(f,{recursive:!0}).then(()=>this[kP](c,u))}))})).then(t)}[kP](t,i){return JLe({path:i,depth:1,packageJsonCache:new Map([[i+"/package.json",t.package]])}).then(s=>xt(s.map(n=>{let a=fl(i,n),c=$o(t.path,a);return this[gl](n,c)})))}[YY](t){let i=this.#o,s=new Map(Object.entries(i).map(([a,c])=>[c,a])),n=Object.entries(this.#n).map(([a,c])=>xt(c.map(l=>{let u=s.get(a),h=fl(u,l.path),f=$o(a,h);return this[kP]({...l,path:f},l.path)})));return xt(n).then(()=>this[NP](t))}[zY](){let t=Ke.start("reify:build"),i=[];_P({tree:this.diff,leave:o(s=>{s.ideal.isProjectRoot||i.push(s.ideal)},"leave"),getChildren:o(s=>s&&s.children,"getChildren"),filter:o(s=>s.action==="ADD"||s.action==="CHANGE","filter")});for(let s of this.diff.unchanged){let n=s.root.target,a=s.parent===n&&!s.inert||s.target.fsTop===n;s.isLink&&a&&i.push(s)}return this.rebuild({nodes:i,handleOptionalFailure:!0}).then(t)}async[KY](){let t=Ke.start("reify:trash"),i=[],s=[],n=o(a=>zf(a,{recursive:!0,force:!0}).catch(c=>s.push([a,c])),"_rm");for(let a of this[vn])i.push(n(a));await xt(i),s.length&&Vr.warn("cleanup","Failed to remove some directories",s),t()}async[ZY](t){let i=t.save!==!1,s=this[WY]||this[CP].length;if(!!(!i&&!s||this.options.global||this.options.dryRun))return!1;let a=Ke.start("reify:save"),c=new Set,l=o(f=>{for(let{name:d,tree:p}of f){let m=p.edgesOut.get(d),y=p.package,w=WLe.resolve(d,m.spec,p.realpath),{rawSpec:S,subSpec:v}=w,_=v?v.rawSpec:S,E=m.to;if(!E||!p.isTop)continue;let b,O=w.type==="directory"||w.type==="file";if(w.registry){let T=E.version,I=T?this.options.savePrefix+T:"*",L=(v||w).type==="range",F=_;(!L||_==="*"||BY(I,_,{loose:!0}))&&(F=I);let X=E.packageName;b=d!==X?`npm:${X}@${F}`:F}else if(w.hosted){let T=w.hosted,I={noCommittish:!1};T.https&&T.auth?b=`git+${T.https(I)}`:b=T.shortcut(I)}else if(O)if(m.type==="workspace"){let{version:T}=m.to.target;b=T?this.options.savePrefix+T:"*"}else{let T=w.fetchSpec.replace(/^file:/,"");b=`file:${jY(p.realpath,T)}`}else b=w.saveSpec;if(t.saveType){let T=cMe.get(t.saveType);y[T][d]=b,t.saveType==="prod"&&y.optionalDependencies&&delete y.optionalDependencies[d]}else pl(y,"dependencies",d)&&(y.dependencies[d]=b),pl(y,"devDependencies",d)?(y.devDependencies[d]=b,pl(y,"peerDependencies",d)&&(O||!qY(b,y.peerDependencies[d]))&&(y.peerDependencies[d]=b),pl(y,"optionalDependencies",d)&&(O||!qY(b,y.optionalDependencies[d]))&&(y.optionalDependencies[d]=b)):(pl(y,"peerDependencies",d)&&(y.peerDependencies[d]=b),pl(y,"optionalDependencies",d)&&(y.optionalDependencies[d]=b));c.add(p)}},"updateNodes"),u=o(f=>{for(let d of f.edgesIn)try{if(BY(d.spec,f.version))return!1}catch{}return!0},"exactVersion"),h=o(f=>{let d=o(y=>!y.isRoot&&y.resolveParent&&y.resolveParent.isRoot&&(!f||f.includes(y.name))&&u(y),"filterDirectDependencies"),p=this.idealTree.inventory.filter(d),m=[];for(let y of p)for(let w of y.edgesIn)m.push({name:y.name,tree:w.from.target});return m},"retrieveUpdatedNodes");if(i)if(this[WY]){let f=h();l(f)}else{if(this[QY].length&&l(this[QY]),this[CP].length){let f=h(this[CP]);l(f)}for(let{from:f}of this.explicitRequests)c.add(f)}if(i)for(let f of c){f.package=f.package;let d=await MY.load(f.path,{create:!0}),{dependencies:p={},devDependencies:m={},optionalDependencies:y={},peerDependencies:w={},bundleDependencies:S}=f.package;d.update({dependencies:p,devDependencies:m,optionalDependencies:y,peerDependencies:w,bundleDependencies:S}),await d.save()}if(this[uMe]){let f=this.idealTree.package[Symbol.for("indent")];f===void 0&&(f=" "),await this.idealTree.meta.save({format:this.options.formatPackageLock&&f?f:this.options.formatPackageLock})}return a(),!0}}});var nZ=g((wZe,sZ)=>{var xP=Symbol("makeIdealGraph"),fMe=Symbol.for("createIsolatedTree"),rZ=Symbol("createBundledTree"),{mkdirSync:dMe}=require("node:fs"),pMe=Hc(),{join:zr}=require("node:path"),{depth:gMe}=cs(),mMe=require("node:crypto"),iZ=o(r=>{let e=new Map;return async function(t){let i=t;if(e.has(i))return e.get(i);let s={};return e.set(i,s),await r(s,t),s}},"memoize");sZ.exports=r=>class extends r{static{o(this,"IsolatedReifier")}async[xP](t){let i={...t,complete:!1};await this.buildIdealTree(i);let s=this.idealTree;this.rootNode={};let n=this.rootNode;this.counter=0,this.externalProxyMemo=iZ(this.externalProxy.bind(this)),this.workspaceProxyMemo=iZ(this.workspaceProxy.bind(this)),n.external=[],n.isProjectRoot=!0,n.localLocation=s.location,n.localPath=s.path,n.workspaces=await Promise.all(Array.from(s.fsChildren.values(),this.workspaceProxyMemo));let a=new Set,c=[s,...s.fsChildren];for(;c.length!==0;){let l=c.pop();a.has(l.location)||(a.add(l.location),l.edgesOut.forEach(u=>{!u.to||(l.package.bundleDependencies||l.package.bundledDependencies||[]).includes(u.to.name)||c.push(u.to)}),!l.isProjectRoot&&!l.isWorkspace&&!l.inert&&n.external.push(await this.externalProxyMemo(l)))}await this.assignCommonProperties(s,n),this.idealGraph=n}async workspaceProxy(t,i){t.localLocation=i.location,t.localPath=i.path,t.isWorkspace=!0,t.resolved=i.resolved,await this.assignCommonProperties(i,t)}async externalProxy(t,i){if(await this.assignCommonProperties(i,t),i.hasShrinkwrap){let s=zr(i.root.path,"node_modules",".store",`${i.name}@${i.version}`);dMe(s,{recursive:!0}),await pMe.extract(i.resolved,s,{...this.options,resolved:i.resolved,integrity:i.integrity});let n=this.constructor,a=new n({...this.options,path:s});await a[xP]({dev:!1}),this.rootNode.external.push(...a.idealGraph.external),a.idealGraph.external.forEach(c=>{c.root=this.rootNode,c.id=`${i.id}=>${c.id}`}),t.localDependencies=[],t.externalDependencies=a.idealGraph.externalDependencies,t.externalOptionalDependencies=a.idealGraph.externalOptionalDependencies,t.dependencies=[...t.externalDependencies,...t.localDependencies,...t.externalOptionalDependencies]}t.optional=i.optional,t.resolved=i.resolved,t.version=i.version}async assignCommonProperties(t,i){function s(l){return[...l.edgesOut.values()].filter(u=>u.to&&u.to.target&&!(l.package.bundledDependencies||l.package.bundleDependencies||[]).includes(u.to.name))}o(s,"validEdgesOut");let n=s(t),a=n.filter(l=>l.optional).map(l=>l.to.target),c=n.filter(l=>!l.optional).map(l=>l.to.target);i.localDependencies=await Promise.all(c.filter(l=>l.isWorkspace).map(this.workspaceProxyMemo)),i.externalDependencies=await Promise.all(c.filter(l=>!l.isWorkspace&&!l.inert).map(this.externalProxyMemo)),i.externalOptionalDependencies=await Promise.all(a.filter(l=>!l.inert).map(this.externalProxyMemo)),i.dependencies=[...i.externalDependencies,...i.localDependencies,...i.externalOptionalDependencies],i.root=this.rootNode,i.id=this.counter++,i.name=t.name,i.package={...t.package},i.package.bundleDependencies=void 0,i.hasInstallScript=t.hasInstallScript}async[rZ](){let t=this.idealTree,i=[];for(let[,c]of t.edgesOut)c.to&&(t.package.bundleDependencies||t.package.bundledDependencies||[]).includes(c.to.name)&&i.push({from:t,to:c.to});for(let c of t.fsChildren)for(let[,l]of c.edgesOut)l.to&&(c.package.bundleDependencies||c.package.bundledDependencies||[]).includes(l.to.name)&&i.push({from:c,to:l.to});let s=new Set,n=new Map,a=[];for(;i.length!==0;){let c=i.pop(),l=`${c.from.location}=>${c.to.location}`;if(s.has(l))continue;s.add(l);let u=c.from;!u.isRoot&&!u.isWorkspace&&n.set(u.location,{location:u.location,resolved:u.resolved,name:u.name,optional:u.optional,pkg:{...u.package,bundleDependencies:void 0}});let h=c.to;n.set(h.location,{location:h.location,resolved:h.resolved,name:h.name,optional:h.optional,pkg:{...h.package,bundleDependencies:void 0}}),a.push({from:u.isRoot?"root":u.location,to:h.location}),h.edgesOut.forEach(f=>{f.to&&i.push({from:f.from,to:f.to})})}return{edges:a,nodes:n}}async[fMe](){await this[xP](this.options);let t=this.idealGraph,i=await this[rZ](),s=o(f=>{let d=[],p=[];return gMe({tree:f,getChildren:o(m=>m.dependencies,"getChildren"),filter:o(m=>m,"filter"),visit:o(m=>{p.push(`${m.name}@${m.version}`),d.push(`${p.join("->")}::${m.resolved}`)},"visit"),leave:o(()=>{p.pop()},"leave")}),d.sort(),mMe.createHash("shake256",{outputLength:16}).update(d.join(",")).digest("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/m,"")},"treeHash"),n=o(f=>`${f.name}@${f.version}-${s(f)}`,"getKey"),a={fsChildren:[],integrity:null,inventory:new Map,isLink:!1,isRoot:!0,binPaths:[],edgesIn:new Set,edgesOut:new Map,hasShrinkwrap:!1,parent:null,resolved:this.idealTree.resolved,isTop:!0,path:t.root.localPath,realpath:t.root.localPath,package:t.root.package,meta:{loadedFromDisk:!1},global:!1,isProjectRoot:!0,children:[]};a.inventory.query=()=>[];let c=new Set;t.workspaces.forEach(f=>{let d={edgesIn:new Set,edgesOut:new Map,children:[],hasInstallScript:f.hasInstallScript,binPaths:[],package:f.package,location:f.localLocation,path:f.localPath,realpath:f.localPath,resolved:f.resolved};a.fsChildren.push(d),a.inventory.set(d.location,d)});let l=o((f,d,p,m)=>{let y={global:!1,globalTop:!1,isProjectRoot:!1,isTop:!1,location:d,name:f.name,optional:f.optional,top:{path:t.root.localPath},children:[],edgesIn:new Set,edgesOut:new Map,binPaths:[],fsChildren:[],getBundler(){return null},hasShrinkwrap:!1,inDepBundle:!1,integrity:null,isLink:!1,isRoot:!1,isInStore:m,path:zr(t.root.localPath,d),realpath:zr(t.root.localPath,d),resolved:f.resolved,version:p.version,package:p};y.target=y,a.children.push(y),a.inventory.set(y.location,y)},"generateChild");t.external.forEach(f=>{let d=n(f);if(c.has(d))return;c.add(d);let p=zr("node_modules",".store",d,"node_modules",f.name);l(f,p,f.package,!0)}),i.nodes.forEach(f=>{l(f,f.location,f.pkg,!1)}),i.edges.forEach(f=>{let d=f.from==="root"?a:a.inventory.get(f.from),p=a.inventory.get(f.to),m={optional:!1,from:d,to:p};d.edgesOut.set(p.name,m),p.edgesIn.add(m)});let u=new Set;function h(f,d){d=!!d;let p=n(f);if(u.has(p))return;u.add(p);let m,y;if(d){let S=zr("node_modules",".store",p,"node_modules",f.name);m=a.children.find(v=>v.location===S),y=zr("node_modules",".store",p,"node_modules")}else m=f.isProjectRoot?a:a.fsChildren.find(S=>S.location===f.localLocation),y=zr(f.localLocation,"node_modules");let w=o((S,v,_)=>{v=!!v,_=!!_;let E=zr(y,S.name),b=S.package.bin&&Object.keys(S.package.bin)||[],O=n(S),T;if(_){let X=zr("node_modules",".store",O,"node_modules",S.name);T=a.children.find(Ce=>Ce.location===X)}else T=a.fsChildren.find(X=>X.location===S.localLocation);b.forEach(X=>{T.binPaths.push(zr(m.realpath,"node_modules",".bin",X))});let I={global:!1,globalTop:!1,isProjectRoot:!1,edgesIn:new Set,edgesOut:new Map,binPaths:[],isTop:!1,optional:v,location:E,path:zr(S.root.localPath,y,S.name),realpath:T.path,name:O,resolved:S.resolved,top:{path:S.root.localPath},children:[],fsChildren:[],isLink:!0,isStoreLink:!0,isRoot:!1,package:{_id:"abc",bundleDependencies:void 0,deprecated:void 0,bin:T.package.bin,scripts:S.package.scripts},target:T},L={optional:v,from:m,to:I};m.edgesOut.set(S.name,L),I.edgesIn.add(L);let F={optional:!1,from:I,to:T};I.edgesOut.set(S.name,F),T.edgesIn.add(F),a.children.push(I)},"processDeps");for(let S of f.localDependencies)h(S,!1),w(S,!1,!1);for(let S of f.externalDependencies)h(S,!0),w(S,!1,!0);for(let S of f.externalOptionalDependencies)h(S,!0),w(S,!0,!0)}o(h,"processEdges"),h(t,!1);for(let f of t.workspaces)h(f,!1);return a.children.forEach(f=>f.parent=a),a.children.forEach(f=>f.root=a),a.root=a,a.target=a,a}}});var lZ=g((EZe,cZ)=>{var{resolve:oZ}=require("node:path"),{homedir:yMe}=require("node:os"),{depth:SMe}=cs(),wMe=OA(),{log:DP,time:aZ}=se(),{saveTypeMap:vMe}=LS(),EMe=KA(),_Me=Oi(),bMe=j5(),OMe=[K5(),XK(),hY(),gY(),OY(),tZ(),nZ()],IMe=Symbol.for("setWorkspaces"),TMe=OMe.reduce((r,e)=>e(r),require("node:events")),RMe=o(r=>{if(r===1||r===2||r===3)return r;if(r==null)return null;throw new TypeError("Invalid lockfileVersion config: "+r)},"lockfileVersion"),LP=class extends TMe{static{o(this,"Arborist")}constructor(e={}){let t=aZ.start("arborist:ctor");if(super(e),this.options={nodeVersion:process.version,...e,Arborist:this.constructor,binLinks:"binLinks"in e?!!e.binLinks:!0,cache:e.cache||`${yMe()}/.npm/_cacache`,dryRun:!!e.dryRun,formatPackageLock:"formatPackageLock"in e?!!e.formatPackageLock:!0,force:!!e.force,global:!!e.global,ignoreScripts:!!e.ignoreScripts,installStrategy:e.global?"shallow":e.installStrategy?e.installStrategy:"hoisted",lockfileVersion:RMe(e.lockfileVersion),packageLockOnly:!!e.packageLockOnly,packumentCache:e.packumentCache||new bMe,path:e.path||".",rebuildBundle:"rebuildBundle"in e?!!e.rebuildBundle:!0,replaceRegistryHost:e.replaceRegistryHost,savePrefix:"savePrefix"in e?e.savePrefix:"^",scriptShell:e.scriptShell,workspaces:e.workspaces||[],workspacesEnabled:e.workspacesEnabled!==!1},this.replaceRegistryHost=this.options.replaceRegistryHost=!this.options.replaceRegistryHost||this.options.replaceRegistryHost==="npmjs"?"registry.npmjs.org":this.options.replaceRegistryHost,e.saveType&&!vMe.get(e.saveType))throw new Error(`Invalid saveType ${e.saveType}`);this.cache=oZ(this.options.cache),this.diff=null,this.path=oZ(this.options.path),t()}workspaceNodes(e,t){let i=e.workspaces;if(!i)return DP.warn("workspaces","filter set, but no workspaces present"),[];let s=[];for(let n of t){let a=i.get(n);if(!a){DP.warn("workspaces",`${n} in filter set, but not in workspaces`);continue}let c=_Me(e.realpath,a),l=e.inventory.get(c);if(!l){DP.warn("workspaces",`${n} in filter set, but no workspace folder present`);continue}s.push(l)}return s}workspaceDependencySet(e,t,i){let s=this.workspaceNodes(e,t);if(i)for(let c of e.edgesOut.values())c.type!=="workspace"&&c.to&&s.push(c.to);let n=new Set(s),a=new Set;for(let c of n){for(let l of c.edgesOut.values()){let u=l.to;u&&(n.add(u),u.isLink&&n.add(u.target))}for(let l of c.children.values())l.extraneous&&a.add(l)}for(let c of a)n.add(c);return n}excludeWorkspacesDependencySet(e){let t=new Set;return SMe({tree:e,visit:o(i=>{for(let{to:s}of i.edgesOut.values())if(!(!s||s.isWorkspace))for(let n of s.edgesIn.values())(n.from.isRoot||t.has(n.from))&&t.add(s);return i},"visit"),filter:o(i=>i,"filter"),getChildren:o((i,s)=>[...s.edgesOut.values()].map(n=>n.to),"getChildren")}),t}async[IMe](e){let t=await wMe({cwd:e.path,pkg:e.package});return e&&t.size&&(e.workspaces=t),e}async audit(e={}){if(this.addTracker("audit"),this.options.global)throw Object.assign(new Error("`npm audit` does not support testing globals"),{code:"EAUDITGLOBAL"});e={...this.options,...e};let t=aZ.start("audit"),i;e.packageLock===!1?(await this.loadActual(e),await this.buildIdealTree(),i=this.idealTree):i=await this.loadVirtual(),this.options.workspaces.length&&(e.filterSet=this.workspaceDependencySet(i,this.options.workspaces,this.options.includeWorkspaceRoot)),e.workspacesEnabled||(e.filterSet=this.excludeWorkspacesDependencySet(i)),this.auditReport=await EMe.load(i,e);let s=e.fix?this.reify(e):this.auditReport;return t(),this.finishTracker("audit"),s}async dedupe(e={}){e={...this.options,...e};let t=await this.loadVirtual().catch(()=>this.loadActual()),i=[];for(let s of t.inventory.query("name"))t.inventory.query("name",s).size>1&&i.push(s);return this.reify({...e,preferDedupe:!0,update:{names:i}})}};cZ.exports=LP});var uZ=g((bZe,En)=>{En.exports=lZ();En.exports.Arborist=En.exports;En.exports.Node=sl();En.exports.Link=nl();En.exports.Edge=GC();En.exports.Shrinkwrap=cl()});var hZ=Hc(),AMe=ye(),fZ=Ka(),CMe=require("node:path"),dZ=uZ(),{writeFile:kMe}=require("node:fs/promises");module.exports=PMe;async function PMe(r="file:.",e={}){r=AMe(r);let t=await hZ.manifest(r,{...e,Arborist:dZ}),i=e.foregroundScripts?"inherit":"pipe";r.type==="directory"&&!e.ignoreScripts&&await fZ({...e,event:"prepack",path:r.fetchSpec,stdio:i,pkg:t});let s=await hZ.tarball(t._resolved,{...e,Arborist:dZ,integrity:t._integrity});if(e.dryRun===!1){let n=`${t.name}-${t.version}.tgz`.replace(/^@/,"").replace(/\//,"-"),a=CMe.resolve(e.packDestination,n);await kMe(a,s)}return r.type==="directory"&&!e.ignoreScripts&&await fZ({...e,event:"postpack",path:r.fetchSpec,stdio:i,pkg:t,env:{npm_package_from:s.from,npm_package_resolved:s.resolved,npm_package_integrity:s.integrity}}),s}o(PMe,"pack");
184
+ /*! Bundled license information:
185
+
186
+ imurmurhash/imurmurhash.js:
187
+ (**
188
+ * @preserve
189
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
190
+ *
191
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
192
+ * @see http://github.com/homebrewing/brauhaus-diff
193
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
194
+ * @see http://github.com/garycourt/murmurhash-js
195
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
196
+ * @see http://sites.google.com/site/murmurhash/
197
+ *)
198
+
199
+ negotiator/index.js:
200
+ (*!
201
+ * negotiator
202
+ * Copyright(c) 2012 Federico Romero
203
+ * Copyright(c) 2012-2014 Isaac Z. Schlueter
204
+ * Copyright(c) 2015 Douglas Christopher Wilson
205
+ * MIT Licensed
206
+ *)
207
+
208
+ make-fetch-happen/lib/fetch.js:
209
+ (**
210
+ * @license
211
+ * Copyright (c) 2010-2012 Mikeal Rogers
212
+ * Licensed under the Apache License, Version 2.0 (the "License");
213
+ * you may not use this file except in compliance with the License.
214
+ * You may obtain a copy of the License at
215
+ * http://www.apache.org/licenses/LICENSE-2.0
216
+ * Unless required by applicable law or agreed to in writing,
217
+ * software distributed under the License is distributed on an "AS
218
+ * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
219
+ * express or implied. See the License for the specific language
220
+ * governing permissions and limitations under the License.
221
+ *)
222
+
223
+ cssesc/cssesc.js:
224
+ (*! https://mths.be/cssesc v3.0.0 by @mathias *)
225
+ */